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::__getitem__;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
234 %newobject MEDCoupling::MEDCouplingFieldInt::New;
235 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
236 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
237 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
238 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
239 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
240 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
241 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
242 %newobject MEDCoupling::MEDCouplingMesh::clone;
243 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
244 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
245 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
246 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
247 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
249 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
250 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
251 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
252 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
253 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
254 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
255 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
256 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
257 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
259 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
260 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
261 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
262 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
263 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
264 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
265 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
266 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
267 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
268 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
270 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
271 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
272 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
273 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
274 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
275 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
276 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
277 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
278 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
280 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
281 %newobject MEDCoupling::MEDCouplingUMesh::New;
282 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
283 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
284 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
285 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
286 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
287 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
288 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
289 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
290 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
291 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
292 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
293 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
294 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
295 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
296 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
297 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
298 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
299 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
300 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
301 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
302 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
304 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
305 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
306 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
307 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
308 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
311 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
313 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
314 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
315 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
316 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
317 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
318 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
319 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
320 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
321 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
322 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
323 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
324 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
325 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
326 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
327 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
328 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
329 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
330 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
331 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
332 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
333 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
334 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
335 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
336 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
337 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
338 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
339 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
340 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
341 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
345 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
346 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
347 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
348 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
350 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
351 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
352 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
353 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
354 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
355 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
360 %newobject MEDCoupling::MEDCouplingCMesh::New;
361 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
362 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
363 %newobject MEDCoupling::MEDCouplingIMesh::New;
364 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
365 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
366 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
367 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
368 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
369 %newobject MEDCoupling::MEDCouplingMultiFields::New;
370 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
371 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
372 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
373 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
374 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
389 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
390 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
391 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
392 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
393 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
398 %newobject MEDCoupling::DenseMatrix::New;
399 %newobject MEDCoupling::DenseMatrix::deepCopy;
400 %newobject MEDCoupling::DenseMatrix::shallowCpy;
401 %newobject MEDCoupling::DenseMatrix::getData;
402 %newobject MEDCoupling::DenseMatrix::matVecMult;
403 %newobject MEDCoupling::DenseMatrix::MatVecMult;
404 %newobject MEDCoupling::DenseMatrix::__add__;
405 %newobject MEDCoupling::DenseMatrix::__sub__;
406 %newobject MEDCoupling::DenseMatrix::__mul__;
407 %newobject MEDCoupling::PartDefinition::New;
408 %newobject MEDCoupling::PartDefinition::toDAI;
409 %newobject MEDCoupling::PartDefinition::__add__;
410 %newobject MEDCoupling::PartDefinition::composeWith;
411 %newobject MEDCoupling::PartDefinition::tryToSimplify;
412 %newobject MEDCoupling::DataArrayPartDefinition::New;
413 %newobject MEDCoupling::SlicePartDefinition::New;
415 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
416 %feature("unref") MEDCouplingMesh "$this->decrRef();"
417 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
418 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
419 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
420 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
424 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
425 %feature("unref") MEDCouplingField "$this->decrRef();"
426 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
427 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
428 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
429 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
432 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
434 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
435 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
436 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
437 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
438 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
441 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
442 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
443 %feature("unref") DenseMatrix "$this->decrRef();"
444 %feature("unref") PartDefinition "$this->decrRef();"
445 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
446 %feature("unref") SlicePartDefinition "$this->decrRef();"
448 %rename(assign) *::operator=;
449 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
450 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
451 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
452 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
456 %rename (InterpKernelException) INTERP_KERNEL::Exception;
458 %include "MEDCouplingRefCountObject.i"
459 %include "MEDCouplingMemArray.i"
461 namespace INTERP_KERNEL
464 * \class BoxSplittingOptions
465 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
467 class BoxSplittingOptions
470 BoxSplittingOptions();
471 void init() throw(INTERP_KERNEL::Exception);
472 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
473 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
474 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
475 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
476 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
477 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
478 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
479 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
480 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
481 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
482 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
483 std::string printOptions() const throw(INTERP_KERNEL::Exception);
486 std::string __str__() const throw(INTERP_KERNEL::Exception)
488 return self->printOptions();
494 namespace MEDCoupling
510 CONST_ON_TIME_INTERVAL = 7
511 } TypeOfTimeDiscretization;
519 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
520 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
522 } MEDCouplingMeshType;
525 class DataArrayDouble;
526 class MEDCouplingUMesh;
527 class MEDCouplingCMesh;
528 class MEDCouplingFieldDouble;
530 %extend RefCountObject
532 std::string getHiddenCppPointer() const
534 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
539 %extend MEDCouplingGaussLocalization
541 std::string __str__() const throw(INTERP_KERNEL::Exception)
543 return self->getStringRepr();
546 std::string __repr__() const throw(INTERP_KERNEL::Exception)
548 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
549 oss << self->getStringRepr();
556 class MEDCouplingMesh : public RefCountObject, public TimeLabel
559 void setName(const std::string& name);
560 std::string getName() const;
561 void setDescription(const std::string& descr);
562 std::string getDescription() const;
563 void setTime(double val, int iteration, int order);
564 void setTimeUnit(const std::string& unit);
565 std::string getTimeUnit() const;
566 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
567 bool isStructured() const throw(INTERP_KERNEL::Exception);
568 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
569 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
570 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
571 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
572 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
573 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
574 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
575 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
576 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
577 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
578 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
579 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
580 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
588 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
589 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
590 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
591 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
592 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
593 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
594 virtual std::string getVTKFileExtension() const;
595 std::string getVTKFileNameOf(const std::string& fileName) const;
597 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
605 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
606 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
607 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);
608 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
609 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
612 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
613 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 std::string __str__() const throw(INTERP_KERNEL::Exception)
619 return self->simpleRepr();
622 PyObject *getTime() throw(INTERP_KERNEL::Exception)
625 double tmp0=self->getTime(tmp1,tmp2);
626 PyObject *res = PyList_New(3);
627 PyList_SetItem(res,0,SWIG_From_double(tmp0));
628 PyList_SetItem(res,1,SWIG_From_int(tmp1));
629 PyList_SetItem(res,2,SWIG_From_int(tmp2));
633 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
635 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
636 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
642 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
646 DataArrayDoubleTuple *aa;
647 std::vector<double> bb;
649 int spaceDim=self->getSpaceDimension();
650 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
651 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
652 return self->getCellContainingPoint(pos,eps);
655 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
659 DataArrayDoubleTuple *aa;
660 std::vector<double> bb;
662 int spaceDim=self->getSpaceDimension();
663 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
664 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
665 MCAuto<DataArrayInt> elts,eltsIndex;
666 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
667 PyObject *ret=PyTuple_New(2);
668 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
669 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
673 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
675 MCAuto<DataArrayInt> elts,eltsIndex;
676 int spaceDim=self->getSpaceDimension();
678 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
679 if (!SWIG_IsOK(res1))
682 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
683 int nbOfPoints=size/spaceDim;
686 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
688 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
692 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
694 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
695 da2->checkAllocated();
696 int size=da2->getNumberOfTuples();
697 int nbOfCompo=da2->getNumberOfComponents();
698 if(nbOfCompo!=spaceDim)
700 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
702 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
704 PyObject *ret=PyTuple_New(2);
705 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
706 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
710 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
714 DataArrayDoubleTuple *aa;
715 std::vector<double> bb;
717 int spaceDim=self->getSpaceDimension();
718 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
719 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
720 std::vector<int> elts;
721 self->getCellsContainingPoint(pos,eps,elts);
722 DataArrayInt *ret=DataArrayInt::New();
723 ret->alloc((int)elts.size(),1);
724 std::copy(elts.begin(),elts.end(),ret->getPointer());
725 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
728 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
730 MCAuto<DataArrayInt> d0=DataArrayInt::New();
731 MCAuto<DataArrayInt> d1=DataArrayInt::New();
732 self->getReverseNodalConnectivity(d0,d1);
733 PyObject *ret=PyTuple_New(2);
734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
739 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
742 int v0; std::vector<int> v1;
743 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
744 self->renumberCells(ids,check);
747 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
749 DataArrayInt *cellCor, *nodeCor;
750 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
751 PyObject *res = PyList_New(2);
752 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
753 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
757 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
759 DataArrayInt *cellCor=0,*nodeCor=0;
760 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
761 PyObject *res = PyList_New(2);
762 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
763 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
767 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
769 DataArrayInt *cellCor=0;
770 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
774 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
777 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
778 if (!SWIG_IsOK(res1))
781 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
782 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
786 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
788 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
789 da2->checkAllocated();
790 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
793 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
795 std::vector<int> conn;
796 self->getNodeIdsOfCell(cellId,conn);
797 return convertIntArrToPyList2(conn);
800 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
802 std::vector<double> coo;
803 self->getCoordinatesOfNode(nodeId,coo);
804 return convertDblArrToPyList2(coo);
807 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
811 DataArrayDoubleTuple *aa;
812 std::vector<double> bb;
814 int spaceDim=self->getSpaceDimension();
815 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
816 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
817 self->scale(pointPtr,factor);
820 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
822 int spaceDim=self->getSpaceDimension();
823 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
824 self->getBoundingBox(tmp);
825 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
829 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
832 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
833 PyObject *ret=PyTuple_New(2);
834 PyObject *ret0Py=ret0?Py_True:Py_False;
836 PyTuple_SetItem(ret,0,ret0Py);
837 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
841 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
843 int szArr,sw,iTypppArr;
844 std::vector<int> stdvecTyyppArr;
845 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
846 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
847 if(sw==3)//DataArrayInt
849 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
850 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
851 std::string name=argpt->getName();
853 ret->setName(name.c_str());
855 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
858 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
860 int szArr,sw,iTypppArr;
861 std::vector<int> stdvecTyyppArr;
863 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
864 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
865 if(sw==3)//DataArrayInt
867 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
868 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
869 std::string name=argpt->getName();
871 ret->setName(name.c_str());
874 PyObject *res = PyList_New(2);
875 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
876 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
877 PyList_SetItem(res,0,obj0);
878 PyList_SetItem(res,1,obj1);
882 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
886 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
887 PyObject *res = PyTuple_New(2);
888 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
891 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
893 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
894 PyTuple_SetItem(res,0,obj0);
895 PyTuple_SetItem(res,1,obj1);
899 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
901 std::vector<int> vals=self->getDistributionOfTypes();
903 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
904 PyObject *ret=PyList_New((int)vals.size()/3);
905 for(int j=0;j<(int)vals.size()/3;j++)
907 PyObject *ret1=PyList_New(3);
908 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
909 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
910 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
911 PyList_SetItem(ret,j,ret1);
916 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
918 std::vector<int> code;
919 std::vector<const DataArrayInt *> idsPerType;
920 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
921 convertPyToNewIntArr4(li,1,3,code);
922 return self->checkTypeConsistencyAndContig(code,idsPerType);
925 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
927 std::vector<int> code;
928 std::vector<DataArrayInt *> idsInPflPerType;
929 std::vector<DataArrayInt *> idsPerType;
930 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
931 PyObject *ret=PyTuple_New(3);
934 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
935 PyObject *ret0=PyList_New((int)code.size()/3);
936 for(int j=0;j<(int)code.size()/3;j++)
938 PyObject *ret00=PyList_New(3);
939 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
940 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
941 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
942 PyList_SetItem(ret0,j,ret00);
944 PyTuple_SetItem(ret,0,ret0);
946 PyObject *ret1=PyList_New(idsInPflPerType.size());
947 for(std::size_t j=0;j<idsInPflPerType.size();j++)
948 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
949 PyTuple_SetItem(ret,1,ret1);
950 int n=idsPerType.size();
951 PyObject *ret2=PyList_New(n);
953 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
954 PyTuple_SetItem(ret,2,ret2);
958 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
962 DataArrayDoubleTuple *aa;
963 std::vector<double> bb;
965 int spaceDim=self->getSpaceDimension();
966 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
967 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
968 self->translate(vectorPtr);
971 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
973 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
976 DataArrayDoubleTuple *aa;
977 std::vector<double> bb;
979 int spaceDim=self->getSpaceDimension();
980 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
981 self->rotate(centerPtr,0,alpha);
984 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
986 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
988 DataArrayDouble *a,*a2;
989 DataArrayDoubleTuple *aa,*aa2;
990 std::vector<double> bb,bb2;
992 int spaceDim=self->getSpaceDimension();
993 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
994 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
995 self->rotate(centerPtr,vectorPtr,alpha);
998 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1000 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1001 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1002 PyObject *res=PyList_New(result.size());
1003 for(int i=0;iL!=result.end(); i++, iL++)
1004 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1008 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1010 std::vector<double> a0;
1011 std::vector<int> a1;
1012 std::vector<std::string> a2;
1013 self->getTinySerializationInformation(a0,a1,a2);
1014 PyObject *ret(PyTuple_New(3));
1015 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1016 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1018 PyObject *ret2(PyList_New(sz));
1020 for(int i=0;i<sz;i++)
1021 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1023 PyTuple_SetItem(ret,2,ret2);
1027 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1029 DataArrayInt *a0Tmp(0);
1030 DataArrayDouble *a1Tmp(0);
1031 self->serialize(a0Tmp,a1Tmp);
1032 PyObject *ret(PyTuple_New(2));
1033 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1034 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1038 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1040 std::vector<std::string> littleStrings;
1041 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1044 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1045 {// put an empty dict in input to say to __new__ to call __init__...
1046 PyObject *ret(PyTuple_New(1));
1047 PyObject *ret0(PyDict_New());
1048 PyTuple_SetItem(ret,0,ret0);
1052 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1054 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1055 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1056 PyObject *ret(PyTuple_New(2));
1057 PyTuple_SetItem(ret,0,ret0);
1058 PyTuple_SetItem(ret,1,ret1);
1062 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1064 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1065 if(!PyTuple_Check(inp))
1066 throw INTERP_KERNEL::Exception(MSG);
1067 int sz(PyTuple_Size(inp));
1069 throw INTERP_KERNEL::Exception(MSG);
1070 PyObject *elt0(PyTuple_GetItem(inp,0));
1071 PyObject *elt1(PyTuple_GetItem(inp,1));
1072 std::vector<double> a0;
1073 std::vector<int> a1;
1074 std::vector<std::string> a2;
1075 DataArrayInt *b0(0);
1076 DataArrayDouble *b1(0);
1078 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1079 throw INTERP_KERNEL::Exception(MSG);
1080 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1082 fillArrayWithPyListDbl3(a0py,tmp,a0);
1083 convertPyToNewIntArr3(a1py,a1);
1084 fillStringVector(a2py,a2);
1087 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1088 throw INTERP_KERNEL::Exception(MSG);
1089 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1091 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1092 if(!SWIG_IsOK(status))
1093 throw INTERP_KERNEL::Exception(MSG);
1094 b0=reinterpret_cast<DataArrayInt *>(argp);
1095 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1096 if(!SWIG_IsOK(status))
1097 throw INTERP_KERNEL::Exception(MSG);
1098 b1=reinterpret_cast<DataArrayDouble *>(argp);
1100 // useless here to call resizeForUnserialization because arrays are well resized.
1101 self->unserialization(a0,a1,b0,b1,a2);
1104 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1106 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1107 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1108 return MEDCouplingMesh::MergeMeshes(tmp);
1114 //== MEDCouplingMesh End
1116 %include "NormalizedGeometricTypes"
1117 %include "MEDCouplingNatureOfFieldEnum"
1119 namespace MEDCoupling
1121 class MEDCouplingNatureOfField
1124 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1125 static std::string GetReprNoThrow(NatureOfField nat);
1126 static std::string GetAllPossibilitiesStr();
1130 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1131 // include "MEDCouplingTimeDiscretization.i"
1133 namespace MEDCoupling
1135 class MEDCouplingGaussLocalization
1138 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1139 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1140 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1141 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1142 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1143 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1144 int getDimension() const throw(INTERP_KERNEL::Exception);
1145 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1146 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1147 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1148 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1150 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1151 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1152 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1153 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1154 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1155 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1156 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1157 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1158 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1159 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1160 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1161 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1163 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1166 class MEDCouplingSkyLineArray
1169 MEDCouplingSkyLineArray();
1170 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1171 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1172 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1174 void set( DataArrayInt* index, DataArrayInt* value );
1175 int getNumberOf() const;
1176 int getLength() const;
1177 DataArrayInt* getIndexArray() const;
1178 DataArrayInt* getValueArray() const;
1181 std::string __str__() const throw(INTERP_KERNEL::Exception)
1183 return self->simpleRepr();
1189 %include "MEDCouplingFieldDiscretization.i"
1191 //== MEDCouplingPointSet
1193 namespace MEDCoupling
1195 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1198 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1199 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1200 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1201 void zipCoords() throw(INTERP_KERNEL::Exception);
1202 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1203 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1204 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1205 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1206 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1207 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1208 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1209 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1210 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1211 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1212 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1213 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1214 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1215 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1216 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1217 virtual DataArrayInt *findBoundaryNodes() const;
1218 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1219 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1220 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1221 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1222 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1223 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1224 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1225 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1226 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1229 std::string __str__() const throw(INTERP_KERNEL::Exception)
1231 return self->simpleRepr();
1234 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1237 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1238 PyObject *res = PyList_New(2);
1239 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1240 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1244 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1246 DataArrayInt *comm, *commIndex;
1247 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1248 PyObject *res = PyList_New(2);
1249 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1250 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1254 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1256 DataArrayDouble *ret1=self->getCoords();
1259 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1262 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1264 int szArr,sw,iTypppArr;
1265 std::vector<int> stdvecTyyppArr;
1266 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1267 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1268 if(sw==3)//DataArrayInt
1270 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1271 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1272 std::string name=argpt->getName();
1274 ret->setName(name.c_str());
1276 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1279 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1281 int szArr,sw,iTypppArr;
1282 std::vector<int> stdvecTyyppArr;
1283 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1284 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1285 if(sw==3)//DataArrayInt
1287 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1288 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1289 std::string name=argpt->getName();
1291 ret->setName(name.c_str());
1293 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1296 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1298 int szArr,sw,iTypppArr;
1299 std::vector<int> stdvecTyyppArr;
1300 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1301 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1302 if(sw==3)//DataArrayInt
1304 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1305 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1306 std::string name=argpt->getName();
1308 ret->setName(name.c_str());
1310 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1313 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1315 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1316 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1319 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1321 int szArr,sw,iTypppArr;
1322 std::vector<int> stdvecTyyppArr;
1323 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1324 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1325 if(sw==3)//DataArrayInt
1327 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1328 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1329 std::string name=argpt->getName();
1331 ret->setName(name.c_str());
1333 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1336 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1338 int szArr,sw,iTypppArr;
1339 std::vector<int> stdvecTyyppArr;
1340 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1341 self->renumberNodes(tmp,newNbOfNodes);
1344 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1346 int szArr,sw,iTypppArr;
1347 std::vector<int> stdvecTyyppArr;
1348 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1349 self->renumberNodesCenter(tmp,newNbOfNodes);
1352 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1354 int spaceDim=self->getSpaceDimension();
1356 DataArrayDouble *a,*a2;
1357 DataArrayDoubleTuple *aa,*aa2;
1358 std::vector<double> bb,bb2;
1360 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1361 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1362 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1363 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1364 std::vector<int> nodes;
1365 self->findNodesOnLine(p,v,eps,nodes);
1366 DataArrayInt *ret=DataArrayInt::New();
1367 ret->alloc((int)nodes.size(),1);
1368 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1369 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1371 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1373 int spaceDim=self->getSpaceDimension();
1375 DataArrayDouble *a,*a2;
1376 DataArrayDoubleTuple *aa,*aa2;
1377 std::vector<double> bb,bb2;
1379 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1380 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1381 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1382 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1383 std::vector<int> nodes;
1384 self->findNodesOnPlane(p,v,eps,nodes);
1385 DataArrayInt *ret=DataArrayInt::New();
1386 ret->alloc((int)nodes.size(),1);
1387 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1388 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1391 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1395 DataArrayDoubleTuple *aa;
1396 std::vector<double> bb;
1398 int spaceDim=self->getSpaceDimension();
1399 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1400 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1401 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1402 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1405 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1407 DataArrayInt *c=0,*cI=0;
1411 DataArrayDoubleTuple *aa;
1412 std::vector<double> bb;
1414 int spaceDim=self->getSpaceDimension();
1415 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1416 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1417 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1418 PyObject *ret=PyTuple_New(2);
1419 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1420 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1424 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1426 DataArrayInt *c=0,*cI=0;
1427 int spaceDim=self->getSpaceDimension();
1430 DataArrayDoubleTuple *aa;
1431 std::vector<double> bb;
1434 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1435 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1437 PyObject *ret=PyTuple_New(2);
1438 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1439 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1443 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1447 DataArrayDoubleTuple *aa;
1448 std::vector<double> bb;
1450 int spaceDim=self->getSpaceDimension();
1451 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1452 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1454 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1455 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1458 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1462 std::vector<int> multiVal;
1463 std::pair<int, std::pair<int,int> > slic;
1464 MEDCoupling::DataArrayInt *daIntTyypp=0;
1465 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1469 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1471 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1473 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1475 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1479 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1481 DataArrayInt *v0=0,*v1=0;
1482 self->findCommonCells(compType,startCellId,v0,v1);
1483 PyObject *res = PyList_New(2);
1484 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1485 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1490 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1493 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1494 if (!SWIG_IsOK(res1))
1497 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1498 self->renumberNodesInConn(tmp);
1502 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1504 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1505 da2->checkAllocated();
1506 self->renumberNodesInConn(da2->getConstPointer());
1510 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1513 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1514 PyObject *ret=PyTuple_New(2);
1515 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1516 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1520 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1522 DataArrayInt *ret=0;
1524 int szArr,sw,iTypppArr;
1525 std::vector<int> stdvecTyyppArr;
1526 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1527 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1531 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1535 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1536 PyObject *res = PyList_New(3);
1537 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1538 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1539 PyList_SetItem(res,2,SWIG_From_int(ret2));
1543 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1547 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1548 PyObject *res = PyList_New(3);
1549 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1550 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1551 PyList_SetItem(res,2,SWIG_From_int(ret2));
1555 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1558 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1559 if (!SWIG_IsOK(res1))
1562 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1563 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1567 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1569 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1570 da2->checkAllocated();
1571 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1575 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1579 std::vector<int> multiVal;
1580 std::pair<int, std::pair<int,int> > slic;
1581 MEDCoupling::DataArrayInt *daIntTyypp=0;
1582 int nbc=self->getNumberOfCells();
1583 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1590 std::ostringstream oss;
1591 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1592 throw INTERP_KERNEL::Exception(oss.str().c_str());
1595 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1600 int tmp=nbc+singleVal;
1601 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1605 std::ostringstream oss;
1606 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1607 throw INTERP_KERNEL::Exception(oss.str().c_str());
1613 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1617 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1622 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1623 daIntTyypp->checkAllocated();
1624 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1627 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1631 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1634 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1635 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1636 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1637 for(int i=0;i<sz;i++)
1638 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1641 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1644 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1646 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1647 std::vector<double> val3;
1648 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1649 "Rotate2DAlg",2,true,nbNodes);
1651 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1652 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1655 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1658 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1659 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1660 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1661 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1662 for(int i=0;i<sz;i++)
1663 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1666 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1669 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1671 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1672 std::vector<double> val3;
1673 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1674 "Rotate3DAlg",3,true,nbNodes);
1676 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1677 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1678 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1683 //== MEDCouplingPointSet End
1685 class MEDCouplingUMeshCell
1688 INTERP_KERNEL::NormalizedCellType getType() const;
1691 std::string __str__() const throw(INTERP_KERNEL::Exception)
1693 return self->repr();
1696 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1699 const int *r=self->getAllConn(ret2);
1700 PyObject *ret=PyTuple_New(ret2);
1701 for(int i=0;i<ret2;i++)
1702 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1708 class MEDCouplingUMeshCellIterator
1715 MEDCouplingUMeshCell *ret=self->nextt();
1717 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1720 PyErr_SetString(PyExc_StopIteration,"No more data.");
1727 class MEDCouplingUMeshCellByTypeIterator
1730 ~MEDCouplingUMeshCellByTypeIterator();
1735 MEDCouplingUMeshCellEntry *ret=self->nextt();
1737 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1740 PyErr_SetString(PyExc_StopIteration,"No more data.");
1747 class MEDCouplingUMeshCellByTypeEntry
1750 ~MEDCouplingUMeshCellByTypeEntry();
1753 MEDCouplingUMeshCellByTypeIterator *__iter__()
1755 return self->iterator();
1760 class MEDCouplingUMeshCellEntry
1763 INTERP_KERNEL::NormalizedCellType getType() const;
1764 int getNumberOfElems() const;
1767 MEDCouplingUMeshCellIterator *__iter__()
1769 return self->iterator();
1774 //== MEDCouplingUMesh
1776 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1779 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1780 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1781 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1782 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1783 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1784 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1785 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1786 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1787 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1788 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1789 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1790 void computeTypes() throw(INTERP_KERNEL::Exception);
1791 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1792 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1794 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1795 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1796 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1797 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1798 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1799 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1800 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1801 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1802 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1803 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1804 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1805 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1806 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1807 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1808 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1809 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1810 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1811 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1812 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1813 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1814 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1815 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1816 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1817 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1818 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1819 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1820 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1821 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1822 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1823 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1824 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1825 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1826 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1827 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1828 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1829 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1830 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1831 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1832 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1833 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1834 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1835 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1836 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1837 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1838 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1839 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);
1840 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1841 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1842 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1843 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1844 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1846 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1848 return MEDCouplingUMesh::New();
1851 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1853 return MEDCouplingUMesh::New(meshName,meshDim);
1857 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1859 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1862 std::string __str__() const throw(INTERP_KERNEL::Exception)
1864 return self->simpleRepr();
1867 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1869 std::ostringstream oss;
1870 self->reprQuickOverview(oss);
1874 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1876 return self->cellIterator();
1879 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1881 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1882 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1883 PyObject *res=PyList_New(result.size());
1884 for(int i=0;iL!=result.end(); i++, iL++)
1885 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1889 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1893 std::vector<int> multiVal;
1894 std::pair<int, std::pair<int,int> > slic;
1895 MEDCoupling::DataArrayInt *daIntTyypp=0;
1896 int nbc=self->getNumberOfCells();
1897 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1904 std::ostringstream oss;
1905 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1906 throw INTERP_KERNEL::Exception(oss.str().c_str());
1910 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1917 int tmp=nbc+singleVal;
1918 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1923 std::ostringstream oss;
1924 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1925 throw INTERP_KERNEL::Exception(oss.str().c_str());
1931 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1937 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1938 daIntTyypp->checkAllocated();
1939 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1943 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1947 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1951 std::vector<int> multiVal;
1952 std::pair<int, std::pair<int,int> > slic;
1953 MEDCoupling::DataArrayInt *daIntTyypp=0;
1954 int nbc=self->getNumberOfCells();
1955 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1962 std::ostringstream oss;
1963 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1964 throw INTERP_KERNEL::Exception(oss.str().c_str());
1968 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1975 int tmp=nbc+singleVal;
1976 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1981 std::ostringstream oss;
1982 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1983 throw INTERP_KERNEL::Exception(oss.str().c_str());
1989 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1994 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2000 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2001 daIntTyypp->checkAllocated();
2002 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2006 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2010 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2012 int szArr,sw,iTypppArr;
2013 std::vector<int> stdvecTyyppArr;
2014 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2017 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2018 throw INTERP_KERNEL::Exception(oss.str().c_str());
2020 self->insertNextCell(type,size,tmp);
2023 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2025 int szArr,sw,iTypppArr;
2026 std::vector<int> stdvecTyyppArr;
2027 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2028 self->insertNextCell(type,szArr,tmp);
2031 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2033 DataArrayInt *ret=self->getNodalConnectivity();
2038 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2040 DataArrayInt *ret=self->getNodalConnectivityIndex();
2046 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2048 int szArr,sw,iTypppArr;
2049 std::vector<int> stdvecTyyppArr;
2050 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2051 int nbOfDepthPeelingPerformed=0;
2052 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2053 PyObject *res=PyTuple_New(2);
2054 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2055 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2059 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2061 DataArrayInt *v0=0,*v1=0;
2062 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2063 PyObject *res = PyList_New(2);
2064 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2065 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2069 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2073 DataArrayDoubleTuple *aa;
2074 std::vector<double> bb;
2076 int nbOfCompo=self->getSpaceDimension();
2077 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2080 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2081 PyObject *ret=PyTuple_New(2);
2082 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2083 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2087 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2089 DataArrayInt *ret1=0;
2090 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2091 PyObject *ret=PyTuple_New(2);
2092 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2093 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2097 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2100 DataArrayInt *ret1(0);
2101 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2102 PyObject *ret=PyTuple_New(3);
2103 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2104 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2105 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2109 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2111 std::vector<int> cells;
2112 self->checkButterflyCells(cells,eps);
2113 DataArrayInt *ret=DataArrayInt::New();
2114 ret->alloc((int)cells.size(),1);
2115 std::copy(cells.begin(),cells.end(),ret->getPointer());
2116 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2119 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2121 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2123 PyObject *ret = PyList_New(sz);
2124 for(int i=0;i<sz;i++)
2125 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2129 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2131 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2132 int sz=retCpp.size();
2133 PyObject *ret=PyList_New(sz);
2134 for(int i=0;i<sz;i++)
2135 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2139 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2142 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2143 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2144 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2147 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2150 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2151 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2155 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2158 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2159 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2163 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2166 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2167 PyObject *ret=PyTuple_New(3);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2170 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2174 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2176 DataArrayInt *tmp0=0,*tmp1=0;
2177 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2178 PyObject *ret=PyTuple_New(2);
2179 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2180 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2188 std::vector<int> multiVal;
2189 std::pair<int, std::pair<int,int> > slic;
2190 MEDCoupling::DataArrayInt *daIntTyypp=0;
2191 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2195 return self->duplicateNodes(&singleVal,&singleVal+1);
2197 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2199 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2201 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2205 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2209 std::vector<int> multiVal;
2210 std::pair<int, std::pair<int,int> > slic;
2211 MEDCoupling::DataArrayInt *daIntTyypp=0;
2212 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2216 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2218 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2220 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2222 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2226 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2229 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2230 DataArrayInt *tmp0,*tmp1=0;
2231 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2232 PyObject *ret=PyTuple_New(2);
2233 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2234 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2240 DataArrayInt *ret0=0,*ret1=0;
2241 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2242 PyObject *ret=PyTuple_New(2);
2243 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2248 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2250 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2251 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2252 DataArrayInt *ret1=0,*ret2=0;
2253 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2254 PyObject *ret=PyTuple_New(3);
2255 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2256 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2257 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2261 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2263 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2264 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2265 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2266 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2269 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2272 std::vector<const MEDCouplingUMesh *> meshes;
2273 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2274 std::vector<DataArrayInt *> corr;
2275 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2277 PyObject *ret1=PyList_New(sz);
2278 for(int i=0;i<sz;i++)
2279 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280 PyObject *ret=PyList_New(2);
2281 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2282 PyList_SetItem(ret,1,ret1);
2286 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2288 std::vector<MEDCouplingUMesh *> meshes;
2289 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2290 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2293 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2295 std::vector<MEDCouplingUMesh *> meshes;
2296 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2297 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2300 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2304 std::vector<int> multiVal;
2305 std::pair<int, std::pair<int,int> > slic;
2306 MEDCoupling::DataArrayInt *daIntTyypp=0;
2308 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2309 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2313 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2315 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2317 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2319 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2323 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2325 DataArrayInt *arrOut=0,*arrIndexOut=0;
2328 std::vector<int> multiVal;
2329 std::pair<int, std::pair<int,int> > slic;
2330 MEDCoupling::DataArrayInt *daIntTyypp=0;
2332 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2333 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2338 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2343 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2348 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2352 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2354 PyObject *ret=PyTuple_New(2);
2355 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2356 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2360 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2362 DataArrayInt *arrOut=0,*arrIndexOut=0;
2363 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2364 PyObject *ret=PyTuple_New(2);
2365 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2366 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2370 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2372 if(!PySlice_Check(slic))
2373 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2374 Py_ssize_t strt=2,stp=2,step=2;
2375 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2377 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2378 arrIndxIn->checkAllocated();
2379 if(arrIndxIn->getNumberOfComponents()!=1)
2380 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2381 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2382 DataArrayInt *arrOut=0,*arrIndexOut=0;
2383 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2384 PyObject *ret=PyTuple_New(2);
2385 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2386 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2391 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2392 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2394 DataArrayInt *arrOut=0,*arrIndexOut=0;
2397 std::vector<int> multiVal;
2398 std::pair<int, std::pair<int,int> > slic;
2399 MEDCoupling::DataArrayInt *daIntTyypp=0;
2401 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2402 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2407 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2412 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2417 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2421 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2423 PyObject *ret=PyTuple_New(2);
2424 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2425 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2429 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2430 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2434 std::vector<int> multiVal;
2435 std::pair<int, std::pair<int,int> > slic;
2436 MEDCoupling::DataArrayInt *daIntTyypp=0;
2438 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2439 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2444 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2449 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2454 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2458 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2462 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2466 DataArrayDoubleTuple *aa;
2467 std::vector<double> bb;
2469 int spaceDim=self->getSpaceDimension();
2470 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2471 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2473 std::vector<int> cells;
2474 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2475 DataArrayInt *ret=DataArrayInt::New();
2476 ret->alloc((int)cells.size(),1);
2477 std::copy(cells.begin(),cells.end(),ret->getPointer());
2478 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2481 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2485 DataArrayDoubleTuple *aa;
2486 std::vector<double> bb;
2488 int spaceDim=self->getSpaceDimension();
2489 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2490 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2491 self->orientCorrectly2DCells(v,polyOnly);
2494 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2496 std::vector<int> cells;
2497 self->arePolyhedronsNotCorrectlyOriented(cells);
2498 DataArrayInt *ret=DataArrayInt::New();
2499 ret->alloc((int)cells.size(),1);
2500 std::copy(cells.begin(),cells.end(),ret->getPointer());
2501 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2504 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2508 self->getFastAveragePlaneOfThis(vec,pos);
2510 std::copy(vec,vec+3,vals);
2511 std::copy(pos,pos+3,vals+3);
2512 return convertDblArrToPyListOfTuple(vals,3,2);
2515 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2517 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2518 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2519 return MEDCouplingUMesh::MergeUMeshes(tmp);
2522 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2525 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2526 PyObject *ret=PyTuple_New(2);
2527 PyObject *ret0Py=ret0?Py_True:Py_False;
2529 PyTuple_SetItem(ret,0,ret0Py);
2530 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2537 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2538 PyObject *ret=PyTuple_New(2);
2539 PyObject *ret0Py=ret0?Py_True:Py_False;
2541 PyTuple_SetItem(ret,0,ret0Py);
2542 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2548 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2549 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2550 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2551 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2552 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2553 PyObject *ret=PyTuple_New(5);
2554 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2555 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2557 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2564 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2565 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2566 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2567 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2568 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2569 PyObject *ret=PyTuple_New(5);
2570 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2571 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2572 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2573 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2574 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2580 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2581 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2582 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2583 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2584 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2585 PyObject *ret=PyTuple_New(5);
2586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2588 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2589 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2590 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2596 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2597 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2598 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2599 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2600 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2601 PyObject *ret=PyTuple_New(5);
2602 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2603 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2605 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2606 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2612 DataArrayInt *neighbors=0,*neighborsIdx=0;
2613 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2614 PyObject *ret=PyTuple_New(2);
2615 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2616 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2620 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2622 DataArrayInt *neighbors=0,*neighborsIdx=0;
2623 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2624 PyObject *ret=PyTuple_New(2);
2625 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2630 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2632 DataArrayInt *neighbors=0,*neighborsIdx=0;
2633 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2634 PyObject *ret=PyTuple_New(2);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2642 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2643 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2644 DataArrayInt *d2,*d3,*d4,*dd5;
2645 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2646 PyObject *ret=PyTuple_New(7);
2647 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2648 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2649 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2651 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2652 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2653 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2660 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2661 da->checkAllocated();
2662 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2665 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2668 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2669 da->checkAllocated();
2670 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2673 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2676 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2677 da->checkAllocated();
2678 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2681 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2684 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2685 da->checkAllocated();
2686 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2687 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2688 PyObject *res = PyList_New(result.size());
2689 for (int i=0;iL!=result.end(); i++, iL++)
2690 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2694 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2697 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2698 da->checkAllocated();
2699 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2700 ret->setName(da->getName().c_str());
2704 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2706 DataArrayInt *cellNb1=0,*cellNb2=0;
2707 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2708 PyObject *ret=PyTuple_New(3);
2709 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2715 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2717 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2718 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2719 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2720 PyObject *ret(PyTuple_New(4));
2721 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2722 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2723 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2724 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2728 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2730 int spaceDim=self->getSpaceDimension();
2732 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2734 DataArrayDouble *a,*a2;
2735 DataArrayDoubleTuple *aa,*aa2;
2736 std::vector<double> bb,bb2;
2738 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2739 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2740 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2741 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2743 DataArrayInt *cellIds=0;
2744 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2745 PyObject *ret=PyTuple_New(2);
2746 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2751 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2753 int spaceDim=self->getSpaceDimension();
2755 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2757 DataArrayDouble *a,*a2;
2758 DataArrayDoubleTuple *aa,*aa2;
2759 std::vector<double> bb,bb2;
2761 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2762 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2763 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2764 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2766 DataArrayInt *cellIds=0;
2767 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2768 PyObject *ret=PyTuple_New(2);
2769 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2774 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2776 int spaceDim=self->getSpaceDimension();
2778 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2780 DataArrayDouble *a,*a2;
2781 DataArrayDoubleTuple *aa,*aa2;
2782 std::vector<double> bb,bb2;
2784 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2785 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2786 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2787 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2788 return self->getCellIdsCrossingPlane(orig,vect,eps);
2791 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2795 std::vector<int> pos2;
2796 DataArrayInt *pos3=0;
2797 DataArrayIntTuple *pos4=0;
2798 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2803 self->convertToPolyTypes(&pos1,&pos1+1);
2810 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2815 self->convertToPolyTypes(pos3->begin(),pos3->end());
2819 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2823 void convertAllToPoly();
2824 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2825 bool unPolyze() throw(INTERP_KERNEL::Exception);
2826 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2827 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2828 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2831 //== MEDCouplingUMesh End
2833 //== MEDCouplingMappedExtrudedMesh
2835 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2838 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2839 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2840 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2841 int get2DCellIdForExtrusion() const;
2843 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2845 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2848 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2850 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2853 MEDCouplingMappedExtrudedMesh()
2855 return MEDCouplingMappedExtrudedMesh::New();
2858 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2860 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2863 std::string __str__() const throw(INTERP_KERNEL::Exception)
2865 return self->simpleRepr();
2868 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2870 std::ostringstream oss;
2871 self->reprQuickOverview(oss);
2875 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2877 MEDCouplingUMesh *ret=self->getMesh2D();
2880 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2882 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2884 MEDCouplingUMesh *ret=self->getMesh1D();
2887 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2889 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2891 DataArrayInt *ret=self->getMesh3DIds();
2894 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2899 //== MEDCouplingMappedExtrudedMesh End
2901 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2904 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2905 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2906 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2907 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2908 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2909 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2912 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2914 int szArr,sw,iTypppArr;
2915 std::vector<int> stdvecTyyppArr;
2916 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2917 self->insertNextCell(tmp,tmp+szArr);
2920 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2922 DataArrayInt *ret=self->getNodalConnectivity();
2923 if(ret) ret->incrRef();
2927 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2929 std::vector< const MEDCoupling1GTUMesh *> parts;
2930 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2931 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2936 //== MEDCoupling1SGTUMesh
2938 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2941 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2942 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2943 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2944 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2945 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2946 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2947 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2948 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2949 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2952 MEDCoupling1SGTUMesh()
2954 return MEDCoupling1SGTUMesh::New();
2957 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2959 return MEDCoupling1SGTUMesh::New(name,type);
2962 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2964 return MEDCoupling1SGTUMesh::New(m);
2967 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2969 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2972 std::string __str__() const throw(INTERP_KERNEL::Exception)
2974 return self->simpleRepr();
2977 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2979 std::ostringstream oss;
2980 self->reprQuickOverview(oss);
2984 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2986 DataArrayInt *cellPerm(0),*nodePerm(0);
2987 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2988 PyObject *ret(PyTuple_New(3));
2989 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2990 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2991 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2995 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2997 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2998 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2999 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3002 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3004 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3005 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3006 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3011 //== MEDCoupling1SGTUMesh End
3013 //== MEDCoupling1DGTUMesh
3015 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3018 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3019 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3020 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3021 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3022 bool isPacked() const throw(INTERP_KERNEL::Exception);
3025 MEDCoupling1DGTUMesh()
3027 return MEDCoupling1DGTUMesh::New();
3029 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3031 return MEDCoupling1DGTUMesh::New(name,type);
3034 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3036 return MEDCoupling1DGTUMesh::New(m);
3039 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3041 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3044 std::string __str__() const throw(INTERP_KERNEL::Exception)
3046 return self->simpleRepr();
3049 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3051 std::ostringstream oss;
3052 self->reprQuickOverview(oss);
3056 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3058 DataArrayInt *ret=self->getNodalConnectivityIndex();
3059 if(ret) ret->incrRef();
3063 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3065 DataArrayInt *ret1=0,*ret2=0;
3066 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3067 PyObject *ret0Py=ret0?Py_True:Py_False;
3069 PyObject *ret=PyTuple_New(3);
3070 PyTuple_SetItem(ret,0,ret0Py);
3071 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3072 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3076 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3079 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3080 PyObject *ret=PyTuple_New(2);
3081 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3082 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3083 PyTuple_SetItem(ret,1,ret1Py);
3087 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3089 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3090 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3091 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3094 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3096 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3097 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3098 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3101 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3103 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3104 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3105 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3110 //== MEDCoupling1DGTUMeshEnd
3112 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3115 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3116 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3117 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3118 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3119 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3120 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3121 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3122 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3123 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3124 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3125 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3126 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3127 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3128 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3129 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3132 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3134 int tmpp1=-1,tmpp2=-1;
3135 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3136 std::vector< std::pair<int,int> > inp;
3140 for(int i=0;i<tmpp1;i++)
3141 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3146 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3147 inp.resize(tmpp1/2);
3148 for(int i=0;i<tmpp1/2;i++)
3149 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3152 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3153 return self->buildStructuredSubPart(inp);
3156 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3158 std::vector< std::pair<int,int> > inp;
3159 convertPyToVectorPairInt(part,inp);
3161 int szArr,sw,iTypppArr;
3162 std::vector<int> stdvecTyyppArr;
3163 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3164 std::vector<int> tmp5(tmp4,tmp4+szArr);
3166 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3169 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3171 std::vector< std::pair<int,int> > inp;
3172 convertPyToVectorPairInt(part,inp);
3173 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3176 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3178 std::vector< std::pair<int,int> > inp;
3179 convertPyToVectorPairInt(part,inp);
3180 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3183 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3185 std::vector< std::pair<int,int> > inp;
3186 convertPyToVectorPairInt(part,inp);
3187 std::vector<int> stWithGhost;
3188 std::vector< std::pair<int,int> > partWithGhost;
3189 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3190 PyObject *ret(PyTuple_New(2));
3191 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3192 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3196 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3198 std::vector< std::pair<int,int> > inp;
3199 convertPyToVectorPairInt(partCompactFormat,inp);
3200 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3203 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3205 std::vector< std::pair<int,int> > inp;
3206 convertPyToVectorPairInt(partCompactFormat,inp);
3207 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3210 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3212 std::vector< std::pair<int,int> > inp;
3213 convertPyToVectorPairInt(part,inp);
3214 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3217 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3219 int szArr,sw,iTypppArr;
3220 std::vector<int> stdvecTyyppArr;
3221 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3222 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3225 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3227 int szArr,sw,iTypppArr;
3228 std::vector<int> stdvecTyyppArr;
3229 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3230 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3233 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3235 std::vector< std::pair<int,int> > inp;
3236 convertPyToVectorPairInt(partCompactFormat,inp);
3237 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3240 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3242 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3243 PyObject *retPy=PyList_New(ret.size());
3244 for(std::size_t i=0;i<ret.size();i++)
3246 PyObject *tmp=PyTuple_New(2);
3247 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3248 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3249 PyList_SetItem(retPy,i,tmp);
3254 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3256 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3257 convertPyToVectorPairInt(r1,r1Cpp);
3258 convertPyToVectorPairInt(r2,r2Cpp);
3259 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3260 PyObject *retPy=PyList_New(ret.size());
3261 for(std::size_t i=0;i<ret.size();i++)
3263 PyObject *tmp=PyTuple_New(2);
3264 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3265 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3266 PyList_SetItem(retPy,i,tmp);
3271 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3273 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3274 convertPyToVectorPairInt(r1,r1Cpp);
3275 convertPyToVectorPairInt(r2,r2Cpp);
3276 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3279 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3281 int szArr,sw,iTypppArr;
3282 std::vector<int> stdvecTyyppArr;
3283 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3284 int szArr2,sw2,iTypppArr2;
3285 std::vector<int> stdvecTyyppArr2;
3286 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3287 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3288 std::vector< std::pair<int,int> > partCompactFormat;
3289 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3290 PyObject *ret=PyTuple_New(2);
3291 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3292 PyTuple_SetItem(ret,0,ret0Py);
3293 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3294 for(std::size_t i=0;i<partCompactFormat.size();i++)
3296 PyObject *tmp4=PyTuple_New(2);
3297 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3298 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3299 PyList_SetItem(ret1Py,i,tmp4);
3301 PyTuple_SetItem(ret,1,ret1Py);
3305 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3307 std::vector< std::pair<int,int> > param0,param1,ret;
3308 convertPyToVectorPairInt(bigInAbs,param0);
3309 convertPyToVectorPairInt(partOfBigInAbs,param1);
3310 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3311 PyObject *retPy(PyList_New(ret.size()));
3312 for(std::size_t i=0;i<ret.size();i++)
3314 PyObject *tmp(PyTuple_New(2));
3315 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3316 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3317 PyList_SetItem(retPy,i,tmp);
3322 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3324 std::vector< std::pair<int,int> > param0;
3325 convertPyToVectorPairInt(part,param0);
3326 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3327 PyObject *retPy(PyList_New(ret.size()));
3328 for(std::size_t i=0;i<ret.size();i++)
3330 PyObject *tmp(PyTuple_New(2));
3331 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3332 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3333 PyList_SetItem(retPy,i,tmp);
3338 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3340 std::vector< std::pair<int,int> > param0,param1;
3341 convertPyToVectorPairInt(startingFrom,param0);
3342 convertPyToVectorPairInt(goingTo,param1);
3343 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3346 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3348 std::vector< std::pair<int,int> > param0,param1,ret;
3349 convertPyToVectorPairInt(bigInAbs,param0);
3350 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3351 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3352 PyObject *retPy(PyList_New(ret.size()));
3353 for(std::size_t i=0;i<ret.size();i++)
3355 PyObject *tmp(PyTuple_New(2));
3356 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3357 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3358 PyList_SetItem(retPy,i,tmp);
3365 class MEDCouplingCurveLinearMesh;
3367 //== MEDCouplingCMesh
3369 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3372 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3373 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3374 void setCoords(const DataArrayDouble *coordsX,
3375 const DataArrayDouble *coordsY=0,
3376 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3377 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3378 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3380 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3382 return MEDCouplingCMesh::New();
3384 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3386 return MEDCouplingCMesh::New(meshName);
3389 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3391 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3393 std::string __str__() const throw(INTERP_KERNEL::Exception)
3395 return self->simpleRepr();
3397 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3399 std::ostringstream oss;
3400 self->reprQuickOverview(oss);
3403 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3405 DataArrayDouble *ret=self->getCoordsAt(i);
3413 //== MEDCouplingCMesh End
3415 //== MEDCouplingCurveLinearMesh
3417 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3420 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3421 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3422 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3424 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3426 return MEDCouplingCurveLinearMesh::New();
3428 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3430 return MEDCouplingCurveLinearMesh::New(meshName);
3432 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3434 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3436 std::string __str__() const throw(INTERP_KERNEL::Exception)
3438 return self->simpleRepr();
3440 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3442 std::ostringstream oss;
3443 self->reprQuickOverview(oss);
3446 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3448 DataArrayDouble *ret=self->getCoords();
3453 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3455 int szArr,sw,iTypppArr;
3456 std::vector<int> stdvecTyyppArr;
3457 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3458 self->setNodeGridStructure(tmp,tmp+szArr);
3463 //== MEDCouplingCurveLinearMesh End
3465 //== MEDCouplingIMesh
3467 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3470 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3472 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3473 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3474 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3475 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3476 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3477 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3478 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3479 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3480 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3481 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3482 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3487 return MEDCouplingIMesh::New();
3489 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3491 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3492 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3493 const int *nodeStrctPtr(0);
3494 const double *originPtr(0),*dxyzPtr(0);
3496 std::vector<int> bb0;
3497 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3500 std::vector<double> bb,bb2;
3502 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3503 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3505 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3508 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3510 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3513 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3515 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3518 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3521 std::vector<int> bb0;
3522 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3523 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3526 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3528 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3531 DataArrayDoubleTuple *aa;
3532 std::vector<double> bb;
3534 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3535 self->setOrigin(originPtr,originPtr+nbTuples);
3538 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3540 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3543 DataArrayDoubleTuple *aa;
3544 std::vector<double> bb;
3546 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3547 self->setDXYZ(originPtr,originPtr+nbTuples);
3550 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3552 std::vector< std::pair<int,int> > inp;
3553 convertPyToVectorPairInt(fineLocInCoarse,inp);
3554 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3557 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)
3559 std::vector< std::pair<int,int> > inp;
3560 convertPyToVectorPairInt(fineLocInCoarse,inp);
3561 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3564 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3566 std::vector< std::pair<int,int> > inp;
3567 convertPyToVectorPairInt(fineLocInCoarse,inp);
3568 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3571 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)
3573 std::vector< std::pair<int,int> > inp;
3574 convertPyToVectorPairInt(fineLocInCoarse,inp);
3575 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3578 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)
3580 std::vector< std::pair<int,int> > inp;
3581 convertPyToVectorPairInt(fineLocInCoarse,inp);
3582 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3585 std::string __str__() const throw(INTERP_KERNEL::Exception)
3587 return self->simpleRepr();
3589 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3591 std::ostringstream oss;
3592 self->reprQuickOverview(oss);
3598 //== MEDCouplingIMesh End
3602 namespace MEDCoupling
3604 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3607 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3608 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3609 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3610 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3611 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3612 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3613 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3614 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3615 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3616 std::string getName() const throw(INTERP_KERNEL::Exception);
3617 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3618 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3619 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3620 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3621 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3622 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3623 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3624 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3625 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3626 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3627 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3628 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3629 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3630 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3631 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3632 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3634 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3636 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3639 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3642 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3644 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3647 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3650 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3652 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3653 return convertIntArrToPyList3(ret);
3656 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3659 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3660 PyObject *ret=PyTuple_New(2);
3661 PyObject *ret0Py=ret0?Py_True:Py_False;
3663 PyTuple_SetItem(ret,0,ret0Py);
3664 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3668 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3670 DataArrayInt *ret1=0;
3671 MEDCouplingMesh *ret0=0;
3673 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3674 if (!SWIG_IsOK(res1))
3677 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3678 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3682 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3684 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3685 da2->checkAllocated();
3686 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3688 PyObject *res = PyList_New(2);
3689 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3690 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3694 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3696 DataArrayInt *ret1=0;
3698 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3699 PyObject *res=PyTuple_New(2);
3700 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3702 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3705 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3706 PyTuple_SetItem(res,1,res1);
3711 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3714 int v0; std::vector<int> v1;
3715 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3716 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3719 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3720 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3723 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3724 if (!SWIG_IsOK(res1))
3727 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3728 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3732 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3734 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3735 da2->checkAllocated();
3736 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3740 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3742 std::vector<int> tmp;
3743 self->getCellIdsHavingGaussLocalization(locId,tmp);
3744 DataArrayInt *ret=DataArrayInt::New();
3745 ret->alloc((int)tmp.size(),1);
3746 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3747 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3750 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3752 std::vector<int> inp0;
3753 convertPyToNewIntArr4(code,1,3,inp0);
3754 std::vector<const DataArrayInt *> inp1;
3755 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3756 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3761 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3764 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3765 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3766 static MEDCouplingFieldTemplate *New(TypeOfField type);
3767 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3768 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3771 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3773 return MEDCouplingFieldTemplate::New(f);
3776 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3778 return MEDCouplingFieldTemplate::New(f);
3781 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3783 return MEDCouplingFieldTemplate::New(type);
3786 std::string __str__() const throw(INTERP_KERNEL::Exception)
3788 return self->simpleRepr();
3791 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3793 std::ostringstream oss;
3794 self->reprQuickOverview(oss);
3800 class MEDCouplingFieldInt;
3802 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3805 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3806 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3807 void setTimeUnit(const std::string& unit);
3808 std::string getTimeUnit() const;
3809 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3810 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3811 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3812 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3813 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3814 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3815 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3816 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3817 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3818 MEDCouplingFieldDouble *deepCopy() const;
3819 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3820 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3821 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3822 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3823 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3824 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3825 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3826 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3827 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3828 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3829 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3830 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3831 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3832 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3833 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3834 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3835 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3836 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3837 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3838 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3839 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3840 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3841 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3842 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3843 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3844 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3845 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3846 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3847 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3848 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3849 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3850 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3851 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3852 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3853 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3854 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3855 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3856 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3857 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3858 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3859 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3860 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3861 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3862 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3863 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3864 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3865 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3866 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3867 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3868 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3869 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3870 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3871 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3872 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3873 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3874 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3875 double getMinValue() const throw(INTERP_KERNEL::Exception);
3876 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3877 double norm2() const throw(INTERP_KERNEL::Exception);
3878 double normMax() const throw(INTERP_KERNEL::Exception);
3879 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3880 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3881 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3882 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3883 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3884 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3885 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3886 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3887 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3888 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3890 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3891 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3892 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3893 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3894 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3895 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3896 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3897 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3898 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3899 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3900 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3902 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3904 return MEDCouplingFieldDouble::New(type,td);
3907 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3909 return MEDCouplingFieldDouble::New(ft,td);
3912 std::string __str__() const throw(INTERP_KERNEL::Exception)
3914 return self->simpleRepr();
3917 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3919 std::ostringstream oss;
3920 self->reprQuickOverview(oss);
3924 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
3926 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
3928 DataArrayDouble *a,*a2;
3929 DataArrayDoubleTuple *aa,*aa2;
3930 std::vector<double> bb,bb2;
3932 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
3933 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
3934 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
3937 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3939 DataArrayDouble *ret=self->getArray();
3945 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3947 std::vector<DataArrayDouble *> arrs=self->getArrays();
3948 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3952 PyObject *ret=PyTuple_New(sz);
3953 for(int i=0;i<sz;i++)
3956 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3958 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3963 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3965 std::vector<const DataArrayDouble *> tmp;
3966 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3968 std::vector<DataArrayDouble *> arrs(sz);
3969 for(int i=0;i<sz;i++)
3970 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3971 self->setArrays(arrs);
3974 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3976 DataArrayDouble *ret=self->getEndArray();
3982 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3986 DataArrayDoubleTuple *aa;
3987 std::vector<double> bb;
3989 const MEDCouplingMesh *mesh=self->getMesh();
3991 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3992 int spaceDim=mesh->getSpaceDimension();
3993 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3994 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3996 int sz=self->getNumberOfComponents();
3997 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3998 self->getValueOn(spaceLoc,res);
3999 return convertDblArrToPyList(res,sz);
4002 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4004 int sz=self->getNumberOfComponents();
4005 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4006 self->getValueOnPos(i,j,k,res);
4007 return convertDblArrToPyList(res,sz);
4010 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4012 const MEDCouplingMesh *mesh(self->getMesh());
4014 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4017 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4018 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4019 mesh->getSpaceDimension(),true,nbPts);
4020 return self->getValueOnMulti(inp,nbPts);
4023 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4027 DataArrayDoubleTuple *aa;
4028 std::vector<double> bb;
4030 const MEDCouplingMesh *mesh=self->getMesh();
4032 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4033 int spaceDim=mesh->getSpaceDimension();
4034 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4035 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4038 int sz=self->getNumberOfComponents();
4039 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4040 self->getValueOn(spaceLoc,time,res);
4041 return convertDblArrToPyList(res,sz);
4044 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4046 if(self->getArray()!=0)
4047 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4050 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4051 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4052 self->setArray(arr);
4056 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4059 double tmp0=self->getTime(tmp1,tmp2);
4060 PyObject *res = PyList_New(3);
4061 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4062 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4063 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4067 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4070 double tmp0=self->getStartTime(tmp1,tmp2);
4071 PyObject *res = PyList_New(3);
4072 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4073 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4074 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4078 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4081 double tmp0=self->getEndTime(tmp1,tmp2);
4082 PyObject *res = PyList_New(3);
4083 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4084 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4085 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4088 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4090 int sz=self->getNumberOfComponents();
4091 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4092 self->accumulate(tmp);
4093 return convertDblArrToPyList(tmp,sz);
4095 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4097 int sz=self->getNumberOfComponents();
4098 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4099 self->integral(isWAbs,tmp);
4100 return convertDblArrToPyList(tmp,sz);
4102 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4104 int sz=self->getNumberOfComponents();
4105 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4106 self->getWeightedAverageValue(tmp,isWAbs);
4107 return convertDblArrToPyList(tmp,sz);
4109 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4111 int sz=self->getNumberOfComponents();
4112 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4114 return convertDblArrToPyList(tmp,sz);
4116 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4118 int sz=self->getNumberOfComponents();
4119 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4121 return convertDblArrToPyList(tmp,sz);
4123 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4125 int szArr,sw,iTypppArr;
4126 std::vector<int> stdvecTyyppArr;
4127 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4128 self->renumberCells(tmp,check);
4131 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4133 int szArr,sw,iTypppArr;
4134 std::vector<int> stdvecTyyppArr;
4135 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4136 self->renumberCellsWithoutMesh(tmp,check);
4139 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4141 int szArr,sw,iTypppArr;
4142 std::vector<int> stdvecTyyppArr;
4143 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4144 self->renumberNodes(tmp,eps);
4147 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4149 int szArr,sw,iTypppArr;
4150 std::vector<int> stdvecTyyppArr;
4151 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4152 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4155 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4159 std::vector<int> multiVal;
4160 std::pair<int, std::pair<int,int> > slic;
4161 MEDCoupling::DataArrayInt *daIntTyypp=0;
4162 const MEDCouplingMesh *mesh=self->getMesh();
4164 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4165 int nbc=mesh->getNumberOfCells();
4166 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4173 std::ostringstream oss;
4174 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4175 throw INTERP_KERNEL::Exception(oss.str().c_str());
4178 return self->buildSubPart(&singleVal,&singleVal+1);
4183 int tmp=nbc+singleVal;
4184 return self->buildSubPart(&tmp,&tmp+1);
4188 std::ostringstream oss;
4189 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4190 throw INTERP_KERNEL::Exception(oss.str().c_str());
4196 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4200 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4205 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4206 daIntTyypp->checkAllocated();
4207 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4210 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4214 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4216 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";
4217 if(PyTuple_Check(li))
4219 Py_ssize_t sz=PyTuple_Size(li);
4221 throw INTERP_KERNEL::Exception(msg);
4222 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4225 std::vector<int> multiVal;
4226 std::pair<int, std::pair<int,int> > slic;
4227 MEDCoupling::DataArrayInt *daIntTyypp=0;
4228 if(!self->getArray())
4229 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4231 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4232 catch(INTERP_KERNEL::Exception& e)
4233 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4234 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4235 DataArrayDouble *ret0Arr=ret0->getArray();
4237 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4242 std::vector<int> v2(1,singleVal);
4243 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4244 ret0->setArray(aarr);
4249 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4250 ret0->setArray(aarr);
4255 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4256 std::vector<int> v2(nbOfComp);
4257 for(int i=0;i<nbOfComp;i++)
4258 v2[i]=slic.first+i*slic.second.second;
4259 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4260 ret0->setArray(aarr);
4264 throw INTERP_KERNEL::Exception(msg);
4269 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4272 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4275 double r1=self->getMaxValue2(tmp);
4276 PyObject *ret=PyTuple_New(2);
4277 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4282 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4285 double r1=self->getMinValue2(tmp);
4286 PyObject *ret=PyTuple_New(2);
4287 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4288 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4292 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4294 std::vector<int> tmp;
4295 convertPyToNewIntArr3(li,tmp);
4296 return self->keepSelectedComponents(tmp);
4299 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4301 std::vector<int> tmp;
4302 convertPyToNewIntArr3(li,tmp);
4303 self->setSelectedComponents(f,tmp);
4306 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4309 DataArrayDouble *a,*a2;
4310 DataArrayDoubleTuple *aa,*aa2;
4311 std::vector<double> bb,bb2;
4314 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4315 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4316 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4317 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4319 return self->extractSlice3D(orig,vect,eps);
4322 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4324 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4327 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4329 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4332 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4334 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.";
4335 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4338 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4340 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4342 return (*self)-(*other);
4344 throw INTERP_KERNEL::Exception(msg);
4349 DataArrayDoubleTuple *aa;
4350 std::vector<double> bb;
4352 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4357 if(!self->getArray())
4358 throw INTERP_KERNEL::Exception(msg2);
4359 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4360 ret->applyLin(1.,-val);
4361 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4362 ret2->setArray(ret);
4367 if(!self->getArray())
4368 throw INTERP_KERNEL::Exception(msg2);
4369 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4370 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4371 ret2->setArray(ret);
4376 if(!self->getArray())
4377 throw INTERP_KERNEL::Exception(msg2);
4378 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4379 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4380 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4381 ret2->setArray(ret);
4386 if(!self->getArray())
4387 throw INTERP_KERNEL::Exception(msg2);
4388 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4389 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4390 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4391 ret2->setArray(ret);
4395 { throw INTERP_KERNEL::Exception(msg); }
4399 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4401 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4404 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4406 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4409 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4411 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4414 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4416 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.";
4417 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4420 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4422 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4424 return (*self)/(*other);
4426 throw INTERP_KERNEL::Exception(msg);
4431 DataArrayDoubleTuple *aa;
4432 std::vector<double> bb;
4434 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4440 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4441 if(!self->getArray())
4442 throw INTERP_KERNEL::Exception(msg2);
4443 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4444 ret->applyLin(1./val,0);
4445 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4446 ret2->setArray(ret);
4451 if(!self->getArray())
4452 throw INTERP_KERNEL::Exception(msg2);
4453 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4454 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4455 ret2->setArray(ret);
4460 if(!self->getArray())
4461 throw INTERP_KERNEL::Exception(msg2);
4462 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4463 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4464 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4465 ret2->setArray(ret);
4470 if(!self->getArray())
4471 throw INTERP_KERNEL::Exception(msg2);
4472 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4473 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4474 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4475 ret2->setArray(ret);
4479 { throw INTERP_KERNEL::Exception(msg); }
4483 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4485 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4488 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4490 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.";
4491 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4494 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4496 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4498 return (*self)^(*other);
4500 throw INTERP_KERNEL::Exception(msg);
4505 DataArrayDoubleTuple *aa;
4506 std::vector<double> bb;
4508 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4513 if(!self->getArray())
4514 throw INTERP_KERNEL::Exception(msg2);
4515 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4517 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4518 ret2->setArray(ret);
4523 if(!self->getArray())
4524 throw INTERP_KERNEL::Exception(msg2);
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4536 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4537 ret2->setArray(ret);
4542 if(!self->getArray())
4543 throw INTERP_KERNEL::Exception(msg2);
4544 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4545 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4546 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 ret2->setArray(ret);
4551 { throw INTERP_KERNEL::Exception(msg); }
4555 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4557 return self->negate();
4560 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4562 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.";
4563 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4566 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4568 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4572 Py_XINCREF(trueSelf);
4576 throw INTERP_KERNEL::Exception(msg);
4581 DataArrayDoubleTuple *aa;
4582 std::vector<double> bb;
4584 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4589 if(!self->getArray())
4590 throw INTERP_KERNEL::Exception(msg2);
4591 self->getArray()->applyLin(1.,val);
4592 Py_XINCREF(trueSelf);
4597 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4600 Py_XINCREF(trueSelf);
4605 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4606 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4607 ret2->setArray(aaa);
4609 Py_XINCREF(trueSelf);
4614 if(!self->getArray())
4615 throw INTERP_KERNEL::Exception(msg2);
4616 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4617 self->getArray()->addEqual(aaa);
4618 Py_XINCREF(trueSelf);
4622 { throw INTERP_KERNEL::Exception(msg); }
4626 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4628 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.";
4629 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4632 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4634 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4638 Py_XINCREF(trueSelf);
4642 throw INTERP_KERNEL::Exception(msg);
4647 DataArrayDoubleTuple *aa;
4648 std::vector<double> bb;
4650 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4655 if(!self->getArray())
4656 throw INTERP_KERNEL::Exception(msg2);
4657 self->getArray()->applyLin(1.,-val);
4658 Py_XINCREF(trueSelf);
4663 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4666 Py_XINCREF(trueSelf);
4671 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4672 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4673 ret2->setArray(aaa);
4675 Py_XINCREF(trueSelf);
4680 if(!self->getArray())
4681 throw INTERP_KERNEL::Exception(msg2);
4682 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4683 self->getArray()->substractEqual(aaa);
4684 Py_XINCREF(trueSelf);
4688 { throw INTERP_KERNEL::Exception(msg); }
4692 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4694 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.";
4695 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4698 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4700 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4704 Py_XINCREF(trueSelf);
4708 throw INTERP_KERNEL::Exception(msg);
4713 DataArrayDoubleTuple *aa;
4714 std::vector<double> bb;
4716 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4721 if(!self->getArray())
4722 throw INTERP_KERNEL::Exception(msg2);
4723 self->getArray()->applyLin(val,0);
4724 Py_XINCREF(trueSelf);
4729 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4732 Py_XINCREF(trueSelf);
4737 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4738 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4739 ret2->setArray(aaa);
4741 Py_XINCREF(trueSelf);
4746 if(!self->getArray())
4747 throw INTERP_KERNEL::Exception(msg2);
4748 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4749 self->getArray()->multiplyEqual(aaa);
4750 Py_XINCREF(trueSelf);
4754 { throw INTERP_KERNEL::Exception(msg); }
4758 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4760 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.";
4761 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4764 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4766 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4770 Py_XINCREF(trueSelf);
4774 throw INTERP_KERNEL::Exception(msg);
4779 DataArrayDoubleTuple *aa;
4780 std::vector<double> bb;
4782 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4788 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4789 if(!self->getArray())
4790 throw INTERP_KERNEL::Exception(msg2);
4791 self->getArray()->applyLin(1./val,0);
4792 Py_XINCREF(trueSelf);
4797 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4800 Py_XINCREF(trueSelf);
4805 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4806 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4807 ret2->setArray(aaa);
4809 Py_XINCREF(trueSelf);
4814 if(!self->getArray())
4815 throw INTERP_KERNEL::Exception(msg2);
4816 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4817 self->getArray()->divideEqual(aaa);
4818 Py_XINCREF(trueSelf);
4822 { throw INTERP_KERNEL::Exception(msg); }
4826 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4828 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.";
4829 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4832 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4834 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4838 Py_XINCREF(trueSelf);
4842 throw INTERP_KERNEL::Exception(msg);
4847 DataArrayDoubleTuple *aa;
4848 std::vector<double> bb;
4850 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4855 if(!self->getArray())
4856 throw INTERP_KERNEL::Exception(msg2);
4857 self->getArray()->applyPow(val);
4858 Py_XINCREF(trueSelf);
4863 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4866 Py_XINCREF(trueSelf);
4871 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4872 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4873 ret2->setArray(aaa);
4875 Py_XINCREF(trueSelf);
4880 if(!self->getArray())
4881 throw INTERP_KERNEL::Exception(msg2);
4882 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4883 self->getArray()->powEqual(aaa);
4884 Py_XINCREF(trueSelf);
4888 { throw INTERP_KERNEL::Exception(msg); }
4892 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4894 std::vector<const MEDCouplingFieldDouble *> tmp;
4895 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4896 return MEDCouplingFieldDouble::MergeFields(tmp);
4899 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4901 std::vector<const MEDCouplingFieldDouble *> tmp;
4902 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4903 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4906 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4908 std::vector<double> a0;
4909 std::vector<int> a1;
4910 std::vector<std::string> a2;
4911 self->getTinySerializationDbleInformation(a0);
4912 self->getTinySerializationIntInformation(a1);
4913 self->getTinySerializationStrInformation(a2);
4915 PyObject *ret(PyTuple_New(3));
4916 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4917 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4919 PyObject *ret2(PyList_New(sz));
4921 for(int i=0;i<sz;i++)
4922 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4924 PyTuple_SetItem(ret,2,ret2);
4928 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4930 DataArrayInt *ret0(0);
4931 std::vector<DataArrayDouble *> ret1;
4932 self->serialize(ret0,ret1);
4935 std::size_t sz(ret1.size());
4936 PyObject *ret(PyTuple_New(2));
4937 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4938 PyObject *ret1Py(PyList_New(sz));
4939 for(std::size_t i=0;i<sz;i++)
4943 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4945 PyTuple_SetItem(ret,1,ret1Py);
4949 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4951 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4952 if(!PyTuple_Check(args))
4953 throw INTERP_KERNEL::Exception(MSG);
4954 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4955 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4956 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4958 PyObject *tmp0(PyTuple_New(1));
4959 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4960 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4962 Py_DECREF(selfMeth);
4963 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4964 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4965 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4967 PyObject *a(PyInt_FromLong(0));
4968 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4971 throw INTERP_KERNEL::Exception(MSG);
4972 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4973 throw INTERP_KERNEL::Exception(MSG);
4974 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4977 Py_DECREF(initMeth);
4982 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4983 {// put an empty dict in input to say to __new__ to call __init__...
4984 self->checkConsistencyLight();
4985 PyObject *ret(PyTuple_New(1));
4986 PyObject *ret0(PyDict_New());
4988 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4989 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4990 PyDict_SetItem(ret0,a,d);
4991 Py_DECREF(a); Py_DECREF(d);
4993 PyTuple_SetItem(ret,0,ret0);
4997 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4999 self->checkConsistencyLight();
5000 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5001 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5002 const MEDCouplingMesh *mesh(self->getMesh());
5005 PyObject *ret(PyTuple_New(3));
5006 PyTuple_SetItem(ret,0,ret0);
5007 PyTuple_SetItem(ret,1,ret1);
5008 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5012 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5014 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5015 if(!PyTuple_Check(inp))
5016 throw INTERP_KERNEL::Exception(MSG);
5017 int sz(PyTuple_Size(inp));
5019 throw INTERP_KERNEL::Exception(MSG);
5021 PyObject *elt2(PyTuple_GetItem(inp,2));
5023 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5024 if(!SWIG_IsOK(status))
5025 throw INTERP_KERNEL::Exception(MSG);
5026 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5028 PyObject *elt0(PyTuple_GetItem(inp,0));
5029 PyObject *elt1(PyTuple_GetItem(inp,1));
5030 std::vector<double> a0;
5031 std::vector<int> a1;
5032 std::vector<std::string> a2;
5033 DataArrayInt *b0(0);
5034 std::vector<DataArrayDouble *>b1;
5036 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5037 throw INTERP_KERNEL::Exception(MSG);
5038 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5040 fillArrayWithPyListDbl3(a0py,tmp,a0);
5041 convertPyToNewIntArr3(a1py,a1);
5042 fillStringVector(a2py,a2);
5045 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5046 throw INTERP_KERNEL::Exception(MSG);
5047 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5049 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5050 if(!SWIG_IsOK(status))
5051 throw INTERP_KERNEL::Exception(MSG);
5052 b0=reinterpret_cast<DataArrayInt *>(argp);
5053 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5055 self->checkForUnserialization(a1,b0,b1);
5056 // useless here to call resizeForUnserialization because arrays are well resized.
5057 self->finishUnserialization(a1,a0,a2);
5062 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5065 int getNumberOfFields() const;
5066 MEDCouplingMultiFields *deepCopy() const;
5067 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5068 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5069 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5070 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5071 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5074 std::string __str__() const throw(INTERP_KERNEL::Exception)
5076 return self->simpleRepr();
5078 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5080 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5081 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5083 std::vector<MEDCouplingFieldDouble *> fs(sz);
5084 for(int i=0;i<sz;i++)
5085 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5086 return MEDCouplingMultiFields::New(fs);
5088 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5090 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5091 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5093 std::vector<MEDCouplingFieldDouble *> fs(sz);
5094 for(int i=0;i<sz;i++)
5095 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5096 return MEDCouplingMultiFields::New(fs);
5098 PyObject *getFields() const
5100 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5101 int sz=fields.size();
5102 PyObject *res = PyList_New(sz);
5103 for(int i=0;i<sz;i++)
5107 fields[i]->incrRef();
5108 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5112 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5117 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5119 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5123 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5126 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5128 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5130 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5132 PyObject *res = PyList_New(sz);
5133 for(int i=0;i<sz;i++)
5138 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5142 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5147 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5149 std::vector<int> refs;
5150 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5152 PyObject *res = PyList_New(sz);
5153 for(int i=0;i<sz;i++)
5158 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5162 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5166 PyObject *ret=PyTuple_New(2);
5167 PyTuple_SetItem(ret,0,res);
5168 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5171 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5173 std::vector<DataArrayDouble *> ms=self->getArrays();
5175 PyObject *res = PyList_New(sz);
5176 for(int i=0;i<sz;i++)
5181 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5185 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5190 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5192 std::vector< std::vector<int> > refs;
5193 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5195 PyObject *res = PyList_New(sz);
5196 PyObject *res2 = PyList_New(sz);
5197 for(int i=0;i<sz;i++)
5202 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5206 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5208 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5211 PyObject *ret=PyTuple_New(2);
5212 PyTuple_SetItem(ret,0,res);
5213 PyTuple_SetItem(ret,1,res2);
5219 class MEDCouplingFieldInt : public MEDCouplingField
5222 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5223 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5224 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5225 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5226 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5227 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5228 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5229 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5230 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5231 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5233 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5235 return MEDCouplingFieldInt::New(type,td);
5238 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5240 return MEDCouplingFieldInt::New(ft,td);
5243 std::string __str__() const throw(INTERP_KERNEL::Exception)
5245 return self->simpleRepr();
5248 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5250 std::ostringstream oss;
5251 self->reprQuickOverview(oss);
5255 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5257 DataArrayInt *ret=self->getArray();
5263 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5266 double tmp0=self->getTime(tmp1,tmp2);
5267 PyObject *res = PyList_New(3);
5268 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5269 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5270 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5276 class MEDCouplingDefinitionTime
5279 MEDCouplingDefinitionTime();
5280 void assign(const MEDCouplingDefinitionTime& other);
5281 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5282 double getTimeResolution() const;
5283 std::vector<double> getHotSpotsTime() const;
5286 std::string __str__() const throw(INTERP_KERNEL::Exception)
5288 std::ostringstream oss;
5289 self->appendRepr(oss);
5293 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5295 int meshId,arrId,arrIdInField,fieldId;
5296 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5297 PyObject *res=PyList_New(4);
5298 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5299 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5300 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5301 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5305 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5307 int meshId,arrId,arrIdInField,fieldId;
5308 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5309 PyObject *res=PyList_New(4);
5310 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5311 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5312 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5313 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5319 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5322 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5323 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5327 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5329 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5330 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5332 std::vector<MEDCouplingFieldDouble *> fs(sz);
5333 for(int i=0;i<sz;i++)
5334 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5335 return MEDCouplingFieldOverTime::New(fs);
5337 std::string __str__() const throw(INTERP_KERNEL::Exception)
5339 return self->simpleRepr();
5341 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5343 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5344 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5346 std::vector<MEDCouplingFieldDouble *> fs(sz);
5347 for(int i=0;i<sz;i++)
5348 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5349 return MEDCouplingFieldOverTime::New(fs);
5354 class MEDCouplingCartesianAMRMesh;
5356 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5359 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5360 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5361 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5364 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5366 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5374 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5377 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5378 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5379 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5382 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5384 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5385 return convertFromVectorPairInt(ret);
5388 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5390 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5391 return convertFromVectorPairInt(ret);
5394 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5396 std::vector< std::pair<int,int> > inp;
5397 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5398 self->addPatch(inp,factors);
5401 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5403 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5405 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5406 if(patchId==mesh->getNumberOfPatches())
5408 std::ostringstream oss;
5409 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5410 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5413 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5419 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5421 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5423 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5424 mesh->removePatch(patchId);
5427 int __len__() const throw(INTERP_KERNEL::Exception)
5429 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5431 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5432 return mesh->getNumberOfPatches();
5437 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5441 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5444 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5445 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5446 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5447 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5448 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5449 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5450 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5451 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5452 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5453 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5454 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5455 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5456 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5458 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5459 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5460 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5461 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5462 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5463 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5464 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5465 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5466 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5467 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5468 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5469 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5470 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5471 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5472 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5473 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5474 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5475 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5476 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5477 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5480 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5482 std::vector< std::pair<int,int> > inp;
5483 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5484 self->addPatch(inp,factors);
5487 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5489 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5491 PyObject *ret = PyList_New(sz);
5492 for(int i=0;i<sz;i++)
5494 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5497 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5502 // agy : don't know why typemap fails here ??? let it in the extend section
5503 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5505 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5508 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5510 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5511 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5517 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5519 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5520 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5526 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5528 std::vector<int> out1;
5529 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5530 PyObject *ret(PyTuple_New(2));
5531 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5532 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5536 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5538 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5540 PyObject *ret = PyList_New(sz);
5541 for(int i=0;i<sz;i++)
5542 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5546 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5548 std::vector<const DataArrayDouble *> inp;
5549 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5550 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5553 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5555 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5561 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5563 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5569 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5571 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5577 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5579 const MEDCouplingIMesh *ret(self->getImageMesh());
5582 return const_cast<MEDCouplingIMesh *>(ret);
5585 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5587 if(patchId==self->getNumberOfPatches())
5589 std::ostringstream oss;
5590 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5591 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5594 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5600 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5602 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5603 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5604 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5607 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5609 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5610 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5611 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5614 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5616 self->removePatch(patchId);
5619 int __len__() const throw(INTERP_KERNEL::Exception)
5621 return self->getNumberOfPatches();
5626 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5630 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5633 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5636 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5638 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5639 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5640 const int *nodeStrctPtr(0);
5641 const double *originPtr(0),*dxyzPtr(0);
5643 std::vector<int> bb0;
5644 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5647 std::vector<double> bb,bb2;
5649 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5650 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5652 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5655 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5657 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5658 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5659 std::vector< std::vector<int> > inp2;
5660 convertPyToVectorOfVectorOfInt(factors,inp2);
5661 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5664 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5666 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5669 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5671 return MEDCouplingCartesianAMRMesh::New(mesh);
5676 class MEDCouplingDataForGodFather : public RefCountObject
5679 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5680 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5681 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5682 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5683 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5684 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5685 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5686 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5687 virtual void alloc() throw(INTERP_KERNEL::Exception);
5688 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5691 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5693 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5701 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5704 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5705 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5706 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5707 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5708 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5709 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5710 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5711 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5712 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5715 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5717 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5718 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5719 MEDCouplingAMRAttribute *ret(0);
5722 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5723 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5725 catch(INTERP_KERNEL::Exception&)
5727 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5728 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5733 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5735 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5738 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5740 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5741 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5747 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5749 std::vector< std::vector<std::string> > compNamesCpp;
5750 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5751 self->spillInfoOnComponents(compNamesCpp);
5754 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5756 std::vector<int> inp0;
5757 if(!fillIntVector(nfs,inp0))
5758 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5759 std::size_t sz(inp0.size());
5760 std::vector<NatureOfField> inp00(sz);
5761 for(std::size_t i=0;i<sz;i++)
5762 inp00[i]=(NatureOfField)inp0[i];
5763 self->spillNatures(inp00);
5766 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5768 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5769 int sz((int)ret.size());
5770 PyObject *retPy(PyList_New(sz));
5771 for(int i=0;i<sz;i++)
5772 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5778 class DenseMatrix : public RefCountObject, public TimeLabel
5781 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5782 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5783 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5784 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5786 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5787 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5788 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5789 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5790 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5791 void transpose() throw(INTERP_KERNEL::Exception);
5793 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5794 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5795 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5798 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5800 return DenseMatrix::New(nbRows,nbCols);
5803 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5805 return DenseMatrix::New(array,nbRows,nbCols);
5808 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5811 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5812 PyObject *ret=PyTuple_New(2);
5813 PyObject *ret0Py=ret0?Py_True:Py_False;
5815 PyTuple_SetItem(ret,0,ret0Py);
5816 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5820 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5822 DataArrayDouble *ret(self->getData());
5828 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5830 return MEDCoupling::DenseMatrix::Add(self,other);
5833 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5835 return MEDCoupling::DenseMatrix::Substract(self,other);
5838 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5840 return MEDCoupling::DenseMatrix::Multiply(self,other);
5843 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5845 return MEDCoupling::DenseMatrix::Multiply(self,other);
5848 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5850 self->addEqual(other);
5851 Py_XINCREF(trueSelf);
5855 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5857 self->substractEqual(other);
5858 Py_XINCREF(trueSelf);
5862 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5864 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5871 class PartDefinition : public RefCountObject, public TimeLabel
5874 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5875 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5876 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5877 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5878 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5879 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5880 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5881 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5884 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5886 return (*self)+other;
5889 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5892 bool ret0(self->isEqual(other,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 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5903 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5907 virtual ~PartDefinition();
5910 class DataArrayPartDefinition : public PartDefinition
5913 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5916 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5918 return DataArrayPartDefinition::New(listOfIds);
5921 std::string __str__() const throw(INTERP_KERNEL::Exception)
5923 return self->getRepr();
5926 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5928 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5929 oss << self->getRepr();
5934 virtual ~DataArrayPartDefinition();
5937 class SlicePartDefinition : public PartDefinition
5940 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5941 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5944 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5946 return SlicePartDefinition::New(start,stop,step);
5949 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5952 self->getSlice(a,b,c);
5953 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5956 std::string __str__() const throw(INTERP_KERNEL::Exception)
5958 return self->getRepr();
5961 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5963 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5964 oss << self->getRepr();
5969 virtual ~SlicePartDefinition();
5975 __filename=os.environ.get('PYTHONSTARTUP')
5976 if __filename and os.path.isfile(__filename):
5977 execfile(__filename)