1 // Copyright (C) 2017 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 (EDF R&D)
21 #ifdef WITH_DOCSTRINGS
22 %include MEDCoupling_doc.i
29 #include "MEDCouplingMemArray.hxx"
30 #include "MEDCouplingUMesh.hxx"
31 #include "MEDCouplingMappedExtrudedMesh.hxx"
32 #include "MEDCouplingCMesh.hxx"
33 #include "MEDCouplingIMesh.hxx"
34 #include "MEDCouplingCurveLinearMesh.hxx"
35 #include "MEDCoupling1GTUMesh.hxx"
36 #include "MEDCouplingField.hxx"
37 #include "MEDCouplingFieldDouble.hxx"
38 #include "MEDCouplingFieldInt.hxx"
39 #include "MEDCouplingFieldFloat.hxx"
40 #include "MEDCouplingFieldTemplate.hxx"
41 #include "MEDCouplingGaussLocalization.hxx"
43 #include "MEDCouplingMultiFields.hxx"
44 #include "MEDCouplingFieldOverTime.hxx"
45 #include "MEDCouplingDefinitionTime.hxx"
46 #include "MEDCouplingFieldDiscretization.hxx"
47 #include "MEDCouplingCartesianAMRMesh.hxx"
48 #include "MEDCouplingAMRAttribute.hxx"
49 #include "MEDCouplingMatrix.hxx"
50 #include "MEDCouplingPartDefinition.hxx"
51 #include "MEDCouplingSkyLineArray.hxx"
52 #include "MEDCouplingTypemaps.i"
54 #include "InterpKernelAutoPtr.hxx"
55 #include "BoxSplittingOptions.hxx"
57 using namespace MEDCoupling;
58 using namespace INTERP_KERNEL;
62 %template(ivec) std::vector<int>;
63 %template(dvec) std::vector<double>;
64 %template(svec) std::vector<std::string>;
67 %typemap(out) MEDCoupling::MEDCouplingMesh*
69 $result=convertMesh($1,$owner);
72 %typemap(out) MEDCouplingMesh*
74 $result=convertMesh($1,$owner);
79 %typemap(out) MEDCoupling::MEDCouplingPointSet*
81 $result=convertMesh($1,$owner);
84 %typemap(out) MEDCouplingPointSet*
86 $result=convertMesh($1,$owner);
91 %typemap(out) MEDCouplingCartesianAMRPatchGen*
93 $result=convertCartesianAMRPatch($1,$owner);
98 %typemap(out) MEDCouplingCartesianAMRMeshGen*
100 $result=convertCartesianAMRMesh($1,$owner);
105 %typemap(out) MEDCouplingDataForGodFather*
107 $result=convertDataForGodFather($1,$owner);
112 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
114 $result=convertMesh($1,$owner);
117 %typemap(out) MEDCoupling1GTUMesh*
119 $result=convertMesh($1,$owner);
124 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
126 $result=convertMesh($1,$owner);
129 %typemap(out) MEDCouplingStructuredMesh*
131 $result=convertMesh($1,$owner);
136 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
138 $result=convertFieldDiscretization($1,$owner);
141 %typemap(out) MEDCouplingFieldDiscretization*
143 $result=convertFieldDiscretization($1,$owner);
148 %typemap(out) MEDCoupling::MEDCouplingField*
150 $result=convertField($1,$owner);
153 %typemap(out) MEDCouplingField*
155 $result=convertField($1,$owner);
160 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
162 $result=convertMultiFields($1,$owner);
165 %typemap(out) MEDCouplingMultiFields*
167 $result=convertMultiFields($1,$owner);
172 %typemap(out) MEDCoupling::PartDefinition*
174 $result=convertPartDefinition($1,$owner);
177 %typemap(out) PartDefinition*
179 $result=convertPartDefinition($1,$owner);
184 %init %{ import_array(); %}
187 %init %{ initializeMe(); %}
189 %feature("autodoc", "1");
190 %feature("docstring");
192 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
193 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
194 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
250 %newobject MEDCoupling::MEDCouplingFieldInt::New;
251 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
252 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
253 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
254 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
255 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
256 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
257 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
258 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
259 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
260 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
261 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
262 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
263 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
264 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
265 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
266 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
267 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
268 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
269 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
270 %newobject MEDCoupling::MEDCouplingMesh::clone;
271 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
272 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
273 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
274 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
275 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
276 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
277 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
278 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
279 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
280 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
281 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
282 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
283 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
284 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
285 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
286 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
287 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
288 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
289 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
290 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
291 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
292 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
293 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
294 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
295 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
296 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
297 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
298 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
299 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
300 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
301 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
302 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
303 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
304 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
305 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
306 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
307 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
308 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
309 %newobject MEDCoupling::MEDCouplingUMesh::New;
310 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
311 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
312 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
313 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
314 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
316 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
317 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
318 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
319 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
320 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
321 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
322 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
323 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
324 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
325 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
326 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
327 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
328 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
329 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
330 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
331 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
332 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
333 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
334 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
335 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
336 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
337 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
338 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
339 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
340 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
341 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
342 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
343 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
344 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
345 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
346 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
347 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
348 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
349 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
350 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
351 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
352 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
353 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
354 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
355 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
356 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
357 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
359 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
360 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
361 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
362 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
363 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
364 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
365 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
366 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
367 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
368 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
369 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
370 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
371 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
372 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
373 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
374 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
375 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
376 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
377 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
378 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
379 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
380 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
381 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
382 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
383 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
384 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
385 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
386 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
387 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
388 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
389 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
390 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
391 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
392 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
393 %newobject MEDCoupling::MEDCouplingCMesh::New;
394 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
395 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
396 %newobject MEDCoupling::MEDCouplingIMesh::New;
397 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
398 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
399 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
400 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
401 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
402 %newobject MEDCoupling::MEDCouplingMultiFields::New;
403 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
404 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
405 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
409 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
410 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
411 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
412 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
413 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
414 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
415 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
416 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
417 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
418 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
419 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
420 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
421 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
422 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
423 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
424 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
425 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
426 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
427 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
428 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
429 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
430 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
431 %newobject MEDCoupling::DenseMatrix::New;
432 %newobject MEDCoupling::DenseMatrix::deepCopy;
433 %newobject MEDCoupling::DenseMatrix::shallowCpy;
434 %newobject MEDCoupling::DenseMatrix::getData;
435 %newobject MEDCoupling::DenseMatrix::matVecMult;
436 %newobject MEDCoupling::DenseMatrix::MatVecMult;
437 %newobject MEDCoupling::DenseMatrix::__add__;
438 %newobject MEDCoupling::DenseMatrix::__sub__;
439 %newobject MEDCoupling::DenseMatrix::__mul__;
440 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
441 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
442 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
443 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
444 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
445 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
447 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
448 %feature("unref") MEDCouplingMesh "$this->decrRef();"
449 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
450 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
451 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
452 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
453 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
454 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
455 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
456 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
457 %feature("unref") MEDCouplingField "$this->decrRef();"
458 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
459 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
460 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
461 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
462 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
463 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
464 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
465 %feature("unref") MEDCouplingFieldInt "$this->decrRef();"
466 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
467 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
468 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
469 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
470 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
471 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
472 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
473 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
474 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
475 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
476 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
477 %feature("unref") DenseMatrix "$this->decrRef();"
478 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
480 %rename(assign) *::operator=;
481 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
482 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
483 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
484 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
488 %rename (InterpKernelException) INTERP_KERNEL::Exception;
490 %include "MEDCouplingRefCountObject.i"
491 %include "MEDCouplingMemArray.i"
495 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
496 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
497 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
498 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
499 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
500 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
501 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
505 namespace INTERP_KERNEL
508 * \class BoxSplittingOptions
509 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
511 class BoxSplittingOptions
514 BoxSplittingOptions();
515 void init() throw(INTERP_KERNEL::Exception);
516 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
517 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
518 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
519 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
520 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
521 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
522 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
523 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
524 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
525 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
526 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
527 std::string printOptions() const throw(INTERP_KERNEL::Exception);
530 std::string __str__() const throw(INTERP_KERNEL::Exception)
532 return self->printOptions();
538 namespace MEDCoupling
554 CONST_ON_TIME_INTERVAL = 7
555 } TypeOfTimeDiscretization;
563 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
564 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
566 } MEDCouplingMeshType;
569 class DataArrayDouble;
570 class MEDCouplingUMesh;
571 class MEDCouplingCMesh;
572 class MEDCouplingFieldDouble;
574 %extend RefCountObject
576 std::string getHiddenCppPointer() const
578 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
583 %extend MEDCouplingGaussLocalization
585 std::string __str__() const throw(INTERP_KERNEL::Exception)
587 return self->getStringRepr();
590 std::string __repr__() const throw(INTERP_KERNEL::Exception)
592 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
593 oss << self->getStringRepr();
600 class MEDCouplingMesh : public RefCountObject, public TimeLabel
603 void setName(const std::string& name);
604 std::string getName() const;
605 void setDescription(const std::string& descr);
606 std::string getDescription() const;
607 void setTime(double val, int iteration, int order);
608 void setTimeUnit(const std::string& unit);
609 std::string getTimeUnit() const;
610 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
611 bool isStructured() const throw(INTERP_KERNEL::Exception);
612 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
613 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
614 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
615 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
616 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
617 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
618 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
619 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
620 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
621 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
622 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
623 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
624 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
625 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
626 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
627 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
628 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
629 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
630 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
631 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
632 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
633 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
634 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
635 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
636 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
637 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
638 virtual std::string getVTKFileExtension() const;
639 std::string getVTKFileNameOf(const std::string& fileName) const;
641 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
642 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
643 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
644 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
645 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
646 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
647 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
648 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
649 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
650 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
651 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);
652 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
653 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
654 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
655 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
656 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
657 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
658 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
661 std::string __str__() const throw(INTERP_KERNEL::Exception)
663 return self->simpleRepr();
666 PyObject *getTime() throw(INTERP_KERNEL::Exception)
669 double tmp0=self->getTime(tmp1,tmp2);
670 PyObject *res = PyList_New(3);
671 PyList_SetItem(res,0,SWIG_From_double(tmp0));
672 PyList_SetItem(res,1,SWIG_From_int(tmp1));
673 PyList_SetItem(res,2,SWIG_From_int(tmp2));
677 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
679 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
680 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
686 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
690 DataArrayDoubleTuple *aa;
691 std::vector<double> bb;
693 int spaceDim=self->getSpaceDimension();
694 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
695 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
696 return self->getCellContainingPoint(pos,eps);
699 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
703 DataArrayDoubleTuple *aa;
704 std::vector<double> bb;
706 int spaceDim=self->getSpaceDimension();
707 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
708 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
709 MCAuto<DataArrayInt> elts,eltsIndex;
710 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
711 PyObject *ret=PyTuple_New(2);
712 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
713 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
717 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
721 DataArrayDoubleTuple *aa;
722 std::vector<double> bb;
724 int spaceDim=self->getSpaceDimension();
725 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
726 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
727 MCAuto<DataArrayInt> elts,eltsIndex;
728 self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
729 PyObject *ret=PyTuple_New(2);
730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
737 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
738 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
741 PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
743 auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayInt>& d, MCAuto<DataArrayInt>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
744 return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
747 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
751 DataArrayDoubleTuple *aa;
752 std::vector<double> bb;
754 int spaceDim=self->getSpaceDimension();
755 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
756 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
757 std::vector<int> elts;
758 self->getCellsContainingPoint(pos,eps,elts);
759 DataArrayInt *ret=DataArrayInt::New();
760 ret->alloc((int)elts.size(),1);
761 std::copy(elts.begin(),elts.end(),ret->getPointer());
762 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
765 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
767 MCAuto<DataArrayInt> d0=DataArrayInt::New();
768 MCAuto<DataArrayInt> d1=DataArrayInt::New();
769 self->getReverseNodalConnectivity(d0,d1);
770 PyObject *ret=PyTuple_New(2);
771 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
772 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
776 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
779 int v0; std::vector<int> v1;
780 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
781 self->renumberCells(ids,check);
784 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
786 DataArrayInt *cellCor, *nodeCor;
787 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
788 PyObject *res = PyList_New(2);
789 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
790 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
794 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
796 DataArrayInt *cellCor=0,*nodeCor=0;
797 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
798 PyObject *res = PyList_New(2);
799 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
800 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
804 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
806 DataArrayInt *cellCor=0;
807 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
811 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
814 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
815 if (!SWIG_IsOK(res1))
818 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
819 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
823 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
825 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
826 da2->checkAllocated();
827 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
830 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
832 std::vector<int> conn;
833 self->getNodeIdsOfCell(cellId,conn);
834 return convertIntArrToPyList2(conn);
837 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
839 std::vector<double> coo;
840 self->getCoordinatesOfNode(nodeId,coo);
841 return convertDblArrToPyList2(coo);
844 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
848 DataArrayDoubleTuple *aa;
849 std::vector<double> bb;
851 int spaceDim=self->getSpaceDimension();
852 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
853 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
854 self->scale(pointPtr,factor);
857 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
859 int spaceDim=self->getSpaceDimension();
860 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
861 self->getBoundingBox(tmp);
862 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
866 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
869 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
870 PyObject *ret=PyTuple_New(2);
871 PyObject *ret0Py=ret0?Py_True:Py_False;
873 PyTuple_SetItem(ret,0,ret0Py);
874 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
878 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
880 int szArr,sw,iTypppArr;
881 std::vector<int> stdvecTyyppArr;
882 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
883 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
884 if(sw==3)//DataArrayInt
886 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
887 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
888 std::string name=argpt->getName();
890 ret->setName(name.c_str());
892 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
895 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
897 int szArr,sw,iTypppArr;
898 std::vector<int> stdvecTyyppArr;
900 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
901 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
902 if(sw==3)//DataArrayInt
904 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
905 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
906 std::string name=argpt->getName();
908 ret->setName(name.c_str());
911 PyObject *res = PyList_New(2);
912 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
913 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
914 PyList_SetItem(res,0,obj0);
915 PyList_SetItem(res,1,obj1);
919 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
923 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
924 PyObject *res = PyTuple_New(2);
925 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
928 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
930 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
931 PyTuple_SetItem(res,0,obj0);
932 PyTuple_SetItem(res,1,obj1);
936 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
938 std::vector<int> vals=self->getDistributionOfTypes();
940 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
941 PyObject *ret=PyList_New((int)vals.size()/3);
942 for(int j=0;j<(int)vals.size()/3;j++)
944 PyObject *ret1=PyList_New(3);
945 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
946 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
947 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
948 PyList_SetItem(ret,j,ret1);
953 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
955 std::vector<int> code;
956 std::vector<const DataArrayInt *> idsPerType;
957 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
958 convertPyToNewIntArr4(li,1,3,code);
959 return self->checkTypeConsistencyAndContig(code,idsPerType);
962 PyObject *splitProfilePerType(const DataArrayInt *profile, bool smartPflKiller=true) const throw(INTERP_KERNEL::Exception)
964 std::vector<int> code;
965 std::vector<DataArrayInt *> idsInPflPerType;
966 std::vector<DataArrayInt *> idsPerType;
967 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
968 PyObject *ret=PyTuple_New(3);
971 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
972 PyObject *ret0=PyList_New((int)code.size()/3);
973 for(int j=0;j<(int)code.size()/3;j++)
975 PyObject *ret00=PyList_New(3);
976 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
977 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
978 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
979 PyList_SetItem(ret0,j,ret00);
981 PyTuple_SetItem(ret,0,ret0);
983 PyObject *ret1=PyList_New(idsInPflPerType.size());
984 for(std::size_t j=0;j<idsInPflPerType.size();j++)
985 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
986 PyTuple_SetItem(ret,1,ret1);
987 int n=idsPerType.size();
988 PyObject *ret2=PyList_New(n);
990 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
991 PyTuple_SetItem(ret,2,ret2);
995 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
999 DataArrayDoubleTuple *aa;
1000 std::vector<double> bb;
1002 int spaceDim=self->getSpaceDimension();
1003 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1004 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1005 self->translate(vectorPtr);
1008 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1010 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1013 DataArrayDoubleTuple *aa;
1014 std::vector<double> bb;
1016 int spaceDim=self->getSpaceDimension();
1017 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1018 self->rotate(centerPtr,0,alpha);
1021 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1023 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1025 DataArrayDouble *a,*a2;
1026 DataArrayDoubleTuple *aa,*aa2;
1027 std::vector<double> bb,bb2;
1029 int spaceDim=self->getSpaceDimension();
1030 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1031 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
1032 self->rotate(centerPtr,vectorPtr,alpha);
1035 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1037 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1038 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1039 PyObject *res=PyList_New(result.size());
1040 for(int i=0;iL!=result.end(); i++, iL++)
1041 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1045 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1047 std::vector<double> a0;
1048 std::vector<int> a1;
1049 std::vector<std::string> a2;
1050 self->getTinySerializationInformation(a0,a1,a2);
1051 PyObject *ret(PyTuple_New(3));
1052 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1053 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1055 PyObject *ret2(PyList_New(sz));
1057 for(int i=0;i<sz;i++)
1058 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1060 PyTuple_SetItem(ret,2,ret2);
1064 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1066 DataArrayInt *a0Tmp(0);
1067 DataArrayDouble *a1Tmp(0);
1068 self->serialize(a0Tmp,a1Tmp);
1069 PyObject *ret(PyTuple_New(2));
1070 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1071 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1075 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1077 std::vector<std::string> littleStrings;
1078 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1081 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1083 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1084 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1085 PyObject *ret(PyTuple_New(2));
1086 PyTuple_SetItem(ret,0,ret0);
1087 PyTuple_SetItem(ret,1,ret1);
1091 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1093 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1094 if(!PyTuple_Check(inp))
1095 throw INTERP_KERNEL::Exception(MSG);
1096 int sz(PyTuple_Size(inp));
1098 throw INTERP_KERNEL::Exception(MSG);
1099 PyObject *elt0(PyTuple_GetItem(inp,0));
1100 PyObject *elt1(PyTuple_GetItem(inp,1));
1101 std::vector<double> a0;
1102 std::vector<int> a1;
1103 std::vector<std::string> a2;
1104 DataArrayInt *b0(0);
1105 DataArrayDouble *b1(0);
1107 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1108 throw INTERP_KERNEL::Exception(MSG);
1109 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1111 fillArrayWithPyListDbl3(a0py,tmp,a0);
1112 convertPyToNewIntArr3(a1py,a1);
1113 fillStringVector(a2py,a2);
1116 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1117 throw INTERP_KERNEL::Exception(MSG);
1118 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1120 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1121 if(!SWIG_IsOK(status))
1122 throw INTERP_KERNEL::Exception(MSG);
1123 b0=reinterpret_cast<DataArrayInt *>(argp);
1124 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1125 if(!SWIG_IsOK(status))
1126 throw INTERP_KERNEL::Exception(MSG);
1127 b1=reinterpret_cast<DataArrayDouble *>(argp);
1129 // useless here to call resizeForUnserialization because arrays are well resized.
1130 self->unserialization(a0,a1,b0,b1,a2);
1133 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1135 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1136 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1137 return MEDCouplingMesh::MergeMeshes(tmp);
1143 //== MEDCouplingMesh End
1145 %include "NormalizedGeometricTypes"
1146 %include "MEDCouplingNatureOfFieldEnum"
1148 namespace MEDCoupling
1150 class MEDCouplingNatureOfField
1153 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1154 static std::string GetReprNoThrow(NatureOfField nat);
1155 static std::string GetAllPossibilitiesStr();
1159 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1160 // include "MEDCouplingTimeDiscretization.i"
1162 namespace MEDCoupling
1164 class MEDCouplingGaussLocalization
1167 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1168 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1169 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1170 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1171 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1172 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1173 int getDimension() const throw(INTERP_KERNEL::Exception);
1174 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1175 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1176 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1177 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1179 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1180 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1181 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1182 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1183 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1184 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1185 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1186 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1187 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1188 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1189 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1190 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1192 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1196 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1198 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1202 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1204 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1210 class MEDCouplingSkyLineArray
1213 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1215 void set( DataArrayInt* index, DataArrayInt* value );
1216 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1218 int getSuperNumberOf() const;
1219 int getNumberOf() const;
1220 int getLength() const;
1222 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1224 void deleteSimplePack(const int i) throw(INTERP_KERNEL::Exception);
1225 void deleteSimplePacks(const DataArrayInt* idx) throw(INTERP_KERNEL::Exception);
1229 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1231 return MEDCouplingSkyLineArray::New();
1234 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1236 return MEDCouplingSkyLineArray::New(index, value);
1239 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1241 return MEDCouplingSkyLineArray::New(index, value);
1244 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1246 return MEDCouplingSkyLineArray::New(other);
1249 std::string __str__() const throw(INTERP_KERNEL::Exception)
1251 return self->simpleRepr();
1254 DataArrayInt *getSuperIndexArray() const
1256 DataArrayInt *ret(self->getSuperIndexArray());
1262 DataArrayInt *getIndexArray() const
1264 DataArrayInt *ret(self->getIndexArray());
1270 DataArrayInt *getValuesArray() const
1272 DataArrayInt *ret(self->getValuesArray());
1278 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1280 std::vector<int> ret;
1281 self->getSimplePackSafe(absolutePackId,ret);
1282 return convertIntArrToPyList2(ret);
1285 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1287 std::vector<int> vpack, vspIdx, out;
1289 convertPyToNewIntArr3(superPackIndices,vspIdx);
1290 convertPyToNewIntArr3(pack,vpack);
1292 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1293 return convertIntArrToPyList2(out);
1296 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1298 std::vector<int> vpack;
1299 convertPyToNewIntArr3(pack,vpack);
1300 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1303 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1305 std::vector<int> vpack;
1306 convertPyToNewIntArr3(pack,vpack);
1307 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1310 void replaceSimplePacks(const DataArrayInt* idx, PyObject *listePacks) throw(INTERP_KERNEL::Exception)
1312 std::vector<const DataArrayInt*> packs;
1313 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt*>(listePacks,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",packs);
1314 self->replaceSimplePacks(idx, packs);
1317 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1319 std::vector<int> vpack;
1320 convertPyToNewIntArr3(pack,vpack);
1321 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1324 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1326 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1327 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1328 self->convertToPolyhedronConn(d0,d1);
1329 PyObject *ret=PyTuple_New(2);
1330 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1331 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1338 %include "MEDCouplingFieldDiscretization.i"
1340 //== MEDCouplingPointSet
1342 namespace MEDCoupling
1344 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1347 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1348 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1349 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1350 void zipCoords() throw(INTERP_KERNEL::Exception);
1351 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1352 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1353 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1354 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1355 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1356 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1357 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1358 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1359 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1360 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1361 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1362 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1363 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1364 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1365 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1366 virtual DataArrayInt *findBoundaryNodes() const;
1367 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1368 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1369 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1370 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1371 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1372 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1373 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1374 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1375 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1376 virtual void invertOrientationOfAllCells() throw(INTERP_KERNEL::Exception);
1379 std::string __str__() const throw(INTERP_KERNEL::Exception)
1381 return self->simpleRepr();
1384 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1387 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1388 PyObject *res = PyList_New(2);
1389 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1390 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1394 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1396 DataArrayInt *comm, *commIndex;
1397 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1398 PyObject *res = PyList_New(2);
1399 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1400 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1404 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1406 DataArrayDouble *ret1=self->getCoords();
1409 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1412 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1414 int szArr,sw,iTypppArr;
1415 std::vector<int> stdvecTyyppArr;
1416 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1417 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1418 if(sw==3)//DataArrayInt
1420 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1421 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1422 std::string name=argpt->getName();
1424 ret->setName(name.c_str());
1426 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1429 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1431 int szArr,sw,iTypppArr;
1432 std::vector<int> stdvecTyyppArr;
1433 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1434 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1435 if(sw==3)//DataArrayInt
1437 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1438 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1439 std::string name=argpt->getName();
1441 ret->setName(name.c_str());
1443 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1446 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1448 int szArr,sw,iTypppArr;
1449 std::vector<int> stdvecTyyppArr;
1450 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1451 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1452 if(sw==3)//DataArrayInt
1454 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1455 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1456 std::string name=argpt->getName();
1458 ret->setName(name.c_str());
1460 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1463 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1465 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1466 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1469 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1471 int szArr,sw,iTypppArr;
1472 std::vector<int> stdvecTyyppArr;
1473 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1474 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1475 if(sw==3)//DataArrayInt
1477 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1478 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1479 std::string name=argpt->getName();
1481 ret->setName(name.c_str());
1483 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1486 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1488 int szArr,sw,iTypppArr;
1489 std::vector<int> stdvecTyyppArr;
1490 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1491 self->renumberNodes(tmp,newNbOfNodes);
1494 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1496 int szArr,sw,iTypppArr;
1497 std::vector<int> stdvecTyyppArr;
1498 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1499 self->renumberNodesCenter(tmp,newNbOfNodes);
1502 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1504 int spaceDim=self->getSpaceDimension();
1506 DataArrayDouble *a,*a2;
1507 DataArrayDoubleTuple *aa,*aa2;
1508 std::vector<double> bb,bb2;
1510 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1511 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1512 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1513 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1514 std::vector<int> nodes;
1515 self->findNodesOnLine(p,v,eps,nodes);
1516 DataArrayInt *ret=DataArrayInt::New();
1517 ret->alloc((int)nodes.size(),1);
1518 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1519 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1521 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1523 int spaceDim=self->getSpaceDimension();
1525 DataArrayDouble *a,*a2;
1526 DataArrayDoubleTuple *aa,*aa2;
1527 std::vector<double> bb,bb2;
1529 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1530 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1531 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1532 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1533 std::vector<int> nodes;
1534 self->findNodesOnPlane(p,v,eps,nodes);
1535 DataArrayInt *ret=DataArrayInt::New();
1536 ret->alloc((int)nodes.size(),1);
1537 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1538 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1541 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1545 DataArrayDoubleTuple *aa;
1546 std::vector<double> bb;
1548 int spaceDim=self->getSpaceDimension();
1549 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1550 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1551 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1552 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1555 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1557 DataArrayInt *c=0,*cI=0;
1561 DataArrayDoubleTuple *aa;
1562 std::vector<double> bb;
1564 int spaceDim=self->getSpaceDimension();
1565 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1566 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1567 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1568 PyObject *ret=PyTuple_New(2);
1569 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1570 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1574 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1576 DataArrayInt *c=0,*cI=0;
1577 int spaceDim=self->getSpaceDimension();
1580 DataArrayDoubleTuple *aa;
1581 std::vector<double> bb;
1584 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1585 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1587 PyObject *ret=PyTuple_New(2);
1588 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1589 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1597 DataArrayDoubleTuple *aa;
1598 std::vector<double> bb;
1600 int spaceDim=self->getSpaceDimension();
1601 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1602 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1604 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1605 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1608 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1612 std::vector<int> multiVal;
1613 std::pair<int, std::pair<int,int> > slic;
1614 MEDCoupling::DataArrayInt *daIntTyypp=0;
1615 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1619 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1621 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1623 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1625 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1629 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1631 DataArrayInt *v0=0,*v1=0;
1632 self->findCommonCells(compType,startCellId,v0,v1);
1633 PyObject *res = PyList_New(2);
1634 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1635 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1640 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1643 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1644 if (!SWIG_IsOK(res1))
1647 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1648 self->renumberNodesInConn(tmp);
1652 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1654 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1655 da2->checkAllocated();
1656 self->renumberNodesInConn(da2->getConstPointer());
1660 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1663 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1664 PyObject *ret=PyTuple_New(2);
1665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1666 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1670 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1672 DataArrayInt *ret=0;
1674 int szArr,sw,iTypppArr;
1675 std::vector<int> stdvecTyyppArr;
1676 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1677 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1681 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1685 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1686 PyObject *res = PyList_New(3);
1687 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1688 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1689 PyList_SetItem(res,2,SWIG_From_int(ret2));
1693 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1697 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1698 PyObject *res = PyList_New(3);
1699 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1700 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1701 PyList_SetItem(res,2,SWIG_From_int(ret2));
1705 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1708 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1709 if (!SWIG_IsOK(res1))
1712 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1713 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1717 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1719 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1720 da2->checkAllocated();
1721 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1725 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1729 std::vector<int> multiVal;
1730 std::pair<int, std::pair<int,int> > slic;
1731 MEDCoupling::DataArrayInt *daIntTyypp=0;
1732 int nbc=self->getNumberOfCells();
1733 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1740 std::ostringstream oss;
1741 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1742 throw INTERP_KERNEL::Exception(oss.str().c_str());
1745 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1750 int tmp=nbc+singleVal;
1751 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1755 std::ostringstream oss;
1756 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1757 throw INTERP_KERNEL::Exception(oss.str().c_str());
1763 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1767 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1772 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1773 daIntTyypp->checkAllocated();
1774 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1777 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1781 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1784 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1785 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1786 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1787 for(int i=0;i<sz;i++)
1788 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1791 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1794 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1796 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1797 std::vector<double> val3;
1798 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1799 "Rotate2DAlg",2,true,nbNodes);
1801 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1802 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1805 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1808 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1809 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1810 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1811 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1812 for(int i=0;i<sz;i++)
1813 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1816 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1819 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1821 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1822 std::vector<double> val3;
1823 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1824 "Rotate3DAlg",3,true,nbNodes);
1826 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1827 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1828 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1833 //== MEDCouplingPointSet End
1835 class MEDCouplingUMeshCell
1838 INTERP_KERNEL::NormalizedCellType getType() const;
1841 std::string __str__() const throw(INTERP_KERNEL::Exception)
1843 return self->repr();
1846 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1849 const int *r=self->getAllConn(ret2);
1850 PyObject *ret=PyTuple_New(ret2);
1851 for(int i=0;i<ret2;i++)
1852 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1858 class MEDCouplingUMeshCellIterator
1865 MEDCouplingUMeshCell *ret=self->nextt();
1867 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1870 PyErr_SetString(PyExc_StopIteration,"No more data.");
1877 class MEDCouplingUMeshCellByTypeIterator
1880 ~MEDCouplingUMeshCellByTypeIterator();
1885 MEDCouplingUMeshCellEntry *ret=self->nextt();
1887 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1890 PyErr_SetString(PyExc_StopIteration,"No more data.");
1897 class MEDCouplingUMeshCellByTypeEntry
1900 ~MEDCouplingUMeshCellByTypeEntry();
1903 MEDCouplingUMeshCellByTypeIterator *__iter__()
1905 return self->iterator();
1910 class MEDCouplingUMeshCellEntry
1913 INTERP_KERNEL::NormalizedCellType getType() const;
1914 int getNumberOfElems() const;
1917 MEDCouplingUMeshCellIterator *__iter__()
1919 return self->iterator();
1924 //== MEDCouplingUMesh
1926 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1929 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1930 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1931 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1932 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1933 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1934 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1935 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1936 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1937 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1938 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1939 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1940 void computeTypes() throw(INTERP_KERNEL::Exception);
1941 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1942 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1944 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1945 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1946 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1947 DataArrayInt *colinearizeKeepingConform2D(double eps) throw(INTERP_KERNEL::Exception);
1948 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1949 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1950 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1951 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1952 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1953 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1954 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1955 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1956 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1957 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1958 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1959 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1960 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1961 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1962 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1963 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1964 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1965 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1966 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1967 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1968 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1969 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1970 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1971 DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes() throw(INTERP_KERNEL::Exception);
1972 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1973 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1974 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1975 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1976 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1977 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1978 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1979 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1980 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1981 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1982 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1983 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1984 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1985 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1986 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1987 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1988 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1989 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1990 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1991 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1992 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);
1993 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1994 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1995 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1996 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1997 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1999 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
2001 return MEDCouplingUMesh::New();
2004 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
2006 return MEDCouplingUMesh::New(meshName,meshDim);
2009 std::string __str__() const throw(INTERP_KERNEL::Exception)
2011 return self->simpleRepr();
2014 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2016 std::ostringstream oss;
2017 self->reprQuickOverview(oss);
2021 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2023 return self->cellIterator();
2026 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2028 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2032 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2034 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2035 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2036 PyObject *res=PyList_New(result.size());
2037 for(int i=0;iL!=result.end(); i++, iL++)
2038 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2042 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2046 std::vector<int> multiVal;
2047 std::pair<int, std::pair<int,int> > slic;
2048 MEDCoupling::DataArrayInt *daIntTyypp=0;
2049 int nbc=self->getNumberOfCells();
2050 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2057 std::ostringstream oss;
2058 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2059 throw INTERP_KERNEL::Exception(oss.str().c_str());
2063 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2070 int tmp=nbc+singleVal;
2071 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2076 std::ostringstream oss;
2077 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2078 throw INTERP_KERNEL::Exception(oss.str().c_str());
2084 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2090 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2091 daIntTyypp->checkAllocated();
2092 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2096 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2100 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2104 std::vector<int> multiVal;
2105 std::pair<int, std::pair<int,int> > slic;
2106 MEDCoupling::DataArrayInt *daIntTyypp=0;
2107 int nbc=self->getNumberOfCells();
2108 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2115 std::ostringstream oss;
2116 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2117 throw INTERP_KERNEL::Exception(oss.str().c_str());
2121 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2128 int tmp=nbc+singleVal;
2129 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2134 std::ostringstream oss;
2135 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2136 throw INTERP_KERNEL::Exception(oss.str().c_str());
2142 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2147 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2153 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2154 daIntTyypp->checkAllocated();
2155 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2159 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2163 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2165 int szArr,sw,iTypppArr;
2166 std::vector<int> stdvecTyyppArr;
2167 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2170 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2171 throw INTERP_KERNEL::Exception(oss.str().c_str());
2173 self->insertNextCell(type,size,tmp);
2176 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2178 int szArr,sw,iTypppArr;
2179 std::vector<int> stdvecTyyppArr;
2180 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2181 self->insertNextCell(type,szArr,tmp);
2184 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2186 DataArrayInt *ret=self->getNodalConnectivity();
2191 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2193 DataArrayInt *ret=self->getNodalConnectivityIndex();
2199 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2201 int szArr,sw,iTypppArr;
2202 std::vector<int> stdvecTyyppArr;
2203 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2204 int nbOfDepthPeelingPerformed=0;
2205 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2206 PyObject *res=PyTuple_New(2);
2207 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2212 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2214 DataArrayInt *v0=0,*v1=0;
2215 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2216 PyObject *res = PyList_New(2);
2217 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2226 DataArrayDoubleTuple *aa;
2227 std::vector<double> bb;
2229 int nbOfCompo=self->getSpaceDimension();
2230 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2233 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2234 PyObject *ret=PyTuple_New(2);
2235 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2236 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2240 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2242 DataArrayInt *ret1=0;
2243 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2244 PyObject *ret=PyTuple_New(2);
2245 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2246 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2250 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2253 DataArrayInt *ret1(0);
2254 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2255 PyObject *ret=PyTuple_New(3);
2256 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2257 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2258 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2262 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2264 std::vector<int> cells;
2265 self->checkButterflyCells(cells,eps);
2266 DataArrayInt *ret=DataArrayInt::New();
2267 ret->alloc((int)cells.size(),1);
2268 std::copy(cells.begin(),cells.end(),ret->getPointer());
2269 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2272 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2274 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2276 PyObject *ret = PyList_New(sz);
2277 for(int i=0;i<sz;i++)
2278 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2282 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2284 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2285 int sz=retCpp.size();
2286 PyObject *ret=PyList_New(sz);
2287 for(int i=0;i<sz;i++)
2288 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2292 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2294 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2295 int sz=retCpp.size();
2296 PyObject *ret=PyList_New(sz);
2297 for(int i=0;i<sz;i++)
2298 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2302 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2305 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2306 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2310 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2313 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2314 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2318 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2321 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2322 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2326 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2328 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2329 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2330 PyObject *ret=PyTuple_New(3);
2331 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2332 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2333 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2339 DataArrayInt *tmp0=0,*tmp1=0;
2340 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2351 std::vector<int> multiVal;
2352 std::pair<int, std::pair<int,int> > slic;
2353 MEDCoupling::DataArrayInt *daIntTyypp=0;
2354 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2358 return self->duplicateNodes(&singleVal,&singleVal+1);
2360 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2362 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2364 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2368 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2372 std::vector<int> multiVal;
2373 std::pair<int, std::pair<int,int> > slic;
2374 MEDCoupling::DataArrayInt *daIntTyypp=0;
2375 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2379 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2381 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2383 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2385 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2389 void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds) throw(INTERP_KERNEL::Exception)
2391 int szArr,sw,iTypppArr;
2392 std::vector<int> stdvecTyyppArr;
2393 const int *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2394 self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2397 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2400 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2401 DataArrayInt *tmp0,*tmp1=0;
2402 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2403 PyObject *ret=PyTuple_New(2);
2404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2409 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2411 DataArrayInt *ret0=0,*ret1=0;
2412 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2413 PyObject *ret=PyTuple_New(2);
2414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2421 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2422 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2423 DataArrayInt *ret1=0,*ret2=0;
2424 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2425 PyObject *ret=PyTuple_New(3);
2426 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2427 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2428 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2432 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2434 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2435 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2436 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2437 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2440 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2443 std::vector<const MEDCouplingUMesh *> meshes;
2444 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2445 std::vector<DataArrayInt *> corr;
2446 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2448 PyObject *ret1=PyList_New(sz);
2449 for(int i=0;i<sz;i++)
2450 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2451 PyObject *ret=PyList_New(2);
2452 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2453 PyList_SetItem(ret,1,ret1);
2457 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2459 std::vector<MEDCouplingUMesh *> meshes;
2460 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2461 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2464 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2466 std::vector<MEDCouplingUMesh *> meshes;
2467 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2468 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2471 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2475 std::vector<int> multiVal;
2476 std::pair<int, std::pair<int,int> > slic;
2477 MEDCoupling::DataArrayInt *daIntTyypp=0;
2479 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2480 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2484 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2486 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2488 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2490 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2494 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2496 DataArrayInt *arrOut=0,*arrIndexOut=0;
2499 std::vector<int> multiVal;
2500 std::pair<int, std::pair<int,int> > slic;
2501 MEDCoupling::DataArrayInt *daIntTyypp=0;
2503 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2504 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2509 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2514 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2519 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2523 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2525 PyObject *ret=PyTuple_New(2);
2526 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2531 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2533 DataArrayInt *arrOut=0,*arrIndexOut=0;
2534 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2535 PyObject *ret=PyTuple_New(2);
2536 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2543 if(!PySlice_Check(slic))
2544 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2545 Py_ssize_t strt=2,stp=2,step=2;
2547 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2548 arrIndxIn->checkAllocated();
2549 if(arrIndxIn->getNumberOfComponents()!=1)
2550 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2551 GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2552 DataArrayInt *arrOut=0,*arrIndexOut=0;
2553 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2554 PyObject *ret=PyTuple_New(2);
2555 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2561 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2562 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2564 DataArrayInt *arrOut=0,*arrIndexOut=0;
2567 std::vector<int> multiVal;
2568 std::pair<int, std::pair<int,int> > slic;
2569 MEDCoupling::DataArrayInt *daIntTyypp=0;
2571 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2572 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2577 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2582 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2587 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2591 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2593 PyObject *ret=PyTuple_New(2);
2594 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2599 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2600 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2604 std::vector<int> multiVal;
2605 std::pair<int, std::pair<int,int> > slic;
2606 MEDCoupling::DataArrayInt *daIntTyypp=0;
2608 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2609 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2614 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2619 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2624 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2628 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2632 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2636 DataArrayDoubleTuple *aa;
2637 std::vector<double> bb;
2639 int spaceDim=self->getSpaceDimension();
2640 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2641 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2643 std::vector<int> cells;
2644 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2645 DataArrayInt *ret=DataArrayInt::New();
2646 ret->alloc((int)cells.size(),1);
2647 std::copy(cells.begin(),cells.end(),ret->getPointer());
2648 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2651 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2655 DataArrayDoubleTuple *aa;
2656 std::vector<double> bb;
2658 int spaceDim=self->getSpaceDimension();
2659 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2660 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2661 self->orientCorrectly2DCells(v,polyOnly);
2664 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2666 std::vector<int> cells;
2667 self->arePolyhedronsNotCorrectlyOriented(cells);
2668 DataArrayInt *ret=DataArrayInt::New();
2669 ret->alloc((int)cells.size(),1);
2670 std::copy(cells.begin(),cells.end(),ret->getPointer());
2671 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2674 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2678 self->getFastAveragePlaneOfThis(vec,pos);
2680 std::copy(vec,vec+3,vals);
2681 std::copy(pos,pos+3,vals+3);
2682 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2685 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2687 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2688 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2689 return MEDCouplingUMesh::MergeUMeshes(tmp);
2692 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2695 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2696 PyObject *ret=PyTuple_New(2);
2697 PyObject *ret0Py=ret0?Py_True:Py_False;
2699 PyTuple_SetItem(ret,0,ret0Py);
2700 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2707 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2708 PyObject *ret=PyTuple_New(2);
2709 PyObject *ret0Py=ret0?Py_True:Py_False;
2711 PyTuple_SetItem(ret,0,ret0Py);
2712 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2716 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2718 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2719 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2720 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2721 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2722 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2723 PyObject *ret=PyTuple_New(5);
2724 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2725 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2726 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2727 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2728 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2734 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2735 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2736 PyObject *ret=PyTuple_New(5);
2737 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2739 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2740 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2741 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2745 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2747 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2748 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2749 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2750 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2751 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2752 PyObject *ret=PyTuple_New(5);
2753 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2754 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2755 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2756 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2757 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2761 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2763 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2764 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2765 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2766 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2767 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2768 PyObject *ret=PyTuple_New(5);
2769 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2771 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2773 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2777 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2779 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2780 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2781 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2782 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2783 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2784 PyObject *ret=PyTuple_New(5);
2785 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2786 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2787 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2788 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2789 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2793 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2795 DataArrayInt *neighbors=0,*neighborsIdx=0;
2796 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2797 PyObject *ret=PyTuple_New(2);
2798 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2799 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2805 DataArrayInt *neighbors=0,*neighborsIdx=0;
2806 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2807 PyObject *ret=PyTuple_New(2);
2808 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2815 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2816 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2817 PyObject *ret=PyTuple_New(2);
2818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2825 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2826 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2827 PyObject *ret=PyTuple_New(2);
2828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2835 DataArrayInt *neighbors=0,*neighborsIdx=0;
2836 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2837 PyObject *ret=PyTuple_New(2);
2838 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2843 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2845 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2846 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2847 DataArrayInt *d2,*d3,*d4,*dd5;
2848 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2849 PyObject *ret=PyTuple_New(7);
2850 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2851 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2852 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2854 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2855 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2856 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2860 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2863 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2864 da->checkAllocated();
2865 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2868 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2871 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2872 da->checkAllocated();
2873 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2876 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2879 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2880 da->checkAllocated();
2881 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2884 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2887 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2888 da->checkAllocated();
2889 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2890 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2891 PyObject *res = PyList_New(result.size());
2892 for (int i=0;iL!=result.end(); i++, iL++)
2893 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2897 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2900 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2901 da->checkAllocated();
2902 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2903 ret->setName(da->getName().c_str());
2907 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2909 DataArrayInt *cellNb1=0,*cellNb2=0;
2910 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2911 PyObject *ret=PyTuple_New(3);
2912 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2913 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2914 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2918 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2920 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2921 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2922 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2923 PyObject *ret(PyTuple_New(4));
2924 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2925 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2926 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2927 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2931 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2933 int spaceDim=self->getSpaceDimension();
2935 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2937 DataArrayDouble *a,*a2;
2938 DataArrayDoubleTuple *aa,*aa2;
2939 std::vector<double> bb,bb2;
2941 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2942 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2943 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2944 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2946 DataArrayInt *cellIds=0;
2947 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2948 PyObject *ret=PyTuple_New(2);
2949 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2950 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2954 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2956 int spaceDim=self->getSpaceDimension();
2958 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2960 DataArrayDouble *a,*a2;
2961 DataArrayDoubleTuple *aa,*aa2;
2962 std::vector<double> bb,bb2;
2964 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2965 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2966 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2967 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2969 DataArrayInt *cellIds=0;
2970 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2971 PyObject *ret=PyTuple_New(2);
2972 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2973 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2977 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2980 DataArrayDouble *a,*a2;
2981 DataArrayDoubleTuple *aa,*aa2;
2982 std::vector<double> bb,bb2;
2984 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2985 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2986 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2987 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2988 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2992 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2994 int spaceDim=self->getSpaceDimension();
2996 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2998 DataArrayDouble *a,*a2;
2999 DataArrayDoubleTuple *aa,*aa2;
3000 std::vector<double> bb,bb2;
3002 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
3003 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
3004 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3005 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3006 return self->getCellIdsCrossingPlane(orig,vect,eps);
3009 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
3013 std::vector<int> pos2;
3014 DataArrayInt *pos3=0;
3015 DataArrayIntTuple *pos4=0;
3016 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3021 self->convertToPolyTypes(&pos1,&pos1+1);
3028 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3033 self->convertToPolyTypes(pos3->begin(),pos3->end());
3037 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3041 void convertAllToPoly();
3042 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3043 bool unPolyze() throw(INTERP_KERNEL::Exception);
3044 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3045 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3046 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3049 //== MEDCouplingUMesh End
3051 //== MEDCouplingMappedExtrudedMesh
3053 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3056 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3057 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3058 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3059 int get2DCellIdForExtrusion() const;
3061 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3063 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3066 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3068 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3071 MEDCouplingMappedExtrudedMesh()
3073 return MEDCouplingMappedExtrudedMesh::New();
3076 std::string __str__() const throw(INTERP_KERNEL::Exception)
3078 return self->simpleRepr();
3081 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3083 std::ostringstream oss;
3084 self->reprQuickOverview(oss);
3088 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3090 MEDCouplingUMesh *ret=self->getMesh2D();
3093 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3095 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3097 MEDCouplingUMesh *ret=self->getMesh1D();
3100 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3102 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3104 DataArrayInt *ret=self->getMesh3DIds();
3107 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3112 //== MEDCouplingMappedExtrudedMesh End
3114 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3117 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3118 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3119 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3120 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3121 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3122 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3125 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3127 int szArr,sw,iTypppArr;
3128 std::vector<int> stdvecTyyppArr;
3129 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3130 self->insertNextCell(tmp,tmp+szArr);
3133 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3135 DataArrayInt *ret=self->getNodalConnectivity();
3136 if(ret) ret->incrRef();
3140 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3142 std::vector< const MEDCoupling1GTUMesh *> parts;
3143 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3144 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3149 //== MEDCoupling1SGTUMesh
3151 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3154 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3155 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3156 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3157 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3158 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3159 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3160 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3161 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3162 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3165 MEDCoupling1SGTUMesh()
3167 return MEDCoupling1SGTUMesh::New();
3170 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3172 return MEDCoupling1SGTUMesh::New(name,type);
3175 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3177 return MEDCoupling1SGTUMesh::New(m);
3180 std::string __str__() const throw(INTERP_KERNEL::Exception)
3182 return self->simpleRepr();
3185 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3187 std::ostringstream oss;
3188 self->reprQuickOverview(oss);
3192 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3194 DataArrayInt *cellPerm(0),*nodePerm(0);
3195 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3196 PyObject *ret(PyTuple_New(3));
3197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3199 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3203 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3205 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3206 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3207 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3210 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3212 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3213 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3214 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3219 //== MEDCoupling1SGTUMesh End
3221 //== MEDCoupling1DGTUMesh
3223 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3226 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3227 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3228 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3229 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3230 bool isPacked() const throw(INTERP_KERNEL::Exception);
3233 MEDCoupling1DGTUMesh()
3235 return MEDCoupling1DGTUMesh::New();
3237 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3239 return MEDCoupling1DGTUMesh::New(name,type);
3242 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3244 return MEDCoupling1DGTUMesh::New(m);
3247 std::string __str__() const throw(INTERP_KERNEL::Exception)
3249 return self->simpleRepr();
3252 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3254 std::ostringstream oss;
3255 self->reprQuickOverview(oss);
3259 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3261 DataArrayInt *ret=self->getNodalConnectivityIndex();
3262 if(ret) ret->incrRef();
3266 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3268 DataArrayInt *ret1=0,*ret2=0;
3269 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3270 PyObject *ret0Py=ret0?Py_True:Py_False;
3272 PyObject *ret=PyTuple_New(3);
3273 PyTuple_SetItem(ret,0,ret0Py);
3274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3275 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3279 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3282 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3283 PyObject *ret=PyTuple_New(2);
3284 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3285 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3286 PyTuple_SetItem(ret,1,ret1Py);
3290 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3292 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3293 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3294 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3297 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3299 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3300 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3301 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3304 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3306 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3307 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3308 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3313 //== MEDCoupling1DGTUMeshEnd
3315 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3318 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3319 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3320 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3321 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3322 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3323 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3324 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3325 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3326 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3327 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3328 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3329 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3330 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3331 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3332 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3335 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3337 int tmpp1=-1,tmpp2=-1;
3338 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3339 std::vector< std::pair<int,int> > inp;
3343 for(int i=0;i<tmpp1;i++)
3344 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3349 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3350 inp.resize(tmpp1/2);
3351 for(int i=0;i<tmpp1/2;i++)
3352 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3355 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3356 return self->buildStructuredSubPart(inp);
3359 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3361 std::vector< std::pair<int,int> > inp;
3362 convertPyToVectorPairInt(part,inp);
3364 int szArr,sw,iTypppArr;
3365 std::vector<int> stdvecTyyppArr;
3366 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3367 std::vector<int> tmp5(tmp4,tmp4+szArr);
3369 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3372 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3374 std::vector< std::pair<int,int> > inp;
3375 convertPyToVectorPairInt(part,inp);
3376 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3379 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3381 std::vector< std::pair<int,int> > inp;
3382 convertPyToVectorPairInt(part,inp);
3383 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3386 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3388 std::vector< std::pair<int,int> > inp;
3389 convertPyToVectorPairInt(part,inp);
3390 std::vector<int> stWithGhost;
3391 std::vector< std::pair<int,int> > partWithGhost;
3392 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3393 PyObject *ret(PyTuple_New(2));
3394 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3395 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3399 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3401 std::vector< std::pair<int,int> > inp;
3402 convertPyToVectorPairInt(partCompactFormat,inp);
3403 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3406 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3408 std::vector< std::pair<int,int> > inp;
3409 convertPyToVectorPairInt(partCompactFormat,inp);
3410 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3413 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3415 std::vector< std::pair<int,int> > inp;
3416 convertPyToVectorPairInt(part,inp);
3417 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3420 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3422 int szArr,sw,iTypppArr;
3423 std::vector<int> stdvecTyyppArr;
3424 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3425 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3428 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3430 int szArr,sw,iTypppArr;
3431 std::vector<int> stdvecTyyppArr;
3432 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3433 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3436 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3438 std::vector< std::pair<int,int> > inp;
3439 convertPyToVectorPairInt(partCompactFormat,inp);
3440 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3443 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3445 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3446 PyObject *retPy=PyList_New(ret.size());
3447 for(std::size_t i=0;i<ret.size();i++)
3449 PyObject *tmp=PyTuple_New(2);
3450 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3451 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3452 PyList_SetItem(retPy,i,tmp);
3457 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3459 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3460 convertPyToVectorPairInt(r1,r1Cpp);
3461 convertPyToVectorPairInt(r2,r2Cpp);
3462 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3463 PyObject *retPy=PyList_New(ret.size());
3464 for(std::size_t i=0;i<ret.size();i++)
3466 PyObject *tmp=PyTuple_New(2);
3467 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3468 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3469 PyList_SetItem(retPy,i,tmp);
3474 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3476 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3477 convertPyToVectorPairInt(r1,r1Cpp);
3478 convertPyToVectorPairInt(r2,r2Cpp);
3479 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3482 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3484 int szArr,sw,iTypppArr;
3485 std::vector<int> stdvecTyyppArr;
3486 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3487 int szArr2,sw2,iTypppArr2;
3488 std::vector<int> stdvecTyyppArr2;
3489 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3490 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3491 std::vector< std::pair<int,int> > partCompactFormat;
3492 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3493 PyObject *ret=PyTuple_New(2);
3494 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3495 PyTuple_SetItem(ret,0,ret0Py);
3496 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3497 for(std::size_t i=0;i<partCompactFormat.size();i++)
3499 PyObject *tmp4=PyTuple_New(2);
3500 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3501 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3502 PyList_SetItem(ret1Py,i,tmp4);
3504 PyTuple_SetItem(ret,1,ret1Py);
3508 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3510 std::vector< std::pair<int,int> > param0,param1,ret;
3511 convertPyToVectorPairInt(bigInAbs,param0);
3512 convertPyToVectorPairInt(partOfBigInAbs,param1);
3513 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3514 PyObject *retPy(PyList_New(ret.size()));
3515 for(std::size_t i=0;i<ret.size();i++)
3517 PyObject *tmp(PyTuple_New(2));
3518 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3519 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3520 PyList_SetItem(retPy,i,tmp);
3525 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3527 std::vector< std::pair<int,int> > param0;
3528 convertPyToVectorPairInt(part,param0);
3529 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3530 PyObject *retPy(PyList_New(ret.size()));
3531 for(std::size_t i=0;i<ret.size();i++)
3533 PyObject *tmp(PyTuple_New(2));
3534 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3535 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3536 PyList_SetItem(retPy,i,tmp);
3541 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3543 std::vector< std::pair<int,int> > param0,param1;
3544 convertPyToVectorPairInt(startingFrom,param0);
3545 convertPyToVectorPairInt(goingTo,param1);
3546 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3549 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3551 std::vector< std::pair<int,int> > param0,param1,ret;
3552 convertPyToVectorPairInt(bigInAbs,param0);
3553 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3554 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3555 PyObject *retPy(PyList_New(ret.size()));
3556 for(std::size_t i=0;i<ret.size();i++)
3558 PyObject *tmp(PyTuple_New(2));
3559 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3560 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3561 PyList_SetItem(retPy,i,tmp);
3568 class MEDCouplingCurveLinearMesh;
3570 //== MEDCouplingCMesh
3572 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3575 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3576 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3577 void setCoords(const DataArrayDouble *coordsX,
3578 const DataArrayDouble *coordsY=0,
3579 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3580 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3581 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3583 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3585 return MEDCouplingCMesh::New();
3587 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3589 return MEDCouplingCMesh::New(meshName);
3591 std::string __str__() const throw(INTERP_KERNEL::Exception)
3593 return self->simpleRepr();
3595 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3597 std::ostringstream oss;
3598 self->reprQuickOverview(oss);
3601 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3603 DataArrayDouble *ret=self->getCoordsAt(i);
3611 //== MEDCouplingCMesh End
3613 //== MEDCouplingCurveLinearMesh
3615 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3618 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3619 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3620 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3622 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3624 return MEDCouplingCurveLinearMesh::New();
3626 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3628 return MEDCouplingCurveLinearMesh::New(meshName);
3630 std::string __str__() const throw(INTERP_KERNEL::Exception)
3632 return self->simpleRepr();
3634 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3636 std::ostringstream oss;
3637 self->reprQuickOverview(oss);
3640 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3642 DataArrayDouble *ret=self->getCoords();
3647 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3649 int szArr,sw,iTypppArr;
3650 std::vector<int> stdvecTyyppArr;
3651 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3652 self->setNodeGridStructure(tmp,tmp+szArr);
3657 //== MEDCouplingCurveLinearMesh End
3659 //== MEDCouplingIMesh
3661 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3664 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3666 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3667 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3668 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3669 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3670 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3671 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3672 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3673 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3674 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3675 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3676 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3681 return MEDCouplingIMesh::New();
3683 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3685 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3686 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3687 const int *nodeStrctPtr(0);
3688 const double *originPtr(0),*dxyzPtr(0);
3690 std::vector<int> bb0;
3691 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3694 std::vector<double> bb,bb2;
3696 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3697 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3699 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3702 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3704 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3707 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3710 std::vector<int> bb0;
3711 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3712 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3715 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3717 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3720 DataArrayDoubleTuple *aa;
3721 std::vector<double> bb;
3723 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3724 self->setOrigin(originPtr,originPtr+nbTuples);
3727 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3729 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3732 DataArrayDoubleTuple *aa;
3733 std::vector<double> bb;
3735 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3736 self->setDXYZ(originPtr,originPtr+nbTuples);
3739 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3741 std::vector< std::pair<int,int> > inp;
3742 convertPyToVectorPairInt(fineLocInCoarse,inp);
3743 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3746 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)
3748 std::vector< std::pair<int,int> > inp;
3749 convertPyToVectorPairInt(fineLocInCoarse,inp);
3750 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3753 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3755 std::vector< std::pair<int,int> > inp;
3756 convertPyToVectorPairInt(fineLocInCoarse,inp);
3757 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3760 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)
3762 std::vector< std::pair<int,int> > inp;
3763 convertPyToVectorPairInt(fineLocInCoarse,inp);
3764 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3767 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)
3769 std::vector< std::pair<int,int> > inp;
3770 convertPyToVectorPairInt(fineLocInCoarse,inp);
3771 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3774 std::string __str__() const throw(INTERP_KERNEL::Exception)
3776 return self->simpleRepr();
3778 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3780 std::ostringstream oss;
3781 self->reprQuickOverview(oss);
3787 //== MEDCouplingIMesh End
3791 namespace MEDCoupling
3793 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3796 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3797 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3798 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3799 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3800 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3801 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3802 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3803 std::string getName() const throw(INTERP_KERNEL::Exception);
3804 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3805 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3806 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3807 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3808 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3809 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3810 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3811 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3812 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3813 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3814 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3815 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3816 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3817 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3818 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3819 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3821 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3823 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3826 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3829 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3831 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3834 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3837 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3839 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3840 return convertIntArrToPyList3(ret);
3843 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3845 DataArrayInt *ret1=0;
3846 MEDCouplingMesh *ret0=0;
3848 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3849 if (!SWIG_IsOK(res1))
3852 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3853 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3857 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3859 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3860 da2->checkAllocated();
3861 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3863 PyObject *res = PyList_New(2);
3864 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3865 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3869 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3871 DataArrayInt *ret1=0;
3873 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3874 PyObject *res=PyTuple_New(2);
3875 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3877 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3880 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3881 PyTuple_SetItem(res,1,res1);
3886 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3889 int v0; std::vector<int> v1;
3890 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3891 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3894 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3895 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3898 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3899 if (!SWIG_IsOK(res1))
3902 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3903 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3907 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3909 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3910 da2->checkAllocated();
3911 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3915 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3917 std::vector<int> tmp;
3918 self->getCellIdsHavingGaussLocalization(locId,tmp);
3919 DataArrayInt *ret=DataArrayInt::New();
3920 ret->alloc((int)tmp.size(),1);
3921 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3922 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3925 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3927 std::vector<int> inp0;
3928 convertPyToNewIntArr4(code,1,3,inp0);
3929 std::vector<const DataArrayInt *> inp1;
3930 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3931 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3936 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3939 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3940 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3941 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3942 static MEDCouplingFieldTemplate *New(TypeOfField type);
3943 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3944 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3945 bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3946 bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception);
3949 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3951 return MEDCouplingFieldTemplate::New(f);
3954 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3956 return MEDCouplingFieldTemplate::New(f);
3959 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3961 return MEDCouplingFieldTemplate::New(f);
3964 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3966 return MEDCouplingFieldTemplate::New(type);
3969 std::string __str__() const throw(INTERP_KERNEL::Exception)
3971 return self->simpleRepr();
3974 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3976 std::ostringstream oss;
3977 self->reprQuickOverview(oss);
3981 PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const throw(INTERP_KERNEL::Exception)
3984 bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3985 PyObject *ret=PyTuple_New(2);
3986 PyObject *ret0Py=ret0?Py_True:Py_False;
3988 PyTuple_SetItem(ret,0,ret0Py);
3989 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3996 class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3999 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4001 MEDCouplingFieldT();
4002 ~MEDCouplingFieldT();
4005 %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
4006 %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
4007 %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
4009 class MEDCouplingFieldInt;
4010 class MEDCouplingFieldFloat;
4012 class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
4015 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4016 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4017 bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4018 bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
4019 void setTimeUnit(const std::string& unit);
4020 std::string getTimeUnit() const;
4021 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
4022 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4023 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4024 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4025 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4026 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4027 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4028 MEDCouplingFieldFloat *convertToFloatField() const throw(INTERP_KERNEL::Exception);
4029 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4030 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4031 MEDCouplingFieldDouble *deepCopy() const;
4032 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4033 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4034 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4035 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4036 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4037 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4038 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4039 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4040 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4041 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4042 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4043 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4044 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4045 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4046 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4047 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4048 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4049 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4050 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4051 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4052 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4053 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4054 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4055 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4056 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4057 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4058 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4059 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4060 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4061 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4062 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4063 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4064 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4065 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4066 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4067 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4068 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4069 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4070 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4071 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4072 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4073 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4074 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4075 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4076 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4077 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4078 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4079 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4080 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4081 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4082 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4083 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4084 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4085 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4086 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4087 double getMinValue() const throw(INTERP_KERNEL::Exception);
4088 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4089 double norm2() const throw(INTERP_KERNEL::Exception);
4090 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4091 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4092 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4093 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4094 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4095 double normMax(int compId) const throw(INTERP_KERNEL::Exception);
4096 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4097 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4098 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4099 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4100 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4101 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4102 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4103 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4104 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4105 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4106 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4107 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4108 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4109 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4110 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4111 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4112 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4114 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4116 return MEDCouplingFieldDouble::New(type,td);
4119 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4121 return MEDCouplingFieldDouble::New(ft,td);
4124 std::string __str__() const throw(INTERP_KERNEL::Exception)
4126 return self->simpleRepr();
4129 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4131 std::ostringstream oss;
4132 self->reprQuickOverview(oss);
4136 PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
4139 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4140 PyObject *ret=PyTuple_New(2);
4141 PyObject *ret0Py=ret0?Py_True:Py_False;
4143 PyTuple_SetItem(ret,0,ret0Py);
4144 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4148 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4150 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4154 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4156 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4160 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4162 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4164 DataArrayDouble *a,*a2;
4165 DataArrayDoubleTuple *aa,*aa2;
4166 std::vector<double> bb,bb2;
4168 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4169 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4170 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4173 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4175 DataArrayDouble *ret=self->getArray();
4181 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4183 std::vector<DataArrayDouble *> arrs=self->getArrays();
4184 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4188 PyObject *ret=PyTuple_New(sz);
4189 for(int i=0;i<sz;i++)
4192 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4194 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4199 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4201 std::vector<const DataArrayDouble *> tmp;
4202 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4204 std::vector<DataArrayDouble *> arrs(sz);
4205 for(int i=0;i<sz;i++)
4206 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4207 self->setArrays(arrs);
4210 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4212 DataArrayDouble *ret=self->getEndArray();
4218 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4222 DataArrayDoubleTuple *aa;
4223 std::vector<double> bb;
4225 const MEDCouplingMesh *mesh=self->getMesh();
4227 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4228 int spaceDim=mesh->getSpaceDimension();
4229 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4230 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4232 int sz=self->getNumberOfComponents();
4233 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4234 self->getValueOn(spaceLoc,res);
4235 return convertDblArrToPyList<double>(res,sz);
4238 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4240 int sz=self->getNumberOfComponents();
4241 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4242 self->getValueOnPos(i,j,k,res);
4243 return convertDblArrToPyList<double>(res,sz);
4246 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4248 const MEDCouplingMesh *mesh(self->getMesh());
4250 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4253 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4254 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4255 mesh->getSpaceDimension(),true,nbPts);
4256 return self->getValueOnMulti(inp,nbPts);
4259 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4263 DataArrayDoubleTuple *aa;
4264 std::vector<double> bb;
4266 const MEDCouplingMesh *mesh=self->getMesh();
4268 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4269 int spaceDim=mesh->getSpaceDimension();
4270 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4271 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4274 int sz=self->getNumberOfComponents();
4275 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4276 self->getValueOn(spaceLoc,time,res);
4277 return convertDblArrToPyList<double>(res,sz);
4280 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4282 if(self->getArray()!=0)
4283 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4286 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4287 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4288 self->setArray(arr);
4292 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4295 double tmp0=self->getTime(tmp1,tmp2);
4296 PyObject *res = PyList_New(3);
4297 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4298 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4299 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4303 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4306 double tmp0=self->getStartTime(tmp1,tmp2);
4307 PyObject *res = PyList_New(3);
4308 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4309 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4310 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4314 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4317 double tmp0=self->getEndTime(tmp1,tmp2);
4318 PyObject *res = PyList_New(3);
4319 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4320 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4321 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4324 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4326 int sz=self->getNumberOfComponents();
4327 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4328 self->accumulate(tmp);
4329 return convertDblArrToPyList<double>(tmp,sz);
4331 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4333 int sz=self->getNumberOfComponents();
4334 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4335 self->integral(isWAbs,tmp);
4336 return convertDblArrToPyList<double>(tmp,sz);
4338 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4340 int sz=self->getNumberOfComponents();
4341 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4342 self->getWeightedAverageValue(tmp,isWAbs);
4343 return convertDblArrToPyList<double>(tmp,sz);
4345 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4347 int sz=self->getNumberOfComponents();
4348 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4350 return convertDblArrToPyList<double>(tmp,sz);
4352 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4354 int sz=self->getNumberOfComponents();
4355 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4357 return convertDblArrToPyList<double>(tmp,sz);
4359 PyObject *normMax() const throw(INTERP_KERNEL::Exception)
4361 int sz=self->getNumberOfComponents();
4362 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4364 return convertDblArrToPyList<double>(tmp,sz);
4366 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4368 int szArr,sw,iTypppArr;
4369 std::vector<int> stdvecTyyppArr;
4370 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4371 self->renumberCells(tmp,check);
4374 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4376 int szArr,sw,iTypppArr;
4377 std::vector<int> stdvecTyyppArr;
4378 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4379 self->renumberCellsWithoutMesh(tmp,check);
4382 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4384 int szArr,sw,iTypppArr;
4385 std::vector<int> stdvecTyyppArr;
4386 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4387 self->renumberNodes(tmp,eps);
4390 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4392 int szArr,sw,iTypppArr;
4393 std::vector<int> stdvecTyyppArr;
4394 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4395 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4398 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4400 return fieldT_buildSubPart(self,li);
4403 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4405 return fieldT__getitem__(self,li);
4408 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4411 double r1=self->getMaxValue2(tmp);
4412 PyObject *ret=PyTuple_New(2);
4413 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4414 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4418 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4421 double r1=self->getMinValue2(tmp);
4422 PyObject *ret=PyTuple_New(2);
4423 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4424 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4428 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4430 std::vector<int> tmp;
4431 convertPyToNewIntArr3(li,tmp);
4432 return self->keepSelectedComponents(tmp);
4435 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4437 std::vector<int> tmp;
4438 convertPyToNewIntArr3(li,tmp);
4439 self->setSelectedComponents(f,tmp);
4442 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4445 DataArrayDouble *a,*a2;
4446 DataArrayDoubleTuple *aa,*aa2;
4447 std::vector<double> bb,bb2;
4450 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4451 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4452 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4453 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4455 return self->extractSlice3D(orig,vect,eps);
4458 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4460 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4463 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4465 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4468 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4470 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.";
4471 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4474 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4476 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4478 return (*self)-(*other);
4480 throw INTERP_KERNEL::Exception(msg);
4485 DataArrayDoubleTuple *aa;
4486 std::vector<double> bb;
4488 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4493 if(!self->getArray())
4494 throw INTERP_KERNEL::Exception(msg2);
4495 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4496 ret->applyLin(1.,-val);
4497 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4498 ret2->setArray(ret);
4503 if(!self->getArray())
4504 throw INTERP_KERNEL::Exception(msg2);
4505 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4506 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4507 ret2->setArray(ret);
4512 if(!self->getArray())
4513 throw INTERP_KERNEL::Exception(msg2);
4514 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4515 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4516 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4517 ret2->setArray(ret);
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4531 { throw INTERP_KERNEL::Exception(msg); }
4535 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4537 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4540 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4542 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4545 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4547 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4550 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4552 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.";
4553 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4556 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4558 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4560 return (*self)/(*other);
4562 throw INTERP_KERNEL::Exception(msg);
4567 DataArrayDoubleTuple *aa;
4568 std::vector<double> bb;
4570 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4576 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4577 if(!self->getArray())
4578 throw INTERP_KERNEL::Exception(msg2);
4579 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4580 ret->applyLin(1./val,0);
4581 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4582 ret2->setArray(ret);
4587 if(!self->getArray())
4588 throw INTERP_KERNEL::Exception(msg2);
4589 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4590 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4591 ret2->setArray(ret);
4596 if(!self->getArray())
4597 throw INTERP_KERNEL::Exception(msg2);
4598 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4599 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4600 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4601 ret2->setArray(ret);
4606 if(!self->getArray())
4607 throw INTERP_KERNEL::Exception(msg2);
4608 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4609 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4610 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4611 ret2->setArray(ret);
4615 { throw INTERP_KERNEL::Exception(msg); }
4619 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4621 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4624 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4626 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.";
4627 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4630 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4632 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4634 return (*self)^(*other);
4636 throw INTERP_KERNEL::Exception(msg);
4641 DataArrayDoubleTuple *aa;
4642 std::vector<double> bb;
4644 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4649 if(!self->getArray())
4650 throw INTERP_KERNEL::Exception(msg2);
4651 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4653 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4654 ret2->setArray(ret);
4659 if(!self->getArray())
4660 throw INTERP_KERNEL::Exception(msg2);
4661 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4662 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4663 ret2->setArray(ret);
4668 if(!self->getArray())
4669 throw INTERP_KERNEL::Exception(msg2);
4670 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4671 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4672 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4673 ret2->setArray(ret);
4678 if(!self->getArray())
4679 throw INTERP_KERNEL::Exception(msg2);
4680 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4681 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4682 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4683 ret2->setArray(ret);
4687 { throw INTERP_KERNEL::Exception(msg); }
4691 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4693 return self->negate();
4696 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4698 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.";
4699 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4702 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4704 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4708 Py_XINCREF(trueSelf);
4712 throw INTERP_KERNEL::Exception(msg);
4717 DataArrayDoubleTuple *aa;
4718 std::vector<double> bb;
4720 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4725 if(!self->getArray())
4726 throw INTERP_KERNEL::Exception(msg2);
4727 self->getArray()->applyLin(1.,val);
4728 Py_XINCREF(trueSelf);
4733 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4736 Py_XINCREF(trueSelf);
4741 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4742 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4743 ret2->setArray(aaa);
4745 Py_XINCREF(trueSelf);
4750 if(!self->getArray())
4751 throw INTERP_KERNEL::Exception(msg2);
4752 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4753 self->getArray()->addEqual(aaa);
4754 Py_XINCREF(trueSelf);
4758 { throw INTERP_KERNEL::Exception(msg); }
4762 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4764 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.";
4765 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4768 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4770 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4774 Py_XINCREF(trueSelf);
4778 throw INTERP_KERNEL::Exception(msg);
4783 DataArrayDoubleTuple *aa;
4784 std::vector<double> bb;
4786 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4791 if(!self->getArray())
4792 throw INTERP_KERNEL::Exception(msg2);
4793 self->getArray()->applyLin(1.,-val);
4794 Py_XINCREF(trueSelf);
4799 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4802 Py_XINCREF(trueSelf);
4807 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4808 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4809 ret2->setArray(aaa);
4811 Py_XINCREF(trueSelf);
4816 if(!self->getArray())
4817 throw INTERP_KERNEL::Exception(msg2);
4818 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4819 self->getArray()->substractEqual(aaa);
4820 Py_XINCREF(trueSelf);
4824 { throw INTERP_KERNEL::Exception(msg); }
4828 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4830 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.";
4831 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4834 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4836 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4840 Py_XINCREF(trueSelf);
4844 throw INTERP_KERNEL::Exception(msg);
4849 DataArrayDoubleTuple *aa;
4850 std::vector<double> bb;
4852 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4857 if(!self->getArray())
4858 throw INTERP_KERNEL::Exception(msg2);
4859 self->getArray()->applyLin(val,0);
4860 Py_XINCREF(trueSelf);
4865 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4868 Py_XINCREF(trueSelf);
4873 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4874 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4875 ret2->setArray(aaa);
4877 Py_XINCREF(trueSelf);
4882 if(!self->getArray())
4883 throw INTERP_KERNEL::Exception(msg2);
4884 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4885 self->getArray()->multiplyEqual(aaa);
4886 Py_XINCREF(trueSelf);
4890 { throw INTERP_KERNEL::Exception(msg); }
4894 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4896 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.";
4897 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4900 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4902 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4906 Py_XINCREF(trueSelf);
4910 throw INTERP_KERNEL::Exception(msg);
4915 DataArrayDoubleTuple *aa;
4916 std::vector<double> bb;
4918 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4924 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4925 if(!self->getArray())
4926 throw INTERP_KERNEL::Exception(msg2);
4927 self->getArray()->applyLin(1./val,0);
4928 Py_XINCREF(trueSelf);
4933 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4936 Py_XINCREF(trueSelf);
4941 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4942 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4943 ret2->setArray(aaa);
4945 Py_XINCREF(trueSelf);
4950 if(!self->getArray())
4951 throw INTERP_KERNEL::Exception(msg2);
4952 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4953 self->getArray()->divideEqual(aaa);
4954 Py_XINCREF(trueSelf);
4958 { throw INTERP_KERNEL::Exception(msg); }
4962 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4964 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.";
4965 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4968 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4970 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4974 Py_XINCREF(trueSelf);
4978 throw INTERP_KERNEL::Exception(msg);
4983 DataArrayDoubleTuple *aa;
4984 std::vector<double> bb;
4986 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4991 if(!self->getArray())
4992 throw INTERP_KERNEL::Exception(msg2);
4993 self->getArray()->applyPow(val);
4994 Py_XINCREF(trueSelf);
4999 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5002 Py_XINCREF(trueSelf);
5007 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5008 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5009 ret2->setArray(aaa);
5011 Py_XINCREF(trueSelf);
5016 if(!self->getArray())
5017 throw INTERP_KERNEL::Exception(msg2);
5018 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5019 self->getArray()->powEqual(aaa);
5020 Py_XINCREF(trueSelf);
5024 { throw INTERP_KERNEL::Exception(msg); }
5028 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5030 std::vector<const MEDCouplingFieldDouble *> tmp;
5031 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5032 return MEDCouplingFieldDouble::MergeFields(tmp);
5035 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5037 std::vector<const MEDCouplingFieldDouble *> tmp;
5038 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5039 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5042 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5044 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5047 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5049 return field_serialize<double>(self);
5052 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5054 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5057 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5059 field__setstate__<double>(self,inp);
5064 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5067 int getNumberOfFields() const;
5068 MEDCouplingMultiFields *deepCopy() const;
5069 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5070 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5071 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5072 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5073 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5076 std::string __str__() const throw(INTERP_KERNEL::Exception)
5078 return self->simpleRepr();
5080 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5082 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5083 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5085 std::vector<MEDCouplingFieldDouble *> fs(sz);
5086 for(int i=0;i<sz;i++)
5087 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5088 return MEDCouplingMultiFields::New(fs);
5090 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5092 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5093 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5095 std::vector<MEDCouplingFieldDouble *> fs(sz);
5096 for(int i=0;i<sz;i++)
5097 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5098 return MEDCouplingMultiFields::New(fs);
5100 PyObject *getFields() const
5102 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5103 int sz=fields.size();
5104 PyObject *res = PyList_New(sz);
5105 for(int i=0;i<sz;i++)
5109 fields[i]->incrRef();
5110 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5114 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5119 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5121 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5125 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5128 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5130 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5132 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5134 PyObject *res = PyList_New(sz);
5135 for(int i=0;i<sz;i++)
5140 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5144 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5149 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5151 std::vector<int> refs;
5152 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5154 PyObject *res = PyList_New(sz);
5155 for(int i=0;i<sz;i++)
5160 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5164 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5168 PyObject *ret=PyTuple_New(2);
5169 PyTuple_SetItem(ret,0,res);
5170 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5173 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5175 std::vector<DataArrayDouble *> ms=self->getArrays();
5177 PyObject *res = PyList_New(sz);
5178 for(int i=0;i<sz;i++)
5183 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5187 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5192 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5194 std::vector< std::vector<int> > refs;
5195 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5197 PyObject *res = PyList_New(sz);
5198 PyObject *res2 = PyList_New(sz);
5199 for(int i=0;i<sz;i++)
5204 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5208 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5210 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5213 PyObject *ret=PyTuple_New(2);
5214 PyTuple_SetItem(ret,0,res);
5215 PyTuple_SetItem(ret,1,res2);
5221 class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
5224 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5225 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5226 bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5227 bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception);
5228 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5229 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5230 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5231 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5232 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5233 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5234 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5235 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5236 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5238 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5240 return MEDCouplingFieldInt::New(type,td);
5243 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5245 return MEDCouplingFieldInt::New(ft,td);
5248 PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const throw(INTERP_KERNEL::Exception)
5251 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5252 PyObject *ret=PyTuple_New(2);
5253 PyObject *ret0Py=ret0?Py_True:Py_False;
5255 PyTuple_SetItem(ret,0,ret0Py);
5256 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5260 std::string __str__() const throw(INTERP_KERNEL::Exception)
5262 return self->simpleRepr();
5265 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5267 std::ostringstream oss;
5268 self->reprQuickOverview(oss);
5272 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5274 return fieldT_buildSubPart(self,li);
5277 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5279 return fieldT__getitem__(self,li);
5282 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5284 DataArrayInt *ret=self->getArray();
5290 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5293 double tmp0=self->getTime(tmp1,tmp2);
5294 PyObject *res = PyList_New(3);
5295 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5296 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5297 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5301 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5303 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5306 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5308 return field_serialize<int>(self);
5311 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5313 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5316 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5318 field__setstate__<int>(self,inp);
5323 class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5326 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5327 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5328 bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5329 bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception);
5330 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5331 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5332 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5333 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5334 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5335 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5336 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5337 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5338 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5340 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5342 return MEDCouplingFieldFloat::New(type,td);
5345 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5347 return MEDCouplingFieldFloat::New(ft,td);
5350 PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const throw(INTERP_KERNEL::Exception)
5353 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5354 PyObject *ret=PyTuple_New(2);
5355 PyObject *ret0Py=ret0?Py_True:Py_False;
5357 PyTuple_SetItem(ret,0,ret0Py);
5358 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5362 std::string __str__() const throw(INTERP_KERNEL::Exception)
5364 return self->simpleRepr();
5367 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5369 std::ostringstream oss;
5370 self->reprQuickOverview(oss);
5374 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5376 return fieldT_buildSubPart(self,li);
5379 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5381 return fieldT__getitem__(self,li);
5384 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5386 DataArrayFloat *ret=self->getArray();
5392 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5395 double tmp0=self->getTime(tmp1,tmp2);
5396 PyObject *res = PyList_New(3);
5397 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5398 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5399 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5403 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5405 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5408 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5410 return field_serialize<float>(self);
5413 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5415 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5418 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5420 field__setstate__<float>(self,inp);
5425 class MEDCouplingDefinitionTime
5428 MEDCouplingDefinitionTime();
5429 void assign(const MEDCouplingDefinitionTime& other);
5430 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5431 double getTimeResolution() const;
5432 std::vector<double> getHotSpotsTime() const;
5435 std::string __str__() const throw(INTERP_KERNEL::Exception)
5437 std::ostringstream oss;
5438 self->appendRepr(oss);
5442 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5444 int meshId,arrId,arrIdInField,fieldId;
5445 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5446 PyObject *res=PyList_New(4);
5447 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5448 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5449 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5450 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5454 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5456 int meshId,arrId,arrIdInField,fieldId;
5457 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5458 PyObject *res=PyList_New(4);
5459 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5460 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5461 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5462 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5468 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5471 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5472 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5476 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5478 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5479 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5481 std::vector<MEDCouplingFieldDouble *> fs(sz);
5482 for(int i=0;i<sz;i++)
5483 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5484 return MEDCouplingFieldOverTime::New(fs);
5486 std::string __str__() const throw(INTERP_KERNEL::Exception)
5488 return self->simpleRepr();
5490 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5492 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5493 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5495 std::vector<MEDCouplingFieldDouble *> fs(sz);
5496 for(int i=0;i<sz;i++)
5497 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5498 return MEDCouplingFieldOverTime::New(fs);
5503 class MEDCouplingCartesianAMRMesh;
5505 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5508 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5509 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5510 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5513 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5515 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5523 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5526 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5527 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5528 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5531 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5533 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5534 return convertFromVectorPairInt(ret);
5537 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5539 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5540 return convertFromVectorPairInt(ret);
5543 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5545 std::vector< std::pair<int,int> > inp;
5546 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5547 self->addPatch(inp,factors);
5550 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5552 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5554 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5555 if(patchId==mesh->getNumberOfPatches())
5557 std::ostringstream oss;
5558 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5559 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5562 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5568 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5570 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5572 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5573 mesh->removePatch(patchId);
5576 int __len__() const throw(INTERP_KERNEL::Exception)
5578 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5580 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5581 return mesh->getNumberOfPatches();
5586 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5590 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5593 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5594 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5595 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5596 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5597 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5598 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5599 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5600 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5601 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5602 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5603 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5604 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5605 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5607 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5608 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5609 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5610 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5611 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5612 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5613 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5614 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5615 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5616 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5617 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5618 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5619 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5620 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5621 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5622 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5623 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5624 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5625 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5626 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5629 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5631 std::vector< std::pair<int,int> > inp;
5632 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5633 self->addPatch(inp,factors);
5636 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5638 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5640 PyObject *ret = PyList_New(sz);
5641 for(int i=0;i<sz;i++)
5643 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5646 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5651 // agy : don't know why typemap fails here ??? let it in the extend section
5652 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5654 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5657 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5659 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5660 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5666 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5668 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5669 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5675 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5677 std::vector<int> out1;
5678 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5679 PyObject *ret(PyTuple_New(2));
5680 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5681 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5685 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5687 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5689 PyObject *ret = PyList_New(sz);
5690 for(int i=0;i<sz;i++)
5691 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5695 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5697 std::vector<const DataArrayDouble *> inp;
5698 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5699 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5702 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5704 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5710 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5712 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5718 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5720 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5726 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5728 const MEDCouplingIMesh *ret(self->getImageMesh());
5731 return const_cast<MEDCouplingIMesh *>(ret);
5734 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5736 if(patchId==self->getNumberOfPatches())
5738 std::ostringstream oss;
5739 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5740 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5743 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5749 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5751 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5752 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5753 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5756 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5758 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5759 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5760 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5763 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5765 self->removePatch(patchId);
5768 int __len__() const throw(INTERP_KERNEL::Exception)
5770 return self->getNumberOfPatches();
5775 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5779 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5782 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5785 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5787 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5788 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5789 const int *nodeStrctPtr(0);
5790 const double *originPtr(0),*dxyzPtr(0);
5792 std::vector<int> bb0;
5793 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5796 std::vector<double> bb,bb2;
5798 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5799 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5801 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5804 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5806 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5807 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5808 std::vector< std::vector<int> > inp2;
5809 convertPyToVectorOfVectorOfInt(factors,inp2);
5810 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5813 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5815 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5818 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5820 return MEDCouplingCartesianAMRMesh::New(mesh);
5825 class MEDCouplingDataForGodFather : public RefCountObject
5828 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5829 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5830 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5831 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5832 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5833 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5834 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5835 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5836 virtual void alloc() throw(INTERP_KERNEL::Exception);
5837 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5840 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5842 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5850 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5853 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5854 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5855 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5856 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5857 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5858 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5859 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5860 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5861 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5864 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5866 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5867 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5868 MEDCouplingAMRAttribute *ret(0);
5871 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5872 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5874 catch(INTERP_KERNEL::Exception&)
5876 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5877 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5882 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5884 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5887 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5889 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5890 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5896 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5898 std::vector< std::vector<std::string> > compNamesCpp;
5899 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5900 self->spillInfoOnComponents(compNamesCpp);
5903 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5905 std::vector<int> inp0;
5906 if(!fillIntVector(nfs,inp0))
5907 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5908 std::size_t sz(inp0.size());
5909 std::vector<NatureOfField> inp00(sz);
5910 for(std::size_t i=0;i<sz;i++)
5911 inp00[i]=(NatureOfField)inp0[i];
5912 self->spillNatures(inp00);
5915 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5917 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5918 int sz((int)ret.size());
5919 PyObject *retPy(PyList_New(sz));
5920 for(int i=0;i<sz;i++)
5921 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5927 class DenseMatrix : public RefCountObject, public TimeLabel
5930 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5931 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5932 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5933 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5935 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5936 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5937 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5938 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5939 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5940 void transpose() throw(INTERP_KERNEL::Exception);
5942 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5943 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5944 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5947 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5949 return DenseMatrix::New(nbRows,nbCols);
5952 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5954 return DenseMatrix::New(array,nbRows,nbCols);
5957 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5960 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5961 PyObject *ret=PyTuple_New(2);
5962 PyObject *ret0Py=ret0?Py_True:Py_False;
5964 PyTuple_SetItem(ret,0,ret0Py);
5965 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5969 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5971 DataArrayDouble *ret(self->getData());
5977 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5979 return MEDCoupling::DenseMatrix::Add(self,other);
5982 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5984 return MEDCoupling::DenseMatrix::Substract(self,other);
5987 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5989 return MEDCoupling::DenseMatrix::Multiply(self,other);
5992 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5994 return MEDCoupling::DenseMatrix::Multiply(self,other);
5997 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5999 self->addEqual(other);
6000 Py_XINCREF(trueSelf);
6004 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6006 self->substractEqual(other);
6007 Py_XINCREF(trueSelf);
6011 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6013 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6022 def MEDCouplingUMeshReduce(self):
6023 return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6024 def MEDCouplingCMeshReduce(self):
6025 return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6026 def MEDCouplingIMeshReduce(self):
6027 return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6028 def MEDCouplingMappedExtrudedMeshReduce(self):
6029 return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6030 def MEDCouplingCurveLinearMeshReduce(self):
6031 return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6032 def MEDCoupling1SGTUMeshReduce(self):
6033 return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6034 def MEDCoupling1DGTUMeshReduce(self):
6035 return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6036 def MEDCouplingFieldDoubleReduce(self):
6037 self.checkConsistencyLight()
6038 d=(self.getTypeOfField(),self.getTimeDiscretization())
6039 return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6040 def MEDCouplingFieldIntReduce(self):
6041 self.checkConsistencyLight()
6042 d=(self.getTypeOfField(),self.getTimeDiscretization())
6043 return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
6044 def MEDCouplingFieldFloatReduce(self):
6045 self.checkConsistencyLight()
6046 d=(self.getTypeOfField(),self.getTimeDiscretization())
6047 return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6052 __filename=os.environ.get('PYTHONSTARTUP')
6053 if __filename and os.path.isfile(__filename):
6054 exec(open(__filename).read())