1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
301 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
305 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
314 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
316 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
317 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
318 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
319 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
320 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
321 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
322 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
323 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
324 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
325 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
326 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
327 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
328 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
329 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
330 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
331 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
332 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
333 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
334 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
338 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
339 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
341 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
342 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
349 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
354 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
355 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
356 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
364 %newobject MEDCoupling::MEDCouplingCMesh::New;
365 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
366 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
367 %newobject MEDCoupling::MEDCouplingIMesh::New;
368 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
369 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
370 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
371 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
372 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
373 %newobject MEDCoupling::MEDCouplingMultiFields::New;
374 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
375 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
393 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
394 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
402 %newobject MEDCoupling::DenseMatrix::New;
403 %newobject MEDCoupling::DenseMatrix::deepCopy;
404 %newobject MEDCoupling::DenseMatrix::shallowCpy;
405 %newobject MEDCoupling::DenseMatrix::getData;
406 %newobject MEDCoupling::DenseMatrix::matVecMult;
407 %newobject MEDCoupling::DenseMatrix::MatVecMult;
408 %newobject MEDCoupling::DenseMatrix::__add__;
409 %newobject MEDCoupling::DenseMatrix::__sub__;
410 %newobject MEDCoupling::DenseMatrix::__mul__;
411 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
412 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
414 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
415 %feature("unref") MEDCouplingMesh "$this->decrRef();"
416 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
417 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
418 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
419 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
420 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
421 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
424 %feature("unref") MEDCouplingField "$this->decrRef();"
425 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
426 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
427 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
428 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
429 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
431 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
433 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
434 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
435 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
436 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
437 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
438 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
440 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
441 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
442 %feature("unref") DenseMatrix "$this->decrRef();"
443 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
445 %rename(assign) *::operator=;
446 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
447 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
448 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
449 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
453 %rename (InterpKernelException) INTERP_KERNEL::Exception;
455 %include "MEDCouplingRefCountObject.i"
456 %include "MEDCouplingMemArray.i"
458 namespace INTERP_KERNEL
461 * \class BoxSplittingOptions
462 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
464 class BoxSplittingOptions
467 BoxSplittingOptions();
468 void init() throw(INTERP_KERNEL::Exception);
469 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
470 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
471 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
472 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
473 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
474 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
475 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
476 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
477 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
478 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
479 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
480 std::string printOptions() const throw(INTERP_KERNEL::Exception);
483 std::string __str__() const throw(INTERP_KERNEL::Exception)
485 return self->printOptions();
491 namespace MEDCoupling
507 CONST_ON_TIME_INTERVAL = 7
508 } TypeOfTimeDiscretization;
516 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
517 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
519 } MEDCouplingMeshType;
522 class DataArrayDouble;
523 class MEDCouplingUMesh;
524 class MEDCouplingCMesh;
525 class MEDCouplingFieldDouble;
527 %extend RefCountObject
529 std::string getHiddenCppPointer() const
531 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
536 %extend MEDCouplingGaussLocalization
538 std::string __str__() const throw(INTERP_KERNEL::Exception)
540 return self->getStringRepr();
543 std::string __repr__() const throw(INTERP_KERNEL::Exception)
545 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
546 oss << self->getStringRepr();
553 class MEDCouplingMesh : public RefCountObject, public TimeLabel
556 void setName(const std::string& name);
557 std::string getName() const;
558 void setDescription(const std::string& descr);
559 std::string getDescription() const;
560 void setTime(double val, int iteration, int order);
561 void setTimeUnit(const std::string& unit);
562 std::string getTimeUnit() const;
563 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
564 bool isStructured() const throw(INTERP_KERNEL::Exception);
565 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
566 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
567 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
568 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
569 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
570 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
571 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
572 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
573 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
574 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
575 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
576 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
577 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
586 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
587 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
588 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
589 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
590 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
591 virtual std::string getVTKFileExtension() const;
592 std::string getVTKFileNameOf(const std::string& fileName) const;
594 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
596 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
602 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
603 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
604 virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
605 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
606 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
607 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
608 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 std::string __str__() const throw(INTERP_KERNEL::Exception)
616 return self->simpleRepr();
619 PyObject *getTime() throw(INTERP_KERNEL::Exception)
622 double tmp0=self->getTime(tmp1,tmp2);
623 PyObject *res = PyList_New(3);
624 PyList_SetItem(res,0,SWIG_From_double(tmp0));
625 PyList_SetItem(res,1,SWIG_From_int(tmp1));
626 PyList_SetItem(res,2,SWIG_From_int(tmp2));
630 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
632 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
633 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
639 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
643 DataArrayDoubleTuple *aa;
644 std::vector<double> bb;
646 int spaceDim=self->getSpaceDimension();
647 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
648 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
649 return self->getCellContainingPoint(pos,eps);
652 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
656 DataArrayDoubleTuple *aa;
657 std::vector<double> bb;
659 int spaceDim=self->getSpaceDimension();
660 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
661 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
662 MCAuto<DataArrayInt> elts,eltsIndex;
663 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
664 PyObject *ret=PyTuple_New(2);
665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
666 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
670 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
672 MCAuto<DataArrayInt> elts,eltsIndex;
673 int spaceDim=self->getSpaceDimension();
675 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
676 if (!SWIG_IsOK(res1))
679 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
680 int nbOfPoints=size/spaceDim;
683 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
685 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
689 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
691 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
692 da2->checkAllocated();
693 int size=da2->getNumberOfTuples();
694 int nbOfCompo=da2->getNumberOfComponents();
695 if(nbOfCompo!=spaceDim)
697 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
699 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
701 PyObject *ret=PyTuple_New(2);
702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
703 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
707 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
711 DataArrayDoubleTuple *aa;
712 std::vector<double> bb;
714 int spaceDim=self->getSpaceDimension();
715 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
716 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
717 std::vector<int> elts;
718 self->getCellsContainingPoint(pos,eps,elts);
719 DataArrayInt *ret=DataArrayInt::New();
720 ret->alloc((int)elts.size(),1);
721 std::copy(elts.begin(),elts.end(),ret->getPointer());
722 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
725 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
727 MCAuto<DataArrayInt> d0=DataArrayInt::New();
728 MCAuto<DataArrayInt> d1=DataArrayInt::New();
729 self->getReverseNodalConnectivity(d0,d1);
730 PyObject *ret=PyTuple_New(2);
731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
732 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
736 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
739 int v0; std::vector<int> v1;
740 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
741 self->renumberCells(ids,check);
744 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
746 DataArrayInt *cellCor, *nodeCor;
747 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
748 PyObject *res = PyList_New(2);
749 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
750 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
754 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
756 DataArrayInt *cellCor=0,*nodeCor=0;
757 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
758 PyObject *res = PyList_New(2);
759 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
760 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
764 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
766 DataArrayInt *cellCor=0;
767 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
771 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
774 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
775 if (!SWIG_IsOK(res1))
778 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
779 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
783 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
785 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
786 da2->checkAllocated();
787 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
790 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
792 std::vector<int> conn;
793 self->getNodeIdsOfCell(cellId,conn);
794 return convertIntArrToPyList2(conn);
797 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
799 std::vector<double> coo;
800 self->getCoordinatesOfNode(nodeId,coo);
801 return convertDblArrToPyList2(coo);
804 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
808 DataArrayDoubleTuple *aa;
809 std::vector<double> bb;
811 int spaceDim=self->getSpaceDimension();
812 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
813 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
814 self->scale(pointPtr,factor);
817 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
819 int spaceDim=self->getSpaceDimension();
820 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
821 self->getBoundingBox(tmp);
822 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
826 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
829 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
830 PyObject *ret=PyTuple_New(2);
831 PyObject *ret0Py=ret0?Py_True:Py_False;
833 PyTuple_SetItem(ret,0,ret0Py);
834 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
838 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
840 int szArr,sw,iTypppArr;
841 std::vector<int> stdvecTyyppArr;
842 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
843 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
844 if(sw==3)//DataArrayInt
846 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
847 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
848 std::string name=argpt->getName();
850 ret->setName(name.c_str());
852 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
855 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
857 int szArr,sw,iTypppArr;
858 std::vector<int> stdvecTyyppArr;
860 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
861 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
862 if(sw==3)//DataArrayInt
864 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
865 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
866 std::string name=argpt->getName();
868 ret->setName(name.c_str());
871 PyObject *res = PyList_New(2);
872 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
873 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
874 PyList_SetItem(res,0,obj0);
875 PyList_SetItem(res,1,obj1);
879 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
883 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
884 PyObject *res = PyTuple_New(2);
885 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
888 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
890 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
891 PyTuple_SetItem(res,0,obj0);
892 PyTuple_SetItem(res,1,obj1);
896 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
898 std::vector<int> vals=self->getDistributionOfTypes();
900 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
901 PyObject *ret=PyList_New((int)vals.size()/3);
902 for(int j=0;j<(int)vals.size()/3;j++)
904 PyObject *ret1=PyList_New(3);
905 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
906 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
907 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
908 PyList_SetItem(ret,j,ret1);
913 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
915 std::vector<int> code;
916 std::vector<const DataArrayInt *> idsPerType;
917 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
918 convertPyToNewIntArr4(li,1,3,code);
919 return self->checkTypeConsistencyAndContig(code,idsPerType);
922 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
924 std::vector<int> code;
925 std::vector<DataArrayInt *> idsInPflPerType;
926 std::vector<DataArrayInt *> idsPerType;
927 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
928 PyObject *ret=PyTuple_New(3);
931 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
932 PyObject *ret0=PyList_New((int)code.size()/3);
933 for(int j=0;j<(int)code.size()/3;j++)
935 PyObject *ret00=PyList_New(3);
936 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
937 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
938 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
939 PyList_SetItem(ret0,j,ret00);
941 PyTuple_SetItem(ret,0,ret0);
943 PyObject *ret1=PyList_New(idsInPflPerType.size());
944 for(std::size_t j=0;j<idsInPflPerType.size();j++)
945 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
946 PyTuple_SetItem(ret,1,ret1);
947 int n=idsPerType.size();
948 PyObject *ret2=PyList_New(n);
950 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
951 PyTuple_SetItem(ret,2,ret2);
955 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
959 DataArrayDoubleTuple *aa;
960 std::vector<double> bb;
962 int spaceDim=self->getSpaceDimension();
963 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
964 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
965 self->translate(vectorPtr);
968 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
970 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
973 DataArrayDoubleTuple *aa;
974 std::vector<double> bb;
976 int spaceDim=self->getSpaceDimension();
977 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
978 self->rotate(centerPtr,0,alpha);
981 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
983 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
985 DataArrayDouble *a,*a2;
986 DataArrayDoubleTuple *aa,*aa2;
987 std::vector<double> bb,bb2;
989 int spaceDim=self->getSpaceDimension();
990 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
991 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
992 self->rotate(centerPtr,vectorPtr,alpha);
995 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
997 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
998 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
999 PyObject *res=PyList_New(result.size());
1000 for(int i=0;iL!=result.end(); i++, iL++)
1001 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1005 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1007 std::vector<double> a0;
1008 std::vector<int> a1;
1009 std::vector<std::string> a2;
1010 self->getTinySerializationInformation(a0,a1,a2);
1011 PyObject *ret(PyTuple_New(3));
1012 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1013 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1015 PyObject *ret2(PyList_New(sz));
1017 for(int i=0;i<sz;i++)
1018 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1020 PyTuple_SetItem(ret,2,ret2);
1024 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1026 DataArrayInt *a0Tmp(0);
1027 DataArrayDouble *a1Tmp(0);
1028 self->serialize(a0Tmp,a1Tmp);
1029 PyObject *ret(PyTuple_New(2));
1030 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1031 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1035 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1037 std::vector<std::string> littleStrings;
1038 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1041 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1042 {// put an empty dict in input to say to __new__ to call __init__...
1043 PyObject *ret(PyTuple_New(1));
1044 PyObject *ret0(PyDict_New());
1045 PyTuple_SetItem(ret,0,ret0);
1049 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1051 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1052 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1053 PyObject *ret(PyTuple_New(2));
1054 PyTuple_SetItem(ret,0,ret0);
1055 PyTuple_SetItem(ret,1,ret1);
1059 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1061 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1062 if(!PyTuple_Check(inp))
1063 throw INTERP_KERNEL::Exception(MSG);
1064 int sz(PyTuple_Size(inp));
1066 throw INTERP_KERNEL::Exception(MSG);
1067 PyObject *elt0(PyTuple_GetItem(inp,0));
1068 PyObject *elt1(PyTuple_GetItem(inp,1));
1069 std::vector<double> a0;
1070 std::vector<int> a1;
1071 std::vector<std::string> a2;
1072 DataArrayInt *b0(0);
1073 DataArrayDouble *b1(0);
1075 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1076 throw INTERP_KERNEL::Exception(MSG);
1077 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1079 fillArrayWithPyListDbl3(a0py,tmp,a0);
1080 convertPyToNewIntArr3(a1py,a1);
1081 fillStringVector(a2py,a2);
1084 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1085 throw INTERP_KERNEL::Exception(MSG);
1086 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1088 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1089 if(!SWIG_IsOK(status))
1090 throw INTERP_KERNEL::Exception(MSG);
1091 b0=reinterpret_cast<DataArrayInt *>(argp);
1092 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1093 if(!SWIG_IsOK(status))
1094 throw INTERP_KERNEL::Exception(MSG);
1095 b1=reinterpret_cast<DataArrayDouble *>(argp);
1097 // useless here to call resizeForUnserialization because arrays are well resized.
1098 self->unserialization(a0,a1,b0,b1,a2);
1101 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1103 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1104 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1105 return MEDCouplingMesh::MergeMeshes(tmp);
1111 //== MEDCouplingMesh End
1113 %include "NormalizedGeometricTypes"
1114 %include "MEDCouplingNatureOfFieldEnum"
1116 namespace MEDCoupling
1118 class MEDCouplingNatureOfField
1121 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1122 static std::string GetReprNoThrow(NatureOfField nat);
1123 static std::string GetAllPossibilitiesStr();
1127 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1128 // include "MEDCouplingTimeDiscretization.i"
1130 namespace MEDCoupling
1132 class MEDCouplingGaussLocalization
1135 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1136 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1137 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1138 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1139 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1140 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1141 int getDimension() const throw(INTERP_KERNEL::Exception);
1142 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1143 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1144 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1145 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1147 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1148 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1149 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1150 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1151 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1152 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1153 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1154 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1155 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1156 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1157 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1158 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1160 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1164 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1166 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1170 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1172 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1178 class MEDCouplingSkyLineArray
1181 void set( DataArrayInt* index, DataArrayInt* value );
1182 int getNumberOf() const;
1183 int getLength() const;
1184 DataArrayInt* getIndexArray() const;
1185 DataArrayInt* getValuesArray() const;
1188 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1190 return MEDCouplingSkyLineArray::New();
1193 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1195 return MEDCouplingSkyLineArray::New(index, value);
1198 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1200 return MEDCouplingSkyLineArray::New(index, value);
1203 std::string __str__() const throw(INTERP_KERNEL::Exception)
1205 return self->simpleRepr();
1212 %include "MEDCouplingFieldDiscretization.i"
1214 //== MEDCouplingPointSet
1216 namespace MEDCoupling
1218 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1221 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1222 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1223 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1224 void zipCoords() throw(INTERP_KERNEL::Exception);
1225 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1226 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1227 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1228 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1229 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1230 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1231 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1232 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1233 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1234 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1235 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1236 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1237 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1238 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1239 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1240 virtual DataArrayInt *findBoundaryNodes() const;
1241 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1242 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1243 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1244 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1245 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1246 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1247 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1248 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1249 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1252 std::string __str__() const throw(INTERP_KERNEL::Exception)
1254 return self->simpleRepr();
1257 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1260 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1261 PyObject *res = PyList_New(2);
1262 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1263 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1267 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1269 DataArrayInt *comm, *commIndex;
1270 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1271 PyObject *res = PyList_New(2);
1272 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1273 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1277 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1279 DataArrayDouble *ret1=self->getCoords();
1282 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1285 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1287 int szArr,sw,iTypppArr;
1288 std::vector<int> stdvecTyyppArr;
1289 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1290 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1291 if(sw==3)//DataArrayInt
1293 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1294 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1295 std::string name=argpt->getName();
1297 ret->setName(name.c_str());
1299 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1302 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1304 int szArr,sw,iTypppArr;
1305 std::vector<int> stdvecTyyppArr;
1306 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1307 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1308 if(sw==3)//DataArrayInt
1310 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1311 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1312 std::string name=argpt->getName();
1314 ret->setName(name.c_str());
1316 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1319 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1321 int szArr,sw,iTypppArr;
1322 std::vector<int> stdvecTyyppArr;
1323 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1324 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1325 if(sw==3)//DataArrayInt
1327 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1328 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1329 std::string name=argpt->getName();
1331 ret->setName(name.c_str());
1333 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1336 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1338 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1339 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1342 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1344 int szArr,sw,iTypppArr;
1345 std::vector<int> stdvecTyyppArr;
1346 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1347 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1348 if(sw==3)//DataArrayInt
1350 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1351 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1352 std::string name=argpt->getName();
1354 ret->setName(name.c_str());
1356 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1359 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1361 int szArr,sw,iTypppArr;
1362 std::vector<int> stdvecTyyppArr;
1363 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1364 self->renumberNodes(tmp,newNbOfNodes);
1367 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1369 int szArr,sw,iTypppArr;
1370 std::vector<int> stdvecTyyppArr;
1371 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1372 self->renumberNodesCenter(tmp,newNbOfNodes);
1375 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1377 int spaceDim=self->getSpaceDimension();
1379 DataArrayDouble *a,*a2;
1380 DataArrayDoubleTuple *aa,*aa2;
1381 std::vector<double> bb,bb2;
1383 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1384 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1385 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1386 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1387 std::vector<int> nodes;
1388 self->findNodesOnLine(p,v,eps,nodes);
1389 DataArrayInt *ret=DataArrayInt::New();
1390 ret->alloc((int)nodes.size(),1);
1391 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1392 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1394 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1396 int spaceDim=self->getSpaceDimension();
1398 DataArrayDouble *a,*a2;
1399 DataArrayDoubleTuple *aa,*aa2;
1400 std::vector<double> bb,bb2;
1402 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1403 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1404 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1405 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1406 std::vector<int> nodes;
1407 self->findNodesOnPlane(p,v,eps,nodes);
1408 DataArrayInt *ret=DataArrayInt::New();
1409 ret->alloc((int)nodes.size(),1);
1410 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1411 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1414 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1418 DataArrayDoubleTuple *aa;
1419 std::vector<double> bb;
1421 int spaceDim=self->getSpaceDimension();
1422 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1423 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1424 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1425 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1428 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1430 DataArrayInt *c=0,*cI=0;
1434 DataArrayDoubleTuple *aa;
1435 std::vector<double> bb;
1437 int spaceDim=self->getSpaceDimension();
1438 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1439 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1440 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1441 PyObject *ret=PyTuple_New(2);
1442 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1443 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1447 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1449 DataArrayInt *c=0,*cI=0;
1450 int spaceDim=self->getSpaceDimension();
1453 DataArrayDoubleTuple *aa;
1454 std::vector<double> bb;
1457 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1458 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1460 PyObject *ret=PyTuple_New(2);
1461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1466 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1470 DataArrayDoubleTuple *aa;
1471 std::vector<double> bb;
1473 int spaceDim=self->getSpaceDimension();
1474 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1475 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1477 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1478 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1481 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1485 std::vector<int> multiVal;
1486 std::pair<int, std::pair<int,int> > slic;
1487 MEDCoupling::DataArrayInt *daIntTyypp=0;
1488 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1492 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1494 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1496 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1498 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1502 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1504 DataArrayInt *v0=0,*v1=0;
1505 self->findCommonCells(compType,startCellId,v0,v1);
1506 PyObject *res = PyList_New(2);
1507 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1508 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1513 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1516 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1517 if (!SWIG_IsOK(res1))
1520 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1521 self->renumberNodesInConn(tmp);
1525 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1527 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1528 da2->checkAllocated();
1529 self->renumberNodesInConn(da2->getConstPointer());
1533 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1536 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1537 PyObject *ret=PyTuple_New(2);
1538 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1539 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1543 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1545 DataArrayInt *ret=0;
1547 int szArr,sw,iTypppArr;
1548 std::vector<int> stdvecTyyppArr;
1549 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1550 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1554 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1558 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1559 PyObject *res = PyList_New(3);
1560 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1561 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1562 PyList_SetItem(res,2,SWIG_From_int(ret2));
1566 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1570 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1571 PyObject *res = PyList_New(3);
1572 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1573 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1574 PyList_SetItem(res,2,SWIG_From_int(ret2));
1578 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1581 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1582 if (!SWIG_IsOK(res1))
1585 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1586 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1590 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1592 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1593 da2->checkAllocated();
1594 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1598 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1602 std::vector<int> multiVal;
1603 std::pair<int, std::pair<int,int> > slic;
1604 MEDCoupling::DataArrayInt *daIntTyypp=0;
1605 int nbc=self->getNumberOfCells();
1606 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1613 std::ostringstream oss;
1614 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1615 throw INTERP_KERNEL::Exception(oss.str().c_str());
1618 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1623 int tmp=nbc+singleVal;
1624 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1628 std::ostringstream oss;
1629 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1630 throw INTERP_KERNEL::Exception(oss.str().c_str());
1636 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1640 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1645 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1646 daIntTyypp->checkAllocated();
1647 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1650 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1654 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1657 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1658 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1659 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1660 for(int i=0;i<sz;i++)
1661 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1664 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1667 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1669 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1670 std::vector<double> val3;
1671 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1672 "Rotate2DAlg",2,true,nbNodes);
1674 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1675 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1678 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1681 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1682 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1683 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1684 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1685 for(int i=0;i<sz;i++)
1686 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1689 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1692 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1694 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1695 std::vector<double> val3;
1696 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1697 "Rotate3DAlg",3,true,nbNodes);
1699 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1700 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1701 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1706 //== MEDCouplingPointSet End
1708 class MEDCouplingUMeshCell
1711 INTERP_KERNEL::NormalizedCellType getType() const;
1714 std::string __str__() const throw(INTERP_KERNEL::Exception)
1716 return self->repr();
1719 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1722 const int *r=self->getAllConn(ret2);
1723 PyObject *ret=PyTuple_New(ret2);
1724 for(int i=0;i<ret2;i++)
1725 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1731 class MEDCouplingUMeshCellIterator
1738 MEDCouplingUMeshCell *ret=self->nextt();
1740 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1743 PyErr_SetString(PyExc_StopIteration,"No more data.");
1750 class MEDCouplingUMeshCellByTypeIterator
1753 ~MEDCouplingUMeshCellByTypeIterator();
1758 MEDCouplingUMeshCellEntry *ret=self->nextt();
1760 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1763 PyErr_SetString(PyExc_StopIteration,"No more data.");
1770 class MEDCouplingUMeshCellByTypeEntry
1773 ~MEDCouplingUMeshCellByTypeEntry();
1776 MEDCouplingUMeshCellByTypeIterator *__iter__()
1778 return self->iterator();
1783 class MEDCouplingUMeshCellEntry
1786 INTERP_KERNEL::NormalizedCellType getType() const;
1787 int getNumberOfElems() const;
1790 MEDCouplingUMeshCellIterator *__iter__()
1792 return self->iterator();
1797 //== MEDCouplingUMesh
1799 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1802 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1803 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1804 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1805 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1806 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1807 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1808 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1809 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1810 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1811 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1812 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1813 void computeTypes() throw(INTERP_KERNEL::Exception);
1814 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1815 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1817 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1818 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1819 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1820 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1821 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1822 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1823 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1824 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1825 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1826 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1827 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1828 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1829 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1830 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1831 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1832 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1833 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1834 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1835 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1836 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1837 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1838 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1839 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1840 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1841 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1842 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1843 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1844 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1845 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1846 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1847 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1848 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1849 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1850 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1851 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1852 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1853 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1854 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1855 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1856 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1857 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1858 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1859 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1860 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1861 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1862 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);
1863 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1864 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1865 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1866 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1867 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1869 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1871 return MEDCouplingUMesh::New();
1874 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1876 return MEDCouplingUMesh::New(meshName,meshDim);
1880 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1882 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1885 std::string __str__() const throw(INTERP_KERNEL::Exception)
1887 return self->simpleRepr();
1890 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1892 std::ostringstream oss;
1893 self->reprQuickOverview(oss);
1897 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1899 return self->cellIterator();
1902 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1904 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1908 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1910 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1911 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1912 PyObject *res=PyList_New(result.size());
1913 for(int i=0;iL!=result.end(); i++, iL++)
1914 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1918 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1922 std::vector<int> multiVal;
1923 std::pair<int, std::pair<int,int> > slic;
1924 MEDCoupling::DataArrayInt *daIntTyypp=0;
1925 int nbc=self->getNumberOfCells();
1926 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1933 std::ostringstream oss;
1934 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1935 throw INTERP_KERNEL::Exception(oss.str().c_str());
1939 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1946 int tmp=nbc+singleVal;
1947 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1952 std::ostringstream oss;
1953 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1954 throw INTERP_KERNEL::Exception(oss.str().c_str());
1960 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1966 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1967 daIntTyypp->checkAllocated();
1968 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1972 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1976 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1980 std::vector<int> multiVal;
1981 std::pair<int, std::pair<int,int> > slic;
1982 MEDCoupling::DataArrayInt *daIntTyypp=0;
1983 int nbc=self->getNumberOfCells();
1984 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1991 std::ostringstream oss;
1992 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1993 throw INTERP_KERNEL::Exception(oss.str().c_str());
1997 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2004 int tmp=nbc+singleVal;
2005 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2010 std::ostringstream oss;
2011 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2012 throw INTERP_KERNEL::Exception(oss.str().c_str());
2018 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2023 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2029 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2030 daIntTyypp->checkAllocated();
2031 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2035 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2039 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2041 int szArr,sw,iTypppArr;
2042 std::vector<int> stdvecTyyppArr;
2043 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2046 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2047 throw INTERP_KERNEL::Exception(oss.str().c_str());
2049 self->insertNextCell(type,size,tmp);
2052 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2054 int szArr,sw,iTypppArr;
2055 std::vector<int> stdvecTyyppArr;
2056 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2057 self->insertNextCell(type,szArr,tmp);
2060 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2062 DataArrayInt *ret=self->getNodalConnectivity();
2067 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2069 DataArrayInt *ret=self->getNodalConnectivityIndex();
2075 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2077 int szArr,sw,iTypppArr;
2078 std::vector<int> stdvecTyyppArr;
2079 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2080 int nbOfDepthPeelingPerformed=0;
2081 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2082 PyObject *res=PyTuple_New(2);
2083 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2084 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2088 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2090 DataArrayInt *v0=0,*v1=0;
2091 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2092 PyObject *res = PyList_New(2);
2093 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2094 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2098 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2102 DataArrayDoubleTuple *aa;
2103 std::vector<double> bb;
2105 int nbOfCompo=self->getSpaceDimension();
2106 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2109 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2110 PyObject *ret=PyTuple_New(2);
2111 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2112 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2116 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2118 DataArrayInt *ret1=0;
2119 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2120 PyObject *ret=PyTuple_New(2);
2121 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2122 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2126 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2129 DataArrayInt *ret1(0);
2130 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2131 PyObject *ret=PyTuple_New(3);
2132 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2133 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2134 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2138 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2140 std::vector<int> cells;
2141 self->checkButterflyCells(cells,eps);
2142 DataArrayInt *ret=DataArrayInt::New();
2143 ret->alloc((int)cells.size(),1);
2144 std::copy(cells.begin(),cells.end(),ret->getPointer());
2145 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2148 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2150 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2152 PyObject *ret = PyList_New(sz);
2153 for(int i=0;i<sz;i++)
2154 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2158 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2160 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2161 int sz=retCpp.size();
2162 PyObject *ret=PyList_New(sz);
2163 for(int i=0;i<sz;i++)
2164 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2170 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2171 int sz=retCpp.size();
2172 PyObject *ret=PyList_New(sz);
2173 for(int i=0;i<sz;i++)
2174 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2181 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2182 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2183 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2186 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2189 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2190 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2194 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2197 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2198 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2202 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2205 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2206 PyObject *ret=PyTuple_New(3);
2207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2215 DataArrayInt *tmp0=0,*tmp1=0;
2216 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2217 PyObject *ret=PyTuple_New(2);
2218 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2219 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2227 std::vector<int> multiVal;
2228 std::pair<int, std::pair<int,int> > slic;
2229 MEDCoupling::DataArrayInt *daIntTyypp=0;
2230 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2234 return self->duplicateNodes(&singleVal,&singleVal+1);
2236 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2238 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2240 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2244 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2248 std::vector<int> multiVal;
2249 std::pair<int, std::pair<int,int> > slic;
2250 MEDCoupling::DataArrayInt *daIntTyypp=0;
2251 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2255 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2257 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2259 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2261 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2265 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2268 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2269 DataArrayInt *tmp0,*tmp1=0;
2270 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2271 PyObject *ret=PyTuple_New(2);
2272 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2273 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2277 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2279 DataArrayInt *ret0=0,*ret1=0;
2280 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2281 PyObject *ret=PyTuple_New(2);
2282 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2283 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2287 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2289 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2290 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2291 DataArrayInt *ret1=0,*ret2=0;
2292 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2293 PyObject *ret=PyTuple_New(3);
2294 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2295 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2296 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2300 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2302 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2303 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2304 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2305 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2308 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2311 std::vector<const MEDCouplingUMesh *> meshes;
2312 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2313 std::vector<DataArrayInt *> corr;
2314 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2316 PyObject *ret1=PyList_New(sz);
2317 for(int i=0;i<sz;i++)
2318 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2319 PyObject *ret=PyList_New(2);
2320 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2321 PyList_SetItem(ret,1,ret1);
2325 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2327 std::vector<MEDCouplingUMesh *> meshes;
2328 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2329 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2332 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2334 std::vector<MEDCouplingUMesh *> meshes;
2335 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2336 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2339 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2343 std::vector<int> multiVal;
2344 std::pair<int, std::pair<int,int> > slic;
2345 MEDCoupling::DataArrayInt *daIntTyypp=0;
2347 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2348 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2352 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2354 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2356 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2358 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2362 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2364 DataArrayInt *arrOut=0,*arrIndexOut=0;
2367 std::vector<int> multiVal;
2368 std::pair<int, std::pair<int,int> > slic;
2369 MEDCoupling::DataArrayInt *daIntTyypp=0;
2371 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2372 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2377 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2382 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2387 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2391 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2393 PyObject *ret=PyTuple_New(2);
2394 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2395 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2399 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2401 DataArrayInt *arrOut=0,*arrIndexOut=0;
2402 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2403 PyObject *ret=PyTuple_New(2);
2404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2409 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2411 if(!PySlice_Check(slic))
2412 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2413 Py_ssize_t strt=2,stp=2,step=2;
2414 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2416 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2417 arrIndxIn->checkAllocated();
2418 if(arrIndxIn->getNumberOfComponents()!=1)
2419 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2420 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2421 DataArrayInt *arrOut=0,*arrIndexOut=0;
2422 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2423 PyObject *ret=PyTuple_New(2);
2424 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2425 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2429 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2430 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2431 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2433 DataArrayInt *arrOut=0,*arrIndexOut=0;
2436 std::vector<int> multiVal;
2437 std::pair<int, std::pair<int,int> > slic;
2438 MEDCoupling::DataArrayInt *daIntTyypp=0;
2440 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2441 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2446 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2451 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2456 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2460 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2462 PyObject *ret=PyTuple_New(2);
2463 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2464 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2468 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2469 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2473 std::vector<int> multiVal;
2474 std::pair<int, std::pair<int,int> > slic;
2475 MEDCoupling::DataArrayInt *daIntTyypp=0;
2477 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2478 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2483 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2488 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2493 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2497 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2501 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const 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::are2DCellsNotCorrectlyOriented : ";
2510 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2512 std::vector<int> cells;
2513 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2514 DataArrayInt *ret=DataArrayInt::New();
2515 ret->alloc((int)cells.size(),1);
2516 std::copy(cells.begin(),cells.end(),ret->getPointer());
2517 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2520 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2524 DataArrayDoubleTuple *aa;
2525 std::vector<double> bb;
2527 int spaceDim=self->getSpaceDimension();
2528 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2529 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2530 self->orientCorrectly2DCells(v,polyOnly);
2533 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2535 std::vector<int> cells;
2536 self->arePolyhedronsNotCorrectlyOriented(cells);
2537 DataArrayInt *ret=DataArrayInt::New();
2538 ret->alloc((int)cells.size(),1);
2539 std::copy(cells.begin(),cells.end(),ret->getPointer());
2540 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2543 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2547 self->getFastAveragePlaneOfThis(vec,pos);
2549 std::copy(vec,vec+3,vals);
2550 std::copy(pos,pos+3,vals+3);
2551 return convertDblArrToPyListOfTuple(vals,3,2);
2554 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2556 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2557 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2558 return MEDCouplingUMesh::MergeUMeshes(tmp);
2561 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2564 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2565 PyObject *ret=PyTuple_New(2);
2566 PyObject *ret0Py=ret0?Py_True:Py_False;
2568 PyTuple_SetItem(ret,0,ret0Py);
2569 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2573 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2576 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2577 PyObject *ret=PyTuple_New(2);
2578 PyObject *ret0Py=ret0?Py_True:Py_False;
2580 PyTuple_SetItem(ret,0,ret0Py);
2581 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2585 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2587 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2588 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2589 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2590 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2591 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2592 PyObject *ret=PyTuple_New(5);
2593 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2596 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2603 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2604 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2605 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2606 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2607 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2608 PyObject *ret=PyTuple_New(5);
2609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2612 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2613 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2617 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2619 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2620 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2621 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2622 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2623 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2624 PyObject *ret=PyTuple_New(5);
2625 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2627 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2628 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2629 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2633 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2635 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2636 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2637 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2638 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2639 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2640 PyObject *ret=PyTuple_New(5);
2641 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2642 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2644 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2649 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2651 DataArrayInt *neighbors=0,*neighborsIdx=0;
2652 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2653 PyObject *ret=PyTuple_New(2);
2654 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2659 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2661 DataArrayInt *neighbors=0,*neighborsIdx=0;
2662 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2663 PyObject *ret=PyTuple_New(2);
2664 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2669 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2671 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2672 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2673 PyObject *ret=PyTuple_New(2);
2674 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2679 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2681 DataArrayInt *neighbors=0,*neighborsIdx=0;
2682 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2683 PyObject *ret=PyTuple_New(2);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2691 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2692 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2693 DataArrayInt *d2,*d3,*d4,*dd5;
2694 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2695 PyObject *ret=PyTuple_New(7);
2696 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2697 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2698 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2709 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2710 da->checkAllocated();
2711 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2714 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2717 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2718 da->checkAllocated();
2719 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2722 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2725 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2726 da->checkAllocated();
2727 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2730 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2733 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2734 da->checkAllocated();
2735 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2736 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2737 PyObject *res = PyList_New(result.size());
2738 for (int i=0;iL!=result.end(); i++, iL++)
2739 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2743 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2746 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2747 da->checkAllocated();
2748 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2749 ret->setName(da->getName().c_str());
2753 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2755 DataArrayInt *cellNb1=0,*cellNb2=0;
2756 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2757 PyObject *ret=PyTuple_New(3);
2758 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2760 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2764 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2766 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2767 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2768 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2769 PyObject *ret(PyTuple_New(4));
2770 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2771 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2772 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2773 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2777 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2779 int spaceDim=self->getSpaceDimension();
2781 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2783 DataArrayDouble *a,*a2;
2784 DataArrayDoubleTuple *aa,*aa2;
2785 std::vector<double> bb,bb2;
2787 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2788 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2789 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2790 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2792 DataArrayInt *cellIds=0;
2793 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2794 PyObject *ret=PyTuple_New(2);
2795 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2796 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2800 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2802 int spaceDim=self->getSpaceDimension();
2804 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2806 DataArrayDouble *a,*a2;
2807 DataArrayDoubleTuple *aa,*aa2;
2808 std::vector<double> bb,bb2;
2810 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2811 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2812 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2813 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2815 DataArrayInt *cellIds=0;
2816 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2817 PyObject *ret=PyTuple_New(2);
2818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2826 DataArrayDouble *a,*a2;
2827 DataArrayDoubleTuple *aa,*aa2;
2828 std::vector<double> bb,bb2;
2830 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2831 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2832 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2833 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2834 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2838 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2840 int spaceDim=self->getSpaceDimension();
2842 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2844 DataArrayDouble *a,*a2;
2845 DataArrayDoubleTuple *aa,*aa2;
2846 std::vector<double> bb,bb2;
2848 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2849 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2850 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2851 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2852 return self->getCellIdsCrossingPlane(orig,vect,eps);
2855 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2859 std::vector<int> pos2;
2860 DataArrayInt *pos3=0;
2861 DataArrayIntTuple *pos4=0;
2862 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2867 self->convertToPolyTypes(&pos1,&pos1+1);
2874 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2879 self->convertToPolyTypes(pos3->begin(),pos3->end());
2883 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2887 void convertAllToPoly();
2888 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2889 bool unPolyze() throw(INTERP_KERNEL::Exception);
2890 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2891 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2892 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2895 //== MEDCouplingUMesh End
2897 //== MEDCouplingMappedExtrudedMesh
2899 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2902 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2903 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2904 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2905 int get2DCellIdForExtrusion() const;
2907 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2909 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2912 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2914 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2917 MEDCouplingMappedExtrudedMesh()
2919 return MEDCouplingMappedExtrudedMesh::New();
2922 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2924 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2927 std::string __str__() const throw(INTERP_KERNEL::Exception)
2929 return self->simpleRepr();
2932 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2934 std::ostringstream oss;
2935 self->reprQuickOverview(oss);
2939 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2941 MEDCouplingUMesh *ret=self->getMesh2D();
2944 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2946 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2948 MEDCouplingUMesh *ret=self->getMesh1D();
2951 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2953 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2955 DataArrayInt *ret=self->getMesh3DIds();
2958 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2963 //== MEDCouplingMappedExtrudedMesh End
2965 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2968 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2969 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2970 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2971 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2972 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2973 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2976 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2978 int szArr,sw,iTypppArr;
2979 std::vector<int> stdvecTyyppArr;
2980 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2981 self->insertNextCell(tmp,tmp+szArr);
2984 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2986 DataArrayInt *ret=self->getNodalConnectivity();
2987 if(ret) ret->incrRef();
2991 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2993 std::vector< const MEDCoupling1GTUMesh *> parts;
2994 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2995 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3000 //== MEDCoupling1SGTUMesh
3002 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3005 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3006 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3007 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3008 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3009 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3010 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3011 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3012 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3013 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3016 MEDCoupling1SGTUMesh()
3018 return MEDCoupling1SGTUMesh::New();
3021 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3023 return MEDCoupling1SGTUMesh::New(name,type);
3026 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3028 return MEDCoupling1SGTUMesh::New(m);
3031 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3033 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3036 std::string __str__() const throw(INTERP_KERNEL::Exception)
3038 return self->simpleRepr();
3041 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3043 std::ostringstream oss;
3044 self->reprQuickOverview(oss);
3048 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3050 DataArrayInt *cellPerm(0),*nodePerm(0);
3051 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3052 PyObject *ret(PyTuple_New(3));
3053 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3054 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3055 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3059 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3061 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3062 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3063 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3066 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3068 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3069 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3070 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3075 //== MEDCoupling1SGTUMesh End
3077 //== MEDCoupling1DGTUMesh
3079 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3082 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3083 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3084 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3085 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3086 bool isPacked() const throw(INTERP_KERNEL::Exception);
3089 MEDCoupling1DGTUMesh()
3091 return MEDCoupling1DGTUMesh::New();
3093 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3095 return MEDCoupling1DGTUMesh::New(name,type);
3098 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3100 return MEDCoupling1DGTUMesh::New(m);
3103 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3105 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3108 std::string __str__() const throw(INTERP_KERNEL::Exception)
3110 return self->simpleRepr();
3113 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3115 std::ostringstream oss;
3116 self->reprQuickOverview(oss);
3120 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3122 DataArrayInt *ret=self->getNodalConnectivityIndex();
3123 if(ret) ret->incrRef();
3127 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3129 DataArrayInt *ret1=0,*ret2=0;
3130 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3131 PyObject *ret0Py=ret0?Py_True:Py_False;
3133 PyObject *ret=PyTuple_New(3);
3134 PyTuple_SetItem(ret,0,ret0Py);
3135 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3136 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3140 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3143 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3144 PyObject *ret=PyTuple_New(2);
3145 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3147 PyTuple_SetItem(ret,1,ret1Py);
3151 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3153 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3154 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3155 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3158 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3160 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3161 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3162 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3165 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3167 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3168 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3169 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3174 //== MEDCoupling1DGTUMeshEnd
3176 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3179 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3180 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3181 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3182 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3183 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3184 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3185 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3186 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3187 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3188 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3189 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3190 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3191 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3192 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3193 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3196 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3198 int tmpp1=-1,tmpp2=-1;
3199 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3200 std::vector< std::pair<int,int> > inp;
3204 for(int i=0;i<tmpp1;i++)
3205 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3210 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3211 inp.resize(tmpp1/2);
3212 for(int i=0;i<tmpp1/2;i++)
3213 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3216 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3217 return self->buildStructuredSubPart(inp);
3220 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3222 std::vector< std::pair<int,int> > inp;
3223 convertPyToVectorPairInt(part,inp);
3225 int szArr,sw,iTypppArr;
3226 std::vector<int> stdvecTyyppArr;
3227 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3228 std::vector<int> tmp5(tmp4,tmp4+szArr);
3230 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3233 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3235 std::vector< std::pair<int,int> > inp;
3236 convertPyToVectorPairInt(part,inp);
3237 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3240 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3242 std::vector< std::pair<int,int> > inp;
3243 convertPyToVectorPairInt(part,inp);
3244 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3247 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3249 std::vector< std::pair<int,int> > inp;
3250 convertPyToVectorPairInt(part,inp);
3251 std::vector<int> stWithGhost;
3252 std::vector< std::pair<int,int> > partWithGhost;
3253 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3254 PyObject *ret(PyTuple_New(2));
3255 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3256 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3260 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3262 std::vector< std::pair<int,int> > inp;
3263 convertPyToVectorPairInt(partCompactFormat,inp);
3264 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3267 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3269 std::vector< std::pair<int,int> > inp;
3270 convertPyToVectorPairInt(partCompactFormat,inp);
3271 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3274 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3276 std::vector< std::pair<int,int> > inp;
3277 convertPyToVectorPairInt(part,inp);
3278 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3281 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3283 int szArr,sw,iTypppArr;
3284 std::vector<int> stdvecTyyppArr;
3285 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3286 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3289 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3291 int szArr,sw,iTypppArr;
3292 std::vector<int> stdvecTyyppArr;
3293 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3294 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3297 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3299 std::vector< std::pair<int,int> > inp;
3300 convertPyToVectorPairInt(partCompactFormat,inp);
3301 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3304 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3306 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3307 PyObject *retPy=PyList_New(ret.size());
3308 for(std::size_t i=0;i<ret.size();i++)
3310 PyObject *tmp=PyTuple_New(2);
3311 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3312 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3313 PyList_SetItem(retPy,i,tmp);
3318 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3320 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3321 convertPyToVectorPairInt(r1,r1Cpp);
3322 convertPyToVectorPairInt(r2,r2Cpp);
3323 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3324 PyObject *retPy=PyList_New(ret.size());
3325 for(std::size_t i=0;i<ret.size();i++)
3327 PyObject *tmp=PyTuple_New(2);
3328 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3329 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3330 PyList_SetItem(retPy,i,tmp);
3335 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3337 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3338 convertPyToVectorPairInt(r1,r1Cpp);
3339 convertPyToVectorPairInt(r2,r2Cpp);
3340 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3343 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3345 int szArr,sw,iTypppArr;
3346 std::vector<int> stdvecTyyppArr;
3347 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3348 int szArr2,sw2,iTypppArr2;
3349 std::vector<int> stdvecTyyppArr2;
3350 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3351 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3352 std::vector< std::pair<int,int> > partCompactFormat;
3353 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3354 PyObject *ret=PyTuple_New(2);
3355 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3356 PyTuple_SetItem(ret,0,ret0Py);
3357 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3358 for(std::size_t i=0;i<partCompactFormat.size();i++)
3360 PyObject *tmp4=PyTuple_New(2);
3361 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3362 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3363 PyList_SetItem(ret1Py,i,tmp4);
3365 PyTuple_SetItem(ret,1,ret1Py);
3369 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3371 std::vector< std::pair<int,int> > param0,param1,ret;
3372 convertPyToVectorPairInt(bigInAbs,param0);
3373 convertPyToVectorPairInt(partOfBigInAbs,param1);
3374 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3375 PyObject *retPy(PyList_New(ret.size()));
3376 for(std::size_t i=0;i<ret.size();i++)
3378 PyObject *tmp(PyTuple_New(2));
3379 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3380 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3381 PyList_SetItem(retPy,i,tmp);
3386 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3388 std::vector< std::pair<int,int> > param0;
3389 convertPyToVectorPairInt(part,param0);
3390 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3391 PyObject *retPy(PyList_New(ret.size()));
3392 for(std::size_t i=0;i<ret.size();i++)
3394 PyObject *tmp(PyTuple_New(2));
3395 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3396 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3397 PyList_SetItem(retPy,i,tmp);
3402 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3404 std::vector< std::pair<int,int> > param0,param1;
3405 convertPyToVectorPairInt(startingFrom,param0);
3406 convertPyToVectorPairInt(goingTo,param1);
3407 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3410 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3412 std::vector< std::pair<int,int> > param0,param1,ret;
3413 convertPyToVectorPairInt(bigInAbs,param0);
3414 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3415 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3416 PyObject *retPy(PyList_New(ret.size()));
3417 for(std::size_t i=0;i<ret.size();i++)
3419 PyObject *tmp(PyTuple_New(2));
3420 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3421 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3422 PyList_SetItem(retPy,i,tmp);
3429 class MEDCouplingCurveLinearMesh;
3431 //== MEDCouplingCMesh
3433 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3436 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3437 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3438 void setCoords(const DataArrayDouble *coordsX,
3439 const DataArrayDouble *coordsY=0,
3440 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3441 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3442 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3444 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3446 return MEDCouplingCMesh::New();
3448 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3450 return MEDCouplingCMesh::New(meshName);
3453 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3455 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3457 std::string __str__() const throw(INTERP_KERNEL::Exception)
3459 return self->simpleRepr();
3461 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3463 std::ostringstream oss;
3464 self->reprQuickOverview(oss);
3467 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3469 DataArrayDouble *ret=self->getCoordsAt(i);
3477 //== MEDCouplingCMesh End
3479 //== MEDCouplingCurveLinearMesh
3481 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3484 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3485 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3486 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3488 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3490 return MEDCouplingCurveLinearMesh::New();
3492 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3494 return MEDCouplingCurveLinearMesh::New(meshName);
3496 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3498 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3500 std::string __str__() const throw(INTERP_KERNEL::Exception)
3502 return self->simpleRepr();
3504 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3506 std::ostringstream oss;
3507 self->reprQuickOverview(oss);
3510 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3512 DataArrayDouble *ret=self->getCoords();
3517 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3519 int szArr,sw,iTypppArr;
3520 std::vector<int> stdvecTyyppArr;
3521 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3522 self->setNodeGridStructure(tmp,tmp+szArr);
3527 //== MEDCouplingCurveLinearMesh End
3529 //== MEDCouplingIMesh
3531 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3534 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3536 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3537 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3538 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3539 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3540 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3541 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3542 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3543 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3544 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3545 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3546 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3551 return MEDCouplingIMesh::New();
3553 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3555 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3556 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3557 const int *nodeStrctPtr(0);
3558 const double *originPtr(0),*dxyzPtr(0);
3560 std::vector<int> bb0;
3561 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3564 std::vector<double> bb,bb2;
3566 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3567 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3569 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3572 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3574 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3577 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3579 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3582 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3585 std::vector<int> bb0;
3586 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3587 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3590 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3592 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3595 DataArrayDoubleTuple *aa;
3596 std::vector<double> bb;
3598 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3599 self->setOrigin(originPtr,originPtr+nbTuples);
3602 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3604 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3607 DataArrayDoubleTuple *aa;
3608 std::vector<double> bb;
3610 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3611 self->setDXYZ(originPtr,originPtr+nbTuples);
3614 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3616 std::vector< std::pair<int,int> > inp;
3617 convertPyToVectorPairInt(fineLocInCoarse,inp);
3618 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3621 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)
3623 std::vector< std::pair<int,int> > inp;
3624 convertPyToVectorPairInt(fineLocInCoarse,inp);
3625 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3628 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3630 std::vector< std::pair<int,int> > inp;
3631 convertPyToVectorPairInt(fineLocInCoarse,inp);
3632 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3635 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)
3637 std::vector< std::pair<int,int> > inp;
3638 convertPyToVectorPairInt(fineLocInCoarse,inp);
3639 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3642 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)
3644 std::vector< std::pair<int,int> > inp;
3645 convertPyToVectorPairInt(fineLocInCoarse,inp);
3646 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3649 std::string __str__() const throw(INTERP_KERNEL::Exception)
3651 return self->simpleRepr();
3653 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3655 std::ostringstream oss;
3656 self->reprQuickOverview(oss);
3662 //== MEDCouplingIMesh End
3666 namespace MEDCoupling
3668 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3671 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3672 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3673 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3674 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3675 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3676 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3677 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3678 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3679 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3680 std::string getName() const throw(INTERP_KERNEL::Exception);
3681 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3682 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3683 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3684 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3685 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3686 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3687 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3688 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3689 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3690 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3691 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3692 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3693 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3694 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3695 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3696 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3698 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3700 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3703 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3706 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3708 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3711 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3714 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3716 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3717 return convertIntArrToPyList3(ret);
3720 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3723 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3724 PyObject *ret=PyTuple_New(2);
3725 PyObject *ret0Py=ret0?Py_True:Py_False;
3727 PyTuple_SetItem(ret,0,ret0Py);
3728 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3732 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3734 DataArrayInt *ret1=0;
3735 MEDCouplingMesh *ret0=0;
3737 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3738 if (!SWIG_IsOK(res1))
3741 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3742 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3746 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3748 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3749 da2->checkAllocated();
3750 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3752 PyObject *res = PyList_New(2);
3753 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3754 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3758 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3760 DataArrayInt *ret1=0;
3762 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3763 PyObject *res=PyTuple_New(2);
3764 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3766 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3769 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3770 PyTuple_SetItem(res,1,res1);
3775 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3778 int v0; std::vector<int> v1;
3779 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3780 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3783 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3784 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3787 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3788 if (!SWIG_IsOK(res1))
3791 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3792 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3796 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3798 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3799 da2->checkAllocated();
3800 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3804 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3806 std::vector<int> tmp;
3807 self->getCellIdsHavingGaussLocalization(locId,tmp);
3808 DataArrayInt *ret=DataArrayInt::New();
3809 ret->alloc((int)tmp.size(),1);
3810 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3811 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3814 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3816 std::vector<int> inp0;
3817 convertPyToNewIntArr4(code,1,3,inp0);
3818 std::vector<const DataArrayInt *> inp1;
3819 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3820 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3825 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3828 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3829 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3830 static MEDCouplingFieldTemplate *New(TypeOfField type);
3831 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3832 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3835 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3837 return MEDCouplingFieldTemplate::New(f);
3840 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3842 return MEDCouplingFieldTemplate::New(f);
3845 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3847 return MEDCouplingFieldTemplate::New(type);
3850 std::string __str__() const throw(INTERP_KERNEL::Exception)
3852 return self->simpleRepr();
3855 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3857 std::ostringstream oss;
3858 self->reprQuickOverview(oss);
3864 class MEDCouplingFieldInt;
3866 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3869 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3870 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3871 void setTimeUnit(const std::string& unit);
3872 std::string getTimeUnit() const;
3873 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3874 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3875 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3876 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3877 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3878 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3879 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3880 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3881 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3882 MEDCouplingFieldDouble *deepCopy() const;
3883 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3884 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3885 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3886 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3887 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3888 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3889 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3890 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3891 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3892 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3893 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3894 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3895 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3896 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3897 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3898 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3899 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3900 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3901 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3902 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3903 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3904 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3905 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3906 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3907 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3908 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3909 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3910 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3911 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3912 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3913 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3914 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3915 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3916 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3917 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3918 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3919 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3920 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3921 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3922 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3923 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3924 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3925 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3926 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3927 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3928 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3929 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3930 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3931 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3932 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3933 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3934 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3935 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3936 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3937 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3938 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3939 double getMinValue() const throw(INTERP_KERNEL::Exception);
3940 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3941 double norm2() const throw(INTERP_KERNEL::Exception);
3942 double normMax() const throw(INTERP_KERNEL::Exception);
3943 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3944 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3945 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3946 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3947 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3948 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3949 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3950 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3951 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3952 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3953 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3954 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3955 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3956 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3957 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3958 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3959 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3960 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3961 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3962 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3963 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3964 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3966 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3968 return MEDCouplingFieldDouble::New(type,td);
3971 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3973 return MEDCouplingFieldDouble::New(ft,td);
3976 std::string __str__() const throw(INTERP_KERNEL::Exception)
3978 return self->simpleRepr();
3981 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3983 std::ostringstream oss;
3984 self->reprQuickOverview(oss);
3988 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
3990 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
3994 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
3996 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4000 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4002 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4004 DataArrayDouble *a,*a2;
4005 DataArrayDoubleTuple *aa,*aa2;
4006 std::vector<double> bb,bb2;
4008 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4009 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4010 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4013 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4015 DataArrayDouble *ret=self->getArray();
4021 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4023 std::vector<DataArrayDouble *> arrs=self->getArrays();
4024 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4028 PyObject *ret=PyTuple_New(sz);
4029 for(int i=0;i<sz;i++)
4032 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4034 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4039 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4041 std::vector<const DataArrayDouble *> tmp;
4042 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4044 std::vector<DataArrayDouble *> arrs(sz);
4045 for(int i=0;i<sz;i++)
4046 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4047 self->setArrays(arrs);
4050 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4052 DataArrayDouble *ret=self->getEndArray();
4058 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4062 DataArrayDoubleTuple *aa;
4063 std::vector<double> bb;
4065 const MEDCouplingMesh *mesh=self->getMesh();
4067 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4068 int spaceDim=mesh->getSpaceDimension();
4069 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4070 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4072 int sz=self->getNumberOfComponents();
4073 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4074 self->getValueOn(spaceLoc,res);
4075 return convertDblArrToPyList(res,sz);
4078 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4080 int sz=self->getNumberOfComponents();
4081 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4082 self->getValueOnPos(i,j,k,res);
4083 return convertDblArrToPyList(res,sz);
4086 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4088 const MEDCouplingMesh *mesh(self->getMesh());
4090 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4093 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4094 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4095 mesh->getSpaceDimension(),true,nbPts);
4096 return self->getValueOnMulti(inp,nbPts);
4099 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4103 DataArrayDoubleTuple *aa;
4104 std::vector<double> bb;
4106 const MEDCouplingMesh *mesh=self->getMesh();
4108 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4109 int spaceDim=mesh->getSpaceDimension();
4110 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4111 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4114 int sz=self->getNumberOfComponents();
4115 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4116 self->getValueOn(spaceLoc,time,res);
4117 return convertDblArrToPyList(res,sz);
4120 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4122 if(self->getArray()!=0)
4123 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4126 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4127 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4128 self->setArray(arr);
4132 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4135 double tmp0=self->getTime(tmp1,tmp2);
4136 PyObject *res = PyList_New(3);
4137 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4138 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4139 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4143 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4146 double tmp0=self->getStartTime(tmp1,tmp2);
4147 PyObject *res = PyList_New(3);
4148 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4149 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4150 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4154 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4157 double tmp0=self->getEndTime(tmp1,tmp2);
4158 PyObject *res = PyList_New(3);
4159 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4160 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4161 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4164 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4166 int sz=self->getNumberOfComponents();
4167 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4168 self->accumulate(tmp);
4169 return convertDblArrToPyList(tmp,sz);
4171 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4173 int sz=self->getNumberOfComponents();
4174 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4175 self->integral(isWAbs,tmp);
4176 return convertDblArrToPyList(tmp,sz);
4178 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4180 int sz=self->getNumberOfComponents();
4181 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4182 self->getWeightedAverageValue(tmp,isWAbs);
4183 return convertDblArrToPyList(tmp,sz);
4185 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4187 int sz=self->getNumberOfComponents();
4188 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4190 return convertDblArrToPyList(tmp,sz);
4192 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4194 int sz=self->getNumberOfComponents();
4195 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4197 return convertDblArrToPyList(tmp,sz);
4199 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4201 int szArr,sw,iTypppArr;
4202 std::vector<int> stdvecTyyppArr;
4203 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4204 self->renumberCells(tmp,check);
4207 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4209 int szArr,sw,iTypppArr;
4210 std::vector<int> stdvecTyyppArr;
4211 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4212 self->renumberCellsWithoutMesh(tmp,check);
4215 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4217 int szArr,sw,iTypppArr;
4218 std::vector<int> stdvecTyyppArr;
4219 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4220 self->renumberNodes(tmp,eps);
4223 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4225 int szArr,sw,iTypppArr;
4226 std::vector<int> stdvecTyyppArr;
4227 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4228 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4231 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4235 std::vector<int> multiVal;
4236 std::pair<int, std::pair<int,int> > slic;
4237 MEDCoupling::DataArrayInt *daIntTyypp=0;
4238 const MEDCouplingMesh *mesh=self->getMesh();
4240 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4241 int nbc=mesh->getNumberOfCells();
4242 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4249 std::ostringstream oss;
4250 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4251 throw INTERP_KERNEL::Exception(oss.str().c_str());
4254 return self->buildSubPart(&singleVal,&singleVal+1);
4259 int tmp=nbc+singleVal;
4260 return self->buildSubPart(&tmp,&tmp+1);
4264 std::ostringstream oss;
4265 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4266 throw INTERP_KERNEL::Exception(oss.str().c_str());
4272 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4276 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4281 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4282 daIntTyypp->checkAllocated();
4283 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4286 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4290 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4292 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";
4293 if(PyTuple_Check(li))
4295 Py_ssize_t sz=PyTuple_Size(li);
4297 throw INTERP_KERNEL::Exception(msg);
4298 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4301 std::vector<int> multiVal;
4302 std::pair<int, std::pair<int,int> > slic;
4303 MEDCoupling::DataArrayInt *daIntTyypp=0;
4304 if(!self->getArray())
4305 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4307 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4308 catch(INTERP_KERNEL::Exception& e)
4309 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4310 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4311 DataArrayDouble *ret0Arr=ret0->getArray();
4313 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4318 std::vector<int> v2(1,singleVal);
4319 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4320 ret0->setArray(aarr);
4325 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4326 ret0->setArray(aarr);
4331 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4332 std::vector<int> v2(nbOfComp);
4333 for(int i=0;i<nbOfComp;i++)
4334 v2[i]=slic.first+i*slic.second.second;
4335 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4336 ret0->setArray(aarr);
4340 throw INTERP_KERNEL::Exception(msg);
4345 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4348 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4351 double r1=self->getMaxValue2(tmp);
4352 PyObject *ret=PyTuple_New(2);
4353 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4354 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4358 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4361 double r1=self->getMinValue2(tmp);
4362 PyObject *ret=PyTuple_New(2);
4363 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4364 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4368 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4370 std::vector<int> tmp;
4371 convertPyToNewIntArr3(li,tmp);
4372 return self->keepSelectedComponents(tmp);
4375 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4377 std::vector<int> tmp;
4378 convertPyToNewIntArr3(li,tmp);
4379 self->setSelectedComponents(f,tmp);
4382 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4385 DataArrayDouble *a,*a2;
4386 DataArrayDoubleTuple *aa,*aa2;
4387 std::vector<double> bb,bb2;
4390 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4391 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4392 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4393 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4395 return self->extractSlice3D(orig,vect,eps);
4398 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4400 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4403 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4405 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4408 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4410 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.";
4411 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4414 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4416 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4418 return (*self)-(*other);
4420 throw INTERP_KERNEL::Exception(msg);
4425 DataArrayDoubleTuple *aa;
4426 std::vector<double> bb;
4428 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4433 if(!self->getArray())
4434 throw INTERP_KERNEL::Exception(msg2);
4435 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4436 ret->applyLin(1.,-val);
4437 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4438 ret2->setArray(ret);
4443 if(!self->getArray())
4444 throw INTERP_KERNEL::Exception(msg2);
4445 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4446 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4447 ret2->setArray(ret);
4452 if(!self->getArray())
4453 throw INTERP_KERNEL::Exception(msg2);
4454 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4455 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4456 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4457 ret2->setArray(ret);
4462 if(!self->getArray())
4463 throw INTERP_KERNEL::Exception(msg2);
4464 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4465 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4466 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4467 ret2->setArray(ret);
4471 { throw INTERP_KERNEL::Exception(msg); }
4475 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4477 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4480 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4482 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4485 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4487 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4490 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4492 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.";
4493 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4496 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4498 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4500 return (*self)/(*other);
4502 throw INTERP_KERNEL::Exception(msg);
4507 DataArrayDoubleTuple *aa;
4508 std::vector<double> bb;
4510 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4516 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4520 ret->applyLin(1./val,0);
4521 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4522 ret2->setArray(ret);
4527 if(!self->getArray())
4528 throw INTERP_KERNEL::Exception(msg2);
4529 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4530 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4531 ret2->setArray(ret);
4536 if(!self->getArray())
4537 throw INTERP_KERNEL::Exception(msg2);
4538 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4539 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4540 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4541 ret2->setArray(ret);
4546 if(!self->getArray())
4547 throw INTERP_KERNEL::Exception(msg2);
4548 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4549 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4550 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4551 ret2->setArray(ret);
4555 { throw INTERP_KERNEL::Exception(msg); }
4559 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4561 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4564 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4566 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.";
4567 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4570 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4572 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4574 return (*self)^(*other);
4576 throw INTERP_KERNEL::Exception(msg);
4581 DataArrayDoubleTuple *aa;
4582 std::vector<double> bb;
4584 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4589 if(!self->getArray())
4590 throw INTERP_KERNEL::Exception(msg2);
4591 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4593 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4594 ret2->setArray(ret);
4599 if(!self->getArray())
4600 throw INTERP_KERNEL::Exception(msg2);
4601 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4602 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4603 ret2->setArray(ret);
4608 if(!self->getArray())
4609 throw INTERP_KERNEL::Exception(msg2);
4610 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4611 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4612 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4613 ret2->setArray(ret);
4618 if(!self->getArray())
4619 throw INTERP_KERNEL::Exception(msg2);
4620 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4621 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4622 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4623 ret2->setArray(ret);
4627 { throw INTERP_KERNEL::Exception(msg); }
4631 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4633 return self->negate();
4636 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4638 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.";
4639 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4642 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4644 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4648 Py_XINCREF(trueSelf);
4652 throw INTERP_KERNEL::Exception(msg);
4657 DataArrayDoubleTuple *aa;
4658 std::vector<double> bb;
4660 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4665 if(!self->getArray())
4666 throw INTERP_KERNEL::Exception(msg2);
4667 self->getArray()->applyLin(1.,val);
4668 Py_XINCREF(trueSelf);
4673 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4676 Py_XINCREF(trueSelf);
4681 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4682 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4683 ret2->setArray(aaa);
4685 Py_XINCREF(trueSelf);
4690 if(!self->getArray())
4691 throw INTERP_KERNEL::Exception(msg2);
4692 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4693 self->getArray()->addEqual(aaa);
4694 Py_XINCREF(trueSelf);
4698 { throw INTERP_KERNEL::Exception(msg); }
4702 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4704 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.";
4705 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4708 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4710 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4714 Py_XINCREF(trueSelf);
4718 throw INTERP_KERNEL::Exception(msg);
4723 DataArrayDoubleTuple *aa;
4724 std::vector<double> bb;
4726 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4731 if(!self->getArray())
4732 throw INTERP_KERNEL::Exception(msg2);
4733 self->getArray()->applyLin(1.,-val);
4734 Py_XINCREF(trueSelf);
4739 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4742 Py_XINCREF(trueSelf);
4747 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4748 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4749 ret2->setArray(aaa);
4751 Py_XINCREF(trueSelf);
4756 if(!self->getArray())
4757 throw INTERP_KERNEL::Exception(msg2);
4758 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4759 self->getArray()->substractEqual(aaa);
4760 Py_XINCREF(trueSelf);
4764 { throw INTERP_KERNEL::Exception(msg); }
4768 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4770 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.";
4771 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4774 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4776 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4780 Py_XINCREF(trueSelf);
4784 throw INTERP_KERNEL::Exception(msg);
4789 DataArrayDoubleTuple *aa;
4790 std::vector<double> bb;
4792 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4797 if(!self->getArray())
4798 throw INTERP_KERNEL::Exception(msg2);
4799 self->getArray()->applyLin(val,0);
4800 Py_XINCREF(trueSelf);
4805 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4808 Py_XINCREF(trueSelf);
4813 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4814 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4815 ret2->setArray(aaa);
4817 Py_XINCREF(trueSelf);
4822 if(!self->getArray())
4823 throw INTERP_KERNEL::Exception(msg2);
4824 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4825 self->getArray()->multiplyEqual(aaa);
4826 Py_XINCREF(trueSelf);
4830 { throw INTERP_KERNEL::Exception(msg); }
4834 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4836 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.";
4837 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4840 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4842 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4846 Py_XINCREF(trueSelf);
4850 throw INTERP_KERNEL::Exception(msg);
4855 DataArrayDoubleTuple *aa;
4856 std::vector<double> bb;
4858 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4864 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4865 if(!self->getArray())
4866 throw INTERP_KERNEL::Exception(msg2);
4867 self->getArray()->applyLin(1./val,0);
4868 Py_XINCREF(trueSelf);
4873 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4876 Py_XINCREF(trueSelf);
4881 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4882 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4883 ret2->setArray(aaa);
4885 Py_XINCREF(trueSelf);
4890 if(!self->getArray())
4891 throw INTERP_KERNEL::Exception(msg2);
4892 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4893 self->getArray()->divideEqual(aaa);
4894 Py_XINCREF(trueSelf);
4898 { throw INTERP_KERNEL::Exception(msg); }
4902 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4904 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.";
4905 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4908 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4910 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4914 Py_XINCREF(trueSelf);
4918 throw INTERP_KERNEL::Exception(msg);
4923 DataArrayDoubleTuple *aa;
4924 std::vector<double> bb;
4926 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4931 if(!self->getArray())
4932 throw INTERP_KERNEL::Exception(msg2);
4933 self->getArray()->applyPow(val);
4934 Py_XINCREF(trueSelf);
4939 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4942 Py_XINCREF(trueSelf);
4947 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4948 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4949 ret2->setArray(aaa);
4951 Py_XINCREF(trueSelf);
4956 if(!self->getArray())
4957 throw INTERP_KERNEL::Exception(msg2);
4958 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4959 self->getArray()->powEqual(aaa);
4960 Py_XINCREF(trueSelf);
4964 { throw INTERP_KERNEL::Exception(msg); }
4968 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4970 std::vector<const MEDCouplingFieldDouble *> tmp;
4971 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4972 return MEDCouplingFieldDouble::MergeFields(tmp);
4975 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4977 std::vector<const MEDCouplingFieldDouble *> tmp;
4978 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4979 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4982 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4984 std::vector<double> a0;
4985 std::vector<int> a1;
4986 std::vector<std::string> a2;
4987 self->getTinySerializationDbleInformation(a0);
4988 self->getTinySerializationIntInformation(a1);
4989 self->getTinySerializationStrInformation(a2);
4991 PyObject *ret(PyTuple_New(3));
4992 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4993 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4995 PyObject *ret2(PyList_New(sz));
4997 for(int i=0;i<sz;i++)
4998 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5000 PyTuple_SetItem(ret,2,ret2);
5004 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5006 DataArrayInt *ret0(0);
5007 std::vector<DataArrayDouble *> ret1;
5008 self->serialize(ret0,ret1);
5011 std::size_t sz(ret1.size());
5012 PyObject *ret(PyTuple_New(2));
5013 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5014 PyObject *ret1Py(PyList_New(sz));
5015 for(std::size_t i=0;i<sz;i++)
5019 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5021 PyTuple_SetItem(ret,1,ret1Py);
5025 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5027 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5028 if(!PyTuple_Check(args))
5029 throw INTERP_KERNEL::Exception(MSG);
5030 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5031 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5032 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5034 PyObject *tmp0(PyTuple_New(1));
5035 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5036 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5038 Py_DECREF(selfMeth);
5039 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5040 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5041 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5043 PyObject *a(PyInt_FromLong(0));
5044 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5047 throw INTERP_KERNEL::Exception(MSG);
5048 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5049 throw INTERP_KERNEL::Exception(MSG);
5050 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5053 Py_DECREF(initMeth);
5058 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5059 {// put an empty dict in input to say to __new__ to call __init__...
5060 self->checkConsistencyLight();
5061 PyObject *ret(PyTuple_New(1));
5062 PyObject *ret0(PyDict_New());
5064 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5065 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5066 PyDict_SetItem(ret0,a,d);
5067 Py_DECREF(a); Py_DECREF(d);
5069 PyTuple_SetItem(ret,0,ret0);
5073 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5075 self->checkConsistencyLight();
5076 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5077 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5078 const MEDCouplingMesh *mesh(self->getMesh());
5081 PyObject *ret(PyTuple_New(3));
5082 PyTuple_SetItem(ret,0,ret0);
5083 PyTuple_SetItem(ret,1,ret1);
5084 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5088 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5090 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5091 if(!PyTuple_Check(inp))
5092 throw INTERP_KERNEL::Exception(MSG);
5093 int sz(PyTuple_Size(inp));
5095 throw INTERP_KERNEL::Exception(MSG);
5097 PyObject *elt2(PyTuple_GetItem(inp,2));
5099 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5100 if(!SWIG_IsOK(status))
5101 throw INTERP_KERNEL::Exception(MSG);
5102 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5104 PyObject *elt0(PyTuple_GetItem(inp,0));
5105 PyObject *elt1(PyTuple_GetItem(inp,1));
5106 std::vector<double> a0;
5107 std::vector<int> a1;
5108 std::vector<std::string> a2;
5109 DataArrayInt *b0(0);
5110 std::vector<DataArrayDouble *>b1;
5112 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5113 throw INTERP_KERNEL::Exception(MSG);
5114 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5116 fillArrayWithPyListDbl3(a0py,tmp,a0);
5117 convertPyToNewIntArr3(a1py,a1);
5118 fillStringVector(a2py,a2);
5121 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5122 throw INTERP_KERNEL::Exception(MSG);
5123 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5125 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5126 if(!SWIG_IsOK(status))
5127 throw INTERP_KERNEL::Exception(MSG);
5128 b0=reinterpret_cast<DataArrayInt *>(argp);
5129 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5131 self->checkForUnserialization(a1,b0,b1);
5132 // useless here to call resizeForUnserialization because arrays are well resized.
5133 self->finishUnserialization(a1,a0,a2);
5138 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5141 int getNumberOfFields() const;
5142 MEDCouplingMultiFields *deepCopy() const;
5143 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5144 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5145 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5146 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5147 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5150 std::string __str__() const throw(INTERP_KERNEL::Exception)
5152 return self->simpleRepr();
5154 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5156 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5157 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5159 std::vector<MEDCouplingFieldDouble *> fs(sz);
5160 for(int i=0;i<sz;i++)
5161 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5162 return MEDCouplingMultiFields::New(fs);
5164 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5166 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5167 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5169 std::vector<MEDCouplingFieldDouble *> fs(sz);
5170 for(int i=0;i<sz;i++)
5171 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5172 return MEDCouplingMultiFields::New(fs);
5174 PyObject *getFields() const
5176 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5177 int sz=fields.size();
5178 PyObject *res = PyList_New(sz);
5179 for(int i=0;i<sz;i++)
5183 fields[i]->incrRef();
5184 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5188 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5193 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5195 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5199 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5202 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5204 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5206 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5208 PyObject *res = PyList_New(sz);
5209 for(int i=0;i<sz;i++)
5214 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5218 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5223 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5225 std::vector<int> refs;
5226 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5228 PyObject *res = PyList_New(sz);
5229 for(int i=0;i<sz;i++)
5234 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5238 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5242 PyObject *ret=PyTuple_New(2);
5243 PyTuple_SetItem(ret,0,res);
5244 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5247 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5249 std::vector<DataArrayDouble *> ms=self->getArrays();
5251 PyObject *res = PyList_New(sz);
5252 for(int i=0;i<sz;i++)
5257 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5261 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5266 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5268 std::vector< std::vector<int> > refs;
5269 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5271 PyObject *res = PyList_New(sz);
5272 PyObject *res2 = PyList_New(sz);
5273 for(int i=0;i<sz;i++)
5278 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5282 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5284 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5287 PyObject *ret=PyTuple_New(2);
5288 PyTuple_SetItem(ret,0,res);
5289 PyTuple_SetItem(ret,1,res2);
5295 class MEDCouplingFieldInt : public MEDCouplingField
5298 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5299 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5300 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5301 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5302 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5303 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5304 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5305 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5306 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5307 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5309 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5311 return MEDCouplingFieldInt::New(type,td);
5314 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5316 return MEDCouplingFieldInt::New(ft,td);
5319 std::string __str__() const throw(INTERP_KERNEL::Exception)
5321 return self->simpleRepr();
5324 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5326 std::ostringstream oss;
5327 self->reprQuickOverview(oss);
5331 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5333 DataArrayInt *ret=self->getArray();
5339 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5342 double tmp0=self->getTime(tmp1,tmp2);
5343 PyObject *res = PyList_New(3);
5344 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5345 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5346 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5352 class MEDCouplingDefinitionTime
5355 MEDCouplingDefinitionTime();
5356 void assign(const MEDCouplingDefinitionTime& other);
5357 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5358 double getTimeResolution() const;
5359 std::vector<double> getHotSpotsTime() const;
5362 std::string __str__() const throw(INTERP_KERNEL::Exception)
5364 std::ostringstream oss;
5365 self->appendRepr(oss);
5369 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5371 int meshId,arrId,arrIdInField,fieldId;
5372 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5373 PyObject *res=PyList_New(4);
5374 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5375 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5376 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5377 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5381 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5383 int meshId,arrId,arrIdInField,fieldId;
5384 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5385 PyObject *res=PyList_New(4);
5386 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5387 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5388 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5389 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5395 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5398 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5399 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5403 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5405 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5406 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5408 std::vector<MEDCouplingFieldDouble *> fs(sz);
5409 for(int i=0;i<sz;i++)
5410 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5411 return MEDCouplingFieldOverTime::New(fs);
5413 std::string __str__() const throw(INTERP_KERNEL::Exception)
5415 return self->simpleRepr();
5417 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5419 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5420 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5422 std::vector<MEDCouplingFieldDouble *> fs(sz);
5423 for(int i=0;i<sz;i++)
5424 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5425 return MEDCouplingFieldOverTime::New(fs);
5430 class MEDCouplingCartesianAMRMesh;
5432 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5435 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5436 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5437 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5440 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5442 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5450 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5453 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5454 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5455 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5458 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5460 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5461 return convertFromVectorPairInt(ret);
5464 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5466 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5467 return convertFromVectorPairInt(ret);
5470 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5472 std::vector< std::pair<int,int> > inp;
5473 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5474 self->addPatch(inp,factors);
5477 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5479 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5481 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5482 if(patchId==mesh->getNumberOfPatches())
5484 std::ostringstream oss;
5485 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5486 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5489 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5495 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5497 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5499 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5500 mesh->removePatch(patchId);
5503 int __len__() const throw(INTERP_KERNEL::Exception)
5505 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5507 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5508 return mesh->getNumberOfPatches();
5513 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5517 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5520 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5521 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5522 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5523 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5524 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5525 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5526 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5527 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5528 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5529 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5530 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5531 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5532 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5534 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5535 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5536 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5537 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5538 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5539 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5540 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5541 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5542 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5543 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5544 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5545 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5546 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5547 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5548 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5549 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5550 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5551 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5552 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5553 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5556 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5558 std::vector< std::pair<int,int> > inp;
5559 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5560 self->addPatch(inp,factors);
5563 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5565 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5567 PyObject *ret = PyList_New(sz);
5568 for(int i=0;i<sz;i++)
5570 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5573 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5578 // agy : don't know why typemap fails here ??? let it in the extend section
5579 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5581 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5584 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5586 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5587 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5593 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5595 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5596 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5602 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5604 std::vector<int> out1;
5605 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5606 PyObject *ret(PyTuple_New(2));
5607 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5608 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5612 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5614 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5616 PyObject *ret = PyList_New(sz);
5617 for(int i=0;i<sz;i++)
5618 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5622 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5624 std::vector<const DataArrayDouble *> inp;
5625 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5626 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5629 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5631 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5637 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5639 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5645 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5647 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5653 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5655 const MEDCouplingIMesh *ret(self->getImageMesh());
5658 return const_cast<MEDCouplingIMesh *>(ret);
5661 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5663 if(patchId==self->getNumberOfPatches())
5665 std::ostringstream oss;
5666 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5667 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5670 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5676 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5678 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5679 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5680 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5683 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5685 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5686 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5687 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5690 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5692 self->removePatch(patchId);
5695 int __len__() const throw(INTERP_KERNEL::Exception)
5697 return self->getNumberOfPatches();
5702 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5706 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5709 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5712 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5714 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5715 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5716 const int *nodeStrctPtr(0);
5717 const double *originPtr(0),*dxyzPtr(0);
5719 std::vector<int> bb0;
5720 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5723 std::vector<double> bb,bb2;
5725 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5726 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5728 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5731 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5733 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5734 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5735 std::vector< std::vector<int> > inp2;
5736 convertPyToVectorOfVectorOfInt(factors,inp2);
5737 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5740 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5742 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5745 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5747 return MEDCouplingCartesianAMRMesh::New(mesh);
5752 class MEDCouplingDataForGodFather : public RefCountObject
5755 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5756 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5757 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5758 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5759 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5760 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5761 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5762 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5763 virtual void alloc() throw(INTERP_KERNEL::Exception);
5764 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5767 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5769 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5777 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5780 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5781 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5782 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5783 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5784 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5785 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5786 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5787 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5788 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5791 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5793 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5794 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5795 MEDCouplingAMRAttribute *ret(0);
5798 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5799 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5801 catch(INTERP_KERNEL::Exception&)
5803 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5804 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5809 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5811 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5814 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5816 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5817 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5823 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5825 std::vector< std::vector<std::string> > compNamesCpp;
5826 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5827 self->spillInfoOnComponents(compNamesCpp);
5830 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5832 std::vector<int> inp0;
5833 if(!fillIntVector(nfs,inp0))
5834 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5835 std::size_t sz(inp0.size());
5836 std::vector<NatureOfField> inp00(sz);
5837 for(std::size_t i=0;i<sz;i++)
5838 inp00[i]=(NatureOfField)inp0[i];
5839 self->spillNatures(inp00);
5842 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5844 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5845 int sz((int)ret.size());
5846 PyObject *retPy(PyList_New(sz));
5847 for(int i=0;i<sz;i++)
5848 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5854 class DenseMatrix : public RefCountObject, public TimeLabel
5857 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5858 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5859 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5860 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5862 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5863 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5864 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5865 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5866 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5867 void transpose() throw(INTERP_KERNEL::Exception);
5869 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5870 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5871 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5874 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5876 return DenseMatrix::New(nbRows,nbCols);
5879 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5881 return DenseMatrix::New(array,nbRows,nbCols);
5884 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5887 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5888 PyObject *ret=PyTuple_New(2);
5889 PyObject *ret0Py=ret0?Py_True:Py_False;
5891 PyTuple_SetItem(ret,0,ret0Py);
5892 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5896 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5898 DataArrayDouble *ret(self->getData());
5904 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5906 return MEDCoupling::DenseMatrix::Add(self,other);
5909 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5911 return MEDCoupling::DenseMatrix::Substract(self,other);
5914 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5916 return MEDCoupling::DenseMatrix::Multiply(self,other);
5919 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5921 return MEDCoupling::DenseMatrix::Multiply(self,other);
5924 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5926 self->addEqual(other);
5927 Py_XINCREF(trueSelf);
5931 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5933 self->substractEqual(other);
5934 Py_XINCREF(trueSelf);
5938 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5940 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5950 __filename=os.environ.get('PYTHONSTARTUP')
5951 if __filename and os.path.isfile(__filename):
5952 execfile(__filename)