1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
301 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
305 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
314 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
317 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
318 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
323 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
324 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
325 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
326 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
327 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
328 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
331 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
332 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
333 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
337 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
338 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
341 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
348 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
353 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
355 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
363 %newobject MEDCoupling::MEDCouplingCMesh::New;
364 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
365 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
366 %newobject MEDCoupling::MEDCouplingIMesh::New;
367 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
368 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
369 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
370 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
372 %newobject MEDCoupling::MEDCouplingMultiFields::New;
373 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
374 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
392 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
393 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
401 %newobject MEDCoupling::DenseMatrix::New;
402 %newobject MEDCoupling::DenseMatrix::deepCopy;
403 %newobject MEDCoupling::DenseMatrix::shallowCpy;
404 %newobject MEDCoupling::DenseMatrix::getData;
405 %newobject MEDCoupling::DenseMatrix::matVecMult;
406 %newobject MEDCoupling::DenseMatrix::MatVecMult;
407 %newobject MEDCoupling::DenseMatrix::__add__;
408 %newobject MEDCoupling::DenseMatrix::__sub__;
409 %newobject MEDCoupling::DenseMatrix::__mul__;
410 %newobject MEDCoupling::PartDefinition::New;
411 %newobject MEDCoupling::PartDefinition::toDAI;
412 %newobject MEDCoupling::PartDefinition::__add__;
413 %newobject MEDCoupling::PartDefinition::composeWith;
414 %newobject MEDCoupling::PartDefinition::tryToSimplify;
415 %newobject MEDCoupling::DataArrayPartDefinition::New;
416 %newobject MEDCoupling::SlicePartDefinition::New;
417 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
418 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
420 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
421 %feature("unref") MEDCouplingMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
423 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
425 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
430 %feature("unref") MEDCouplingField "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
436 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
437 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
438 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
439 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
445 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
446 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
447 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
448 %feature("unref") DenseMatrix "$this->decrRef();"
449 %feature("unref") PartDefinition "$this->decrRef();"
450 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
451 %feature("unref") SlicePartDefinition "$this->decrRef();"
453 %rename(assign) *::operator=;
454 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
455 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
457 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
461 %rename (InterpKernelException) INTERP_KERNEL::Exception;
463 %include "MEDCouplingRefCountObject.i"
464 %include "MEDCouplingMemArray.i"
466 namespace INTERP_KERNEL
469 * \class BoxSplittingOptions
470 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
472 class BoxSplittingOptions
475 BoxSplittingOptions();
476 void init() throw(INTERP_KERNEL::Exception);
477 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
478 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
479 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
480 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
481 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
482 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
483 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
484 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
485 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
486 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
487 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
488 std::string printOptions() const throw(INTERP_KERNEL::Exception);
491 std::string __str__() const throw(INTERP_KERNEL::Exception)
493 return self->printOptions();
499 namespace MEDCoupling
515 CONST_ON_TIME_INTERVAL = 7
516 } TypeOfTimeDiscretization;
524 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
525 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
527 } MEDCouplingMeshType;
530 class DataArrayDouble;
531 class MEDCouplingUMesh;
532 class MEDCouplingCMesh;
533 class MEDCouplingFieldDouble;
535 %extend RefCountObject
537 std::string getHiddenCppPointer() const
539 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
544 %extend MEDCouplingGaussLocalization
546 std::string __str__() const throw(INTERP_KERNEL::Exception)
548 return self->getStringRepr();
551 std::string __repr__() const throw(INTERP_KERNEL::Exception)
553 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
554 oss << self->getStringRepr();
561 class MEDCouplingMesh : public RefCountObject, public TimeLabel
564 void setName(const std::string& name);
565 std::string getName() const;
566 void setDescription(const std::string& descr);
567 std::string getDescription() const;
568 void setTime(double val, int iteration, int order);
569 void setTimeUnit(const std::string& unit);
570 std::string getTimeUnit() const;
571 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
572 bool isStructured() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
574 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
575 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
576 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
577 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
578 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
579 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
580 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
581 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
582 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
583 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
584 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
585 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
592 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
593 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
594 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
595 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
596 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
597 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
598 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
599 virtual std::string getVTKFileExtension() const;
600 std::string getVTKFileNameOf(const std::string& fileName) const;
602 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
604 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
605 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
606 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
607 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
608 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
609 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
610 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
611 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
612 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);
613 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
614 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
615 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
617 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
618 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
619 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
622 std::string __str__() const throw(INTERP_KERNEL::Exception)
624 return self->simpleRepr();
627 PyObject *getTime() throw(INTERP_KERNEL::Exception)
630 double tmp0=self->getTime(tmp1,tmp2);
631 PyObject *res = PyList_New(3);
632 PyList_SetItem(res,0,SWIG_From_double(tmp0));
633 PyList_SetItem(res,1,SWIG_From_int(tmp1));
634 PyList_SetItem(res,2,SWIG_From_int(tmp2));
638 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
640 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
641 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
647 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
651 DataArrayDoubleTuple *aa;
652 std::vector<double> bb;
654 int spaceDim=self->getSpaceDimension();
655 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
656 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
657 return self->getCellContainingPoint(pos,eps);
660 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
664 DataArrayDoubleTuple *aa;
665 std::vector<double> bb;
667 int spaceDim=self->getSpaceDimension();
668 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
669 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
670 MCAuto<DataArrayInt> elts,eltsIndex;
671 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
672 PyObject *ret=PyTuple_New(2);
673 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
678 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
680 MCAuto<DataArrayInt> elts,eltsIndex;
681 int spaceDim=self->getSpaceDimension();
683 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
684 if (!SWIG_IsOK(res1))
687 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
688 int nbOfPoints=size/spaceDim;
691 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
693 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
697 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
699 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
700 da2->checkAllocated();
701 int size=da2->getNumberOfTuples();
702 int nbOfCompo=da2->getNumberOfComponents();
703 if(nbOfCompo!=spaceDim)
705 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
707 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
709 PyObject *ret=PyTuple_New(2);
710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
715 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
719 DataArrayDoubleTuple *aa;
720 std::vector<double> bb;
722 int spaceDim=self->getSpaceDimension();
723 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
724 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
725 std::vector<int> elts;
726 self->getCellsContainingPoint(pos,eps,elts);
727 DataArrayInt *ret=DataArrayInt::New();
728 ret->alloc((int)elts.size(),1);
729 std::copy(elts.begin(),elts.end(),ret->getPointer());
730 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
733 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
735 MCAuto<DataArrayInt> d0=DataArrayInt::New();
736 MCAuto<DataArrayInt> d1=DataArrayInt::New();
737 self->getReverseNodalConnectivity(d0,d1);
738 PyObject *ret=PyTuple_New(2);
739 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
740 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
744 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
747 int v0; std::vector<int> v1;
748 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
749 self->renumberCells(ids,check);
752 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
754 DataArrayInt *cellCor, *nodeCor;
755 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
756 PyObject *res = PyList_New(2);
757 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
758 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
762 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
764 DataArrayInt *cellCor=0,*nodeCor=0;
765 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
766 PyObject *res = PyList_New(2);
767 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
768 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
772 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
774 DataArrayInt *cellCor=0;
775 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
779 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
782 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
783 if (!SWIG_IsOK(res1))
786 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
787 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
791 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
793 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
794 da2->checkAllocated();
795 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
798 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
800 std::vector<int> conn;
801 self->getNodeIdsOfCell(cellId,conn);
802 return convertIntArrToPyList2(conn);
805 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
807 std::vector<double> coo;
808 self->getCoordinatesOfNode(nodeId,coo);
809 return convertDblArrToPyList2(coo);
812 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
816 DataArrayDoubleTuple *aa;
817 std::vector<double> bb;
819 int spaceDim=self->getSpaceDimension();
820 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
821 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
822 self->scale(pointPtr,factor);
825 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
827 int spaceDim=self->getSpaceDimension();
828 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
829 self->getBoundingBox(tmp);
830 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
834 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
837 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
838 PyObject *ret=PyTuple_New(2);
839 PyObject *ret0Py=ret0?Py_True:Py_False;
841 PyTuple_SetItem(ret,0,ret0Py);
842 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
846 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
848 int szArr,sw,iTypppArr;
849 std::vector<int> stdvecTyyppArr;
850 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
851 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
852 if(sw==3)//DataArrayInt
854 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
855 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
856 std::string name=argpt->getName();
858 ret->setName(name.c_str());
860 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
863 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
865 int szArr,sw,iTypppArr;
866 std::vector<int> stdvecTyyppArr;
868 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
869 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
870 if(sw==3)//DataArrayInt
872 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
873 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
874 std::string name=argpt->getName();
876 ret->setName(name.c_str());
879 PyObject *res = PyList_New(2);
880 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
881 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
882 PyList_SetItem(res,0,obj0);
883 PyList_SetItem(res,1,obj1);
887 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
891 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
892 PyObject *res = PyTuple_New(2);
893 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
896 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
898 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
899 PyTuple_SetItem(res,0,obj0);
900 PyTuple_SetItem(res,1,obj1);
904 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
906 std::vector<int> vals=self->getDistributionOfTypes();
908 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
909 PyObject *ret=PyList_New((int)vals.size()/3);
910 for(int j=0;j<(int)vals.size()/3;j++)
912 PyObject *ret1=PyList_New(3);
913 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
914 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
915 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
916 PyList_SetItem(ret,j,ret1);
921 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
923 std::vector<int> code;
924 std::vector<const DataArrayInt *> idsPerType;
925 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
926 convertPyToNewIntArr4(li,1,3,code);
927 return self->checkTypeConsistencyAndContig(code,idsPerType);
930 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
932 std::vector<int> code;
933 std::vector<DataArrayInt *> idsInPflPerType;
934 std::vector<DataArrayInt *> idsPerType;
935 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
936 PyObject *ret=PyTuple_New(3);
939 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
940 PyObject *ret0=PyList_New((int)code.size()/3);
941 for(int j=0;j<(int)code.size()/3;j++)
943 PyObject *ret00=PyList_New(3);
944 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
945 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
946 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
947 PyList_SetItem(ret0,j,ret00);
949 PyTuple_SetItem(ret,0,ret0);
951 PyObject *ret1=PyList_New(idsInPflPerType.size());
952 for(std::size_t j=0;j<idsInPflPerType.size();j++)
953 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
954 PyTuple_SetItem(ret,1,ret1);
955 int n=idsPerType.size();
956 PyObject *ret2=PyList_New(n);
958 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
959 PyTuple_SetItem(ret,2,ret2);
963 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
967 DataArrayDoubleTuple *aa;
968 std::vector<double> bb;
970 int spaceDim=self->getSpaceDimension();
971 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
972 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
973 self->translate(vectorPtr);
976 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
978 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
981 DataArrayDoubleTuple *aa;
982 std::vector<double> bb;
984 int spaceDim=self->getSpaceDimension();
985 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
986 self->rotate(centerPtr,0,alpha);
989 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
991 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
993 DataArrayDouble *a,*a2;
994 DataArrayDoubleTuple *aa,*aa2;
995 std::vector<double> bb,bb2;
997 int spaceDim=self->getSpaceDimension();
998 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
999 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
1000 self->rotate(centerPtr,vectorPtr,alpha);
1003 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1005 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1006 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1007 PyObject *res=PyList_New(result.size());
1008 for(int i=0;iL!=result.end(); i++, iL++)
1009 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1013 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1015 std::vector<double> a0;
1016 std::vector<int> a1;
1017 std::vector<std::string> a2;
1018 self->getTinySerializationInformation(a0,a1,a2);
1019 PyObject *ret(PyTuple_New(3));
1020 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1021 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1023 PyObject *ret2(PyList_New(sz));
1025 for(int i=0;i<sz;i++)
1026 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1028 PyTuple_SetItem(ret,2,ret2);
1032 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1034 DataArrayInt *a0Tmp(0);
1035 DataArrayDouble *a1Tmp(0);
1036 self->serialize(a0Tmp,a1Tmp);
1037 PyObject *ret(PyTuple_New(2));
1038 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1039 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1043 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1045 std::vector<std::string> littleStrings;
1046 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1049 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1050 {// put an empty dict in input to say to __new__ to call __init__...
1051 PyObject *ret(PyTuple_New(1));
1052 PyObject *ret0(PyDict_New());
1053 PyTuple_SetItem(ret,0,ret0);
1057 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1059 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1060 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1061 PyObject *ret(PyTuple_New(2));
1062 PyTuple_SetItem(ret,0,ret0);
1063 PyTuple_SetItem(ret,1,ret1);
1067 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1069 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1070 if(!PyTuple_Check(inp))
1071 throw INTERP_KERNEL::Exception(MSG);
1072 int sz(PyTuple_Size(inp));
1074 throw INTERP_KERNEL::Exception(MSG);
1075 PyObject *elt0(PyTuple_GetItem(inp,0));
1076 PyObject *elt1(PyTuple_GetItem(inp,1));
1077 std::vector<double> a0;
1078 std::vector<int> a1;
1079 std::vector<std::string> a2;
1080 DataArrayInt *b0(0);
1081 DataArrayDouble *b1(0);
1083 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1084 throw INTERP_KERNEL::Exception(MSG);
1085 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1087 fillArrayWithPyListDbl3(a0py,tmp,a0);
1088 convertPyToNewIntArr3(a1py,a1);
1089 fillStringVector(a2py,a2);
1092 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1093 throw INTERP_KERNEL::Exception(MSG);
1094 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1096 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1097 if(!SWIG_IsOK(status))
1098 throw INTERP_KERNEL::Exception(MSG);
1099 b0=reinterpret_cast<DataArrayInt *>(argp);
1100 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1101 if(!SWIG_IsOK(status))
1102 throw INTERP_KERNEL::Exception(MSG);
1103 b1=reinterpret_cast<DataArrayDouble *>(argp);
1105 // useless here to call resizeForUnserialization because arrays are well resized.
1106 self->unserialization(a0,a1,b0,b1,a2);
1109 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1111 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1112 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1113 return MEDCouplingMesh::MergeMeshes(tmp);
1119 //== MEDCouplingMesh End
1121 %include "NormalizedGeometricTypes"
1122 %include "MEDCouplingNatureOfFieldEnum"
1124 namespace MEDCoupling
1126 class MEDCouplingNatureOfField
1129 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1130 static std::string GetReprNoThrow(NatureOfField nat);
1131 static std::string GetAllPossibilitiesStr();
1135 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1136 // include "MEDCouplingTimeDiscretization.i"
1138 namespace MEDCoupling
1140 class MEDCouplingGaussLocalization
1143 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1144 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1145 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1146 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1147 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1148 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1149 int getDimension() const throw(INTERP_KERNEL::Exception);
1150 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1151 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1152 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1153 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1155 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1156 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1157 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1158 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1159 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1160 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1161 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1162 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1163 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1164 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1165 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1166 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1168 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1172 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1174 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1178 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1180 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1186 class MEDCouplingSkyLineArray
1189 MEDCouplingSkyLineArray();
1190 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1191 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1192 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1194 void set( DataArrayInt* index, DataArrayInt* value );
1195 int getNumberOf() const;
1196 int getLength() const;
1197 DataArrayInt* getIndexArray() const;
1198 DataArrayInt* getValueArray() const;
1201 std::string __str__() const throw(INTERP_KERNEL::Exception)
1203 return self->simpleRepr();
1209 %include "MEDCouplingFieldDiscretization.i"
1211 //== MEDCouplingPointSet
1213 namespace MEDCoupling
1215 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1218 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1219 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1220 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1221 void zipCoords() throw(INTERP_KERNEL::Exception);
1222 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1223 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1224 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1225 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1226 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1227 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1228 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1229 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1230 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1231 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1232 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1233 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1234 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1235 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1236 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1237 virtual DataArrayInt *findBoundaryNodes() const;
1238 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1239 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1240 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1241 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1242 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1243 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1244 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1245 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1246 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1249 std::string __str__() const throw(INTERP_KERNEL::Exception)
1251 return self->simpleRepr();
1254 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1257 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1258 PyObject *res = PyList_New(2);
1259 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1260 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1264 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1266 DataArrayInt *comm, *commIndex;
1267 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1268 PyObject *res = PyList_New(2);
1269 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1270 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1274 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1276 DataArrayDouble *ret1=self->getCoords();
1279 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1282 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1284 int szArr,sw,iTypppArr;
1285 std::vector<int> stdvecTyyppArr;
1286 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1287 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1288 if(sw==3)//DataArrayInt
1290 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1291 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1292 std::string name=argpt->getName();
1294 ret->setName(name.c_str());
1296 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1299 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1301 int szArr,sw,iTypppArr;
1302 std::vector<int> stdvecTyyppArr;
1303 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1304 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1305 if(sw==3)//DataArrayInt
1307 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1308 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1309 std::string name=argpt->getName();
1311 ret->setName(name.c_str());
1313 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1316 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1318 int szArr,sw,iTypppArr;
1319 std::vector<int> stdvecTyyppArr;
1320 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1321 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1322 if(sw==3)//DataArrayInt
1324 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1325 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1326 std::string name=argpt->getName();
1328 ret->setName(name.c_str());
1330 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1333 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1335 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1336 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1339 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1341 int szArr,sw,iTypppArr;
1342 std::vector<int> stdvecTyyppArr;
1343 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1344 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1345 if(sw==3)//DataArrayInt
1347 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1348 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1349 std::string name=argpt->getName();
1351 ret->setName(name.c_str());
1353 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1356 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1358 int szArr,sw,iTypppArr;
1359 std::vector<int> stdvecTyyppArr;
1360 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1361 self->renumberNodes(tmp,newNbOfNodes);
1364 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1366 int szArr,sw,iTypppArr;
1367 std::vector<int> stdvecTyyppArr;
1368 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1369 self->renumberNodesCenter(tmp,newNbOfNodes);
1372 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1374 int spaceDim=self->getSpaceDimension();
1376 DataArrayDouble *a,*a2;
1377 DataArrayDoubleTuple *aa,*aa2;
1378 std::vector<double> bb,bb2;
1380 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1381 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1382 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1383 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1384 std::vector<int> nodes;
1385 self->findNodesOnLine(p,v,eps,nodes);
1386 DataArrayInt *ret=DataArrayInt::New();
1387 ret->alloc((int)nodes.size(),1);
1388 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1389 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1391 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1393 int spaceDim=self->getSpaceDimension();
1395 DataArrayDouble *a,*a2;
1396 DataArrayDoubleTuple *aa,*aa2;
1397 std::vector<double> bb,bb2;
1399 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1400 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1401 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1402 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1403 std::vector<int> nodes;
1404 self->findNodesOnPlane(p,v,eps,nodes);
1405 DataArrayInt *ret=DataArrayInt::New();
1406 ret->alloc((int)nodes.size(),1);
1407 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1408 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1411 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1415 DataArrayDoubleTuple *aa;
1416 std::vector<double> bb;
1418 int spaceDim=self->getSpaceDimension();
1419 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1420 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1421 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1422 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1425 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1427 DataArrayInt *c=0,*cI=0;
1431 DataArrayDoubleTuple *aa;
1432 std::vector<double> bb;
1434 int spaceDim=self->getSpaceDimension();
1435 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1436 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1437 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1438 PyObject *ret=PyTuple_New(2);
1439 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1440 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1444 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1446 DataArrayInt *c=0,*cI=0;
1447 int spaceDim=self->getSpaceDimension();
1450 DataArrayDoubleTuple *aa;
1451 std::vector<double> bb;
1454 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1455 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1457 PyObject *ret=PyTuple_New(2);
1458 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1459 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1463 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1467 DataArrayDoubleTuple *aa;
1468 std::vector<double> bb;
1470 int spaceDim=self->getSpaceDimension();
1471 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1472 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1474 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1475 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1478 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1482 std::vector<int> multiVal;
1483 std::pair<int, std::pair<int,int> > slic;
1484 MEDCoupling::DataArrayInt *daIntTyypp=0;
1485 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1489 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1491 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1493 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1495 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1499 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1501 DataArrayInt *v0=0,*v1=0;
1502 self->findCommonCells(compType,startCellId,v0,v1);
1503 PyObject *res = PyList_New(2);
1504 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1505 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1510 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1513 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1514 if (!SWIG_IsOK(res1))
1517 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1518 self->renumberNodesInConn(tmp);
1522 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1524 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1525 da2->checkAllocated();
1526 self->renumberNodesInConn(da2->getConstPointer());
1530 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1533 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1534 PyObject *ret=PyTuple_New(2);
1535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1536 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1540 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1542 DataArrayInt *ret=0;
1544 int szArr,sw,iTypppArr;
1545 std::vector<int> stdvecTyyppArr;
1546 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1547 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1551 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1555 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1556 PyObject *res = PyList_New(3);
1557 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1558 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1559 PyList_SetItem(res,2,SWIG_From_int(ret2));
1563 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1567 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1568 PyObject *res = PyList_New(3);
1569 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1570 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1571 PyList_SetItem(res,2,SWIG_From_int(ret2));
1575 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1578 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1579 if (!SWIG_IsOK(res1))
1582 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1583 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1587 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1589 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1590 da2->checkAllocated();
1591 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1595 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1599 std::vector<int> multiVal;
1600 std::pair<int, std::pair<int,int> > slic;
1601 MEDCoupling::DataArrayInt *daIntTyypp=0;
1602 int nbc=self->getNumberOfCells();
1603 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1610 std::ostringstream oss;
1611 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1612 throw INTERP_KERNEL::Exception(oss.str().c_str());
1615 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1620 int tmp=nbc+singleVal;
1621 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1625 std::ostringstream oss;
1626 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1627 throw INTERP_KERNEL::Exception(oss.str().c_str());
1633 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1637 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1642 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1643 daIntTyypp->checkAllocated();
1644 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1647 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1651 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1654 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1655 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1656 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1657 for(int i=0;i<sz;i++)
1658 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1661 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1664 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1666 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1667 std::vector<double> val3;
1668 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1669 "Rotate2DAlg",2,true,nbNodes);
1671 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1672 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1675 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1678 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1679 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1680 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1681 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1682 for(int i=0;i<sz;i++)
1683 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1686 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1689 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1691 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1692 std::vector<double> val3;
1693 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1694 "Rotate3DAlg",3,true,nbNodes);
1696 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1697 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1698 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1703 //== MEDCouplingPointSet End
1705 class MEDCouplingUMeshCell
1708 INTERP_KERNEL::NormalizedCellType getType() const;
1711 std::string __str__() const throw(INTERP_KERNEL::Exception)
1713 return self->repr();
1716 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1719 const int *r=self->getAllConn(ret2);
1720 PyObject *ret=PyTuple_New(ret2);
1721 for(int i=0;i<ret2;i++)
1722 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1728 class MEDCouplingUMeshCellIterator
1735 MEDCouplingUMeshCell *ret=self->nextt();
1737 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1740 PyErr_SetString(PyExc_StopIteration,"No more data.");
1747 class MEDCouplingUMeshCellByTypeIterator
1750 ~MEDCouplingUMeshCellByTypeIterator();
1755 MEDCouplingUMeshCellEntry *ret=self->nextt();
1757 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1760 PyErr_SetString(PyExc_StopIteration,"No more data.");
1767 class MEDCouplingUMeshCellByTypeEntry
1770 ~MEDCouplingUMeshCellByTypeEntry();
1773 MEDCouplingUMeshCellByTypeIterator *__iter__()
1775 return self->iterator();
1780 class MEDCouplingUMeshCellEntry
1783 INTERP_KERNEL::NormalizedCellType getType() const;
1784 int getNumberOfElems() const;
1787 MEDCouplingUMeshCellIterator *__iter__()
1789 return self->iterator();
1794 //== MEDCouplingUMesh
1796 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1799 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1800 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1801 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1802 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1803 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1804 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1805 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1806 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1807 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1808 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1809 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1810 void computeTypes() throw(INTERP_KERNEL::Exception);
1811 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1812 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1814 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1815 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1816 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1817 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1818 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1819 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1820 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1821 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1823 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1824 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1825 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1826 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1827 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1828 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1829 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1830 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1831 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1832 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1833 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1834 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1835 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1836 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1837 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1838 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1839 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1840 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1841 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1842 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1843 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1844 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1845 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1846 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1847 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1848 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1849 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1850 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1851 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1852 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1853 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1854 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1855 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1856 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1857 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1858 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1859 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);
1860 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1861 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1862 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1863 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1864 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1866 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1868 return MEDCouplingUMesh::New();
1871 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1873 return MEDCouplingUMesh::New(meshName,meshDim);
1877 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1879 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1882 std::string __str__() const throw(INTERP_KERNEL::Exception)
1884 return self->simpleRepr();
1887 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1889 std::ostringstream oss;
1890 self->reprQuickOverview(oss);
1894 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1896 return self->cellIterator();
1899 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1901 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1902 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1903 PyObject *res=PyList_New(result.size());
1904 for(int i=0;iL!=result.end(); i++, iL++)
1905 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1909 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1913 std::vector<int> multiVal;
1914 std::pair<int, std::pair<int,int> > slic;
1915 MEDCoupling::DataArrayInt *daIntTyypp=0;
1916 int nbc=self->getNumberOfCells();
1917 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1924 std::ostringstream oss;
1925 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1926 throw INTERP_KERNEL::Exception(oss.str().c_str());
1930 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1937 int tmp=nbc+singleVal;
1938 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1943 std::ostringstream oss;
1944 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1945 throw INTERP_KERNEL::Exception(oss.str().c_str());
1951 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1957 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1958 daIntTyypp->checkAllocated();
1959 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1963 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1967 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1971 std::vector<int> multiVal;
1972 std::pair<int, std::pair<int,int> > slic;
1973 MEDCoupling::DataArrayInt *daIntTyypp=0;
1974 int nbc=self->getNumberOfCells();
1975 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1982 std::ostringstream oss;
1983 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1984 throw INTERP_KERNEL::Exception(oss.str().c_str());
1988 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1995 int tmp=nbc+singleVal;
1996 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2001 std::ostringstream oss;
2002 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2003 throw INTERP_KERNEL::Exception(oss.str().c_str());
2009 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2014 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2020 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2021 daIntTyypp->checkAllocated();
2022 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2026 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2030 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2032 int szArr,sw,iTypppArr;
2033 std::vector<int> stdvecTyyppArr;
2034 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2037 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2038 throw INTERP_KERNEL::Exception(oss.str().c_str());
2040 self->insertNextCell(type,size,tmp);
2043 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2045 int szArr,sw,iTypppArr;
2046 std::vector<int> stdvecTyyppArr;
2047 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2048 self->insertNextCell(type,szArr,tmp);
2051 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2053 DataArrayInt *ret=self->getNodalConnectivity();
2058 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2060 DataArrayInt *ret=self->getNodalConnectivityIndex();
2066 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2068 int szArr,sw,iTypppArr;
2069 std::vector<int> stdvecTyyppArr;
2070 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2071 int nbOfDepthPeelingPerformed=0;
2072 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2073 PyObject *res=PyTuple_New(2);
2074 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2075 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2079 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2081 DataArrayInt *v0=0,*v1=0;
2082 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2083 PyObject *res = PyList_New(2);
2084 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2093 DataArrayDoubleTuple *aa;
2094 std::vector<double> bb;
2096 int nbOfCompo=self->getSpaceDimension();
2097 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2100 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2101 PyObject *ret=PyTuple_New(2);
2102 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2103 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2107 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2109 DataArrayInt *ret1=0;
2110 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2111 PyObject *ret=PyTuple_New(2);
2112 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2113 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2117 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2120 DataArrayInt *ret1(0);
2121 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2122 PyObject *ret=PyTuple_New(3);
2123 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2124 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2125 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2129 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2131 std::vector<int> cells;
2132 self->checkButterflyCells(cells,eps);
2133 DataArrayInt *ret=DataArrayInt::New();
2134 ret->alloc((int)cells.size(),1);
2135 std::copy(cells.begin(),cells.end(),ret->getPointer());
2136 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2139 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2141 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2143 PyObject *ret = PyList_New(sz);
2144 for(int i=0;i<sz;i++)
2145 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2149 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2151 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2152 int sz=retCpp.size();
2153 PyObject *ret=PyList_New(sz);
2154 for(int i=0;i<sz;i++)
2155 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2162 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2163 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2164 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2167 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2170 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2171 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2175 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2178 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2179 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2183 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2185 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2186 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2187 PyObject *ret=PyTuple_New(3);
2188 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2189 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2194 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2196 DataArrayInt *tmp0=0,*tmp1=0;
2197 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2198 PyObject *ret=PyTuple_New(2);
2199 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2208 std::vector<int> multiVal;
2209 std::pair<int, std::pair<int,int> > slic;
2210 MEDCoupling::DataArrayInt *daIntTyypp=0;
2211 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2215 return self->duplicateNodes(&singleVal,&singleVal+1);
2217 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2219 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2221 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2225 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2229 std::vector<int> multiVal;
2230 std::pair<int, std::pair<int,int> > slic;
2231 MEDCoupling::DataArrayInt *daIntTyypp=0;
2232 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2236 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2238 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2240 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2242 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2246 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2249 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2250 DataArrayInt *tmp0,*tmp1=0;
2251 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2252 PyObject *ret=PyTuple_New(2);
2253 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2254 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2258 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2260 DataArrayInt *ret0=0,*ret1=0;
2261 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2262 PyObject *ret=PyTuple_New(2);
2263 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2264 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2270 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2271 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2272 DataArrayInt *ret1=0,*ret2=0;
2273 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2274 PyObject *ret=PyTuple_New(3);
2275 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2276 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2277 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2283 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2284 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2285 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2286 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2289 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2292 std::vector<const MEDCouplingUMesh *> meshes;
2293 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2294 std::vector<DataArrayInt *> corr;
2295 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2297 PyObject *ret1=PyList_New(sz);
2298 for(int i=0;i<sz;i++)
2299 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2300 PyObject *ret=PyList_New(2);
2301 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2302 PyList_SetItem(ret,1,ret1);
2306 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2308 std::vector<MEDCouplingUMesh *> meshes;
2309 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2310 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2313 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2315 std::vector<MEDCouplingUMesh *> meshes;
2316 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2317 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2320 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2324 std::vector<int> multiVal;
2325 std::pair<int, std::pair<int,int> > slic;
2326 MEDCoupling::DataArrayInt *daIntTyypp=0;
2328 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2329 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2333 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2335 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2337 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2339 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2343 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2345 DataArrayInt *arrOut=0,*arrIndexOut=0;
2348 std::vector<int> multiVal;
2349 std::pair<int, std::pair<int,int> > slic;
2350 MEDCoupling::DataArrayInt *daIntTyypp=0;
2352 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2353 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2358 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2363 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2368 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2372 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2374 PyObject *ret=PyTuple_New(2);
2375 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2382 DataArrayInt *arrOut=0,*arrIndexOut=0;
2383 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2384 PyObject *ret=PyTuple_New(2);
2385 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2386 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2392 if(!PySlice_Check(slic))
2393 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2394 Py_ssize_t strt=2,stp=2,step=2;
2395 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2397 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2398 arrIndxIn->checkAllocated();
2399 if(arrIndxIn->getNumberOfComponents()!=1)
2400 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2401 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2402 DataArrayInt *arrOut=0,*arrIndexOut=0;
2403 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2404 PyObject *ret=PyTuple_New(2);
2405 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2410 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2411 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2412 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2414 DataArrayInt *arrOut=0,*arrIndexOut=0;
2417 std::vector<int> multiVal;
2418 std::pair<int, std::pair<int,int> > slic;
2419 MEDCoupling::DataArrayInt *daIntTyypp=0;
2421 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2422 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2427 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2432 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2437 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2441 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2443 PyObject *ret=PyTuple_New(2);
2444 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2445 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2449 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2450 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2454 std::vector<int> multiVal;
2455 std::pair<int, std::pair<int,int> > slic;
2456 MEDCoupling::DataArrayInt *daIntTyypp=0;
2458 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2459 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2464 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2469 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2474 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2478 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2482 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2486 DataArrayDoubleTuple *aa;
2487 std::vector<double> bb;
2489 int spaceDim=self->getSpaceDimension();
2490 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2491 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2493 std::vector<int> cells;
2494 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2495 DataArrayInt *ret=DataArrayInt::New();
2496 ret->alloc((int)cells.size(),1);
2497 std::copy(cells.begin(),cells.end(),ret->getPointer());
2498 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2501 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2505 DataArrayDoubleTuple *aa;
2506 std::vector<double> bb;
2508 int spaceDim=self->getSpaceDimension();
2509 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2510 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2511 self->orientCorrectly2DCells(v,polyOnly);
2514 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2516 std::vector<int> cells;
2517 self->arePolyhedronsNotCorrectlyOriented(cells);
2518 DataArrayInt *ret=DataArrayInt::New();
2519 ret->alloc((int)cells.size(),1);
2520 std::copy(cells.begin(),cells.end(),ret->getPointer());
2521 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2524 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2528 self->getFastAveragePlaneOfThis(vec,pos);
2530 std::copy(vec,vec+3,vals);
2531 std::copy(pos,pos+3,vals+3);
2532 return convertDblArrToPyListOfTuple(vals,3,2);
2535 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2537 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2538 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2539 return MEDCouplingUMesh::MergeUMeshes(tmp);
2542 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2545 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2546 PyObject *ret=PyTuple_New(2);
2547 PyObject *ret0Py=ret0?Py_True:Py_False;
2549 PyTuple_SetItem(ret,0,ret0Py);
2550 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2554 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2557 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2558 PyObject *ret=PyTuple_New(2);
2559 PyObject *ret0Py=ret0?Py_True:Py_False;
2561 PyTuple_SetItem(ret,0,ret0Py);
2562 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2568 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2569 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2570 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2571 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2572 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2573 PyObject *ret=PyTuple_New(5);
2574 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2575 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2576 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2582 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2584 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2585 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2586 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2587 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2588 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2589 PyObject *ret=PyTuple_New(5);
2590 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2591 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2598 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2600 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2601 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2602 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2603 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2604 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2605 PyObject *ret=PyTuple_New(5);
2606 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2607 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2608 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2609 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2616 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2617 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2618 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2619 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2620 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2621 PyObject *ret=PyTuple_New(5);
2622 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2623 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2630 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2632 DataArrayInt *neighbors=0,*neighborsIdx=0;
2633 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2634 PyObject *ret=PyTuple_New(2);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2642 DataArrayInt *neighbors=0,*neighborsIdx=0;
2643 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2644 PyObject *ret=PyTuple_New(2);
2645 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2646 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2652 DataArrayInt *neighbors=0,*neighborsIdx=0;
2653 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2654 PyObject *ret=PyTuple_New(2);
2655 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2656 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2662 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2663 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2664 DataArrayInt *d2,*d3,*d4,*dd5;
2665 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2666 PyObject *ret=PyTuple_New(7);
2667 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2668 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2669 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2670 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2671 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2672 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2673 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2680 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2681 da->checkAllocated();
2682 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2685 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2688 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2689 da->checkAllocated();
2690 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2693 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2696 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2697 da->checkAllocated();
2698 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2701 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2704 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2705 da->checkAllocated();
2706 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2707 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2708 PyObject *res = PyList_New(result.size());
2709 for (int i=0;iL!=result.end(); i++, iL++)
2710 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2714 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2717 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2718 da->checkAllocated();
2719 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2720 ret->setName(da->getName().c_str());
2724 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2726 DataArrayInt *cellNb1=0,*cellNb2=0;
2727 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2728 PyObject *ret=PyTuple_New(3);
2729 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2730 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2735 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2737 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2738 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2739 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2740 PyObject *ret(PyTuple_New(4));
2741 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2742 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2743 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2744 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2748 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2750 int spaceDim=self->getSpaceDimension();
2752 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2754 DataArrayDouble *a,*a2;
2755 DataArrayDoubleTuple *aa,*aa2;
2756 std::vector<double> bb,bb2;
2758 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2759 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2760 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2761 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2763 DataArrayInt *cellIds=0;
2764 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2765 PyObject *ret=PyTuple_New(2);
2766 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2767 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2773 int spaceDim=self->getSpaceDimension();
2775 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2777 DataArrayDouble *a,*a2;
2778 DataArrayDoubleTuple *aa,*aa2;
2779 std::vector<double> bb,bb2;
2781 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2782 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2783 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2784 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2786 DataArrayInt *cellIds=0;
2787 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2788 PyObject *ret=PyTuple_New(2);
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2794 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2797 DataArrayDouble *a,*a2;
2798 DataArrayDoubleTuple *aa,*aa2;
2799 std::vector<double> bb,bb2;
2801 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2802 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2803 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2804 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2805 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2809 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2811 int spaceDim=self->getSpaceDimension();
2813 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2815 DataArrayDouble *a,*a2;
2816 DataArrayDoubleTuple *aa,*aa2;
2817 std::vector<double> bb,bb2;
2819 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2820 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2821 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2822 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2823 return self->getCellIdsCrossingPlane(orig,vect,eps);
2826 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2830 std::vector<int> pos2;
2831 DataArrayInt *pos3=0;
2832 DataArrayIntTuple *pos4=0;
2833 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2838 self->convertToPolyTypes(&pos1,&pos1+1);
2845 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2850 self->convertToPolyTypes(pos3->begin(),pos3->end());
2854 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2858 void convertAllToPoly();
2859 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2860 bool unPolyze() throw(INTERP_KERNEL::Exception);
2861 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2862 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2863 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2866 //== MEDCouplingUMesh End
2868 //== MEDCouplingMappedExtrudedMesh
2870 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2873 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2874 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2875 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2876 int get2DCellIdForExtrusion() const;
2878 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2880 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2883 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2885 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2888 MEDCouplingMappedExtrudedMesh()
2890 return MEDCouplingMappedExtrudedMesh::New();
2893 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2895 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2898 std::string __str__() const throw(INTERP_KERNEL::Exception)
2900 return self->simpleRepr();
2903 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2905 std::ostringstream oss;
2906 self->reprQuickOverview(oss);
2910 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2912 MEDCouplingUMesh *ret=self->getMesh2D();
2915 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2917 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2919 MEDCouplingUMesh *ret=self->getMesh1D();
2922 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2924 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2926 DataArrayInt *ret=self->getMesh3DIds();
2929 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2934 //== MEDCouplingMappedExtrudedMesh End
2936 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2939 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2940 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2941 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2942 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2943 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2944 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2947 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2949 int szArr,sw,iTypppArr;
2950 std::vector<int> stdvecTyyppArr;
2951 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2952 self->insertNextCell(tmp,tmp+szArr);
2955 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2957 DataArrayInt *ret=self->getNodalConnectivity();
2958 if(ret) ret->incrRef();
2962 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2964 std::vector< const MEDCoupling1GTUMesh *> parts;
2965 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2966 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2971 //== MEDCoupling1SGTUMesh
2973 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2976 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2977 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2978 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2979 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2980 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2981 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2982 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2983 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2984 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2987 MEDCoupling1SGTUMesh()
2989 return MEDCoupling1SGTUMesh::New();
2992 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2994 return MEDCoupling1SGTUMesh::New(name,type);
2997 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2999 return MEDCoupling1SGTUMesh::New(m);
3002 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3004 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3007 std::string __str__() const throw(INTERP_KERNEL::Exception)
3009 return self->simpleRepr();
3012 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3014 std::ostringstream oss;
3015 self->reprQuickOverview(oss);
3019 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3021 DataArrayInt *cellPerm(0),*nodePerm(0);
3022 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3023 PyObject *ret(PyTuple_New(3));
3024 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3025 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3026 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3030 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3032 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3033 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3034 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3037 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3039 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3040 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3041 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3046 //== MEDCoupling1SGTUMesh End
3048 //== MEDCoupling1DGTUMesh
3050 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3053 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3054 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3055 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3056 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3057 bool isPacked() const throw(INTERP_KERNEL::Exception);
3060 MEDCoupling1DGTUMesh()
3062 return MEDCoupling1DGTUMesh::New();
3064 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3066 return MEDCoupling1DGTUMesh::New(name,type);
3069 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3071 return MEDCoupling1DGTUMesh::New(m);
3074 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3076 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3079 std::string __str__() const throw(INTERP_KERNEL::Exception)
3081 return self->simpleRepr();
3084 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3086 std::ostringstream oss;
3087 self->reprQuickOverview(oss);
3091 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3093 DataArrayInt *ret=self->getNodalConnectivityIndex();
3094 if(ret) ret->incrRef();
3098 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3100 DataArrayInt *ret1=0,*ret2=0;
3101 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3102 PyObject *ret0Py=ret0?Py_True:Py_False;
3104 PyObject *ret=PyTuple_New(3);
3105 PyTuple_SetItem(ret,0,ret0Py);
3106 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3107 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3111 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3114 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3115 PyObject *ret=PyTuple_New(2);
3116 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3117 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3118 PyTuple_SetItem(ret,1,ret1Py);
3122 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3124 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3125 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3126 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3129 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3131 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3132 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3133 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3136 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3138 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3139 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3140 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3145 //== MEDCoupling1DGTUMeshEnd
3147 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3150 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3151 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3152 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3153 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3154 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3155 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3156 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3157 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3158 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3159 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3160 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3161 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3162 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3163 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3164 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3167 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3169 int tmpp1=-1,tmpp2=-1;
3170 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3171 std::vector< std::pair<int,int> > inp;
3175 for(int i=0;i<tmpp1;i++)
3176 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3181 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3182 inp.resize(tmpp1/2);
3183 for(int i=0;i<tmpp1/2;i++)
3184 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3187 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3188 return self->buildStructuredSubPart(inp);
3191 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3193 std::vector< std::pair<int,int> > inp;
3194 convertPyToVectorPairInt(part,inp);
3196 int szArr,sw,iTypppArr;
3197 std::vector<int> stdvecTyyppArr;
3198 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3199 std::vector<int> tmp5(tmp4,tmp4+szArr);
3201 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3204 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3206 std::vector< std::pair<int,int> > inp;
3207 convertPyToVectorPairInt(part,inp);
3208 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3211 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3213 std::vector< std::pair<int,int> > inp;
3214 convertPyToVectorPairInt(part,inp);
3215 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3218 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3220 std::vector< std::pair<int,int> > inp;
3221 convertPyToVectorPairInt(part,inp);
3222 std::vector<int> stWithGhost;
3223 std::vector< std::pair<int,int> > partWithGhost;
3224 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3225 PyObject *ret(PyTuple_New(2));
3226 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3227 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3231 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3233 std::vector< std::pair<int,int> > inp;
3234 convertPyToVectorPairInt(partCompactFormat,inp);
3235 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3238 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3240 std::vector< std::pair<int,int> > inp;
3241 convertPyToVectorPairInt(partCompactFormat,inp);
3242 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3245 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3247 std::vector< std::pair<int,int> > inp;
3248 convertPyToVectorPairInt(part,inp);
3249 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3252 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3254 int szArr,sw,iTypppArr;
3255 std::vector<int> stdvecTyyppArr;
3256 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3257 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3260 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3262 int szArr,sw,iTypppArr;
3263 std::vector<int> stdvecTyyppArr;
3264 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3265 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3268 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3270 std::vector< std::pair<int,int> > inp;
3271 convertPyToVectorPairInt(partCompactFormat,inp);
3272 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3275 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3277 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3278 PyObject *retPy=PyList_New(ret.size());
3279 for(std::size_t i=0;i<ret.size();i++)
3281 PyObject *tmp=PyTuple_New(2);
3282 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3283 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3284 PyList_SetItem(retPy,i,tmp);
3289 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3291 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3292 convertPyToVectorPairInt(r1,r1Cpp);
3293 convertPyToVectorPairInt(r2,r2Cpp);
3294 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3295 PyObject *retPy=PyList_New(ret.size());
3296 for(std::size_t i=0;i<ret.size();i++)
3298 PyObject *tmp=PyTuple_New(2);
3299 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3300 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3301 PyList_SetItem(retPy,i,tmp);
3306 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3308 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3309 convertPyToVectorPairInt(r1,r1Cpp);
3310 convertPyToVectorPairInt(r2,r2Cpp);
3311 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3314 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3316 int szArr,sw,iTypppArr;
3317 std::vector<int> stdvecTyyppArr;
3318 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3319 int szArr2,sw2,iTypppArr2;
3320 std::vector<int> stdvecTyyppArr2;
3321 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3322 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3323 std::vector< std::pair<int,int> > partCompactFormat;
3324 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3325 PyObject *ret=PyTuple_New(2);
3326 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3327 PyTuple_SetItem(ret,0,ret0Py);
3328 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3329 for(std::size_t i=0;i<partCompactFormat.size();i++)
3331 PyObject *tmp4=PyTuple_New(2);
3332 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3333 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3334 PyList_SetItem(ret1Py,i,tmp4);
3336 PyTuple_SetItem(ret,1,ret1Py);
3340 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3342 std::vector< std::pair<int,int> > param0,param1,ret;
3343 convertPyToVectorPairInt(bigInAbs,param0);
3344 convertPyToVectorPairInt(partOfBigInAbs,param1);
3345 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3346 PyObject *retPy(PyList_New(ret.size()));
3347 for(std::size_t i=0;i<ret.size();i++)
3349 PyObject *tmp(PyTuple_New(2));
3350 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3351 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3352 PyList_SetItem(retPy,i,tmp);
3357 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3359 std::vector< std::pair<int,int> > param0;
3360 convertPyToVectorPairInt(part,param0);
3361 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3362 PyObject *retPy(PyList_New(ret.size()));
3363 for(std::size_t i=0;i<ret.size();i++)
3365 PyObject *tmp(PyTuple_New(2));
3366 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3367 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3368 PyList_SetItem(retPy,i,tmp);
3373 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3375 std::vector< std::pair<int,int> > param0,param1;
3376 convertPyToVectorPairInt(startingFrom,param0);
3377 convertPyToVectorPairInt(goingTo,param1);
3378 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3381 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3383 std::vector< std::pair<int,int> > param0,param1,ret;
3384 convertPyToVectorPairInt(bigInAbs,param0);
3385 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3386 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3387 PyObject *retPy(PyList_New(ret.size()));
3388 for(std::size_t i=0;i<ret.size();i++)
3390 PyObject *tmp(PyTuple_New(2));
3391 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3392 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3393 PyList_SetItem(retPy,i,tmp);
3400 class MEDCouplingCurveLinearMesh;
3402 //== MEDCouplingCMesh
3404 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3407 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3408 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3409 void setCoords(const DataArrayDouble *coordsX,
3410 const DataArrayDouble *coordsY=0,
3411 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3412 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3413 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3415 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3417 return MEDCouplingCMesh::New();
3419 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3421 return MEDCouplingCMesh::New(meshName);
3424 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3426 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3428 std::string __str__() const throw(INTERP_KERNEL::Exception)
3430 return self->simpleRepr();
3432 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3434 std::ostringstream oss;
3435 self->reprQuickOverview(oss);
3438 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3440 DataArrayDouble *ret=self->getCoordsAt(i);
3448 //== MEDCouplingCMesh End
3450 //== MEDCouplingCurveLinearMesh
3452 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3455 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3456 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3457 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3459 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3461 return MEDCouplingCurveLinearMesh::New();
3463 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3465 return MEDCouplingCurveLinearMesh::New(meshName);
3467 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3469 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3471 std::string __str__() const throw(INTERP_KERNEL::Exception)
3473 return self->simpleRepr();
3475 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3477 std::ostringstream oss;
3478 self->reprQuickOverview(oss);
3481 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3483 DataArrayDouble *ret=self->getCoords();
3488 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3490 int szArr,sw,iTypppArr;
3491 std::vector<int> stdvecTyyppArr;
3492 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3493 self->setNodeGridStructure(tmp,tmp+szArr);
3498 //== MEDCouplingCurveLinearMesh End
3500 //== MEDCouplingIMesh
3502 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3505 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3507 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3508 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3509 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3510 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3511 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3512 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3513 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3514 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3515 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3516 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3517 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3522 return MEDCouplingIMesh::New();
3524 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3526 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3527 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3528 const int *nodeStrctPtr(0);
3529 const double *originPtr(0),*dxyzPtr(0);
3531 std::vector<int> bb0;
3532 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3535 std::vector<double> bb,bb2;
3537 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3538 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3540 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3543 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3545 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3548 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3550 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3553 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3556 std::vector<int> bb0;
3557 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3558 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3561 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3563 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3566 DataArrayDoubleTuple *aa;
3567 std::vector<double> bb;
3569 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3570 self->setOrigin(originPtr,originPtr+nbTuples);
3573 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3575 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3578 DataArrayDoubleTuple *aa;
3579 std::vector<double> bb;
3581 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3582 self->setDXYZ(originPtr,originPtr+nbTuples);
3585 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3587 std::vector< std::pair<int,int> > inp;
3588 convertPyToVectorPairInt(fineLocInCoarse,inp);
3589 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3592 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)
3594 std::vector< std::pair<int,int> > inp;
3595 convertPyToVectorPairInt(fineLocInCoarse,inp);
3596 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3599 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3601 std::vector< std::pair<int,int> > inp;
3602 convertPyToVectorPairInt(fineLocInCoarse,inp);
3603 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3606 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)
3608 std::vector< std::pair<int,int> > inp;
3609 convertPyToVectorPairInt(fineLocInCoarse,inp);
3610 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3613 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)
3615 std::vector< std::pair<int,int> > inp;
3616 convertPyToVectorPairInt(fineLocInCoarse,inp);
3617 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3620 std::string __str__() const throw(INTERP_KERNEL::Exception)
3622 return self->simpleRepr();
3624 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3626 std::ostringstream oss;
3627 self->reprQuickOverview(oss);
3633 //== MEDCouplingIMesh End
3637 namespace MEDCoupling
3639 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3642 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3643 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3644 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3645 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3646 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3647 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3648 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3649 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3650 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3651 std::string getName() const throw(INTERP_KERNEL::Exception);
3652 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3653 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3654 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3655 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3656 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3657 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3658 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3659 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3660 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3661 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3662 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3663 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3664 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3665 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3666 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3667 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3669 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3671 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3674 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3677 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3679 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3682 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3685 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3687 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3688 return convertIntArrToPyList3(ret);
3691 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3694 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3695 PyObject *ret=PyTuple_New(2);
3696 PyObject *ret0Py=ret0?Py_True:Py_False;
3698 PyTuple_SetItem(ret,0,ret0Py);
3699 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3703 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3705 DataArrayInt *ret1=0;
3706 MEDCouplingMesh *ret0=0;
3708 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3709 if (!SWIG_IsOK(res1))
3712 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3713 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3717 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3719 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3720 da2->checkAllocated();
3721 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3723 PyObject *res = PyList_New(2);
3724 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3725 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3729 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3731 DataArrayInt *ret1=0;
3733 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3734 PyObject *res=PyTuple_New(2);
3735 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3737 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3740 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3741 PyTuple_SetItem(res,1,res1);
3746 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3749 int v0; std::vector<int> v1;
3750 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3751 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3754 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3755 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3758 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3759 if (!SWIG_IsOK(res1))
3762 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3763 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3767 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3769 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3770 da2->checkAllocated();
3771 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3775 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3777 std::vector<int> tmp;
3778 self->getCellIdsHavingGaussLocalization(locId,tmp);
3779 DataArrayInt *ret=DataArrayInt::New();
3780 ret->alloc((int)tmp.size(),1);
3781 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3782 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3785 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3787 std::vector<int> inp0;
3788 convertPyToNewIntArr4(code,1,3,inp0);
3789 std::vector<const DataArrayInt *> inp1;
3790 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3791 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3796 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3799 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3800 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3801 static MEDCouplingFieldTemplate *New(TypeOfField type);
3802 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3803 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3806 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3808 return MEDCouplingFieldTemplate::New(f);
3811 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3813 return MEDCouplingFieldTemplate::New(f);
3816 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3818 return MEDCouplingFieldTemplate::New(type);
3821 std::string __str__() const throw(INTERP_KERNEL::Exception)
3823 return self->simpleRepr();
3826 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3828 std::ostringstream oss;
3829 self->reprQuickOverview(oss);
3835 class MEDCouplingFieldInt;
3837 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3840 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3841 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3842 void setTimeUnit(const std::string& unit);
3843 std::string getTimeUnit() const;
3844 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3845 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3846 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3847 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3848 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3849 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3850 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3851 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3852 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3853 MEDCouplingFieldDouble *deepCopy() const;
3854 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3855 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3856 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3857 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3858 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3859 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3860 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3861 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3862 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3863 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3864 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3865 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3866 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3867 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3868 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3869 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3870 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3871 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3872 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3873 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3874 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3875 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3876 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3877 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3878 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3879 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3880 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3881 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3882 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3883 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3884 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3885 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3886 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3887 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3888 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3889 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3890 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3891 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3892 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3893 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3894 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3895 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3896 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3897 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3898 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3899 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3900 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3901 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3902 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3903 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3904 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3905 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3906 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3907 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3908 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3909 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3910 double getMinValue() const throw(INTERP_KERNEL::Exception);
3911 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3912 double norm2() const throw(INTERP_KERNEL::Exception);
3913 double normMax() const throw(INTERP_KERNEL::Exception);
3914 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3915 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3916 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3917 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3918 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3919 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3920 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3921 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3922 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3923 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3924 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3925 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3926 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3927 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3928 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3929 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3930 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3931 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3932 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3933 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3934 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3935 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3937 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3939 return MEDCouplingFieldDouble::New(type,td);
3942 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3944 return MEDCouplingFieldDouble::New(ft,td);
3947 std::string __str__() const throw(INTERP_KERNEL::Exception)
3949 return self->simpleRepr();
3952 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3954 std::ostringstream oss;
3955 self->reprQuickOverview(oss);
3959 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3961 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3965 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
3967 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
3971 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
3973 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
3975 DataArrayDouble *a,*a2;
3976 DataArrayDoubleTuple *aa,*aa2;
3977 std::vector<double> bb,bb2;
3979 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
3980 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
3981 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
3984 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3986 DataArrayDouble *ret=self->getArray();
3992 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3994 std::vector<DataArrayDouble *> arrs=self->getArrays();
3995 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3999 PyObject *ret=PyTuple_New(sz);
4000 for(int i=0;i<sz;i++)
4003 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4005 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4010 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4012 std::vector<const DataArrayDouble *> tmp;
4013 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4015 std::vector<DataArrayDouble *> arrs(sz);
4016 for(int i=0;i<sz;i++)
4017 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4018 self->setArrays(arrs);
4021 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4023 DataArrayDouble *ret=self->getEndArray();
4029 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4033 DataArrayDoubleTuple *aa;
4034 std::vector<double> bb;
4036 const MEDCouplingMesh *mesh=self->getMesh();
4038 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4039 int spaceDim=mesh->getSpaceDimension();
4040 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4041 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4043 int sz=self->getNumberOfComponents();
4044 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4045 self->getValueOn(spaceLoc,res);
4046 return convertDblArrToPyList(res,sz);
4049 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4051 int sz=self->getNumberOfComponents();
4052 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4053 self->getValueOnPos(i,j,k,res);
4054 return convertDblArrToPyList(res,sz);
4057 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4059 const MEDCouplingMesh *mesh(self->getMesh());
4061 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4064 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4065 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4066 mesh->getSpaceDimension(),true,nbPts);
4067 return self->getValueOnMulti(inp,nbPts);
4070 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4074 DataArrayDoubleTuple *aa;
4075 std::vector<double> bb;
4077 const MEDCouplingMesh *mesh=self->getMesh();
4079 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4080 int spaceDim=mesh->getSpaceDimension();
4081 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4082 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4085 int sz=self->getNumberOfComponents();
4086 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4087 self->getValueOn(spaceLoc,time,res);
4088 return convertDblArrToPyList(res,sz);
4091 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4093 if(self->getArray()!=0)
4094 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4097 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4098 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4099 self->setArray(arr);
4103 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4106 double tmp0=self->getTime(tmp1,tmp2);
4107 PyObject *res = PyList_New(3);
4108 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4109 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4110 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4114 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4117 double tmp0=self->getStartTime(tmp1,tmp2);
4118 PyObject *res = PyList_New(3);
4119 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4120 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4121 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4125 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4128 double tmp0=self->getEndTime(tmp1,tmp2);
4129 PyObject *res = PyList_New(3);
4130 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4131 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4132 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4135 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4137 int sz=self->getNumberOfComponents();
4138 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4139 self->accumulate(tmp);
4140 return convertDblArrToPyList(tmp,sz);
4142 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4144 int sz=self->getNumberOfComponents();
4145 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4146 self->integral(isWAbs,tmp);
4147 return convertDblArrToPyList(tmp,sz);
4149 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4151 int sz=self->getNumberOfComponents();
4152 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4153 self->getWeightedAverageValue(tmp,isWAbs);
4154 return convertDblArrToPyList(tmp,sz);
4156 PyObject *normL1() 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 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4165 int sz=self->getNumberOfComponents();
4166 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4168 return convertDblArrToPyList(tmp,sz);
4170 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4172 int szArr,sw,iTypppArr;
4173 std::vector<int> stdvecTyyppArr;
4174 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4175 self->renumberCells(tmp,check);
4178 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4180 int szArr,sw,iTypppArr;
4181 std::vector<int> stdvecTyyppArr;
4182 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4183 self->renumberCellsWithoutMesh(tmp,check);
4186 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4188 int szArr,sw,iTypppArr;
4189 std::vector<int> stdvecTyyppArr;
4190 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4191 self->renumberNodes(tmp,eps);
4194 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4196 int szArr,sw,iTypppArr;
4197 std::vector<int> stdvecTyyppArr;
4198 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4199 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4202 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4206 std::vector<int> multiVal;
4207 std::pair<int, std::pair<int,int> > slic;
4208 MEDCoupling::DataArrayInt *daIntTyypp=0;
4209 const MEDCouplingMesh *mesh=self->getMesh();
4211 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4212 int nbc=mesh->getNumberOfCells();
4213 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4220 std::ostringstream oss;
4221 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4222 throw INTERP_KERNEL::Exception(oss.str().c_str());
4225 return self->buildSubPart(&singleVal,&singleVal+1);
4230 int tmp=nbc+singleVal;
4231 return self->buildSubPart(&tmp,&tmp+1);
4235 std::ostringstream oss;
4236 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4237 throw INTERP_KERNEL::Exception(oss.str().c_str());
4243 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4247 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4252 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4253 daIntTyypp->checkAllocated();
4254 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4257 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4261 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4263 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";
4264 if(PyTuple_Check(li))
4266 Py_ssize_t sz=PyTuple_Size(li);
4268 throw INTERP_KERNEL::Exception(msg);
4269 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4272 std::vector<int> multiVal;
4273 std::pair<int, std::pair<int,int> > slic;
4274 MEDCoupling::DataArrayInt *daIntTyypp=0;
4275 if(!self->getArray())
4276 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4278 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4279 catch(INTERP_KERNEL::Exception& e)
4280 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4281 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4282 DataArrayDouble *ret0Arr=ret0->getArray();
4284 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4289 std::vector<int> v2(1,singleVal);
4290 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4291 ret0->setArray(aarr);
4296 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4297 ret0->setArray(aarr);
4302 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4303 std::vector<int> v2(nbOfComp);
4304 for(int i=0;i<nbOfComp;i++)
4305 v2[i]=slic.first+i*slic.second.second;
4306 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4307 ret0->setArray(aarr);
4311 throw INTERP_KERNEL::Exception(msg);
4316 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4319 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4322 double r1=self->getMaxValue2(tmp);
4323 PyObject *ret=PyTuple_New(2);
4324 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4325 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4329 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4332 double r1=self->getMinValue2(tmp);
4333 PyObject *ret=PyTuple_New(2);
4334 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4335 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4339 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4341 std::vector<int> tmp;
4342 convertPyToNewIntArr3(li,tmp);
4343 return self->keepSelectedComponents(tmp);
4346 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4348 std::vector<int> tmp;
4349 convertPyToNewIntArr3(li,tmp);
4350 self->setSelectedComponents(f,tmp);
4353 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4356 DataArrayDouble *a,*a2;
4357 DataArrayDoubleTuple *aa,*aa2;
4358 std::vector<double> bb,bb2;
4361 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4362 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4363 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4364 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4366 return self->extractSlice3D(orig,vect,eps);
4369 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4371 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4374 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4376 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4379 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4381 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.";
4382 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4385 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4387 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4389 return (*self)-(*other);
4391 throw INTERP_KERNEL::Exception(msg);
4396 DataArrayDoubleTuple *aa;
4397 std::vector<double> bb;
4399 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4404 if(!self->getArray())
4405 throw INTERP_KERNEL::Exception(msg2);
4406 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4407 ret->applyLin(1.,-val);
4408 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4409 ret2->setArray(ret);
4414 if(!self->getArray())
4415 throw INTERP_KERNEL::Exception(msg2);
4416 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4417 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4418 ret2->setArray(ret);
4423 if(!self->getArray())
4424 throw INTERP_KERNEL::Exception(msg2);
4425 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4426 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4427 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4428 ret2->setArray(ret);
4433 if(!self->getArray())
4434 throw INTERP_KERNEL::Exception(msg2);
4435 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4436 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4437 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4438 ret2->setArray(ret);
4442 { throw INTERP_KERNEL::Exception(msg); }
4446 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4448 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4451 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4453 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4456 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4458 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4461 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4463 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.";
4464 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4467 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4469 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4471 return (*self)/(*other);
4473 throw INTERP_KERNEL::Exception(msg);
4478 DataArrayDoubleTuple *aa;
4479 std::vector<double> bb;
4481 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4487 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4488 if(!self->getArray())
4489 throw INTERP_KERNEL::Exception(msg2);
4490 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4491 ret->applyLin(1./val,0);
4492 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4493 ret2->setArray(ret);
4498 if(!self->getArray())
4499 throw INTERP_KERNEL::Exception(msg2);
4500 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4501 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4502 ret2->setArray(ret);
4507 if(!self->getArray())
4508 throw INTERP_KERNEL::Exception(msg2);
4509 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4510 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4511 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4512 ret2->setArray(ret);
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4520 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4521 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4522 ret2->setArray(ret);
4526 { throw INTERP_KERNEL::Exception(msg); }
4530 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4532 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4535 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4537 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.";
4538 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4541 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4543 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4545 return (*self)^(*other);
4547 throw INTERP_KERNEL::Exception(msg);
4552 DataArrayDoubleTuple *aa;
4553 std::vector<double> bb;
4555 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4560 if(!self->getArray())
4561 throw INTERP_KERNEL::Exception(msg2);
4562 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4564 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4565 ret2->setArray(ret);
4570 if(!self->getArray())
4571 throw INTERP_KERNEL::Exception(msg2);
4572 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4573 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4574 ret2->setArray(ret);
4579 if(!self->getArray())
4580 throw INTERP_KERNEL::Exception(msg2);
4581 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4582 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4583 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4584 ret2->setArray(ret);
4589 if(!self->getArray())
4590 throw INTERP_KERNEL::Exception(msg2);
4591 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4592 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4593 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4594 ret2->setArray(ret);
4598 { throw INTERP_KERNEL::Exception(msg); }
4602 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4604 return self->negate();
4607 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4609 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.";
4610 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4613 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4615 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4619 Py_XINCREF(trueSelf);
4623 throw INTERP_KERNEL::Exception(msg);
4628 DataArrayDoubleTuple *aa;
4629 std::vector<double> bb;
4631 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4636 if(!self->getArray())
4637 throw INTERP_KERNEL::Exception(msg2);
4638 self->getArray()->applyLin(1.,val);
4639 Py_XINCREF(trueSelf);
4644 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4647 Py_XINCREF(trueSelf);
4652 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4653 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4654 ret2->setArray(aaa);
4656 Py_XINCREF(trueSelf);
4661 if(!self->getArray())
4662 throw INTERP_KERNEL::Exception(msg2);
4663 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4664 self->getArray()->addEqual(aaa);
4665 Py_XINCREF(trueSelf);
4669 { throw INTERP_KERNEL::Exception(msg); }
4673 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4675 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.";
4676 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4679 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4681 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4685 Py_XINCREF(trueSelf);
4689 throw INTERP_KERNEL::Exception(msg);
4694 DataArrayDoubleTuple *aa;
4695 std::vector<double> bb;
4697 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4702 if(!self->getArray())
4703 throw INTERP_KERNEL::Exception(msg2);
4704 self->getArray()->applyLin(1.,-val);
4705 Py_XINCREF(trueSelf);
4710 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4713 Py_XINCREF(trueSelf);
4718 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4719 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4720 ret2->setArray(aaa);
4722 Py_XINCREF(trueSelf);
4727 if(!self->getArray())
4728 throw INTERP_KERNEL::Exception(msg2);
4729 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4730 self->getArray()->substractEqual(aaa);
4731 Py_XINCREF(trueSelf);
4735 { throw INTERP_KERNEL::Exception(msg); }
4739 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4741 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.";
4742 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4745 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4747 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4751 Py_XINCREF(trueSelf);
4755 throw INTERP_KERNEL::Exception(msg);
4760 DataArrayDoubleTuple *aa;
4761 std::vector<double> bb;
4763 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4768 if(!self->getArray())
4769 throw INTERP_KERNEL::Exception(msg2);
4770 self->getArray()->applyLin(val,0);
4771 Py_XINCREF(trueSelf);
4776 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4779 Py_XINCREF(trueSelf);
4784 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4785 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4786 ret2->setArray(aaa);
4788 Py_XINCREF(trueSelf);
4793 if(!self->getArray())
4794 throw INTERP_KERNEL::Exception(msg2);
4795 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4796 self->getArray()->multiplyEqual(aaa);
4797 Py_XINCREF(trueSelf);
4801 { throw INTERP_KERNEL::Exception(msg); }
4805 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4807 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.";
4808 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4811 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4813 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4817 Py_XINCREF(trueSelf);
4821 throw INTERP_KERNEL::Exception(msg);
4826 DataArrayDoubleTuple *aa;
4827 std::vector<double> bb;
4829 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4835 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4836 if(!self->getArray())
4837 throw INTERP_KERNEL::Exception(msg2);
4838 self->getArray()->applyLin(1./val,0);
4839 Py_XINCREF(trueSelf);
4844 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4847 Py_XINCREF(trueSelf);
4852 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4853 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4854 ret2->setArray(aaa);
4856 Py_XINCREF(trueSelf);
4861 if(!self->getArray())
4862 throw INTERP_KERNEL::Exception(msg2);
4863 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4864 self->getArray()->divideEqual(aaa);
4865 Py_XINCREF(trueSelf);
4869 { throw INTERP_KERNEL::Exception(msg); }
4873 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4875 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.";
4876 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4879 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4881 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4885 Py_XINCREF(trueSelf);
4889 throw INTERP_KERNEL::Exception(msg);
4894 DataArrayDoubleTuple *aa;
4895 std::vector<double> bb;
4897 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4902 if(!self->getArray())
4903 throw INTERP_KERNEL::Exception(msg2);
4904 self->getArray()->applyPow(val);
4905 Py_XINCREF(trueSelf);
4910 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4913 Py_XINCREF(trueSelf);
4918 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4919 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4920 ret2->setArray(aaa);
4922 Py_XINCREF(trueSelf);
4927 if(!self->getArray())
4928 throw INTERP_KERNEL::Exception(msg2);
4929 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4930 self->getArray()->powEqual(aaa);
4931 Py_XINCREF(trueSelf);
4935 { throw INTERP_KERNEL::Exception(msg); }
4939 static MEDCouplingFieldDouble *MergeFields(PyObject *li) 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::MergeFields(tmp);
4946 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4948 std::vector<const MEDCouplingFieldDouble *> tmp;
4949 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4950 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4953 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4955 std::vector<double> a0;
4956 std::vector<int> a1;
4957 std::vector<std::string> a2;
4958 self->getTinySerializationDbleInformation(a0);
4959 self->getTinySerializationIntInformation(a1);
4960 self->getTinySerializationStrInformation(a2);
4962 PyObject *ret(PyTuple_New(3));
4963 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4964 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4966 PyObject *ret2(PyList_New(sz));
4968 for(int i=0;i<sz;i++)
4969 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4971 PyTuple_SetItem(ret,2,ret2);
4975 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4977 DataArrayInt *ret0(0);
4978 std::vector<DataArrayDouble *> ret1;
4979 self->serialize(ret0,ret1);
4982 std::size_t sz(ret1.size());
4983 PyObject *ret(PyTuple_New(2));
4984 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4985 PyObject *ret1Py(PyList_New(sz));
4986 for(std::size_t i=0;i<sz;i++)
4990 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4992 PyTuple_SetItem(ret,1,ret1Py);
4996 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4998 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4999 if(!PyTuple_Check(args))
5000 throw INTERP_KERNEL::Exception(MSG);
5001 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5002 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5003 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5005 PyObject *tmp0(PyTuple_New(1));
5006 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5007 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5009 Py_DECREF(selfMeth);
5010 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5011 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5012 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5014 PyObject *a(PyInt_FromLong(0));
5015 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5018 throw INTERP_KERNEL::Exception(MSG);
5019 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5020 throw INTERP_KERNEL::Exception(MSG);
5021 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5024 Py_DECREF(initMeth);
5029 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5030 {// put an empty dict in input to say to __new__ to call __init__...
5031 self->checkConsistencyLight();
5032 PyObject *ret(PyTuple_New(1));
5033 PyObject *ret0(PyDict_New());
5035 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5036 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5037 PyDict_SetItem(ret0,a,d);
5038 Py_DECREF(a); Py_DECREF(d);
5040 PyTuple_SetItem(ret,0,ret0);
5044 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5046 self->checkConsistencyLight();
5047 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5048 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5049 const MEDCouplingMesh *mesh(self->getMesh());
5052 PyObject *ret(PyTuple_New(3));
5053 PyTuple_SetItem(ret,0,ret0);
5054 PyTuple_SetItem(ret,1,ret1);
5055 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5059 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5061 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5062 if(!PyTuple_Check(inp))
5063 throw INTERP_KERNEL::Exception(MSG);
5064 int sz(PyTuple_Size(inp));
5066 throw INTERP_KERNEL::Exception(MSG);
5068 PyObject *elt2(PyTuple_GetItem(inp,2));
5070 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5071 if(!SWIG_IsOK(status))
5072 throw INTERP_KERNEL::Exception(MSG);
5073 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5075 PyObject *elt0(PyTuple_GetItem(inp,0));
5076 PyObject *elt1(PyTuple_GetItem(inp,1));
5077 std::vector<double> a0;
5078 std::vector<int> a1;
5079 std::vector<std::string> a2;
5080 DataArrayInt *b0(0);
5081 std::vector<DataArrayDouble *>b1;
5083 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5084 throw INTERP_KERNEL::Exception(MSG);
5085 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5087 fillArrayWithPyListDbl3(a0py,tmp,a0);
5088 convertPyToNewIntArr3(a1py,a1);
5089 fillStringVector(a2py,a2);
5092 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5093 throw INTERP_KERNEL::Exception(MSG);
5094 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5096 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5097 if(!SWIG_IsOK(status))
5098 throw INTERP_KERNEL::Exception(MSG);
5099 b0=reinterpret_cast<DataArrayInt *>(argp);
5100 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5102 self->checkForUnserialization(a1,b0,b1);
5103 // useless here to call resizeForUnserialization because arrays are well resized.
5104 self->finishUnserialization(a1,a0,a2);
5109 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5112 int getNumberOfFields() const;
5113 MEDCouplingMultiFields *deepCopy() const;
5114 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5115 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5116 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5117 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5118 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5121 std::string __str__() const throw(INTERP_KERNEL::Exception)
5123 return self->simpleRepr();
5125 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5127 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5128 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5130 std::vector<MEDCouplingFieldDouble *> fs(sz);
5131 for(int i=0;i<sz;i++)
5132 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5133 return MEDCouplingMultiFields::New(fs);
5135 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5137 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5138 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5140 std::vector<MEDCouplingFieldDouble *> fs(sz);
5141 for(int i=0;i<sz;i++)
5142 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5143 return MEDCouplingMultiFields::New(fs);
5145 PyObject *getFields() const
5147 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5148 int sz=fields.size();
5149 PyObject *res = PyList_New(sz);
5150 for(int i=0;i<sz;i++)
5154 fields[i]->incrRef();
5155 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5159 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5164 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5166 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5170 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5173 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5175 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5177 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5179 PyObject *res = PyList_New(sz);
5180 for(int i=0;i<sz;i++)
5185 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5189 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5194 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5196 std::vector<int> refs;
5197 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5199 PyObject *res = PyList_New(sz);
5200 for(int i=0;i<sz;i++)
5205 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5209 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5213 PyObject *ret=PyTuple_New(2);
5214 PyTuple_SetItem(ret,0,res);
5215 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5218 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5220 std::vector<DataArrayDouble *> ms=self->getArrays();
5222 PyObject *res = PyList_New(sz);
5223 for(int i=0;i<sz;i++)
5228 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5232 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5237 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5239 std::vector< std::vector<int> > refs;
5240 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5242 PyObject *res = PyList_New(sz);
5243 PyObject *res2 = PyList_New(sz);
5244 for(int i=0;i<sz;i++)
5249 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5253 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5255 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5258 PyObject *ret=PyTuple_New(2);
5259 PyTuple_SetItem(ret,0,res);
5260 PyTuple_SetItem(ret,1,res2);
5266 class MEDCouplingFieldInt : public MEDCouplingField
5269 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5270 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5271 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5272 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5273 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5274 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5275 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5276 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5277 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5278 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5280 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5282 return MEDCouplingFieldInt::New(type,td);
5285 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5287 return MEDCouplingFieldInt::New(ft,td);
5290 std::string __str__() const throw(INTERP_KERNEL::Exception)
5292 return self->simpleRepr();
5295 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5297 std::ostringstream oss;
5298 self->reprQuickOverview(oss);
5302 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5304 DataArrayInt *ret=self->getArray();
5310 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5313 double tmp0=self->getTime(tmp1,tmp2);
5314 PyObject *res = PyList_New(3);
5315 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5316 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5317 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5323 class MEDCouplingDefinitionTime
5326 MEDCouplingDefinitionTime();
5327 void assign(const MEDCouplingDefinitionTime& other);
5328 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5329 double getTimeResolution() const;
5330 std::vector<double> getHotSpotsTime() const;
5333 std::string __str__() const throw(INTERP_KERNEL::Exception)
5335 std::ostringstream oss;
5336 self->appendRepr(oss);
5340 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5342 int meshId,arrId,arrIdInField,fieldId;
5343 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5344 PyObject *res=PyList_New(4);
5345 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5346 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5347 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5348 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5352 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5354 int meshId,arrId,arrIdInField,fieldId;
5355 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5356 PyObject *res=PyList_New(4);
5357 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5358 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5359 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5360 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5366 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5369 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5370 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5374 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5376 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5377 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5379 std::vector<MEDCouplingFieldDouble *> fs(sz);
5380 for(int i=0;i<sz;i++)
5381 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5382 return MEDCouplingFieldOverTime::New(fs);
5384 std::string __str__() const throw(INTERP_KERNEL::Exception)
5386 return self->simpleRepr();
5388 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5390 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5391 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5393 std::vector<MEDCouplingFieldDouble *> fs(sz);
5394 for(int i=0;i<sz;i++)
5395 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5396 return MEDCouplingFieldOverTime::New(fs);
5401 class MEDCouplingCartesianAMRMesh;
5403 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5406 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5407 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5408 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5411 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5413 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5421 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5424 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5425 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5426 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5429 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5431 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5432 return convertFromVectorPairInt(ret);
5435 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5437 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5438 return convertFromVectorPairInt(ret);
5441 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5443 std::vector< std::pair<int,int> > inp;
5444 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5445 self->addPatch(inp,factors);
5448 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5450 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5452 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5453 if(patchId==mesh->getNumberOfPatches())
5455 std::ostringstream oss;
5456 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5457 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5460 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5466 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5468 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5470 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5471 mesh->removePatch(patchId);
5474 int __len__() const throw(INTERP_KERNEL::Exception)
5476 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5478 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5479 return mesh->getNumberOfPatches();
5484 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5488 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5491 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5492 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5493 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5494 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5495 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5496 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5497 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5498 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5499 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5500 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5501 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5502 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5503 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5505 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5506 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5507 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5508 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5509 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5510 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5511 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5512 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5513 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5514 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5515 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5516 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5517 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5518 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5519 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5520 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5521 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5522 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5523 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5524 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5527 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5529 std::vector< std::pair<int,int> > inp;
5530 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5531 self->addPatch(inp,factors);
5534 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5536 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5538 PyObject *ret = PyList_New(sz);
5539 for(int i=0;i<sz;i++)
5541 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5544 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5549 // agy : don't know why typemap fails here ??? let it in the extend section
5550 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5552 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5555 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5557 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5558 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5564 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5566 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5567 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5573 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5575 std::vector<int> out1;
5576 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5577 PyObject *ret(PyTuple_New(2));
5578 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5579 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5583 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5585 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5587 PyObject *ret = PyList_New(sz);
5588 for(int i=0;i<sz;i++)
5589 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5593 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5595 std::vector<const DataArrayDouble *> inp;
5596 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5597 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5600 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5602 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5608 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5610 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5616 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5618 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5624 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5626 const MEDCouplingIMesh *ret(self->getImageMesh());
5629 return const_cast<MEDCouplingIMesh *>(ret);
5632 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5634 if(patchId==self->getNumberOfPatches())
5636 std::ostringstream oss;
5637 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5638 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5641 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5647 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5649 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5650 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5651 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5654 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5656 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5657 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5658 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5661 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5663 self->removePatch(patchId);
5666 int __len__() const throw(INTERP_KERNEL::Exception)
5668 return self->getNumberOfPatches();
5673 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5677 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5680 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5683 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5685 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5686 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5687 const int *nodeStrctPtr(0);
5688 const double *originPtr(0),*dxyzPtr(0);
5690 std::vector<int> bb0;
5691 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5694 std::vector<double> bb,bb2;
5696 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5697 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5699 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5702 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5704 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5705 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5706 std::vector< std::vector<int> > inp2;
5707 convertPyToVectorOfVectorOfInt(factors,inp2);
5708 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5711 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5713 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5716 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5718 return MEDCouplingCartesianAMRMesh::New(mesh);
5723 class MEDCouplingDataForGodFather : public RefCountObject
5726 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5727 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5728 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5729 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5730 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5731 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5732 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5733 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5734 virtual void alloc() throw(INTERP_KERNEL::Exception);
5735 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5738 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5740 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5748 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5751 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5752 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5753 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5754 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5755 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5756 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5757 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5758 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5759 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5762 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5764 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5765 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5766 MEDCouplingAMRAttribute *ret(0);
5769 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5770 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5772 catch(INTERP_KERNEL::Exception&)
5774 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5775 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5780 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5782 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5785 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5787 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5788 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5794 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5796 std::vector< std::vector<std::string> > compNamesCpp;
5797 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5798 self->spillInfoOnComponents(compNamesCpp);
5801 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5803 std::vector<int> inp0;
5804 if(!fillIntVector(nfs,inp0))
5805 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5806 std::size_t sz(inp0.size());
5807 std::vector<NatureOfField> inp00(sz);
5808 for(std::size_t i=0;i<sz;i++)
5809 inp00[i]=(NatureOfField)inp0[i];
5810 self->spillNatures(inp00);
5813 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5815 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5816 int sz((int)ret.size());
5817 PyObject *retPy(PyList_New(sz));
5818 for(int i=0;i<sz;i++)
5819 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5825 class DenseMatrix : public RefCountObject, public TimeLabel
5828 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5829 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5830 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5831 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5833 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5834 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5835 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5836 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5837 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5838 void transpose() throw(INTERP_KERNEL::Exception);
5840 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5841 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5842 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5845 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5847 return DenseMatrix::New(nbRows,nbCols);
5850 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5852 return DenseMatrix::New(array,nbRows,nbCols);
5855 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5858 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5859 PyObject *ret=PyTuple_New(2);
5860 PyObject *ret0Py=ret0?Py_True:Py_False;
5862 PyTuple_SetItem(ret,0,ret0Py);
5863 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5867 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5869 DataArrayDouble *ret(self->getData());
5875 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5877 return MEDCoupling::DenseMatrix::Add(self,other);
5880 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5882 return MEDCoupling::DenseMatrix::Substract(self,other);
5885 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5887 return MEDCoupling::DenseMatrix::Multiply(self,other);
5890 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5892 return MEDCoupling::DenseMatrix::Multiply(self,other);
5895 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5897 self->addEqual(other);
5898 Py_XINCREF(trueSelf);
5902 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5904 self->substractEqual(other);
5905 Py_XINCREF(trueSelf);
5909 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5911 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5918 class PartDefinition : public RefCountObject, public TimeLabel
5921 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5922 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5923 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5924 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5925 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5926 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5927 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5928 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5931 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5933 return (*self)+other;
5936 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5939 bool ret0(self->isEqual(other,ret1));
5940 PyObject *ret=PyTuple_New(2);
5941 PyObject *ret0Py=ret0?Py_True:Py_False;
5943 PyTuple_SetItem(ret,0,ret0Py);
5944 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5948 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5950 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5954 virtual ~PartDefinition();
5957 class DataArrayPartDefinition : public PartDefinition
5960 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5963 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5965 return DataArrayPartDefinition::New(listOfIds);
5968 std::string __str__() const throw(INTERP_KERNEL::Exception)
5970 return self->getRepr();
5973 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5975 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5976 oss << self->getRepr();
5981 virtual ~DataArrayPartDefinition();
5984 class SlicePartDefinition : public PartDefinition
5987 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5988 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5991 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5993 return SlicePartDefinition::New(start,stop,step);
5996 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5999 self->getSlice(a,b,c);
6000 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
6003 std::string __str__() const throw(INTERP_KERNEL::Exception)
6005 return self->getRepr();
6008 std::string __repr__() const throw(INTERP_KERNEL::Exception)
6010 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
6011 oss << self->getRepr();
6016 virtual ~SlicePartDefinition();
6022 __filename=os.environ.get('PYTHONSTARTUP')
6023 if __filename and os.path.isfile(__filename):
6024 execfile(__filename)