1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
235 %newobject MEDCoupling::MEDCouplingFieldInt::New;
236 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
237 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
238 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
239 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
240 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
241 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
242 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
243 %newobject MEDCoupling::MEDCouplingMesh::clone;
244 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
245 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
246 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
250 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
251 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
252 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
253 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
254 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
255 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
256 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
257 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
261 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
262 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
263 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
264 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
265 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
266 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
267 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
268 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
269 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
270 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
271 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
272 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
273 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
274 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
275 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
276 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
277 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
278 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
279 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
280 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
281 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
282 %newobject MEDCoupling::MEDCouplingUMesh::New;
283 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
285 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
286 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
287 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
289 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
290 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
291 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
293 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
295 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
297 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
298 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
299 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
301 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
302 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
304 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
305 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
306 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
307 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
308 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
312 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
313 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
314 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
315 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
316 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
317 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
318 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
319 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
321 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
322 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
323 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
324 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
325 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
326 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
327 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
328 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
329 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
330 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
331 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
332 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
333 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
335 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
336 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
337 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
338 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
340 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
341 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
347 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
348 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
352 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
353 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
354 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
355 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
362 %newobject MEDCoupling::MEDCouplingCMesh::New;
363 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
364 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
365 %newobject MEDCoupling::MEDCouplingIMesh::New;
366 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
367 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
368 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
369 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
370 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
371 %newobject MEDCoupling::MEDCouplingMultiFields::New;
372 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
373 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
374 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
391 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
392 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
393 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
400 %newobject MEDCoupling::DenseMatrix::New;
401 %newobject MEDCoupling::DenseMatrix::deepCopy;
402 %newobject MEDCoupling::DenseMatrix::shallowCpy;
403 %newobject MEDCoupling::DenseMatrix::getData;
404 %newobject MEDCoupling::DenseMatrix::matVecMult;
405 %newobject MEDCoupling::DenseMatrix::MatVecMult;
406 %newobject MEDCoupling::DenseMatrix::__add__;
407 %newobject MEDCoupling::DenseMatrix::__sub__;
408 %newobject MEDCoupling::DenseMatrix::__mul__;
409 %newobject MEDCoupling::PartDefinition::New;
410 %newobject MEDCoupling::PartDefinition::toDAI;
411 %newobject MEDCoupling::PartDefinition::__add__;
412 %newobject MEDCoupling::PartDefinition::composeWith;
413 %newobject MEDCoupling::PartDefinition::tryToSimplify;
414 %newobject MEDCoupling::DataArrayPartDefinition::New;
415 %newobject MEDCoupling::SlicePartDefinition::New;
416 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
417 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
419 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
420 %feature("unref") MEDCouplingMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
422 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
423 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
425 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingField "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
436 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
437 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
438 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
445 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
446 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
447 %feature("unref") DenseMatrix "$this->decrRef();"
448 %feature("unref") PartDefinition "$this->decrRef();"
449 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
450 %feature("unref") SlicePartDefinition "$this->decrRef();"
452 %rename(assign) *::operator=;
453 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
454 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
455 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
460 %rename (InterpKernelException) INTERP_KERNEL::Exception;
462 %include "MEDCouplingRefCountObject.i"
463 %include "MEDCouplingMemArray.i"
465 namespace INTERP_KERNEL
468 * \class BoxSplittingOptions
469 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
471 class BoxSplittingOptions
474 BoxSplittingOptions();
475 void init() throw(INTERP_KERNEL::Exception);
476 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
477 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
478 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
479 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
480 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
481 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
482 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
483 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
484 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
485 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
486 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
487 std::string printOptions() const throw(INTERP_KERNEL::Exception);
490 std::string __str__() const throw(INTERP_KERNEL::Exception)
492 return self->printOptions();
498 namespace MEDCoupling
514 CONST_ON_TIME_INTERVAL = 7
515 } TypeOfTimeDiscretization;
523 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
524 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
526 } MEDCouplingMeshType;
529 class DataArrayDouble;
530 class MEDCouplingUMesh;
531 class MEDCouplingCMesh;
532 class MEDCouplingFieldDouble;
534 %extend RefCountObject
536 std::string getHiddenCppPointer() const
538 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
543 %extend MEDCouplingGaussLocalization
545 std::string __str__() const throw(INTERP_KERNEL::Exception)
547 return self->getStringRepr();
550 std::string __repr__() const throw(INTERP_KERNEL::Exception)
552 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
553 oss << self->getStringRepr();
560 class MEDCouplingMesh : public RefCountObject, public TimeLabel
563 void setName(const std::string& name);
564 std::string getName() const;
565 void setDescription(const std::string& descr);
566 std::string getDescription() const;
567 void setTime(double val, int iteration, int order);
568 void setTimeUnit(const std::string& unit);
569 std::string getTimeUnit() const;
570 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
571 bool isStructured() const throw(INTERP_KERNEL::Exception);
572 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
574 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
575 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
576 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
577 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
578 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
579 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
580 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
581 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
582 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
583 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
584 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
592 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
593 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
594 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
595 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
596 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
597 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
598 virtual std::string getVTKFileExtension() const;
599 std::string getVTKFileNameOf(const std::string& fileName) const;
601 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
607 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
608 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
609 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
610 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
611 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);
612 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
613 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
615 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
618 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
621 std::string __str__() const throw(INTERP_KERNEL::Exception)
623 return self->simpleRepr();
626 PyObject *getTime() throw(INTERP_KERNEL::Exception)
629 double tmp0=self->getTime(tmp1,tmp2);
630 PyObject *res = PyList_New(3);
631 PyList_SetItem(res,0,SWIG_From_double(tmp0));
632 PyList_SetItem(res,1,SWIG_From_int(tmp1));
633 PyList_SetItem(res,2,SWIG_From_int(tmp2));
637 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
639 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
640 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
646 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
650 DataArrayDoubleTuple *aa;
651 std::vector<double> bb;
653 int spaceDim=self->getSpaceDimension();
654 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
655 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
656 return self->getCellContainingPoint(pos,eps);
659 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
663 DataArrayDoubleTuple *aa;
664 std::vector<double> bb;
666 int spaceDim=self->getSpaceDimension();
667 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
668 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
669 MCAuto<DataArrayInt> elts,eltsIndex;
670 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
671 PyObject *ret=PyTuple_New(2);
672 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
673 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
677 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
679 MCAuto<DataArrayInt> elts,eltsIndex;
680 int spaceDim=self->getSpaceDimension();
682 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
683 if (!SWIG_IsOK(res1))
686 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
687 int nbOfPoints=size/spaceDim;
690 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
692 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
696 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
698 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
699 da2->checkAllocated();
700 int size=da2->getNumberOfTuples();
701 int nbOfCompo=da2->getNumberOfComponents();
702 if(nbOfCompo!=spaceDim)
704 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
706 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
708 PyObject *ret=PyTuple_New(2);
709 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
710 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
714 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
718 DataArrayDoubleTuple *aa;
719 std::vector<double> bb;
721 int spaceDim=self->getSpaceDimension();
722 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
723 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
724 std::vector<int> elts;
725 self->getCellsContainingPoint(pos,eps,elts);
726 DataArrayInt *ret=DataArrayInt::New();
727 ret->alloc((int)elts.size(),1);
728 std::copy(elts.begin(),elts.end(),ret->getPointer());
729 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
732 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
734 MCAuto<DataArrayInt> d0=DataArrayInt::New();
735 MCAuto<DataArrayInt> d1=DataArrayInt::New();
736 self->getReverseNodalConnectivity(d0,d1);
737 PyObject *ret=PyTuple_New(2);
738 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
739 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
743 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
746 int v0; std::vector<int> v1;
747 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
748 self->renumberCells(ids,check);
751 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
753 DataArrayInt *cellCor, *nodeCor;
754 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
755 PyObject *res = PyList_New(2);
756 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
757 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
761 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
763 DataArrayInt *cellCor=0,*nodeCor=0;
764 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
765 PyObject *res = PyList_New(2);
766 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
767 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
771 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
773 DataArrayInt *cellCor=0;
774 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
778 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
781 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
782 if (!SWIG_IsOK(res1))
785 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
786 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
790 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
792 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
793 da2->checkAllocated();
794 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
797 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
799 std::vector<int> conn;
800 self->getNodeIdsOfCell(cellId,conn);
801 return convertIntArrToPyList2(conn);
804 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
806 std::vector<double> coo;
807 self->getCoordinatesOfNode(nodeId,coo);
808 return convertDblArrToPyList2(coo);
811 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
815 DataArrayDoubleTuple *aa;
816 std::vector<double> bb;
818 int spaceDim=self->getSpaceDimension();
819 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
820 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
821 self->scale(pointPtr,factor);
824 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
826 int spaceDim=self->getSpaceDimension();
827 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
828 self->getBoundingBox(tmp);
829 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
833 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
836 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
837 PyObject *ret=PyTuple_New(2);
838 PyObject *ret0Py=ret0?Py_True:Py_False;
840 PyTuple_SetItem(ret,0,ret0Py);
841 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
845 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
847 int szArr,sw,iTypppArr;
848 std::vector<int> stdvecTyyppArr;
849 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
850 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
851 if(sw==3)//DataArrayInt
853 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
854 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
855 std::string name=argpt->getName();
857 ret->setName(name.c_str());
859 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
862 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
864 int szArr,sw,iTypppArr;
865 std::vector<int> stdvecTyyppArr;
867 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
868 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
869 if(sw==3)//DataArrayInt
871 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
872 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
873 std::string name=argpt->getName();
875 ret->setName(name.c_str());
878 PyObject *res = PyList_New(2);
879 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
880 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
881 PyList_SetItem(res,0,obj0);
882 PyList_SetItem(res,1,obj1);
886 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
890 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
891 PyObject *res = PyTuple_New(2);
892 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
895 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
897 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
898 PyTuple_SetItem(res,0,obj0);
899 PyTuple_SetItem(res,1,obj1);
903 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
905 std::vector<int> vals=self->getDistributionOfTypes();
907 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
908 PyObject *ret=PyList_New((int)vals.size()/3);
909 for(int j=0;j<(int)vals.size()/3;j++)
911 PyObject *ret1=PyList_New(3);
912 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
913 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
914 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
915 PyList_SetItem(ret,j,ret1);
920 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
922 std::vector<int> code;
923 std::vector<const DataArrayInt *> idsPerType;
924 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
925 convertPyToNewIntArr4(li,1,3,code);
926 return self->checkTypeConsistencyAndContig(code,idsPerType);
929 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
931 std::vector<int> code;
932 std::vector<DataArrayInt *> idsInPflPerType;
933 std::vector<DataArrayInt *> idsPerType;
934 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
935 PyObject *ret=PyTuple_New(3);
938 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
939 PyObject *ret0=PyList_New((int)code.size()/3);
940 for(int j=0;j<(int)code.size()/3;j++)
942 PyObject *ret00=PyList_New(3);
943 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
944 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
945 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
946 PyList_SetItem(ret0,j,ret00);
948 PyTuple_SetItem(ret,0,ret0);
950 PyObject *ret1=PyList_New(idsInPflPerType.size());
951 for(std::size_t j=0;j<idsInPflPerType.size();j++)
952 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
953 PyTuple_SetItem(ret,1,ret1);
954 int n=idsPerType.size();
955 PyObject *ret2=PyList_New(n);
957 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
958 PyTuple_SetItem(ret,2,ret2);
962 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
966 DataArrayDoubleTuple *aa;
967 std::vector<double> bb;
969 int spaceDim=self->getSpaceDimension();
970 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
971 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
972 self->translate(vectorPtr);
975 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
977 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
980 DataArrayDoubleTuple *aa;
981 std::vector<double> bb;
983 int spaceDim=self->getSpaceDimension();
984 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
985 self->rotate(centerPtr,0,alpha);
988 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
990 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
992 DataArrayDouble *a,*a2;
993 DataArrayDoubleTuple *aa,*aa2;
994 std::vector<double> bb,bb2;
996 int spaceDim=self->getSpaceDimension();
997 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
998 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
999 self->rotate(centerPtr,vectorPtr,alpha);
1002 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1004 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1005 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1006 PyObject *res=PyList_New(result.size());
1007 for(int i=0;iL!=result.end(); i++, iL++)
1008 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1012 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1014 std::vector<double> a0;
1015 std::vector<int> a1;
1016 std::vector<std::string> a2;
1017 self->getTinySerializationInformation(a0,a1,a2);
1018 PyObject *ret(PyTuple_New(3));
1019 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1020 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1022 PyObject *ret2(PyList_New(sz));
1024 for(int i=0;i<sz;i++)
1025 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1027 PyTuple_SetItem(ret,2,ret2);
1031 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1033 DataArrayInt *a0Tmp(0);
1034 DataArrayDouble *a1Tmp(0);
1035 self->serialize(a0Tmp,a1Tmp);
1036 PyObject *ret(PyTuple_New(2));
1037 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1038 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1042 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1044 std::vector<std::string> littleStrings;
1045 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1048 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1049 {// put an empty dict in input to say to __new__ to call __init__...
1050 PyObject *ret(PyTuple_New(1));
1051 PyObject *ret0(PyDict_New());
1052 PyTuple_SetItem(ret,0,ret0);
1056 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1058 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1059 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1060 PyObject *ret(PyTuple_New(2));
1061 PyTuple_SetItem(ret,0,ret0);
1062 PyTuple_SetItem(ret,1,ret1);
1066 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1068 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1069 if(!PyTuple_Check(inp))
1070 throw INTERP_KERNEL::Exception(MSG);
1071 int sz(PyTuple_Size(inp));
1073 throw INTERP_KERNEL::Exception(MSG);
1074 PyObject *elt0(PyTuple_GetItem(inp,0));
1075 PyObject *elt1(PyTuple_GetItem(inp,1));
1076 std::vector<double> a0;
1077 std::vector<int> a1;
1078 std::vector<std::string> a2;
1079 DataArrayInt *b0(0);
1080 DataArrayDouble *b1(0);
1082 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1083 throw INTERP_KERNEL::Exception(MSG);
1084 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1086 fillArrayWithPyListDbl3(a0py,tmp,a0);
1087 convertPyToNewIntArr3(a1py,a1);
1088 fillStringVector(a2py,a2);
1091 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1092 throw INTERP_KERNEL::Exception(MSG);
1093 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1095 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1096 if(!SWIG_IsOK(status))
1097 throw INTERP_KERNEL::Exception(MSG);
1098 b0=reinterpret_cast<DataArrayInt *>(argp);
1099 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1100 if(!SWIG_IsOK(status))
1101 throw INTERP_KERNEL::Exception(MSG);
1102 b1=reinterpret_cast<DataArrayDouble *>(argp);
1104 // useless here to call resizeForUnserialization because arrays are well resized.
1105 self->unserialization(a0,a1,b0,b1,a2);
1108 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1110 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1111 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1112 return MEDCouplingMesh::MergeMeshes(tmp);
1118 //== MEDCouplingMesh End
1120 %include "NormalizedGeometricTypes"
1121 %include "MEDCouplingNatureOfFieldEnum"
1123 namespace MEDCoupling
1125 class MEDCouplingNatureOfField
1128 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1129 static std::string GetReprNoThrow(NatureOfField nat);
1130 static std::string GetAllPossibilitiesStr();
1134 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1135 // include "MEDCouplingTimeDiscretization.i"
1137 namespace MEDCoupling
1139 class MEDCouplingGaussLocalization
1142 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1143 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1144 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1145 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1146 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1147 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1148 int getDimension() const throw(INTERP_KERNEL::Exception);
1149 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1150 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1151 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1152 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1154 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1155 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1156 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1157 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1158 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1159 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1160 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1161 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1162 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1163 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1164 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1165 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1167 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1171 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1173 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1177 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1179 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1185 class MEDCouplingSkyLineArray
1188 MEDCouplingSkyLineArray();
1189 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1190 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1191 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1193 void set( DataArrayInt* index, DataArrayInt* value );
1194 int getNumberOf() const;
1195 int getLength() const;
1196 DataArrayInt* getIndexArray() const;
1197 DataArrayInt* getValueArray() const;
1200 std::string __str__() const throw(INTERP_KERNEL::Exception)
1202 return self->simpleRepr();
1208 %include "MEDCouplingFieldDiscretization.i"
1210 //== MEDCouplingPointSet
1212 namespace MEDCoupling
1214 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1217 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1218 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1219 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1220 void zipCoords() throw(INTERP_KERNEL::Exception);
1221 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1222 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1223 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1224 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1225 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1226 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1227 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1228 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1229 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1230 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1231 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1232 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1233 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1234 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1235 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1236 virtual DataArrayInt *findBoundaryNodes() const;
1237 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1238 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1239 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1240 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1241 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1242 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1243 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1244 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1245 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1248 std::string __str__() const throw(INTERP_KERNEL::Exception)
1250 return self->simpleRepr();
1253 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1256 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1257 PyObject *res = PyList_New(2);
1258 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1259 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1263 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1265 DataArrayInt *comm, *commIndex;
1266 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1267 PyObject *res = PyList_New(2);
1268 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1269 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1273 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1275 DataArrayDouble *ret1=self->getCoords();
1278 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1281 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1283 int szArr,sw,iTypppArr;
1284 std::vector<int> stdvecTyyppArr;
1285 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1286 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1287 if(sw==3)//DataArrayInt
1289 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1290 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1291 std::string name=argpt->getName();
1293 ret->setName(name.c_str());
1295 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1298 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1300 int szArr,sw,iTypppArr;
1301 std::vector<int> stdvecTyyppArr;
1302 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1303 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1304 if(sw==3)//DataArrayInt
1306 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1307 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1308 std::string name=argpt->getName();
1310 ret->setName(name.c_str());
1312 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1315 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1317 int szArr,sw,iTypppArr;
1318 std::vector<int> stdvecTyyppArr;
1319 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1320 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1321 if(sw==3)//DataArrayInt
1323 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1324 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1325 std::string name=argpt->getName();
1327 ret->setName(name.c_str());
1329 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1332 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1334 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1335 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1338 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1340 int szArr,sw,iTypppArr;
1341 std::vector<int> stdvecTyyppArr;
1342 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1343 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1344 if(sw==3)//DataArrayInt
1346 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1347 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1348 std::string name=argpt->getName();
1350 ret->setName(name.c_str());
1352 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1355 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1357 int szArr,sw,iTypppArr;
1358 std::vector<int> stdvecTyyppArr;
1359 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1360 self->renumberNodes(tmp,newNbOfNodes);
1363 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1365 int szArr,sw,iTypppArr;
1366 std::vector<int> stdvecTyyppArr;
1367 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1368 self->renumberNodesCenter(tmp,newNbOfNodes);
1371 PyObject *findNodesOnLine(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::findNodesOnLine : 1st paramater for point.";
1380 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 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->findNodesOnLine(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 );
1390 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1392 int spaceDim=self->getSpaceDimension();
1394 DataArrayDouble *a,*a2;
1395 DataArrayDoubleTuple *aa,*aa2;
1396 std::vector<double> bb,bb2;
1398 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1399 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1400 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1401 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1402 std::vector<int> nodes;
1403 self->findNodesOnPlane(p,v,eps,nodes);
1404 DataArrayInt *ret=DataArrayInt::New();
1405 ret->alloc((int)nodes.size(),1);
1406 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1407 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1410 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1414 DataArrayDoubleTuple *aa;
1415 std::vector<double> bb;
1417 int spaceDim=self->getSpaceDimension();
1418 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1419 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1420 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1421 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1424 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1426 DataArrayInt *c=0,*cI=0;
1430 DataArrayDoubleTuple *aa;
1431 std::vector<double> bb;
1433 int spaceDim=self->getSpaceDimension();
1434 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1435 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1436 self->getNodeIdsNearPoints(pos,nbOfPoints,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 *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1445 DataArrayInt *c=0,*cI=0;
1446 int spaceDim=self->getSpaceDimension();
1449 DataArrayDoubleTuple *aa;
1450 std::vector<double> bb;
1453 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1454 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1456 PyObject *ret=PyTuple_New(2);
1457 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1458 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1462 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1466 DataArrayDoubleTuple *aa;
1467 std::vector<double> bb;
1469 int spaceDim=self->getSpaceDimension();
1470 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1471 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1473 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1474 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1477 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1481 std::vector<int> multiVal;
1482 std::pair<int, std::pair<int,int> > slic;
1483 MEDCoupling::DataArrayInt *daIntTyypp=0;
1484 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1488 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1490 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1492 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1494 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1498 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1500 DataArrayInt *v0=0,*v1=0;
1501 self->findCommonCells(compType,startCellId,v0,v1);
1502 PyObject *res = PyList_New(2);
1503 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1504 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1509 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1512 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1513 if (!SWIG_IsOK(res1))
1516 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1517 self->renumberNodesInConn(tmp);
1521 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1523 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1524 da2->checkAllocated();
1525 self->renumberNodesInConn(da2->getConstPointer());
1529 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1532 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1533 PyObject *ret=PyTuple_New(2);
1534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1535 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1539 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1541 DataArrayInt *ret=0;
1543 int szArr,sw,iTypppArr;
1544 std::vector<int> stdvecTyyppArr;
1545 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1546 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1550 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1554 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1555 PyObject *res = PyList_New(3);
1556 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1557 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1558 PyList_SetItem(res,2,SWIG_From_int(ret2));
1562 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1566 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1567 PyObject *res = PyList_New(3);
1568 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1569 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1570 PyList_SetItem(res,2,SWIG_From_int(ret2));
1574 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1577 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1578 if (!SWIG_IsOK(res1))
1581 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1582 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1586 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1588 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1589 da2->checkAllocated();
1590 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1594 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1598 std::vector<int> multiVal;
1599 std::pair<int, std::pair<int,int> > slic;
1600 MEDCoupling::DataArrayInt *daIntTyypp=0;
1601 int nbc=self->getNumberOfCells();
1602 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1609 std::ostringstream oss;
1610 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1611 throw INTERP_KERNEL::Exception(oss.str().c_str());
1614 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1619 int tmp=nbc+singleVal;
1620 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1624 std::ostringstream oss;
1625 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1626 throw INTERP_KERNEL::Exception(oss.str().c_str());
1632 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1636 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1641 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1642 daIntTyypp->checkAllocated();
1643 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1646 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1650 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1653 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1654 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1655 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1656 for(int i=0;i<sz;i++)
1657 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1660 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1663 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1665 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1666 std::vector<double> val3;
1667 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1668 "Rotate2DAlg",2,true,nbNodes);
1670 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1671 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1674 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1677 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1678 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1679 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1680 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1681 for(int i=0;i<sz;i++)
1682 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1685 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1688 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1690 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1691 std::vector<double> val3;
1692 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1693 "Rotate3DAlg",3,true,nbNodes);
1695 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1696 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1697 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1702 //== MEDCouplingPointSet End
1704 class MEDCouplingUMeshCell
1707 INTERP_KERNEL::NormalizedCellType getType() const;
1710 std::string __str__() const throw(INTERP_KERNEL::Exception)
1712 return self->repr();
1715 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1718 const int *r=self->getAllConn(ret2);
1719 PyObject *ret=PyTuple_New(ret2);
1720 for(int i=0;i<ret2;i++)
1721 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1727 class MEDCouplingUMeshCellIterator
1734 MEDCouplingUMeshCell *ret=self->nextt();
1736 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1739 PyErr_SetString(PyExc_StopIteration,"No more data.");
1746 class MEDCouplingUMeshCellByTypeIterator
1749 ~MEDCouplingUMeshCellByTypeIterator();
1754 MEDCouplingUMeshCellEntry *ret=self->nextt();
1756 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1759 PyErr_SetString(PyExc_StopIteration,"No more data.");
1766 class MEDCouplingUMeshCellByTypeEntry
1769 ~MEDCouplingUMeshCellByTypeEntry();
1772 MEDCouplingUMeshCellByTypeIterator *__iter__()
1774 return self->iterator();
1779 class MEDCouplingUMeshCellEntry
1782 INTERP_KERNEL::NormalizedCellType getType() const;
1783 int getNumberOfElems() const;
1786 MEDCouplingUMeshCellIterator *__iter__()
1788 return self->iterator();
1793 //== MEDCouplingUMesh
1795 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1798 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1799 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1800 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1801 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1802 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1803 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1804 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1805 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1806 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1807 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1808 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1809 void computeTypes() throw(INTERP_KERNEL::Exception);
1810 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1811 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1813 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1814 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1815 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1816 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1817 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1818 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1819 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1820 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1821 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1824 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1825 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1826 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1827 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1828 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1829 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1830 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1831 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1832 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1833 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1834 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1835 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1836 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1837 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1838 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1839 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1840 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1842 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1843 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1844 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1845 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1846 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1847 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1848 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1849 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1850 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1851 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1852 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1853 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1854 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1855 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1856 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1857 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1858 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);
1859 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1860 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1861 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1862 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1863 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1865 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1867 return MEDCouplingUMesh::New();
1870 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1872 return MEDCouplingUMesh::New(meshName,meshDim);
1876 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1878 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1881 std::string __str__() const throw(INTERP_KERNEL::Exception)
1883 return self->simpleRepr();
1886 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1888 std::ostringstream oss;
1889 self->reprQuickOverview(oss);
1893 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1895 return self->cellIterator();
1898 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1900 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1901 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1902 PyObject *res=PyList_New(result.size());
1903 for(int i=0;iL!=result.end(); i++, iL++)
1904 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1908 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1912 std::vector<int> multiVal;
1913 std::pair<int, std::pair<int,int> > slic;
1914 MEDCoupling::DataArrayInt *daIntTyypp=0;
1915 int nbc=self->getNumberOfCells();
1916 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1923 std::ostringstream oss;
1924 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1925 throw INTERP_KERNEL::Exception(oss.str().c_str());
1929 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1936 int tmp=nbc+singleVal;
1937 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1942 std::ostringstream oss;
1943 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1944 throw INTERP_KERNEL::Exception(oss.str().c_str());
1950 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1956 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1957 daIntTyypp->checkAllocated();
1958 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1962 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1966 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1970 std::vector<int> multiVal;
1971 std::pair<int, std::pair<int,int> > slic;
1972 MEDCoupling::DataArrayInt *daIntTyypp=0;
1973 int nbc=self->getNumberOfCells();
1974 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1981 std::ostringstream oss;
1982 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1983 throw INTERP_KERNEL::Exception(oss.str().c_str());
1987 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1994 int tmp=nbc+singleVal;
1995 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2000 std::ostringstream oss;
2001 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2002 throw INTERP_KERNEL::Exception(oss.str().c_str());
2008 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2013 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2019 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2020 daIntTyypp->checkAllocated();
2021 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2025 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2029 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2031 int szArr,sw,iTypppArr;
2032 std::vector<int> stdvecTyyppArr;
2033 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2036 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2037 throw INTERP_KERNEL::Exception(oss.str().c_str());
2039 self->insertNextCell(type,size,tmp);
2042 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2044 int szArr,sw,iTypppArr;
2045 std::vector<int> stdvecTyyppArr;
2046 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2047 self->insertNextCell(type,szArr,tmp);
2050 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2052 DataArrayInt *ret=self->getNodalConnectivity();
2057 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2059 DataArrayInt *ret=self->getNodalConnectivityIndex();
2065 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2067 int szArr,sw,iTypppArr;
2068 std::vector<int> stdvecTyyppArr;
2069 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2070 int nbOfDepthPeelingPerformed=0;
2071 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2072 PyObject *res=PyTuple_New(2);
2073 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2074 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2078 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2080 DataArrayInt *v0=0,*v1=0;
2081 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2082 PyObject *res = PyList_New(2);
2083 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2084 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2088 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2092 DataArrayDoubleTuple *aa;
2093 std::vector<double> bb;
2095 int nbOfCompo=self->getSpaceDimension();
2096 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2099 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2100 PyObject *ret=PyTuple_New(2);
2101 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2102 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2106 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2108 DataArrayInt *ret1=0;
2109 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2110 PyObject *ret=PyTuple_New(2);
2111 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2112 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2116 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2119 DataArrayInt *ret1(0);
2120 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2121 PyObject *ret=PyTuple_New(3);
2122 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2123 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2124 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2128 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2130 std::vector<int> cells;
2131 self->checkButterflyCells(cells,eps);
2132 DataArrayInt *ret=DataArrayInt::New();
2133 ret->alloc((int)cells.size(),1);
2134 std::copy(cells.begin(),cells.end(),ret->getPointer());
2135 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2138 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2140 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2142 PyObject *ret = PyList_New(sz);
2143 for(int i=0;i<sz;i++)
2144 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2148 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2150 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2151 int sz=retCpp.size();
2152 PyObject *ret=PyList_New(sz);
2153 for(int i=0;i<sz;i++)
2154 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2158 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2161 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2162 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2163 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2166 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2169 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2170 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2174 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2177 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2178 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2182 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2184 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2185 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2186 PyObject *ret=PyTuple_New(3);
2187 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2189 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2195 DataArrayInt *tmp0=0,*tmp1=0;
2196 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2197 PyObject *ret=PyTuple_New(2);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2207 std::vector<int> multiVal;
2208 std::pair<int, std::pair<int,int> > slic;
2209 MEDCoupling::DataArrayInt *daIntTyypp=0;
2210 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2214 return self->duplicateNodes(&singleVal,&singleVal+1);
2216 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2218 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2220 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2224 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2228 std::vector<int> multiVal;
2229 std::pair<int, std::pair<int,int> > slic;
2230 MEDCoupling::DataArrayInt *daIntTyypp=0;
2231 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2235 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2237 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2239 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2241 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2245 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2248 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2249 DataArrayInt *tmp0,*tmp1=0;
2250 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2251 PyObject *ret=PyTuple_New(2);
2252 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2253 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2257 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2259 DataArrayInt *ret0=0,*ret1=0;
2260 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2261 PyObject *ret=PyTuple_New(2);
2262 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2263 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2267 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2269 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2270 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2271 DataArrayInt *ret1=0,*ret2=0;
2272 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2273 PyObject *ret=PyTuple_New(3);
2274 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2275 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2276 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2282 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2283 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2284 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2285 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2288 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2291 std::vector<const MEDCouplingUMesh *> meshes;
2292 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2293 std::vector<DataArrayInt *> corr;
2294 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2296 PyObject *ret1=PyList_New(sz);
2297 for(int i=0;i<sz;i++)
2298 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2299 PyObject *ret=PyList_New(2);
2300 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2301 PyList_SetItem(ret,1,ret1);
2305 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2307 std::vector<MEDCouplingUMesh *> meshes;
2308 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2309 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2312 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2314 std::vector<MEDCouplingUMesh *> meshes;
2315 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2316 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2319 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2323 std::vector<int> multiVal;
2324 std::pair<int, std::pair<int,int> > slic;
2325 MEDCoupling::DataArrayInt *daIntTyypp=0;
2327 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2328 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2332 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2334 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2336 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2338 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2342 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2344 DataArrayInt *arrOut=0,*arrIndexOut=0;
2347 std::vector<int> multiVal;
2348 std::pair<int, std::pair<int,int> > slic;
2349 MEDCoupling::DataArrayInt *daIntTyypp=0;
2351 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2352 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2357 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2362 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2367 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2371 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2373 PyObject *ret=PyTuple_New(2);
2374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2379 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2381 DataArrayInt *arrOut=0,*arrIndexOut=0;
2382 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2383 PyObject *ret=PyTuple_New(2);
2384 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2385 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2389 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2391 if(!PySlice_Check(slic))
2392 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2393 Py_ssize_t strt=2,stp=2,step=2;
2394 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2396 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2397 arrIndxIn->checkAllocated();
2398 if(arrIndxIn->getNumberOfComponents()!=1)
2399 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2400 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2401 DataArrayInt *arrOut=0,*arrIndexOut=0;
2402 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2403 PyObject *ret=PyTuple_New(2);
2404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2409 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2410 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2411 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2413 DataArrayInt *arrOut=0,*arrIndexOut=0;
2416 std::vector<int> multiVal;
2417 std::pair<int, std::pair<int,int> > slic;
2418 MEDCoupling::DataArrayInt *daIntTyypp=0;
2420 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2421 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2426 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2431 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2436 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2440 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2442 PyObject *ret=PyTuple_New(2);
2443 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2444 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2448 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2449 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2453 std::vector<int> multiVal;
2454 std::pair<int, std::pair<int,int> > slic;
2455 MEDCoupling::DataArrayInt *daIntTyypp=0;
2457 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2458 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2463 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2468 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2473 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2477 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2481 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const 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::are2DCellsNotCorrectlyOriented : ";
2490 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2492 std::vector<int> cells;
2493 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2494 DataArrayInt *ret=DataArrayInt::New();
2495 ret->alloc((int)cells.size(),1);
2496 std::copy(cells.begin(),cells.end(),ret->getPointer());
2497 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2500 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2504 DataArrayDoubleTuple *aa;
2505 std::vector<double> bb;
2507 int spaceDim=self->getSpaceDimension();
2508 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2509 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2510 self->orientCorrectly2DCells(v,polyOnly);
2513 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2515 std::vector<int> cells;
2516 self->arePolyhedronsNotCorrectlyOriented(cells);
2517 DataArrayInt *ret=DataArrayInt::New();
2518 ret->alloc((int)cells.size(),1);
2519 std::copy(cells.begin(),cells.end(),ret->getPointer());
2520 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2523 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2527 self->getFastAveragePlaneOfThis(vec,pos);
2529 std::copy(vec,vec+3,vals);
2530 std::copy(pos,pos+3,vals+3);
2531 return convertDblArrToPyListOfTuple(vals,3,2);
2534 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2536 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2537 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2538 return MEDCouplingUMesh::MergeUMeshes(tmp);
2541 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2544 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2545 PyObject *ret=PyTuple_New(2);
2546 PyObject *ret0Py=ret0?Py_True:Py_False;
2548 PyTuple_SetItem(ret,0,ret0Py);
2549 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2553 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2556 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2557 PyObject *ret=PyTuple_New(2);
2558 PyObject *ret0Py=ret0?Py_True:Py_False;
2560 PyTuple_SetItem(ret,0,ret0Py);
2561 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2565 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2567 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2568 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2569 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2570 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2571 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2572 PyObject *ret=PyTuple_New(5);
2573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2575 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2576 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2583 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2584 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2585 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2586 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2587 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2588 PyObject *ret=PyTuple_New(5);
2589 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2590 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2591 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2597 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2599 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2600 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2601 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2602 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2603 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2604 PyObject *ret=PyTuple_New(5);
2605 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2606 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2607 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2608 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2613 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2615 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2616 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2617 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2618 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2619 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2620 PyObject *ret=PyTuple_New(5);
2621 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2622 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2623 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2629 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2631 DataArrayInt *neighbors=0,*neighborsIdx=0;
2632 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2633 PyObject *ret=PyTuple_New(2);
2634 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2635 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2639 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2641 DataArrayInt *neighbors=0,*neighborsIdx=0;
2642 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2643 PyObject *ret=PyTuple_New(2);
2644 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2649 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2651 DataArrayInt *neighbors=0,*neighborsIdx=0;
2652 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2653 PyObject *ret=PyTuple_New(2);
2654 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2659 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2661 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2662 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2663 DataArrayInt *d2,*d3,*d4,*dd5;
2664 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2665 PyObject *ret=PyTuple_New(7);
2666 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2667 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2668 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2669 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2670 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2671 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2672 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2679 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2680 da->checkAllocated();
2681 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2684 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2687 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2688 da->checkAllocated();
2689 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2692 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2695 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2696 da->checkAllocated();
2697 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2700 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2703 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2704 da->checkAllocated();
2705 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2706 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2707 PyObject *res = PyList_New(result.size());
2708 for (int i=0;iL!=result.end(); i++, iL++)
2709 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2713 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2716 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2717 da->checkAllocated();
2718 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2719 ret->setName(da->getName().c_str());
2723 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2725 DataArrayInt *cellNb1=0,*cellNb2=0;
2726 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2727 PyObject *ret=PyTuple_New(3);
2728 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2729 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2734 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2736 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2737 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2738 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2739 PyObject *ret(PyTuple_New(4));
2740 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2741 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2742 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2743 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2747 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2749 int spaceDim=self->getSpaceDimension();
2751 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2753 DataArrayDouble *a,*a2;
2754 DataArrayDoubleTuple *aa,*aa2;
2755 std::vector<double> bb,bb2;
2757 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2758 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2759 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2760 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2762 DataArrayInt *cellIds=0;
2763 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2764 PyObject *ret=PyTuple_New(2);
2765 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2766 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2770 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2772 int spaceDim=self->getSpaceDimension();
2774 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2776 DataArrayDouble *a,*a2;
2777 DataArrayDoubleTuple *aa,*aa2;
2778 std::vector<double> bb,bb2;
2780 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2781 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2782 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2783 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2785 DataArrayInt *cellIds=0;
2786 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2787 PyObject *ret=PyTuple_New(2);
2788 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2789 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2793 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2796 DataArrayDouble *a,*a2;
2797 DataArrayDoubleTuple *aa,*aa2;
2798 std::vector<double> bb,bb2;
2800 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2801 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2802 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2803 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2804 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2808 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2810 int spaceDim=self->getSpaceDimension();
2812 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2814 DataArrayDouble *a,*a2;
2815 DataArrayDoubleTuple *aa,*aa2;
2816 std::vector<double> bb,bb2;
2818 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2819 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2820 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2821 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2822 return self->getCellIdsCrossingPlane(orig,vect,eps);
2825 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2829 std::vector<int> pos2;
2830 DataArrayInt *pos3=0;
2831 DataArrayIntTuple *pos4=0;
2832 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2837 self->convertToPolyTypes(&pos1,&pos1+1);
2844 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2849 self->convertToPolyTypes(pos3->begin(),pos3->end());
2853 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2857 void convertAllToPoly();
2858 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2859 bool unPolyze() throw(INTERP_KERNEL::Exception);
2860 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2861 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2862 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2865 //== MEDCouplingUMesh End
2867 //== MEDCouplingMappedExtrudedMesh
2869 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2872 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2873 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2874 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2875 int get2DCellIdForExtrusion() const;
2877 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2879 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2882 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2884 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2887 MEDCouplingMappedExtrudedMesh()
2889 return MEDCouplingMappedExtrudedMesh::New();
2892 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2894 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2897 std::string __str__() const throw(INTERP_KERNEL::Exception)
2899 return self->simpleRepr();
2902 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2904 std::ostringstream oss;
2905 self->reprQuickOverview(oss);
2909 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2911 MEDCouplingUMesh *ret=self->getMesh2D();
2914 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2916 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2918 MEDCouplingUMesh *ret=self->getMesh1D();
2921 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2923 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2925 DataArrayInt *ret=self->getMesh3DIds();
2928 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2933 //== MEDCouplingMappedExtrudedMesh End
2935 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2938 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2939 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2940 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2941 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2942 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2943 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2946 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2948 int szArr,sw,iTypppArr;
2949 std::vector<int> stdvecTyyppArr;
2950 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2951 self->insertNextCell(tmp,tmp+szArr);
2954 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2956 DataArrayInt *ret=self->getNodalConnectivity();
2957 if(ret) ret->incrRef();
2961 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2963 std::vector< const MEDCoupling1GTUMesh *> parts;
2964 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2965 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2970 //== MEDCoupling1SGTUMesh
2972 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2975 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2976 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2977 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2978 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2979 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2980 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2981 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2982 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2983 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2986 MEDCoupling1SGTUMesh()
2988 return MEDCoupling1SGTUMesh::New();
2991 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2993 return MEDCoupling1SGTUMesh::New(name,type);
2996 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2998 return MEDCoupling1SGTUMesh::New(m);
3001 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3003 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3006 std::string __str__() const throw(INTERP_KERNEL::Exception)
3008 return self->simpleRepr();
3011 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3013 std::ostringstream oss;
3014 self->reprQuickOverview(oss);
3018 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3020 DataArrayInt *cellPerm(0),*nodePerm(0);
3021 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3022 PyObject *ret(PyTuple_New(3));
3023 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3024 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3025 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3029 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3031 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3032 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3033 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3036 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3038 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3039 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3040 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3045 //== MEDCoupling1SGTUMesh End
3047 //== MEDCoupling1DGTUMesh
3049 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3052 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3053 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3054 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3055 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3056 bool isPacked() const throw(INTERP_KERNEL::Exception);
3059 MEDCoupling1DGTUMesh()
3061 return MEDCoupling1DGTUMesh::New();
3063 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3065 return MEDCoupling1DGTUMesh::New(name,type);
3068 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3070 return MEDCoupling1DGTUMesh::New(m);
3073 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3075 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3078 std::string __str__() const throw(INTERP_KERNEL::Exception)
3080 return self->simpleRepr();
3083 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3085 std::ostringstream oss;
3086 self->reprQuickOverview(oss);
3090 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3092 DataArrayInt *ret=self->getNodalConnectivityIndex();
3093 if(ret) ret->incrRef();
3097 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3099 DataArrayInt *ret1=0,*ret2=0;
3100 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3101 PyObject *ret0Py=ret0?Py_True:Py_False;
3103 PyObject *ret=PyTuple_New(3);
3104 PyTuple_SetItem(ret,0,ret0Py);
3105 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3106 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3110 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3113 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3114 PyObject *ret=PyTuple_New(2);
3115 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3116 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3117 PyTuple_SetItem(ret,1,ret1Py);
3121 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3123 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3124 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3125 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3128 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3130 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3131 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3132 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3135 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3137 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3138 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3139 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3144 //== MEDCoupling1DGTUMeshEnd
3146 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3149 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3150 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3151 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3152 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3153 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3154 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3155 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3156 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3157 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3158 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3159 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3160 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3161 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3162 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3163 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3166 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3168 int tmpp1=-1,tmpp2=-1;
3169 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3170 std::vector< std::pair<int,int> > inp;
3174 for(int i=0;i<tmpp1;i++)
3175 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3180 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3181 inp.resize(tmpp1/2);
3182 for(int i=0;i<tmpp1/2;i++)
3183 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3186 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3187 return self->buildStructuredSubPart(inp);
3190 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3192 std::vector< std::pair<int,int> > inp;
3193 convertPyToVectorPairInt(part,inp);
3195 int szArr,sw,iTypppArr;
3196 std::vector<int> stdvecTyyppArr;
3197 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3198 std::vector<int> tmp5(tmp4,tmp4+szArr);
3200 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3203 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3205 std::vector< std::pair<int,int> > inp;
3206 convertPyToVectorPairInt(part,inp);
3207 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3210 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3212 std::vector< std::pair<int,int> > inp;
3213 convertPyToVectorPairInt(part,inp);
3214 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3217 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3219 std::vector< std::pair<int,int> > inp;
3220 convertPyToVectorPairInt(part,inp);
3221 std::vector<int> stWithGhost;
3222 std::vector< std::pair<int,int> > partWithGhost;
3223 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3224 PyObject *ret(PyTuple_New(2));
3225 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3226 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3230 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3232 std::vector< std::pair<int,int> > inp;
3233 convertPyToVectorPairInt(partCompactFormat,inp);
3234 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3237 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3239 std::vector< std::pair<int,int> > inp;
3240 convertPyToVectorPairInt(partCompactFormat,inp);
3241 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3244 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3246 std::vector< std::pair<int,int> > inp;
3247 convertPyToVectorPairInt(part,inp);
3248 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3251 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3253 int szArr,sw,iTypppArr;
3254 std::vector<int> stdvecTyyppArr;
3255 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3256 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3259 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3261 int szArr,sw,iTypppArr;
3262 std::vector<int> stdvecTyyppArr;
3263 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3264 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3267 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3269 std::vector< std::pair<int,int> > inp;
3270 convertPyToVectorPairInt(partCompactFormat,inp);
3271 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3274 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3276 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3277 PyObject *retPy=PyList_New(ret.size());
3278 for(std::size_t i=0;i<ret.size();i++)
3280 PyObject *tmp=PyTuple_New(2);
3281 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3282 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3283 PyList_SetItem(retPy,i,tmp);
3288 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3290 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3291 convertPyToVectorPairInt(r1,r1Cpp);
3292 convertPyToVectorPairInt(r2,r2Cpp);
3293 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3294 PyObject *retPy=PyList_New(ret.size());
3295 for(std::size_t i=0;i<ret.size();i++)
3297 PyObject *tmp=PyTuple_New(2);
3298 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3299 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3300 PyList_SetItem(retPy,i,tmp);
3305 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3307 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3308 convertPyToVectorPairInt(r1,r1Cpp);
3309 convertPyToVectorPairInt(r2,r2Cpp);
3310 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3313 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3315 int szArr,sw,iTypppArr;
3316 std::vector<int> stdvecTyyppArr;
3317 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3318 int szArr2,sw2,iTypppArr2;
3319 std::vector<int> stdvecTyyppArr2;
3320 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3321 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3322 std::vector< std::pair<int,int> > partCompactFormat;
3323 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3324 PyObject *ret=PyTuple_New(2);
3325 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3326 PyTuple_SetItem(ret,0,ret0Py);
3327 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3328 for(std::size_t i=0;i<partCompactFormat.size();i++)
3330 PyObject *tmp4=PyTuple_New(2);
3331 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3332 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3333 PyList_SetItem(ret1Py,i,tmp4);
3335 PyTuple_SetItem(ret,1,ret1Py);
3339 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3341 std::vector< std::pair<int,int> > param0,param1,ret;
3342 convertPyToVectorPairInt(bigInAbs,param0);
3343 convertPyToVectorPairInt(partOfBigInAbs,param1);
3344 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3345 PyObject *retPy(PyList_New(ret.size()));
3346 for(std::size_t i=0;i<ret.size();i++)
3348 PyObject *tmp(PyTuple_New(2));
3349 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3350 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3351 PyList_SetItem(retPy,i,tmp);
3356 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3358 std::vector< std::pair<int,int> > param0;
3359 convertPyToVectorPairInt(part,param0);
3360 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3361 PyObject *retPy(PyList_New(ret.size()));
3362 for(std::size_t i=0;i<ret.size();i++)
3364 PyObject *tmp(PyTuple_New(2));
3365 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3366 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3367 PyList_SetItem(retPy,i,tmp);
3372 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3374 std::vector< std::pair<int,int> > param0,param1;
3375 convertPyToVectorPairInt(startingFrom,param0);
3376 convertPyToVectorPairInt(goingTo,param1);
3377 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3380 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3382 std::vector< std::pair<int,int> > param0,param1,ret;
3383 convertPyToVectorPairInt(bigInAbs,param0);
3384 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3385 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3386 PyObject *retPy(PyList_New(ret.size()));
3387 for(std::size_t i=0;i<ret.size();i++)
3389 PyObject *tmp(PyTuple_New(2));
3390 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3391 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3392 PyList_SetItem(retPy,i,tmp);
3399 class MEDCouplingCurveLinearMesh;
3401 //== MEDCouplingCMesh
3403 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3406 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3407 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3408 void setCoords(const DataArrayDouble *coordsX,
3409 const DataArrayDouble *coordsY=0,
3410 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3411 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3412 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3414 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3416 return MEDCouplingCMesh::New();
3418 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3420 return MEDCouplingCMesh::New(meshName);
3423 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3425 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3427 std::string __str__() const throw(INTERP_KERNEL::Exception)
3429 return self->simpleRepr();
3431 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3433 std::ostringstream oss;
3434 self->reprQuickOverview(oss);
3437 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3439 DataArrayDouble *ret=self->getCoordsAt(i);
3447 //== MEDCouplingCMesh End
3449 //== MEDCouplingCurveLinearMesh
3451 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3454 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3455 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3456 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3458 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3460 return MEDCouplingCurveLinearMesh::New();
3462 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3464 return MEDCouplingCurveLinearMesh::New(meshName);
3466 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3468 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3470 std::string __str__() const throw(INTERP_KERNEL::Exception)
3472 return self->simpleRepr();
3474 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3476 std::ostringstream oss;
3477 self->reprQuickOverview(oss);
3480 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3482 DataArrayDouble *ret=self->getCoords();
3487 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3489 int szArr,sw,iTypppArr;
3490 std::vector<int> stdvecTyyppArr;
3491 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3492 self->setNodeGridStructure(tmp,tmp+szArr);
3497 //== MEDCouplingCurveLinearMesh End
3499 //== MEDCouplingIMesh
3501 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3504 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3506 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3507 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3508 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3509 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3510 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3511 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3512 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3513 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3514 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3515 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3516 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3521 return MEDCouplingIMesh::New();
3523 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3525 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3526 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3527 const int *nodeStrctPtr(0);
3528 const double *originPtr(0),*dxyzPtr(0);
3530 std::vector<int> bb0;
3531 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3534 std::vector<double> bb,bb2;
3536 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3537 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3539 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3542 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3544 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3547 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3549 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3552 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3555 std::vector<int> bb0;
3556 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3557 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3560 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3562 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3565 DataArrayDoubleTuple *aa;
3566 std::vector<double> bb;
3568 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3569 self->setOrigin(originPtr,originPtr+nbTuples);
3572 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3574 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3577 DataArrayDoubleTuple *aa;
3578 std::vector<double> bb;
3580 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3581 self->setDXYZ(originPtr,originPtr+nbTuples);
3584 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3586 std::vector< std::pair<int,int> > inp;
3587 convertPyToVectorPairInt(fineLocInCoarse,inp);
3588 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3591 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)
3593 std::vector< std::pair<int,int> > inp;
3594 convertPyToVectorPairInt(fineLocInCoarse,inp);
3595 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3598 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3600 std::vector< std::pair<int,int> > inp;
3601 convertPyToVectorPairInt(fineLocInCoarse,inp);
3602 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3605 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)
3607 std::vector< std::pair<int,int> > inp;
3608 convertPyToVectorPairInt(fineLocInCoarse,inp);
3609 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3612 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)
3614 std::vector< std::pair<int,int> > inp;
3615 convertPyToVectorPairInt(fineLocInCoarse,inp);
3616 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3619 std::string __str__() const throw(INTERP_KERNEL::Exception)
3621 return self->simpleRepr();
3623 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3625 std::ostringstream oss;
3626 self->reprQuickOverview(oss);
3632 //== MEDCouplingIMesh End
3636 namespace MEDCoupling
3638 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3641 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3642 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3643 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3644 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3645 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3646 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3647 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3648 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3649 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3650 std::string getName() const throw(INTERP_KERNEL::Exception);
3651 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3652 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3653 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3654 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3655 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3656 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3657 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3658 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3659 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3660 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3661 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3662 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3663 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3664 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3665 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3666 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3668 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3670 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3673 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3676 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3678 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3681 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3684 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3686 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3687 return convertIntArrToPyList3(ret);
3690 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3693 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3694 PyObject *ret=PyTuple_New(2);
3695 PyObject *ret0Py=ret0?Py_True:Py_False;
3697 PyTuple_SetItem(ret,0,ret0Py);
3698 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3702 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3704 DataArrayInt *ret1=0;
3705 MEDCouplingMesh *ret0=0;
3707 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3708 if (!SWIG_IsOK(res1))
3711 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3712 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3716 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3718 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3719 da2->checkAllocated();
3720 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3722 PyObject *res = PyList_New(2);
3723 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3724 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3728 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3730 DataArrayInt *ret1=0;
3732 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3733 PyObject *res=PyTuple_New(2);
3734 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3736 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3739 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3740 PyTuple_SetItem(res,1,res1);
3745 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3748 int v0; std::vector<int> v1;
3749 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3750 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3753 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3754 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3757 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3758 if (!SWIG_IsOK(res1))
3761 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3762 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3766 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3768 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3769 da2->checkAllocated();
3770 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3774 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3776 std::vector<int> tmp;
3777 self->getCellIdsHavingGaussLocalization(locId,tmp);
3778 DataArrayInt *ret=DataArrayInt::New();
3779 ret->alloc((int)tmp.size(),1);
3780 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3781 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3784 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3786 std::vector<int> inp0;
3787 convertPyToNewIntArr4(code,1,3,inp0);
3788 std::vector<const DataArrayInt *> inp1;
3789 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3790 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3795 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3798 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3799 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3800 static MEDCouplingFieldTemplate *New(TypeOfField type);
3801 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3802 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3805 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3807 return MEDCouplingFieldTemplate::New(f);
3810 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3812 return MEDCouplingFieldTemplate::New(f);
3815 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3817 return MEDCouplingFieldTemplate::New(type);
3820 std::string __str__() const throw(INTERP_KERNEL::Exception)
3822 return self->simpleRepr();
3825 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3827 std::ostringstream oss;
3828 self->reprQuickOverview(oss);
3834 class MEDCouplingFieldInt;
3836 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3839 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3840 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3841 void setTimeUnit(const std::string& unit);
3842 std::string getTimeUnit() const;
3843 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3844 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3845 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3846 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3847 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3848 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3849 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3850 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3851 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3852 MEDCouplingFieldDouble *deepCopy() const;
3853 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3854 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3855 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3856 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3857 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3858 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3859 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3860 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3861 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3862 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3863 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3864 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3865 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3866 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3867 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3868 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3869 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3870 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3871 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3872 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3873 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3874 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3875 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3876 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3877 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3878 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3879 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3880 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3881 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3882 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3883 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3884 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3885 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3886 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3887 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3888 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3890 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3891 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3892 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3893 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3894 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3895 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3896 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3897 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3898 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3899 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3900 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3901 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3902 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3903 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3904 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3905 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3906 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3907 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3908 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3909 double getMinValue() const throw(INTERP_KERNEL::Exception);
3910 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3911 double norm2() const throw(INTERP_KERNEL::Exception);
3912 double normMax() const throw(INTERP_KERNEL::Exception);
3913 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3914 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3915 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3916 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3917 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3918 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3919 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3920 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3921 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3922 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3923 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3924 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3925 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3926 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3927 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3928 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3929 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3930 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3931 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3932 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3933 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3934 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3936 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3938 return MEDCouplingFieldDouble::New(type,td);
3941 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3943 return MEDCouplingFieldDouble::New(ft,td);
3946 std::string __str__() const throw(INTERP_KERNEL::Exception)
3948 return self->simpleRepr();
3951 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3953 std::ostringstream oss;
3954 self->reprQuickOverview(oss);
3958 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3960 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3964 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
3966 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
3968 DataArrayDouble *a,*a2;
3969 DataArrayDoubleTuple *aa,*aa2;
3970 std::vector<double> bb,bb2;
3972 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
3973 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
3974 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
3977 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3979 DataArrayDouble *ret=self->getArray();
3985 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3987 std::vector<DataArrayDouble *> arrs=self->getArrays();
3988 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3992 PyObject *ret=PyTuple_New(sz);
3993 for(int i=0;i<sz;i++)
3996 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3998 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4003 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4005 std::vector<const DataArrayDouble *> tmp;
4006 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4008 std::vector<DataArrayDouble *> arrs(sz);
4009 for(int i=0;i<sz;i++)
4010 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4011 self->setArrays(arrs);
4014 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4016 DataArrayDouble *ret=self->getEndArray();
4022 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4026 DataArrayDoubleTuple *aa;
4027 std::vector<double> bb;
4029 const MEDCouplingMesh *mesh=self->getMesh();
4031 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4032 int spaceDim=mesh->getSpaceDimension();
4033 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4034 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4036 int sz=self->getNumberOfComponents();
4037 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4038 self->getValueOn(spaceLoc,res);
4039 return convertDblArrToPyList(res,sz);
4042 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4044 int sz=self->getNumberOfComponents();
4045 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4046 self->getValueOnPos(i,j,k,res);
4047 return convertDblArrToPyList(res,sz);
4050 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4052 const MEDCouplingMesh *mesh(self->getMesh());
4054 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4057 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4058 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4059 mesh->getSpaceDimension(),true,nbPts);
4060 return self->getValueOnMulti(inp,nbPts);
4063 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4067 DataArrayDoubleTuple *aa;
4068 std::vector<double> bb;
4070 const MEDCouplingMesh *mesh=self->getMesh();
4072 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4073 int spaceDim=mesh->getSpaceDimension();
4074 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4075 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4078 int sz=self->getNumberOfComponents();
4079 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4080 self->getValueOn(spaceLoc,time,res);
4081 return convertDblArrToPyList(res,sz);
4084 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4086 if(self->getArray()!=0)
4087 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4090 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4091 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4092 self->setArray(arr);
4096 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4099 double tmp0=self->getTime(tmp1,tmp2);
4100 PyObject *res = PyList_New(3);
4101 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4102 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4103 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4107 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4110 double tmp0=self->getStartTime(tmp1,tmp2);
4111 PyObject *res = PyList_New(3);
4112 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4113 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4114 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4118 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4121 double tmp0=self->getEndTime(tmp1,tmp2);
4122 PyObject *res = PyList_New(3);
4123 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4124 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4125 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4128 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4130 int sz=self->getNumberOfComponents();
4131 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4132 self->accumulate(tmp);
4133 return convertDblArrToPyList(tmp,sz);
4135 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4137 int sz=self->getNumberOfComponents();
4138 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4139 self->integral(isWAbs,tmp);
4140 return convertDblArrToPyList(tmp,sz);
4142 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4144 int sz=self->getNumberOfComponents();
4145 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4146 self->getWeightedAverageValue(tmp,isWAbs);
4147 return convertDblArrToPyList(tmp,sz);
4149 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4151 int sz=self->getNumberOfComponents();
4152 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4154 return convertDblArrToPyList(tmp,sz);
4156 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4158 int sz=self->getNumberOfComponents();
4159 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4161 return convertDblArrToPyList(tmp,sz);
4163 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4165 int szArr,sw,iTypppArr;
4166 std::vector<int> stdvecTyyppArr;
4167 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4168 self->renumberCells(tmp,check);
4171 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4173 int szArr,sw,iTypppArr;
4174 std::vector<int> stdvecTyyppArr;
4175 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4176 self->renumberCellsWithoutMesh(tmp,check);
4179 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4181 int szArr,sw,iTypppArr;
4182 std::vector<int> stdvecTyyppArr;
4183 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4184 self->renumberNodes(tmp,eps);
4187 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4189 int szArr,sw,iTypppArr;
4190 std::vector<int> stdvecTyyppArr;
4191 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4192 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4195 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4199 std::vector<int> multiVal;
4200 std::pair<int, std::pair<int,int> > slic;
4201 MEDCoupling::DataArrayInt *daIntTyypp=0;
4202 const MEDCouplingMesh *mesh=self->getMesh();
4204 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4205 int nbc=mesh->getNumberOfCells();
4206 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4213 std::ostringstream oss;
4214 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4215 throw INTERP_KERNEL::Exception(oss.str().c_str());
4218 return self->buildSubPart(&singleVal,&singleVal+1);
4223 int tmp=nbc+singleVal;
4224 return self->buildSubPart(&tmp,&tmp+1);
4228 std::ostringstream oss;
4229 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4230 throw INTERP_KERNEL::Exception(oss.str().c_str());
4236 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4240 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4245 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4246 daIntTyypp->checkAllocated();
4247 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4250 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4254 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4256 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";
4257 if(PyTuple_Check(li))
4259 Py_ssize_t sz=PyTuple_Size(li);
4261 throw INTERP_KERNEL::Exception(msg);
4262 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4265 std::vector<int> multiVal;
4266 std::pair<int, std::pair<int,int> > slic;
4267 MEDCoupling::DataArrayInt *daIntTyypp=0;
4268 if(!self->getArray())
4269 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4271 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4272 catch(INTERP_KERNEL::Exception& e)
4273 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4274 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4275 DataArrayDouble *ret0Arr=ret0->getArray();
4277 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4282 std::vector<int> v2(1,singleVal);
4283 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4284 ret0->setArray(aarr);
4289 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4290 ret0->setArray(aarr);
4295 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4296 std::vector<int> v2(nbOfComp);
4297 for(int i=0;i<nbOfComp;i++)
4298 v2[i]=slic.first+i*slic.second.second;
4299 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4300 ret0->setArray(aarr);
4304 throw INTERP_KERNEL::Exception(msg);
4309 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4312 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4315 double r1=self->getMaxValue2(tmp);
4316 PyObject *ret=PyTuple_New(2);
4317 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4318 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4322 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4325 double r1=self->getMinValue2(tmp);
4326 PyObject *ret=PyTuple_New(2);
4327 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4328 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4332 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4334 std::vector<int> tmp;
4335 convertPyToNewIntArr3(li,tmp);
4336 return self->keepSelectedComponents(tmp);
4339 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4341 std::vector<int> tmp;
4342 convertPyToNewIntArr3(li,tmp);
4343 self->setSelectedComponents(f,tmp);
4346 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4349 DataArrayDouble *a,*a2;
4350 DataArrayDoubleTuple *aa,*aa2;
4351 std::vector<double> bb,bb2;
4354 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4355 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4356 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4357 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4359 return self->extractSlice3D(orig,vect,eps);
4362 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4364 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4367 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4369 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4372 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4374 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.";
4375 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4378 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4380 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4382 return (*self)-(*other);
4384 throw INTERP_KERNEL::Exception(msg);
4389 DataArrayDoubleTuple *aa;
4390 std::vector<double> bb;
4392 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4397 if(!self->getArray())
4398 throw INTERP_KERNEL::Exception(msg2);
4399 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4400 ret->applyLin(1.,-val);
4401 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4402 ret2->setArray(ret);
4407 if(!self->getArray())
4408 throw INTERP_KERNEL::Exception(msg2);
4409 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4410 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4411 ret2->setArray(ret);
4416 if(!self->getArray())
4417 throw INTERP_KERNEL::Exception(msg2);
4418 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4419 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4420 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4421 ret2->setArray(ret);
4426 if(!self->getArray())
4427 throw INTERP_KERNEL::Exception(msg2);
4428 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4429 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4430 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4431 ret2->setArray(ret);
4435 { throw INTERP_KERNEL::Exception(msg); }
4439 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4441 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4444 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4446 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4449 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4451 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4454 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4456 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.";
4457 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4460 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4462 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4464 return (*self)/(*other);
4466 throw INTERP_KERNEL::Exception(msg);
4471 DataArrayDoubleTuple *aa;
4472 std::vector<double> bb;
4474 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4480 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4481 if(!self->getArray())
4482 throw INTERP_KERNEL::Exception(msg2);
4483 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4484 ret->applyLin(1./val,0);
4485 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4486 ret2->setArray(ret);
4491 if(!self->getArray())
4492 throw INTERP_KERNEL::Exception(msg2);
4493 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4494 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4495 ret2->setArray(ret);
4500 if(!self->getArray())
4501 throw INTERP_KERNEL::Exception(msg2);
4502 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4503 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4504 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4505 ret2->setArray(ret);
4510 if(!self->getArray())
4511 throw INTERP_KERNEL::Exception(msg2);
4512 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4513 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4514 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4515 ret2->setArray(ret);
4519 { throw INTERP_KERNEL::Exception(msg); }
4523 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4525 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4528 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4530 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.";
4531 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4534 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4536 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4538 return (*self)^(*other);
4540 throw INTERP_KERNEL::Exception(msg);
4545 DataArrayDoubleTuple *aa;
4546 std::vector<double> bb;
4548 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4553 if(!self->getArray())
4554 throw INTERP_KERNEL::Exception(msg2);
4555 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4557 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4558 ret2->setArray(ret);
4563 if(!self->getArray())
4564 throw INTERP_KERNEL::Exception(msg2);
4565 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4566 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4567 ret2->setArray(ret);
4572 if(!self->getArray())
4573 throw INTERP_KERNEL::Exception(msg2);
4574 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4575 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4576 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4577 ret2->setArray(ret);
4582 if(!self->getArray())
4583 throw INTERP_KERNEL::Exception(msg2);
4584 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4585 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4586 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4587 ret2->setArray(ret);
4591 { throw INTERP_KERNEL::Exception(msg); }
4595 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4597 return self->negate();
4600 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4602 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.";
4603 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4606 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4608 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4612 Py_XINCREF(trueSelf);
4616 throw INTERP_KERNEL::Exception(msg);
4621 DataArrayDoubleTuple *aa;
4622 std::vector<double> bb;
4624 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4629 if(!self->getArray())
4630 throw INTERP_KERNEL::Exception(msg2);
4631 self->getArray()->applyLin(1.,val);
4632 Py_XINCREF(trueSelf);
4637 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4640 Py_XINCREF(trueSelf);
4645 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4646 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4647 ret2->setArray(aaa);
4649 Py_XINCREF(trueSelf);
4654 if(!self->getArray())
4655 throw INTERP_KERNEL::Exception(msg2);
4656 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4657 self->getArray()->addEqual(aaa);
4658 Py_XINCREF(trueSelf);
4662 { throw INTERP_KERNEL::Exception(msg); }
4666 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4668 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.";
4669 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4672 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4674 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4678 Py_XINCREF(trueSelf);
4682 throw INTERP_KERNEL::Exception(msg);
4687 DataArrayDoubleTuple *aa;
4688 std::vector<double> bb;
4690 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4695 if(!self->getArray())
4696 throw INTERP_KERNEL::Exception(msg2);
4697 self->getArray()->applyLin(1.,-val);
4698 Py_XINCREF(trueSelf);
4703 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4706 Py_XINCREF(trueSelf);
4711 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4712 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4713 ret2->setArray(aaa);
4715 Py_XINCREF(trueSelf);
4720 if(!self->getArray())
4721 throw INTERP_KERNEL::Exception(msg2);
4722 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4723 self->getArray()->substractEqual(aaa);
4724 Py_XINCREF(trueSelf);
4728 { throw INTERP_KERNEL::Exception(msg); }
4732 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4734 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.";
4735 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4738 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4740 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4744 Py_XINCREF(trueSelf);
4748 throw INTERP_KERNEL::Exception(msg);
4753 DataArrayDoubleTuple *aa;
4754 std::vector<double> bb;
4756 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4761 if(!self->getArray())
4762 throw INTERP_KERNEL::Exception(msg2);
4763 self->getArray()->applyLin(val,0);
4764 Py_XINCREF(trueSelf);
4769 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4772 Py_XINCREF(trueSelf);
4777 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4778 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4779 ret2->setArray(aaa);
4781 Py_XINCREF(trueSelf);
4786 if(!self->getArray())
4787 throw INTERP_KERNEL::Exception(msg2);
4788 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4789 self->getArray()->multiplyEqual(aaa);
4790 Py_XINCREF(trueSelf);
4794 { throw INTERP_KERNEL::Exception(msg); }
4798 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4800 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.";
4801 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4804 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4806 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4810 Py_XINCREF(trueSelf);
4814 throw INTERP_KERNEL::Exception(msg);
4819 DataArrayDoubleTuple *aa;
4820 std::vector<double> bb;
4822 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4828 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4829 if(!self->getArray())
4830 throw INTERP_KERNEL::Exception(msg2);
4831 self->getArray()->applyLin(1./val,0);
4832 Py_XINCREF(trueSelf);
4837 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4840 Py_XINCREF(trueSelf);
4845 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4846 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4847 ret2->setArray(aaa);
4849 Py_XINCREF(trueSelf);
4854 if(!self->getArray())
4855 throw INTERP_KERNEL::Exception(msg2);
4856 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4857 self->getArray()->divideEqual(aaa);
4858 Py_XINCREF(trueSelf);
4862 { throw INTERP_KERNEL::Exception(msg); }
4866 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4868 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.";
4869 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4872 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4874 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4878 Py_XINCREF(trueSelf);
4882 throw INTERP_KERNEL::Exception(msg);
4887 DataArrayDoubleTuple *aa;
4888 std::vector<double> bb;
4890 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4895 if(!self->getArray())
4896 throw INTERP_KERNEL::Exception(msg2);
4897 self->getArray()->applyPow(val);
4898 Py_XINCREF(trueSelf);
4903 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4906 Py_XINCREF(trueSelf);
4911 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4912 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4913 ret2->setArray(aaa);
4915 Py_XINCREF(trueSelf);
4920 if(!self->getArray())
4921 throw INTERP_KERNEL::Exception(msg2);
4922 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4923 self->getArray()->powEqual(aaa);
4924 Py_XINCREF(trueSelf);
4928 { throw INTERP_KERNEL::Exception(msg); }
4932 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4934 std::vector<const MEDCouplingFieldDouble *> tmp;
4935 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4936 return MEDCouplingFieldDouble::MergeFields(tmp);
4939 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4941 std::vector<const MEDCouplingFieldDouble *> tmp;
4942 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4943 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4946 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4948 std::vector<double> a0;
4949 std::vector<int> a1;
4950 std::vector<std::string> a2;
4951 self->getTinySerializationDbleInformation(a0);
4952 self->getTinySerializationIntInformation(a1);
4953 self->getTinySerializationStrInformation(a2);
4955 PyObject *ret(PyTuple_New(3));
4956 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4957 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4959 PyObject *ret2(PyList_New(sz));
4961 for(int i=0;i<sz;i++)
4962 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4964 PyTuple_SetItem(ret,2,ret2);
4968 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4970 DataArrayInt *ret0(0);
4971 std::vector<DataArrayDouble *> ret1;
4972 self->serialize(ret0,ret1);
4975 std::size_t sz(ret1.size());
4976 PyObject *ret(PyTuple_New(2));
4977 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4978 PyObject *ret1Py(PyList_New(sz));
4979 for(std::size_t i=0;i<sz;i++)
4983 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4985 PyTuple_SetItem(ret,1,ret1Py);
4989 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4991 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4992 if(!PyTuple_Check(args))
4993 throw INTERP_KERNEL::Exception(MSG);
4994 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4995 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4996 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4998 PyObject *tmp0(PyTuple_New(1));
4999 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5000 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5002 Py_DECREF(selfMeth);
5003 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5004 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5005 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5007 PyObject *a(PyInt_FromLong(0));
5008 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5011 throw INTERP_KERNEL::Exception(MSG);
5012 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5013 throw INTERP_KERNEL::Exception(MSG);
5014 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5017 Py_DECREF(initMeth);
5022 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5023 {// put an empty dict in input to say to __new__ to call __init__...
5024 self->checkConsistencyLight();
5025 PyObject *ret(PyTuple_New(1));
5026 PyObject *ret0(PyDict_New());
5028 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5029 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5030 PyDict_SetItem(ret0,a,d);
5031 Py_DECREF(a); Py_DECREF(d);
5033 PyTuple_SetItem(ret,0,ret0);
5037 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5039 self->checkConsistencyLight();
5040 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5041 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5042 const MEDCouplingMesh *mesh(self->getMesh());
5045 PyObject *ret(PyTuple_New(3));
5046 PyTuple_SetItem(ret,0,ret0);
5047 PyTuple_SetItem(ret,1,ret1);
5048 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5052 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5054 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5055 if(!PyTuple_Check(inp))
5056 throw INTERP_KERNEL::Exception(MSG);
5057 int sz(PyTuple_Size(inp));
5059 throw INTERP_KERNEL::Exception(MSG);
5061 PyObject *elt2(PyTuple_GetItem(inp,2));
5063 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5064 if(!SWIG_IsOK(status))
5065 throw INTERP_KERNEL::Exception(MSG);
5066 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5068 PyObject *elt0(PyTuple_GetItem(inp,0));
5069 PyObject *elt1(PyTuple_GetItem(inp,1));
5070 std::vector<double> a0;
5071 std::vector<int> a1;
5072 std::vector<std::string> a2;
5073 DataArrayInt *b0(0);
5074 std::vector<DataArrayDouble *>b1;
5076 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5077 throw INTERP_KERNEL::Exception(MSG);
5078 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5080 fillArrayWithPyListDbl3(a0py,tmp,a0);
5081 convertPyToNewIntArr3(a1py,a1);
5082 fillStringVector(a2py,a2);
5085 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5086 throw INTERP_KERNEL::Exception(MSG);
5087 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5089 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5090 if(!SWIG_IsOK(status))
5091 throw INTERP_KERNEL::Exception(MSG);
5092 b0=reinterpret_cast<DataArrayInt *>(argp);
5093 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5095 self->checkForUnserialization(a1,b0,b1);
5096 // useless here to call resizeForUnserialization because arrays are well resized.
5097 self->finishUnserialization(a1,a0,a2);
5102 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5105 int getNumberOfFields() const;
5106 MEDCouplingMultiFields *deepCopy() const;
5107 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5108 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5109 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5110 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5111 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5114 std::string __str__() const throw(INTERP_KERNEL::Exception)
5116 return self->simpleRepr();
5118 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5120 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5121 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5123 std::vector<MEDCouplingFieldDouble *> fs(sz);
5124 for(int i=0;i<sz;i++)
5125 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5126 return MEDCouplingMultiFields::New(fs);
5128 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5130 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5131 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5133 std::vector<MEDCouplingFieldDouble *> fs(sz);
5134 for(int i=0;i<sz;i++)
5135 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5136 return MEDCouplingMultiFields::New(fs);
5138 PyObject *getFields() const
5140 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5141 int sz=fields.size();
5142 PyObject *res = PyList_New(sz);
5143 for(int i=0;i<sz;i++)
5147 fields[i]->incrRef();
5148 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5152 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5157 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5159 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5163 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5166 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5168 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5170 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5172 PyObject *res = PyList_New(sz);
5173 for(int i=0;i<sz;i++)
5178 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5182 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5187 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5189 std::vector<int> refs;
5190 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5192 PyObject *res = PyList_New(sz);
5193 for(int i=0;i<sz;i++)
5198 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5202 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5206 PyObject *ret=PyTuple_New(2);
5207 PyTuple_SetItem(ret,0,res);
5208 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5211 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5213 std::vector<DataArrayDouble *> ms=self->getArrays();
5215 PyObject *res = PyList_New(sz);
5216 for(int i=0;i<sz;i++)
5221 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5225 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5230 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5232 std::vector< std::vector<int> > refs;
5233 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5235 PyObject *res = PyList_New(sz);
5236 PyObject *res2 = PyList_New(sz);
5237 for(int i=0;i<sz;i++)
5242 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5246 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5248 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5251 PyObject *ret=PyTuple_New(2);
5252 PyTuple_SetItem(ret,0,res);
5253 PyTuple_SetItem(ret,1,res2);
5259 class MEDCouplingFieldInt : public MEDCouplingField
5262 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5263 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5264 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5265 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5266 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5267 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5268 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5269 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5270 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5271 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5273 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5275 return MEDCouplingFieldInt::New(type,td);
5278 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5280 return MEDCouplingFieldInt::New(ft,td);
5283 std::string __str__() const throw(INTERP_KERNEL::Exception)
5285 return self->simpleRepr();
5288 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5290 std::ostringstream oss;
5291 self->reprQuickOverview(oss);
5295 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5297 DataArrayInt *ret=self->getArray();
5303 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5306 double tmp0=self->getTime(tmp1,tmp2);
5307 PyObject *res = PyList_New(3);
5308 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5309 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5310 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5316 class MEDCouplingDefinitionTime
5319 MEDCouplingDefinitionTime();
5320 void assign(const MEDCouplingDefinitionTime& other);
5321 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5322 double getTimeResolution() const;
5323 std::vector<double> getHotSpotsTime() const;
5326 std::string __str__() const throw(INTERP_KERNEL::Exception)
5328 std::ostringstream oss;
5329 self->appendRepr(oss);
5333 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5335 int meshId,arrId,arrIdInField,fieldId;
5336 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5337 PyObject *res=PyList_New(4);
5338 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5339 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5340 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5341 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5345 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5347 int meshId,arrId,arrIdInField,fieldId;
5348 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5349 PyObject *res=PyList_New(4);
5350 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5351 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5352 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5353 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5359 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5362 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5363 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5367 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5369 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5370 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5372 std::vector<MEDCouplingFieldDouble *> fs(sz);
5373 for(int i=0;i<sz;i++)
5374 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5375 return MEDCouplingFieldOverTime::New(fs);
5377 std::string __str__() const throw(INTERP_KERNEL::Exception)
5379 return self->simpleRepr();
5381 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5383 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5384 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5386 std::vector<MEDCouplingFieldDouble *> fs(sz);
5387 for(int i=0;i<sz;i++)
5388 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5389 return MEDCouplingFieldOverTime::New(fs);
5394 class MEDCouplingCartesianAMRMesh;
5396 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5399 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5400 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5401 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5404 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5406 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5414 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5417 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5418 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5419 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5422 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5424 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5425 return convertFromVectorPairInt(ret);
5428 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5430 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5431 return convertFromVectorPairInt(ret);
5434 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5436 std::vector< std::pair<int,int> > inp;
5437 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5438 self->addPatch(inp,factors);
5441 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5443 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5445 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5446 if(patchId==mesh->getNumberOfPatches())
5448 std::ostringstream oss;
5449 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5450 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5453 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5459 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5461 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5463 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5464 mesh->removePatch(patchId);
5467 int __len__() const throw(INTERP_KERNEL::Exception)
5469 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5471 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5472 return mesh->getNumberOfPatches();
5477 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5481 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5484 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5485 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5486 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5487 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5488 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5489 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5490 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5491 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5492 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5493 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5494 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5495 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5496 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5498 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5499 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5500 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5501 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5502 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5503 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5504 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5505 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5506 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5507 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5508 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5509 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5510 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5511 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5512 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5513 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5514 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5515 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5516 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5517 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5520 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5522 std::vector< std::pair<int,int> > inp;
5523 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5524 self->addPatch(inp,factors);
5527 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5529 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5531 PyObject *ret = PyList_New(sz);
5532 for(int i=0;i<sz;i++)
5534 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5537 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5542 // agy : don't know why typemap fails here ??? let it in the extend section
5543 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5545 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5548 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5550 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5551 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5557 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5559 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5560 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5566 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5568 std::vector<int> out1;
5569 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5570 PyObject *ret(PyTuple_New(2));
5571 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5572 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5576 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5578 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5580 PyObject *ret = PyList_New(sz);
5581 for(int i=0;i<sz;i++)
5582 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5586 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5588 std::vector<const DataArrayDouble *> inp;
5589 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5590 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5593 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5595 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5601 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5603 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5609 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5611 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5617 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5619 const MEDCouplingIMesh *ret(self->getImageMesh());
5622 return const_cast<MEDCouplingIMesh *>(ret);
5625 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5627 if(patchId==self->getNumberOfPatches())
5629 std::ostringstream oss;
5630 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5631 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5634 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5640 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5642 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5643 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5644 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5647 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5649 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5650 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5651 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5654 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5656 self->removePatch(patchId);
5659 int __len__() const throw(INTERP_KERNEL::Exception)
5661 return self->getNumberOfPatches();
5666 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5670 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5673 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5676 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5678 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5679 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5680 const int *nodeStrctPtr(0);
5681 const double *originPtr(0),*dxyzPtr(0);
5683 std::vector<int> bb0;
5684 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5687 std::vector<double> bb,bb2;
5689 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5690 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5692 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5695 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5697 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5698 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5699 std::vector< std::vector<int> > inp2;
5700 convertPyToVectorOfVectorOfInt(factors,inp2);
5701 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5704 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5706 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5709 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5711 return MEDCouplingCartesianAMRMesh::New(mesh);
5716 class MEDCouplingDataForGodFather : public RefCountObject
5719 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5720 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5721 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5722 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5723 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5724 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5725 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5726 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5727 virtual void alloc() throw(INTERP_KERNEL::Exception);
5728 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5731 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5733 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5741 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5744 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5745 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5746 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5747 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5748 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5749 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5750 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5751 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5752 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5755 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5757 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5758 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5759 MEDCouplingAMRAttribute *ret(0);
5762 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5763 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5765 catch(INTERP_KERNEL::Exception&)
5767 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5768 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5773 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5775 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5778 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5780 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5781 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5787 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5789 std::vector< std::vector<std::string> > compNamesCpp;
5790 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5791 self->spillInfoOnComponents(compNamesCpp);
5794 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5796 std::vector<int> inp0;
5797 if(!fillIntVector(nfs,inp0))
5798 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5799 std::size_t sz(inp0.size());
5800 std::vector<NatureOfField> inp00(sz);
5801 for(std::size_t i=0;i<sz;i++)
5802 inp00[i]=(NatureOfField)inp0[i];
5803 self->spillNatures(inp00);
5806 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5808 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5809 int sz((int)ret.size());
5810 PyObject *retPy(PyList_New(sz));
5811 for(int i=0;i<sz;i++)
5812 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5818 class DenseMatrix : public RefCountObject, public TimeLabel
5821 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5822 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5823 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5824 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5826 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5827 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5828 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5829 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5830 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5831 void transpose() throw(INTERP_KERNEL::Exception);
5833 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5834 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5835 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5838 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5840 return DenseMatrix::New(nbRows,nbCols);
5843 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5845 return DenseMatrix::New(array,nbRows,nbCols);
5848 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5851 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5852 PyObject *ret=PyTuple_New(2);
5853 PyObject *ret0Py=ret0?Py_True:Py_False;
5855 PyTuple_SetItem(ret,0,ret0Py);
5856 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5860 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5862 DataArrayDouble *ret(self->getData());
5868 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5870 return MEDCoupling::DenseMatrix::Add(self,other);
5873 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5875 return MEDCoupling::DenseMatrix::Substract(self,other);
5878 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5880 return MEDCoupling::DenseMatrix::Multiply(self,other);
5883 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5885 return MEDCoupling::DenseMatrix::Multiply(self,other);
5888 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5890 self->addEqual(other);
5891 Py_XINCREF(trueSelf);
5895 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5897 self->substractEqual(other);
5898 Py_XINCREF(trueSelf);
5902 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5904 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5911 class PartDefinition : public RefCountObject, public TimeLabel
5914 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5915 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5916 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5917 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5918 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5919 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5920 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5921 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5924 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5926 return (*self)+other;
5929 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5932 bool ret0(self->isEqual(other,ret1));
5933 PyObject *ret=PyTuple_New(2);
5934 PyObject *ret0Py=ret0?Py_True:Py_False;
5936 PyTuple_SetItem(ret,0,ret0Py);
5937 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5941 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5943 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5947 virtual ~PartDefinition();
5950 class DataArrayPartDefinition : public PartDefinition
5953 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5956 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5958 return DataArrayPartDefinition::New(listOfIds);
5961 std::string __str__() const throw(INTERP_KERNEL::Exception)
5963 return self->getRepr();
5966 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5968 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5969 oss << self->getRepr();
5974 virtual ~DataArrayPartDefinition();
5977 class SlicePartDefinition : public PartDefinition
5980 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5981 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5984 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5986 return SlicePartDefinition::New(start,stop,step);
5989 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5992 self->getSlice(a,b,c);
5993 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5996 std::string __str__() const throw(INTERP_KERNEL::Exception)
5998 return self->getRepr();
6001 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6003 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
6004 oss << self->getRepr();
6009 virtual ~SlicePartDefinition();
6015 __filename=os.environ.get('PYTHONSTARTUP')
6016 if __filename and os.path.isfile(__filename):
6017 execfile(__filename)