1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldFloat.hxx"
42 #include "MEDCouplingFieldTemplate.hxx"
43 #include "MEDCouplingGaussLocalization.hxx"
45 #include "MEDCouplingMultiFields.hxx"
46 #include "MEDCouplingFieldOverTime.hxx"
47 #include "MEDCouplingDefinitionTime.hxx"
48 #include "MEDCouplingFieldDiscretization.hxx"
49 #include "MEDCouplingCartesianAMRMesh.hxx"
50 #include "MEDCouplingAMRAttribute.hxx"
51 #include "MEDCouplingMatrix.hxx"
52 #include "MEDCouplingPartDefinition.hxx"
53 #include "MEDCouplingSkyLineArray.hxx"
54 #include "MEDCouplingTypemaps.i"
56 #include "InterpKernelAutoPtr.hxx"
57 #include "BoxSplittingOptions.hxx"
59 using namespace MEDCoupling;
60 using namespace INTERP_KERNEL;
64 %template(ivec) std::vector<int>;
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
69 %typemap(out) MEDCoupling::MEDCouplingMesh*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingMesh*
76 $result=convertMesh($1,$owner);
81 %typemap(out) MEDCoupling::MEDCouplingPointSet*
83 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCouplingPointSet*
88 $result=convertMesh($1,$owner);
93 %typemap(out) MEDCouplingCartesianAMRPatchGen*
95 $result=convertCartesianAMRPatch($1,$owner);
100 %typemap(out) MEDCouplingCartesianAMRMeshGen*
102 $result=convertCartesianAMRMesh($1,$owner);
107 %typemap(out) MEDCouplingDataForGodFather*
109 $result=convertDataForGodFather($1,$owner);
114 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
116 $result=convertMesh($1,$owner);
119 %typemap(out) MEDCoupling1GTUMesh*
121 $result=convertMesh($1,$owner);
126 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
128 $result=convertMesh($1,$owner);
131 %typemap(out) MEDCouplingStructuredMesh*
133 $result=convertMesh($1,$owner);
138 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
140 $result=convertFieldDiscretization($1,$owner);
143 %typemap(out) MEDCouplingFieldDiscretization*
145 $result=convertFieldDiscretization($1,$owner);
150 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
152 $result=convertMultiFields($1,$owner);
155 %typemap(out) MEDCouplingMultiFields*
157 $result=convertMultiFields($1,$owner);
162 %typemap(out) MEDCoupling::PartDefinition*
164 $result=convertPartDefinition($1,$owner);
167 %typemap(out) PartDefinition*
169 $result=convertPartDefinition($1,$owner);
174 %init %{ import_array(); %}
177 %init %{ initializeMe(); %}
179 %feature("autodoc", "1");
180 %feature("docstring");
182 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
183 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
184 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
239 %newobject MEDCoupling::MEDCouplingFieldInt::New;
240 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
241 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
242 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
243 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
244 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
245 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
246 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
247 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
248 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
249 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
250 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
251 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
252 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
253 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
254 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
255 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
256 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
257 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
258 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
259 %newobject MEDCoupling::MEDCouplingMesh::clone;
260 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
261 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
262 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
263 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
264 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
265 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
266 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
267 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
268 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
269 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
270 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
271 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
272 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
273 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
274 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
275 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
276 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
277 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
278 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
279 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
280 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
281 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
282 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
283 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
284 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
285 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
286 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
287 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
288 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
289 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
290 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
291 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
292 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
293 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
294 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
295 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
296 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
297 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
298 %newobject MEDCoupling::MEDCouplingUMesh::New;
299 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
300 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
301 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
302 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
303 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
304 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
305 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
306 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
307 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
308 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
309 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
310 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
311 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
312 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
313 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
314 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
315 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
316 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
317 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
318 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
319 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
321 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
322 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
323 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
324 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
325 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
326 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
327 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
328 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
329 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
330 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
331 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
332 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
333 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
334 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
335 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
336 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
337 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
338 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
339 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
340 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
341 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
342 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
343 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
344 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
345 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
346 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
347 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
348 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
349 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
350 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
351 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
352 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
353 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
354 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
355 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
356 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
357 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
358 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
359 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
360 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
361 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
362 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
363 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
364 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
365 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
366 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
367 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
368 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
369 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
370 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
371 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
372 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
373 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
374 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
375 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
376 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
377 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
378 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
379 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
380 %newobject MEDCoupling::MEDCouplingCMesh::New;
381 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
382 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
383 %newobject MEDCoupling::MEDCouplingIMesh::New;
384 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
385 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
386 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
387 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
388 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
389 %newobject MEDCoupling::MEDCouplingMultiFields::New;
390 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
391 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
394 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
395 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
396 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
397 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
398 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
399 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
400 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
401 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
402 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
403 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
404 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
405 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
409 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
410 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
411 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
412 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
413 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
414 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
415 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
416 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
417 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
418 %newobject MEDCoupling::DenseMatrix::New;
419 %newobject MEDCoupling::DenseMatrix::deepCopy;
420 %newobject MEDCoupling::DenseMatrix::shallowCpy;
421 %newobject MEDCoupling::DenseMatrix::getData;
422 %newobject MEDCoupling::DenseMatrix::matVecMult;
423 %newobject MEDCoupling::DenseMatrix::MatVecMult;
424 %newobject MEDCoupling::DenseMatrix::__add__;
425 %newobject MEDCoupling::DenseMatrix::__sub__;
426 %newobject MEDCoupling::DenseMatrix::__mul__;
427 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
428 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
429 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
430 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
431 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
432 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
434 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
435 %feature("unref") MEDCouplingMesh "$this->decrRef();"
436 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
437 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
438 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
439 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
440 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
441 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
442 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
443 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
444 %feature("unref") MEDCouplingField "$this->decrRef();"
445 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
446 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
447 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
448 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
449 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
450 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
451 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
452 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
453 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
454 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
455 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
456 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
457 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
458 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
459 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
460 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
461 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
462 %feature("unref") DenseMatrix "$this->decrRef();"
463 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
465 %rename(assign) *::operator=;
466 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
467 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
468 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
469 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
473 %rename (InterpKernelException) INTERP_KERNEL::Exception;
475 %include "MEDCouplingRefCountObject.i"
476 %include "MEDCouplingMemArray.i"
480 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
481 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
482 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
483 SWIGTITraits<int>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt;
484 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
485 SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
486 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
490 namespace INTERP_KERNEL
493 * \class BoxSplittingOptions
494 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
496 class BoxSplittingOptions
499 BoxSplittingOptions();
500 void init() throw(INTERP_KERNEL::Exception);
501 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
502 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
503 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
504 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
505 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
506 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
507 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
508 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
509 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
510 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
511 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
512 std::string printOptions() const throw(INTERP_KERNEL::Exception);
515 std::string __str__() const throw(INTERP_KERNEL::Exception)
517 return self->printOptions();
523 namespace MEDCoupling
539 CONST_ON_TIME_INTERVAL = 7
540 } TypeOfTimeDiscretization;
548 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
549 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
551 } MEDCouplingMeshType;
554 class DataArrayDouble;
555 class MEDCouplingUMesh;
556 class MEDCouplingCMesh;
557 class MEDCouplingFieldDouble;
559 %extend RefCountObject
561 std::string getHiddenCppPointer() const
563 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
568 %extend MEDCouplingGaussLocalization
570 std::string __str__() const throw(INTERP_KERNEL::Exception)
572 return self->getStringRepr();
575 std::string __repr__() const throw(INTERP_KERNEL::Exception)
577 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
578 oss << self->getStringRepr();
585 class MEDCouplingMesh : public RefCountObject, public TimeLabel
588 void setName(const std::string& name);
589 std::string getName() const;
590 void setDescription(const std::string& descr);
591 std::string getDescription() const;
592 void setTime(double val, int iteration, int order);
593 void setTimeUnit(const std::string& unit);
594 std::string getTimeUnit() const;
595 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
596 bool isStructured() const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
599 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
600 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
601 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
602 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
603 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
604 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
605 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
606 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
607 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
608 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
609 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
610 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
611 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
612 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
613 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
614 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
615 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
616 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
617 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
618 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
619 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
620 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
621 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
622 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
623 virtual std::string getVTKFileExtension() const;
624 std::string getVTKFileNameOf(const std::string& fileName) const;
626 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
627 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
628 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
629 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
630 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
631 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
632 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
633 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
634 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
635 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
636 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);
637 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
638 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
639 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
640 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
641 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
642 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
643 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
646 std::string __str__() const throw(INTERP_KERNEL::Exception)
648 return self->simpleRepr();
651 PyObject *getTime() throw(INTERP_KERNEL::Exception)
654 double tmp0=self->getTime(tmp1,tmp2);
655 PyObject *res = PyList_New(3);
656 PyList_SetItem(res,0,SWIG_From_double(tmp0));
657 PyList_SetItem(res,1,SWIG_From_int(tmp1));
658 PyList_SetItem(res,2,SWIG_From_int(tmp2));
662 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
664 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
665 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
671 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
675 DataArrayDoubleTuple *aa;
676 std::vector<double> bb;
678 int spaceDim=self->getSpaceDimension();
679 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
680 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
681 return self->getCellContainingPoint(pos,eps);
684 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
688 DataArrayDoubleTuple *aa;
689 std::vector<double> bb;
691 int spaceDim=self->getSpaceDimension();
692 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
693 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
694 MCAuto<DataArrayInt> elts,eltsIndex;
695 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
696 PyObject *ret=PyTuple_New(2);
697 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
698 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
702 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
704 MCAuto<DataArrayInt> elts,eltsIndex;
705 int spaceDim=self->getSpaceDimension();
707 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
708 if (!SWIG_IsOK(res1))
711 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
712 int nbOfPoints=size/spaceDim;
715 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
717 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
721 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
723 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
724 da2->checkAllocated();
725 int size=da2->getNumberOfTuples();
726 int nbOfCompo=da2->getNumberOfComponents();
727 if(nbOfCompo!=spaceDim)
729 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
731 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
733 PyObject *ret=PyTuple_New(2);
734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
739 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
743 DataArrayDoubleTuple *aa;
744 std::vector<double> bb;
746 int spaceDim=self->getSpaceDimension();
747 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
748 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
749 std::vector<int> elts;
750 self->getCellsContainingPoint(pos,eps,elts);
751 DataArrayInt *ret=DataArrayInt::New();
752 ret->alloc((int)elts.size(),1);
753 std::copy(elts.begin(),elts.end(),ret->getPointer());
754 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
757 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
759 MCAuto<DataArrayInt> d0=DataArrayInt::New();
760 MCAuto<DataArrayInt> d1=DataArrayInt::New();
761 self->getReverseNodalConnectivity(d0,d1);
762 PyObject *ret=PyTuple_New(2);
763 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
764 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
768 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
771 int v0; std::vector<int> v1;
772 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
773 self->renumberCells(ids,check);
776 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
778 DataArrayInt *cellCor, *nodeCor;
779 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
780 PyObject *res = PyList_New(2);
781 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
782 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
786 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
788 DataArrayInt *cellCor=0,*nodeCor=0;
789 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
790 PyObject *res = PyList_New(2);
791 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
792 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
796 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
798 DataArrayInt *cellCor=0;
799 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
803 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
806 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
807 if (!SWIG_IsOK(res1))
810 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
811 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
815 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
817 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
818 da2->checkAllocated();
819 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
822 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
824 std::vector<int> conn;
825 self->getNodeIdsOfCell(cellId,conn);
826 return convertIntArrToPyList2(conn);
829 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
831 std::vector<double> coo;
832 self->getCoordinatesOfNode(nodeId,coo);
833 return convertDblArrToPyList2(coo);
836 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
840 DataArrayDoubleTuple *aa;
841 std::vector<double> bb;
843 int spaceDim=self->getSpaceDimension();
844 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
845 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
846 self->scale(pointPtr,factor);
849 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
851 int spaceDim=self->getSpaceDimension();
852 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
853 self->getBoundingBox(tmp);
854 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
858 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
861 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
862 PyObject *ret=PyTuple_New(2);
863 PyObject *ret0Py=ret0?Py_True:Py_False;
865 PyTuple_SetItem(ret,0,ret0Py);
866 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
870 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
872 int szArr,sw,iTypppArr;
873 std::vector<int> stdvecTyyppArr;
874 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
875 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
876 if(sw==3)//DataArrayInt
878 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
879 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
880 std::string name=argpt->getName();
882 ret->setName(name.c_str());
884 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
887 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
889 int szArr,sw,iTypppArr;
890 std::vector<int> stdvecTyyppArr;
892 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
893 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
894 if(sw==3)//DataArrayInt
896 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
897 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
898 std::string name=argpt->getName();
900 ret->setName(name.c_str());
903 PyObject *res = PyList_New(2);
904 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
905 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
906 PyList_SetItem(res,0,obj0);
907 PyList_SetItem(res,1,obj1);
911 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
915 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
916 PyObject *res = PyTuple_New(2);
917 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
920 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
922 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
923 PyTuple_SetItem(res,0,obj0);
924 PyTuple_SetItem(res,1,obj1);
928 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
930 std::vector<int> vals=self->getDistributionOfTypes();
932 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
933 PyObject *ret=PyList_New((int)vals.size()/3);
934 for(int j=0;j<(int)vals.size()/3;j++)
936 PyObject *ret1=PyList_New(3);
937 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
938 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
939 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
940 PyList_SetItem(ret,j,ret1);
945 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
947 std::vector<int> code;
948 std::vector<const DataArrayInt *> idsPerType;
949 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
950 convertPyToNewIntArr4(li,1,3,code);
951 return self->checkTypeConsistencyAndContig(code,idsPerType);
954 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
956 std::vector<int> code;
957 std::vector<DataArrayInt *> idsInPflPerType;
958 std::vector<DataArrayInt *> idsPerType;
959 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
960 PyObject *ret=PyTuple_New(3);
963 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
964 PyObject *ret0=PyList_New((int)code.size()/3);
965 for(int j=0;j<(int)code.size()/3;j++)
967 PyObject *ret00=PyList_New(3);
968 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
969 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
970 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
971 PyList_SetItem(ret0,j,ret00);
973 PyTuple_SetItem(ret,0,ret0);
975 PyObject *ret1=PyList_New(idsInPflPerType.size());
976 for(std::size_t j=0;j<idsInPflPerType.size();j++)
977 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
978 PyTuple_SetItem(ret,1,ret1);
979 int n=idsPerType.size();
980 PyObject *ret2=PyList_New(n);
982 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
983 PyTuple_SetItem(ret,2,ret2);
987 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
991 DataArrayDoubleTuple *aa;
992 std::vector<double> bb;
994 int spaceDim=self->getSpaceDimension();
995 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
996 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
997 self->translate(vectorPtr);
1000 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1002 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1005 DataArrayDoubleTuple *aa;
1006 std::vector<double> bb;
1008 int spaceDim=self->getSpaceDimension();
1009 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1010 self->rotate(centerPtr,0,alpha);
1013 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1015 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1017 DataArrayDouble *a,*a2;
1018 DataArrayDoubleTuple *aa,*aa2;
1019 std::vector<double> bb,bb2;
1021 int spaceDim=self->getSpaceDimension();
1022 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1023 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
1024 self->rotate(centerPtr,vectorPtr,alpha);
1027 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1029 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1030 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1031 PyObject *res=PyList_New(result.size());
1032 for(int i=0;iL!=result.end(); i++, iL++)
1033 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1037 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1039 std::vector<double> a0;
1040 std::vector<int> a1;
1041 std::vector<std::string> a2;
1042 self->getTinySerializationInformation(a0,a1,a2);
1043 PyObject *ret(PyTuple_New(3));
1044 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1045 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1047 PyObject *ret2(PyList_New(sz));
1049 for(int i=0;i<sz;i++)
1050 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1052 PyTuple_SetItem(ret,2,ret2);
1056 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1058 DataArrayInt *a0Tmp(0);
1059 DataArrayDouble *a1Tmp(0);
1060 self->serialize(a0Tmp,a1Tmp);
1061 PyObject *ret(PyTuple_New(2));
1062 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1063 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1067 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1069 std::vector<std::string> littleStrings;
1070 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1073 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1074 {// put an empty dict in input to say to __new__ to call __init__...
1075 PyObject *ret(PyTuple_New(1));
1076 PyObject *ret0(PyDict_New());
1077 PyTuple_SetItem(ret,0,ret0);
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);
1226 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1228 return MEDCouplingSkyLineArray::New();
1231 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1233 return MEDCouplingSkyLineArray::New(index, value);
1236 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1238 return MEDCouplingSkyLineArray::New(index, value);
1241 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1243 return MEDCouplingSkyLineArray::New(other);
1246 std::string __str__() const throw(INTERP_KERNEL::Exception)
1248 return self->simpleRepr();
1251 DataArrayInt *getSuperIndexArray() const
1253 DataArrayInt *ret(self->getSuperIndexArray());
1259 DataArrayInt *getIndexArray() const
1261 DataArrayInt *ret(self->getIndexArray());
1267 DataArrayInt *getValuesArray() const
1269 DataArrayInt *ret(self->getValuesArray());
1275 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1277 std::vector<int> ret;
1278 self->getSimplePackSafe(absolutePackId,ret);
1279 return convertIntArrToPyList2(ret);
1282 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1284 std::vector<int> vpack, vspIdx, out;
1286 convertPyToNewIntArr3(superPackIndices,vspIdx);
1287 convertPyToNewIntArr3(pack,vpack);
1289 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1290 return convertIntArrToPyList2(out);
1293 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1295 std::vector<int> vpack;
1296 convertPyToNewIntArr3(pack,vpack);
1297 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1300 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1302 std::vector<int> vpack;
1303 convertPyToNewIntArr3(pack,vpack);
1304 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1307 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1309 std::vector<int> vpack;
1310 convertPyToNewIntArr3(pack,vpack);
1311 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1314 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1316 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1317 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1318 self->convertToPolyhedronConn(d0,d1);
1319 PyObject *ret=PyTuple_New(2);
1320 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1321 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1328 %include "MEDCouplingFieldDiscretization.i"
1330 //== MEDCouplingPointSet
1332 namespace MEDCoupling
1334 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1337 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1338 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1339 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1340 void zipCoords() throw(INTERP_KERNEL::Exception);
1341 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1342 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1343 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1344 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1345 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1346 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1347 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1348 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1349 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1350 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1351 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1352 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1353 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1354 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1355 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1356 virtual DataArrayInt *findBoundaryNodes() const;
1357 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1358 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1359 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1360 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1361 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1362 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1363 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1364 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1365 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1366 virtual void invertOrientationOfAllCells() throw(INTERP_KERNEL::Exception);
1369 std::string __str__() const throw(INTERP_KERNEL::Exception)
1371 return self->simpleRepr();
1374 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1377 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1378 PyObject *res = PyList_New(2);
1379 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1380 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1384 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1386 DataArrayInt *comm, *commIndex;
1387 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1388 PyObject *res = PyList_New(2);
1389 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1390 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1394 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1396 DataArrayDouble *ret1=self->getCoords();
1399 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1402 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1404 int szArr,sw,iTypppArr;
1405 std::vector<int> stdvecTyyppArr;
1406 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1407 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1408 if(sw==3)//DataArrayInt
1410 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1411 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1412 std::string name=argpt->getName();
1414 ret->setName(name.c_str());
1416 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1419 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1421 int szArr,sw,iTypppArr;
1422 std::vector<int> stdvecTyyppArr;
1423 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1424 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1425 if(sw==3)//DataArrayInt
1427 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1428 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1429 std::string name=argpt->getName();
1431 ret->setName(name.c_str());
1433 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1436 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1438 int szArr,sw,iTypppArr;
1439 std::vector<int> stdvecTyyppArr;
1440 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1441 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1442 if(sw==3)//DataArrayInt
1444 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1445 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1446 std::string name=argpt->getName();
1448 ret->setName(name.c_str());
1450 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1453 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1455 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1456 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1459 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1461 int szArr,sw,iTypppArr;
1462 std::vector<int> stdvecTyyppArr;
1463 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1464 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1465 if(sw==3)//DataArrayInt
1467 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1468 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1469 std::string name=argpt->getName();
1471 ret->setName(name.c_str());
1473 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1476 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1478 int szArr,sw,iTypppArr;
1479 std::vector<int> stdvecTyyppArr;
1480 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1481 self->renumberNodes(tmp,newNbOfNodes);
1484 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1486 int szArr,sw,iTypppArr;
1487 std::vector<int> stdvecTyyppArr;
1488 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1489 self->renumberNodesCenter(tmp,newNbOfNodes);
1492 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1494 int spaceDim=self->getSpaceDimension();
1496 DataArrayDouble *a,*a2;
1497 DataArrayDoubleTuple *aa,*aa2;
1498 std::vector<double> bb,bb2;
1500 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1501 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1502 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1503 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1504 std::vector<int> nodes;
1505 self->findNodesOnLine(p,v,eps,nodes);
1506 DataArrayInt *ret=DataArrayInt::New();
1507 ret->alloc((int)nodes.size(),1);
1508 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1509 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1511 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1513 int spaceDim=self->getSpaceDimension();
1515 DataArrayDouble *a,*a2;
1516 DataArrayDoubleTuple *aa,*aa2;
1517 std::vector<double> bb,bb2;
1519 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1520 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1521 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1522 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1523 std::vector<int> nodes;
1524 self->findNodesOnPlane(p,v,eps,nodes);
1525 DataArrayInt *ret=DataArrayInt::New();
1526 ret->alloc((int)nodes.size(),1);
1527 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1528 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1531 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1535 DataArrayDoubleTuple *aa;
1536 std::vector<double> bb;
1538 int spaceDim=self->getSpaceDimension();
1539 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1540 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1541 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1542 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1545 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1547 DataArrayInt *c=0,*cI=0;
1551 DataArrayDoubleTuple *aa;
1552 std::vector<double> bb;
1554 int spaceDim=self->getSpaceDimension();
1555 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1556 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1557 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1558 PyObject *ret=PyTuple_New(2);
1559 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1560 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1564 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1566 DataArrayInt *c=0,*cI=0;
1567 int spaceDim=self->getSpaceDimension();
1570 DataArrayDoubleTuple *aa;
1571 std::vector<double> bb;
1574 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1575 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1577 PyObject *ret=PyTuple_New(2);
1578 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1579 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1583 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1587 DataArrayDoubleTuple *aa;
1588 std::vector<double> bb;
1590 int spaceDim=self->getSpaceDimension();
1591 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1592 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1594 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1595 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1598 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1602 std::vector<int> multiVal;
1603 std::pair<int, std::pair<int,int> > slic;
1604 MEDCoupling::DataArrayInt *daIntTyypp=0;
1605 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1609 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1611 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1613 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1615 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1619 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1621 DataArrayInt *v0=0,*v1=0;
1622 self->findCommonCells(compType,startCellId,v0,v1);
1623 PyObject *res = PyList_New(2);
1624 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1625 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1630 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1633 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1634 if (!SWIG_IsOK(res1))
1637 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1638 self->renumberNodesInConn(tmp);
1642 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1644 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1645 da2->checkAllocated();
1646 self->renumberNodesInConn(da2->getConstPointer());
1650 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1653 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1654 PyObject *ret=PyTuple_New(2);
1655 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1656 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1660 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1662 DataArrayInt *ret=0;
1664 int szArr,sw,iTypppArr;
1665 std::vector<int> stdvecTyyppArr;
1666 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1667 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1671 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1675 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1676 PyObject *res = PyList_New(3);
1677 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1678 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1679 PyList_SetItem(res,2,SWIG_From_int(ret2));
1683 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1687 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1688 PyObject *res = PyList_New(3);
1689 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1690 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1691 PyList_SetItem(res,2,SWIG_From_int(ret2));
1695 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1698 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1699 if (!SWIG_IsOK(res1))
1702 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1703 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1707 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1709 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1710 da2->checkAllocated();
1711 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1715 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1719 std::vector<int> multiVal;
1720 std::pair<int, std::pair<int,int> > slic;
1721 MEDCoupling::DataArrayInt *daIntTyypp=0;
1722 int nbc=self->getNumberOfCells();
1723 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1730 std::ostringstream oss;
1731 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1732 throw INTERP_KERNEL::Exception(oss.str().c_str());
1735 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1740 int tmp=nbc+singleVal;
1741 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1745 std::ostringstream oss;
1746 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1747 throw INTERP_KERNEL::Exception(oss.str().c_str());
1753 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1757 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1762 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1763 daIntTyypp->checkAllocated();
1764 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1767 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1771 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1774 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1775 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1776 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1777 for(int i=0;i<sz;i++)
1778 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1781 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1784 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1786 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1787 std::vector<double> val3;
1788 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1789 "Rotate2DAlg",2,true,nbNodes);
1791 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1792 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1795 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1798 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1799 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1800 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1801 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1802 for(int i=0;i<sz;i++)
1803 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1806 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1809 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1811 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1812 std::vector<double> val3;
1813 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1814 "Rotate3DAlg",3,true,nbNodes);
1816 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1817 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1818 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1823 //== MEDCouplingPointSet End
1825 class MEDCouplingUMeshCell
1828 INTERP_KERNEL::NormalizedCellType getType() const;
1831 std::string __str__() const throw(INTERP_KERNEL::Exception)
1833 return self->repr();
1836 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1839 const int *r=self->getAllConn(ret2);
1840 PyObject *ret=PyTuple_New(ret2);
1841 for(int i=0;i<ret2;i++)
1842 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1848 class MEDCouplingUMeshCellIterator
1855 MEDCouplingUMeshCell *ret=self->nextt();
1857 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1860 PyErr_SetString(PyExc_StopIteration,"No more data.");
1867 class MEDCouplingUMeshCellByTypeIterator
1870 ~MEDCouplingUMeshCellByTypeIterator();
1875 MEDCouplingUMeshCellEntry *ret=self->nextt();
1877 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1880 PyErr_SetString(PyExc_StopIteration,"No more data.");
1887 class MEDCouplingUMeshCellByTypeEntry
1890 ~MEDCouplingUMeshCellByTypeEntry();
1893 MEDCouplingUMeshCellByTypeIterator *__iter__()
1895 return self->iterator();
1900 class MEDCouplingUMeshCellEntry
1903 INTERP_KERNEL::NormalizedCellType getType() const;
1904 int getNumberOfElems() const;
1907 MEDCouplingUMeshCellIterator *__iter__()
1909 return self->iterator();
1914 //== MEDCouplingUMesh
1916 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1919 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1920 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1921 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1922 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1923 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1924 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1925 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1926 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1927 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1928 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1929 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1930 void computeTypes() throw(INTERP_KERNEL::Exception);
1931 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1932 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1934 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1935 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1936 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1937 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1938 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1939 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1940 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1941 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1942 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1943 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1944 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1945 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1946 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1947 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1948 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1949 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1950 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1951 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1952 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1953 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1954 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1955 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1956 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1957 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1958 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1959 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1960 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1961 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1962 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1963 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1964 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1965 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1966 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1967 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1968 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1969 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1970 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1971 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1972 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1973 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1974 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1975 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1976 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1977 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1978 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1979 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1980 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);
1981 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1982 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1983 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1984 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1985 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1987 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1989 return MEDCouplingUMesh::New();
1992 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1994 return MEDCouplingUMesh::New(meshName,meshDim);
1998 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2000 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
2003 std::string __str__() const throw(INTERP_KERNEL::Exception)
2005 return self->simpleRepr();
2008 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2010 std::ostringstream oss;
2011 self->reprQuickOverview(oss);
2015 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2017 return self->cellIterator();
2020 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2022 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2026 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2028 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2029 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2030 PyObject *res=PyList_New(result.size());
2031 for(int i=0;iL!=result.end(); i++, iL++)
2032 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2036 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2040 std::vector<int> multiVal;
2041 std::pair<int, std::pair<int,int> > slic;
2042 MEDCoupling::DataArrayInt *daIntTyypp=0;
2043 int nbc=self->getNumberOfCells();
2044 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2051 std::ostringstream oss;
2052 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2053 throw INTERP_KERNEL::Exception(oss.str().c_str());
2057 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2064 int tmp=nbc+singleVal;
2065 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2070 std::ostringstream oss;
2071 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2072 throw INTERP_KERNEL::Exception(oss.str().c_str());
2078 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2084 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2085 daIntTyypp->checkAllocated();
2086 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2090 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2094 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2098 std::vector<int> multiVal;
2099 std::pair<int, std::pair<int,int> > slic;
2100 MEDCoupling::DataArrayInt *daIntTyypp=0;
2101 int nbc=self->getNumberOfCells();
2102 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2109 std::ostringstream oss;
2110 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2111 throw INTERP_KERNEL::Exception(oss.str().c_str());
2115 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2122 int tmp=nbc+singleVal;
2123 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2128 std::ostringstream oss;
2129 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2130 throw INTERP_KERNEL::Exception(oss.str().c_str());
2136 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2141 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2147 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2148 daIntTyypp->checkAllocated();
2149 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2153 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2157 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2159 int szArr,sw,iTypppArr;
2160 std::vector<int> stdvecTyyppArr;
2161 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2164 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2165 throw INTERP_KERNEL::Exception(oss.str().c_str());
2167 self->insertNextCell(type,size,tmp);
2170 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2172 int szArr,sw,iTypppArr;
2173 std::vector<int> stdvecTyyppArr;
2174 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2175 self->insertNextCell(type,szArr,tmp);
2178 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2180 DataArrayInt *ret=self->getNodalConnectivity();
2185 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2187 DataArrayInt *ret=self->getNodalConnectivityIndex();
2193 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2195 int szArr,sw,iTypppArr;
2196 std::vector<int> stdvecTyyppArr;
2197 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2198 int nbOfDepthPeelingPerformed=0;
2199 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2200 PyObject *res=PyTuple_New(2);
2201 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2206 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2208 DataArrayInt *v0=0,*v1=0;
2209 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2210 PyObject *res = PyList_New(2);
2211 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2220 DataArrayDoubleTuple *aa;
2221 std::vector<double> bb;
2223 int nbOfCompo=self->getSpaceDimension();
2224 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2227 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2228 PyObject *ret=PyTuple_New(2);
2229 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2230 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2234 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2236 DataArrayInt *ret1=0;
2237 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2238 PyObject *ret=PyTuple_New(2);
2239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2247 DataArrayInt *ret1(0);
2248 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2249 PyObject *ret=PyTuple_New(3);
2250 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2251 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2252 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2256 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2258 std::vector<int> cells;
2259 self->checkButterflyCells(cells,eps);
2260 DataArrayInt *ret=DataArrayInt::New();
2261 ret->alloc((int)cells.size(),1);
2262 std::copy(cells.begin(),cells.end(),ret->getPointer());
2263 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2266 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2268 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2270 PyObject *ret = PyList_New(sz);
2271 for(int i=0;i<sz;i++)
2272 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2276 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2278 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2279 int sz=retCpp.size();
2280 PyObject *ret=PyList_New(sz);
2281 for(int i=0;i<sz;i++)
2282 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2286 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2288 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2289 int sz=retCpp.size();
2290 PyObject *ret=PyList_New(sz);
2291 for(int i=0;i<sz;i++)
2292 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2296 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2299 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2300 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2301 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2304 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2307 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2308 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2312 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2315 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2316 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2320 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2322 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2323 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2324 PyObject *ret=PyTuple_New(3);
2325 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2326 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2327 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2331 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2333 DataArrayInt *tmp0=0,*tmp1=0;
2334 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2335 PyObject *ret=PyTuple_New(2);
2336 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2341 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2345 std::vector<int> multiVal;
2346 std::pair<int, std::pair<int,int> > slic;
2347 MEDCoupling::DataArrayInt *daIntTyypp=0;
2348 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2352 return self->duplicateNodes(&singleVal,&singleVal+1);
2354 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2356 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2358 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2362 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2366 std::vector<int> multiVal;
2367 std::pair<int, std::pair<int,int> > slic;
2368 MEDCoupling::DataArrayInt *daIntTyypp=0;
2369 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2373 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2375 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2377 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2379 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2383 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2386 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2387 DataArrayInt *tmp0,*tmp1=0;
2388 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2389 PyObject *ret=PyTuple_New(2);
2390 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2391 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2395 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2397 DataArrayInt *ret0=0,*ret1=0;
2398 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2399 PyObject *ret=PyTuple_New(2);
2400 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2401 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2407 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2408 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2409 DataArrayInt *ret1=0,*ret2=0;
2410 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2411 PyObject *ret=PyTuple_New(3);
2412 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2413 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2420 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2421 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2422 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2423 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2426 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2429 std::vector<const MEDCouplingUMesh *> meshes;
2430 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2431 std::vector<DataArrayInt *> corr;
2432 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2434 PyObject *ret1=PyList_New(sz);
2435 for(int i=0;i<sz;i++)
2436 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2437 PyObject *ret=PyList_New(2);
2438 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2439 PyList_SetItem(ret,1,ret1);
2443 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2445 std::vector<MEDCouplingUMesh *> meshes;
2446 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2447 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2450 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2452 std::vector<MEDCouplingUMesh *> meshes;
2453 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2454 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2457 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2461 std::vector<int> multiVal;
2462 std::pair<int, std::pair<int,int> > slic;
2463 MEDCoupling::DataArrayInt *daIntTyypp=0;
2465 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2466 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2470 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2472 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2474 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2476 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2480 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2482 DataArrayInt *arrOut=0,*arrIndexOut=0;
2485 std::vector<int> multiVal;
2486 std::pair<int, std::pair<int,int> > slic;
2487 MEDCoupling::DataArrayInt *daIntTyypp=0;
2489 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2490 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2495 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2500 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2505 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2509 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2511 PyObject *ret=PyTuple_New(2);
2512 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2513 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2517 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2519 DataArrayInt *arrOut=0,*arrIndexOut=0;
2520 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2521 PyObject *ret=PyTuple_New(2);
2522 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2529 if(!PySlice_Check(slic))
2530 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2531 Py_ssize_t strt=2,stp=2,step=2;
2533 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2534 arrIndxIn->checkAllocated();
2535 if(arrIndxIn->getNumberOfComponents()!=1)
2536 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2537 GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2538 DataArrayInt *arrOut=0,*arrIndexOut=0;
2539 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2540 PyObject *ret=PyTuple_New(2);
2541 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2547 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2548 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2550 DataArrayInt *arrOut=0,*arrIndexOut=0;
2553 std::vector<int> multiVal;
2554 std::pair<int, std::pair<int,int> > slic;
2555 MEDCoupling::DataArrayInt *daIntTyypp=0;
2557 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2558 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2563 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2568 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2573 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2577 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2579 PyObject *ret=PyTuple_New(2);
2580 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2585 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2586 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2590 std::vector<int> multiVal;
2591 std::pair<int, std::pair<int,int> > slic;
2592 MEDCoupling::DataArrayInt *daIntTyypp=0;
2594 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2595 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2600 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2605 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2610 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2614 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2618 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2622 DataArrayDoubleTuple *aa;
2623 std::vector<double> bb;
2625 int spaceDim=self->getSpaceDimension();
2626 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2627 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2629 std::vector<int> cells;
2630 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2631 DataArrayInt *ret=DataArrayInt::New();
2632 ret->alloc((int)cells.size(),1);
2633 std::copy(cells.begin(),cells.end(),ret->getPointer());
2634 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2637 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2641 DataArrayDoubleTuple *aa;
2642 std::vector<double> bb;
2644 int spaceDim=self->getSpaceDimension();
2645 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2646 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2647 self->orientCorrectly2DCells(v,polyOnly);
2650 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2652 std::vector<int> cells;
2653 self->arePolyhedronsNotCorrectlyOriented(cells);
2654 DataArrayInt *ret=DataArrayInt::New();
2655 ret->alloc((int)cells.size(),1);
2656 std::copy(cells.begin(),cells.end(),ret->getPointer());
2657 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2660 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2664 self->getFastAveragePlaneOfThis(vec,pos);
2666 std::copy(vec,vec+3,vals);
2667 std::copy(pos,pos+3,vals+3);
2668 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2671 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2673 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2674 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2675 return MEDCouplingUMesh::MergeUMeshes(tmp);
2678 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2681 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2682 PyObject *ret=PyTuple_New(2);
2683 PyObject *ret0Py=ret0?Py_True:Py_False;
2685 PyTuple_SetItem(ret,0,ret0Py);
2686 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2693 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2694 PyObject *ret=PyTuple_New(2);
2695 PyObject *ret0Py=ret0?Py_True:Py_False;
2697 PyTuple_SetItem(ret,0,ret0Py);
2698 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2702 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2704 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2705 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2706 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2707 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2708 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2709 PyObject *ret=PyTuple_New(5);
2710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2714 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2718 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2720 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2721 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2722 PyObject *ret=PyTuple_New(5);
2723 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2724 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2725 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2726 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2727 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2731 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2733 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2734 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2735 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2736 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2737 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2738 PyObject *ret=PyTuple_New(5);
2739 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2740 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2741 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2743 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2747 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2749 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2750 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2751 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2752 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2753 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2754 PyObject *ret=PyTuple_New(5);
2755 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2756 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2757 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2763 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2765 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2766 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2767 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2768 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2769 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2770 PyObject *ret=PyTuple_New(5);
2771 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2772 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2773 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2774 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2775 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2779 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2781 DataArrayInt *neighbors=0,*neighborsIdx=0;
2782 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2783 PyObject *ret=PyTuple_New(2);
2784 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2785 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2789 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2791 DataArrayInt *neighbors=0,*neighborsIdx=0;
2792 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2793 PyObject *ret=PyTuple_New(2);
2794 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2795 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2799 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2801 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2802 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2803 PyObject *ret=PyTuple_New(2);
2804 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2805 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2811 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2812 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2813 PyObject *ret=PyTuple_New(2);
2814 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2821 DataArrayInt *neighbors=0,*neighborsIdx=0;
2822 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2823 PyObject *ret=PyTuple_New(2);
2824 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2825 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2829 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2831 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2832 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2833 DataArrayInt *d2,*d3,*d4,*dd5;
2834 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2835 PyObject *ret=PyTuple_New(7);
2836 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2837 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2838 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2840 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2841 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2842 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2846 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2849 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2850 da->checkAllocated();
2851 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2854 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2857 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2858 da->checkAllocated();
2859 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2862 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2865 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2866 da->checkAllocated();
2867 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2870 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2873 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2874 da->checkAllocated();
2875 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2876 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2877 PyObject *res = PyList_New(result.size());
2878 for (int i=0;iL!=result.end(); i++, iL++)
2879 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2883 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2886 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2887 da->checkAllocated();
2888 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2889 ret->setName(da->getName().c_str());
2893 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2895 DataArrayInt *cellNb1=0,*cellNb2=0;
2896 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2897 PyObject *ret=PyTuple_New(3);
2898 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2899 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2900 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2904 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2906 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2907 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2908 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2909 PyObject *ret(PyTuple_New(4));
2910 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2911 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2912 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2913 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2917 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2919 int spaceDim=self->getSpaceDimension();
2921 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2923 DataArrayDouble *a,*a2;
2924 DataArrayDoubleTuple *aa,*aa2;
2925 std::vector<double> bb,bb2;
2927 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2928 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2929 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2930 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2932 DataArrayInt *cellIds=0;
2933 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2934 PyObject *ret=PyTuple_New(2);
2935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2940 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2942 int spaceDim=self->getSpaceDimension();
2944 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2946 DataArrayDouble *a,*a2;
2947 DataArrayDoubleTuple *aa,*aa2;
2948 std::vector<double> bb,bb2;
2950 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2951 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2952 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2953 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2955 DataArrayInt *cellIds=0;
2956 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2957 PyObject *ret=PyTuple_New(2);
2958 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2959 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2963 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2966 DataArrayDouble *a,*a2;
2967 DataArrayDoubleTuple *aa,*aa2;
2968 std::vector<double> bb,bb2;
2970 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2971 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2972 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2973 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2974 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2978 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2980 int spaceDim=self->getSpaceDimension();
2982 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2984 DataArrayDouble *a,*a2;
2985 DataArrayDoubleTuple *aa,*aa2;
2986 std::vector<double> bb,bb2;
2988 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2989 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2990 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2991 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2992 return self->getCellIdsCrossingPlane(orig,vect,eps);
2995 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2999 std::vector<int> pos2;
3000 DataArrayInt *pos3=0;
3001 DataArrayIntTuple *pos4=0;
3002 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3007 self->convertToPolyTypes(&pos1,&pos1+1);
3014 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3019 self->convertToPolyTypes(pos3->begin(),pos3->end());
3023 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3027 void convertAllToPoly();
3028 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3029 bool unPolyze() throw(INTERP_KERNEL::Exception);
3030 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3031 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3032 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3035 //== MEDCouplingUMesh End
3037 //== MEDCouplingMappedExtrudedMesh
3039 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3042 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3043 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3044 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3045 int get2DCellIdForExtrusion() const;
3047 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3049 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3052 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3054 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3057 MEDCouplingMappedExtrudedMesh()
3059 return MEDCouplingMappedExtrudedMesh::New();
3062 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3064 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3067 std::string __str__() const throw(INTERP_KERNEL::Exception)
3069 return self->simpleRepr();
3072 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3074 std::ostringstream oss;
3075 self->reprQuickOverview(oss);
3079 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3081 MEDCouplingUMesh *ret=self->getMesh2D();
3084 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3086 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3088 MEDCouplingUMesh *ret=self->getMesh1D();
3091 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3093 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3095 DataArrayInt *ret=self->getMesh3DIds();
3098 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3103 //== MEDCouplingMappedExtrudedMesh End
3105 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3108 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3109 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3110 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3111 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3112 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3113 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3116 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3118 int szArr,sw,iTypppArr;
3119 std::vector<int> stdvecTyyppArr;
3120 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3121 self->insertNextCell(tmp,tmp+szArr);
3124 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3126 DataArrayInt *ret=self->getNodalConnectivity();
3127 if(ret) ret->incrRef();
3131 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3133 std::vector< const MEDCoupling1GTUMesh *> parts;
3134 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3135 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3140 //== MEDCoupling1SGTUMesh
3142 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3145 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3146 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3147 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3148 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3149 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3150 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3151 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3152 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3153 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3156 MEDCoupling1SGTUMesh()
3158 return MEDCoupling1SGTUMesh::New();
3161 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3163 return MEDCoupling1SGTUMesh::New(name,type);
3166 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3168 return MEDCoupling1SGTUMesh::New(m);
3171 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3173 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3176 std::string __str__() const throw(INTERP_KERNEL::Exception)
3178 return self->simpleRepr();
3181 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3183 std::ostringstream oss;
3184 self->reprQuickOverview(oss);
3188 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3190 DataArrayInt *cellPerm(0),*nodePerm(0);
3191 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3192 PyObject *ret(PyTuple_New(3));
3193 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3195 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3199 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3201 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3202 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3203 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3206 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3208 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3209 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3210 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3215 //== MEDCoupling1SGTUMesh End
3217 //== MEDCoupling1DGTUMesh
3219 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3222 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3223 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3224 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3225 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3226 bool isPacked() const throw(INTERP_KERNEL::Exception);
3229 MEDCoupling1DGTUMesh()
3231 return MEDCoupling1DGTUMesh::New();
3233 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3235 return MEDCoupling1DGTUMesh::New(name,type);
3238 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3240 return MEDCoupling1DGTUMesh::New(m);
3243 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3245 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3248 std::string __str__() const throw(INTERP_KERNEL::Exception)
3250 return self->simpleRepr();
3253 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3255 std::ostringstream oss;
3256 self->reprQuickOverview(oss);
3260 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3262 DataArrayInt *ret=self->getNodalConnectivityIndex();
3263 if(ret) ret->incrRef();
3267 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3269 DataArrayInt *ret1=0,*ret2=0;
3270 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3271 PyObject *ret0Py=ret0?Py_True:Py_False;
3273 PyObject *ret=PyTuple_New(3);
3274 PyTuple_SetItem(ret,0,ret0Py);
3275 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3276 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3280 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3283 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3284 PyObject *ret=PyTuple_New(2);
3285 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3286 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3287 PyTuple_SetItem(ret,1,ret1Py);
3291 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3293 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3294 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3295 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3298 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3300 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3301 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3302 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3305 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3307 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3308 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3309 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3314 //== MEDCoupling1DGTUMeshEnd
3316 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3319 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3320 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3321 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3322 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3323 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3324 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3325 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3326 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3327 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3328 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3329 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3330 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3331 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3332 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3333 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3336 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3338 int tmpp1=-1,tmpp2=-1;
3339 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3340 std::vector< std::pair<int,int> > inp;
3344 for(int i=0;i<tmpp1;i++)
3345 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3350 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3351 inp.resize(tmpp1/2);
3352 for(int i=0;i<tmpp1/2;i++)
3353 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3356 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3357 return self->buildStructuredSubPart(inp);
3360 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3362 std::vector< std::pair<int,int> > inp;
3363 convertPyToVectorPairInt(part,inp);
3365 int szArr,sw,iTypppArr;
3366 std::vector<int> stdvecTyyppArr;
3367 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3368 std::vector<int> tmp5(tmp4,tmp4+szArr);
3370 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3373 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3375 std::vector< std::pair<int,int> > inp;
3376 convertPyToVectorPairInt(part,inp);
3377 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3380 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3382 std::vector< std::pair<int,int> > inp;
3383 convertPyToVectorPairInt(part,inp);
3384 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3387 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3389 std::vector< std::pair<int,int> > inp;
3390 convertPyToVectorPairInt(part,inp);
3391 std::vector<int> stWithGhost;
3392 std::vector< std::pair<int,int> > partWithGhost;
3393 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3394 PyObject *ret(PyTuple_New(2));
3395 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3396 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3400 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3402 std::vector< std::pair<int,int> > inp;
3403 convertPyToVectorPairInt(partCompactFormat,inp);
3404 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3407 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3409 std::vector< std::pair<int,int> > inp;
3410 convertPyToVectorPairInt(partCompactFormat,inp);
3411 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3414 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3416 std::vector< std::pair<int,int> > inp;
3417 convertPyToVectorPairInt(part,inp);
3418 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3421 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3423 int szArr,sw,iTypppArr;
3424 std::vector<int> stdvecTyyppArr;
3425 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3426 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3429 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3431 int szArr,sw,iTypppArr;
3432 std::vector<int> stdvecTyyppArr;
3433 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3434 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3437 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3439 std::vector< std::pair<int,int> > inp;
3440 convertPyToVectorPairInt(partCompactFormat,inp);
3441 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3444 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3446 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3447 PyObject *retPy=PyList_New(ret.size());
3448 for(std::size_t i=0;i<ret.size();i++)
3450 PyObject *tmp=PyTuple_New(2);
3451 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3452 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3453 PyList_SetItem(retPy,i,tmp);
3458 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3460 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3461 convertPyToVectorPairInt(r1,r1Cpp);
3462 convertPyToVectorPairInt(r2,r2Cpp);
3463 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3464 PyObject *retPy=PyList_New(ret.size());
3465 for(std::size_t i=0;i<ret.size();i++)
3467 PyObject *tmp=PyTuple_New(2);
3468 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3469 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3470 PyList_SetItem(retPy,i,tmp);
3475 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3477 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3478 convertPyToVectorPairInt(r1,r1Cpp);
3479 convertPyToVectorPairInt(r2,r2Cpp);
3480 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3483 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3485 int szArr,sw,iTypppArr;
3486 std::vector<int> stdvecTyyppArr;
3487 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3488 int szArr2,sw2,iTypppArr2;
3489 std::vector<int> stdvecTyyppArr2;
3490 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3491 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3492 std::vector< std::pair<int,int> > partCompactFormat;
3493 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3494 PyObject *ret=PyTuple_New(2);
3495 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3496 PyTuple_SetItem(ret,0,ret0Py);
3497 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3498 for(std::size_t i=0;i<partCompactFormat.size();i++)
3500 PyObject *tmp4=PyTuple_New(2);
3501 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3502 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3503 PyList_SetItem(ret1Py,i,tmp4);
3505 PyTuple_SetItem(ret,1,ret1Py);
3509 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3511 std::vector< std::pair<int,int> > param0,param1,ret;
3512 convertPyToVectorPairInt(bigInAbs,param0);
3513 convertPyToVectorPairInt(partOfBigInAbs,param1);
3514 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3515 PyObject *retPy(PyList_New(ret.size()));
3516 for(std::size_t i=0;i<ret.size();i++)
3518 PyObject *tmp(PyTuple_New(2));
3519 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3520 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3521 PyList_SetItem(retPy,i,tmp);
3526 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3528 std::vector< std::pair<int,int> > param0;
3529 convertPyToVectorPairInt(part,param0);
3530 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3531 PyObject *retPy(PyList_New(ret.size()));
3532 for(std::size_t i=0;i<ret.size();i++)
3534 PyObject *tmp(PyTuple_New(2));
3535 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3536 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3537 PyList_SetItem(retPy,i,tmp);
3542 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3544 std::vector< std::pair<int,int> > param0,param1;
3545 convertPyToVectorPairInt(startingFrom,param0);
3546 convertPyToVectorPairInt(goingTo,param1);
3547 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3550 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3552 std::vector< std::pair<int,int> > param0,param1,ret;
3553 convertPyToVectorPairInt(bigInAbs,param0);
3554 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3555 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3556 PyObject *retPy(PyList_New(ret.size()));
3557 for(std::size_t i=0;i<ret.size();i++)
3559 PyObject *tmp(PyTuple_New(2));
3560 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3561 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3562 PyList_SetItem(retPy,i,tmp);
3569 class MEDCouplingCurveLinearMesh;
3571 //== MEDCouplingCMesh
3573 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3576 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3577 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3578 void setCoords(const DataArrayDouble *coordsX,
3579 const DataArrayDouble *coordsY=0,
3580 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3581 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3582 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3584 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3586 return MEDCouplingCMesh::New();
3588 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3590 return MEDCouplingCMesh::New(meshName);
3593 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3595 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3597 std::string __str__() const throw(INTERP_KERNEL::Exception)
3599 return self->simpleRepr();
3601 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3603 std::ostringstream oss;
3604 self->reprQuickOverview(oss);
3607 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3609 DataArrayDouble *ret=self->getCoordsAt(i);
3617 //== MEDCouplingCMesh End
3619 //== MEDCouplingCurveLinearMesh
3621 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3624 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3625 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3626 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3628 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3630 return MEDCouplingCurveLinearMesh::New();
3632 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3634 return MEDCouplingCurveLinearMesh::New(meshName);
3636 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3638 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3640 std::string __str__() const throw(INTERP_KERNEL::Exception)
3642 return self->simpleRepr();
3644 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3646 std::ostringstream oss;
3647 self->reprQuickOverview(oss);
3650 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3652 DataArrayDouble *ret=self->getCoords();
3657 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3659 int szArr,sw,iTypppArr;
3660 std::vector<int> stdvecTyyppArr;
3661 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3662 self->setNodeGridStructure(tmp,tmp+szArr);
3667 //== MEDCouplingCurveLinearMesh End
3669 //== MEDCouplingIMesh
3671 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3674 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3676 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3677 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3678 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3679 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3680 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3681 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3682 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3683 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3684 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3685 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3686 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3691 return MEDCouplingIMesh::New();
3693 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3695 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3696 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3697 const int *nodeStrctPtr(0);
3698 const double *originPtr(0),*dxyzPtr(0);
3700 std::vector<int> bb0;
3701 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3704 std::vector<double> bb,bb2;
3706 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3707 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3709 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3712 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3714 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3717 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3719 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3722 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3725 std::vector<int> bb0;
3726 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3727 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3730 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3732 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3735 DataArrayDoubleTuple *aa;
3736 std::vector<double> bb;
3738 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3739 self->setOrigin(originPtr,originPtr+nbTuples);
3742 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3744 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3747 DataArrayDoubleTuple *aa;
3748 std::vector<double> bb;
3750 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3751 self->setDXYZ(originPtr,originPtr+nbTuples);
3754 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3756 std::vector< std::pair<int,int> > inp;
3757 convertPyToVectorPairInt(fineLocInCoarse,inp);
3758 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3761 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)
3763 std::vector< std::pair<int,int> > inp;
3764 convertPyToVectorPairInt(fineLocInCoarse,inp);
3765 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3768 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3770 std::vector< std::pair<int,int> > inp;
3771 convertPyToVectorPairInt(fineLocInCoarse,inp);
3772 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3775 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)
3777 std::vector< std::pair<int,int> > inp;
3778 convertPyToVectorPairInt(fineLocInCoarse,inp);
3779 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3782 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)
3784 std::vector< std::pair<int,int> > inp;
3785 convertPyToVectorPairInt(fineLocInCoarse,inp);
3786 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3789 std::string __str__() const throw(INTERP_KERNEL::Exception)
3791 return self->simpleRepr();
3793 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3795 std::ostringstream oss;
3796 self->reprQuickOverview(oss);
3802 //== MEDCouplingIMesh End
3806 namespace MEDCoupling
3808 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3811 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3812 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3813 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3814 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3815 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3816 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3817 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3818 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3819 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3820 std::string getName() const throw(INTERP_KERNEL::Exception);
3821 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3822 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3823 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3824 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3825 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3826 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3827 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3828 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3829 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3830 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3831 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3832 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3833 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3834 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3835 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3836 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3838 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3840 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3843 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3846 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3848 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3851 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3854 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3856 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3857 return convertIntArrToPyList3(ret);
3860 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3863 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3864 PyObject *ret=PyTuple_New(2);
3865 PyObject *ret0Py=ret0?Py_True:Py_False;
3867 PyTuple_SetItem(ret,0,ret0Py);
3868 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3872 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3874 DataArrayInt *ret1=0;
3875 MEDCouplingMesh *ret0=0;
3877 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3878 if (!SWIG_IsOK(res1))
3881 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3882 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3886 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3888 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3889 da2->checkAllocated();
3890 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3892 PyObject *res = PyList_New(2);
3893 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3894 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3898 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3900 DataArrayInt *ret1=0;
3902 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3903 PyObject *res=PyTuple_New(2);
3904 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3906 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3909 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3910 PyTuple_SetItem(res,1,res1);
3915 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3918 int v0; std::vector<int> v1;
3919 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3920 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3923 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3924 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3927 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3928 if (!SWIG_IsOK(res1))
3931 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3932 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3936 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3938 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3939 da2->checkAllocated();
3940 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3944 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3946 std::vector<int> tmp;
3947 self->getCellIdsHavingGaussLocalization(locId,tmp);
3948 DataArrayInt *ret=DataArrayInt::New();
3949 ret->alloc((int)tmp.size(),1);
3950 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3951 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3954 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3956 std::vector<int> inp0;
3957 convertPyToNewIntArr4(code,1,3,inp0);
3958 std::vector<const DataArrayInt *> inp1;
3959 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3960 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3965 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3968 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3969 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3970 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3971 static MEDCouplingFieldTemplate *New(TypeOfField type);
3972 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3973 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3976 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3978 return MEDCouplingFieldTemplate::New(f);
3981 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3983 return MEDCouplingFieldTemplate::New(f);
3986 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3988 return MEDCouplingFieldTemplate::New(f);
3991 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3993 return MEDCouplingFieldTemplate::New(type);
3996 std::string __str__() const throw(INTERP_KERNEL::Exception)
3998 return self->simpleRepr();
4001 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4003 std::ostringstream oss;
4004 self->reprQuickOverview(oss);
4010 class MEDCouplingFieldInt;
4012 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
4015 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4016 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4017 void setTimeUnit(const std::string& unit);
4018 std::string getTimeUnit() const;
4019 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
4020 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4021 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
4022 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4023 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4024 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4025 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4026 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4027 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4028 MEDCouplingFieldDouble *deepCopy() const;
4029 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4030 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4031 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4032 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4033 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4034 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4035 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4036 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4037 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4038 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4039 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4040 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4041 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4042 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4043 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4044 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4045 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4046 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4047 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4048 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4049 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4050 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4051 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4052 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4053 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4054 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4055 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4056 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4057 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4058 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4059 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4060 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4061 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4062 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4063 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4064 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4065 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4066 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4067 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4068 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4069 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4070 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4071 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4072 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4073 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4074 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4075 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4076 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4077 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4078 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4079 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4080 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4081 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4082 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4083 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4084 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4085 double getMinValue() const throw(INTERP_KERNEL::Exception);
4086 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4087 double norm2() const throw(INTERP_KERNEL::Exception);
4088 double normMax() const throw(INTERP_KERNEL::Exception);
4089 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4090 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4091 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4092 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4093 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4094 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4095 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4096 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4097 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4098 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4099 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4100 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4101 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4102 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4103 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4104 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4105 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4106 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4107 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4108 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4109 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4110 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4112 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4114 return MEDCouplingFieldDouble::New(type,td);
4117 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4119 return MEDCouplingFieldDouble::New(ft,td);
4122 std::string __str__() const throw(INTERP_KERNEL::Exception)
4124 return self->simpleRepr();
4127 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4129 std::ostringstream oss;
4130 self->reprQuickOverview(oss);
4134 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4136 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4140 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4142 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4146 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4148 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4150 DataArrayDouble *a,*a2;
4151 DataArrayDoubleTuple *aa,*aa2;
4152 std::vector<double> bb,bb2;
4154 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4155 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4156 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4159 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4161 DataArrayDouble *ret=self->getArray();
4167 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4169 std::vector<DataArrayDouble *> arrs=self->getArrays();
4170 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4174 PyObject *ret=PyTuple_New(sz);
4175 for(int i=0;i<sz;i++)
4178 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4180 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4185 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4187 std::vector<const DataArrayDouble *> tmp;
4188 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4190 std::vector<DataArrayDouble *> arrs(sz);
4191 for(int i=0;i<sz;i++)
4192 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4193 self->setArrays(arrs);
4196 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4198 DataArrayDouble *ret=self->getEndArray();
4204 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4208 DataArrayDoubleTuple *aa;
4209 std::vector<double> bb;
4211 const MEDCouplingMesh *mesh=self->getMesh();
4213 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4214 int spaceDim=mesh->getSpaceDimension();
4215 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4216 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4218 int sz=self->getNumberOfComponents();
4219 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4220 self->getValueOn(spaceLoc,res);
4221 return convertDblArrToPyList<double>(res,sz);
4224 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4226 int sz=self->getNumberOfComponents();
4227 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4228 self->getValueOnPos(i,j,k,res);
4229 return convertDblArrToPyList<double>(res,sz);
4232 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4234 const MEDCouplingMesh *mesh(self->getMesh());
4236 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4239 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4240 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4241 mesh->getSpaceDimension(),true,nbPts);
4242 return self->getValueOnMulti(inp,nbPts);
4245 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4249 DataArrayDoubleTuple *aa;
4250 std::vector<double> bb;
4252 const MEDCouplingMesh *mesh=self->getMesh();
4254 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4255 int spaceDim=mesh->getSpaceDimension();
4256 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4257 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4260 int sz=self->getNumberOfComponents();
4261 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4262 self->getValueOn(spaceLoc,time,res);
4263 return convertDblArrToPyList<double>(res,sz);
4266 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4268 if(self->getArray()!=0)
4269 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4272 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4273 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4274 self->setArray(arr);
4278 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4281 double tmp0=self->getTime(tmp1,tmp2);
4282 PyObject *res = PyList_New(3);
4283 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4284 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4285 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4289 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4292 double tmp0=self->getStartTime(tmp1,tmp2);
4293 PyObject *res = PyList_New(3);
4294 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4295 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4296 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4300 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4303 double tmp0=self->getEndTime(tmp1,tmp2);
4304 PyObject *res = PyList_New(3);
4305 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4306 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4307 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4310 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4312 int sz=self->getNumberOfComponents();
4313 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4314 self->accumulate(tmp);
4315 return convertDblArrToPyList<double>(tmp,sz);
4317 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4319 int sz=self->getNumberOfComponents();
4320 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4321 self->integral(isWAbs,tmp);
4322 return convertDblArrToPyList<double>(tmp,sz);
4324 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4326 int sz=self->getNumberOfComponents();
4327 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4328 self->getWeightedAverageValue(tmp,isWAbs);
4329 return convertDblArrToPyList<double>(tmp,sz);
4331 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4333 int sz=self->getNumberOfComponents();
4334 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4336 return convertDblArrToPyList<double>(tmp,sz);
4338 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4340 int sz=self->getNumberOfComponents();
4341 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4343 return convertDblArrToPyList<double>(tmp,sz);
4345 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4347 int szArr,sw,iTypppArr;
4348 std::vector<int> stdvecTyyppArr;
4349 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4350 self->renumberCells(tmp,check);
4353 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4355 int szArr,sw,iTypppArr;
4356 std::vector<int> stdvecTyyppArr;
4357 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4358 self->renumberCellsWithoutMesh(tmp,check);
4361 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4363 int szArr,sw,iTypppArr;
4364 std::vector<int> stdvecTyyppArr;
4365 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4366 self->renumberNodes(tmp,eps);
4369 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4371 int szArr,sw,iTypppArr;
4372 std::vector<int> stdvecTyyppArr;
4373 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4374 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4377 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4379 return fieldT_buildSubPart(self,li);
4382 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4384 return fieldT__getitem__(self,li);
4387 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4390 double r1=self->getMaxValue2(tmp);
4391 PyObject *ret=PyTuple_New(2);
4392 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4393 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4397 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4400 double r1=self->getMinValue2(tmp);
4401 PyObject *ret=PyTuple_New(2);
4402 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4403 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4407 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4409 std::vector<int> tmp;
4410 convertPyToNewIntArr3(li,tmp);
4411 return self->keepSelectedComponents(tmp);
4414 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4416 std::vector<int> tmp;
4417 convertPyToNewIntArr3(li,tmp);
4418 self->setSelectedComponents(f,tmp);
4421 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4424 DataArrayDouble *a,*a2;
4425 DataArrayDoubleTuple *aa,*aa2;
4426 std::vector<double> bb,bb2;
4429 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4430 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4431 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4432 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4434 return self->extractSlice3D(orig,vect,eps);
4437 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4439 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4442 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4444 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4447 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4449 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.";
4450 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4453 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4455 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4457 return (*self)-(*other);
4459 throw INTERP_KERNEL::Exception(msg);
4464 DataArrayDoubleTuple *aa;
4465 std::vector<double> bb;
4467 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4472 if(!self->getArray())
4473 throw INTERP_KERNEL::Exception(msg2);
4474 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4475 ret->applyLin(1.,-val);
4476 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4477 ret2->setArray(ret);
4482 if(!self->getArray())
4483 throw INTERP_KERNEL::Exception(msg2);
4484 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4485 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4486 ret2->setArray(ret);
4491 if(!self->getArray())
4492 throw INTERP_KERNEL::Exception(msg2);
4493 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4494 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4495 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4496 ret2->setArray(ret);
4501 if(!self->getArray())
4502 throw INTERP_KERNEL::Exception(msg2);
4503 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4504 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4505 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4506 ret2->setArray(ret);
4510 { throw INTERP_KERNEL::Exception(msg); }
4514 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4516 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4519 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4521 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4524 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4526 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4529 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4531 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.";
4532 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4535 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4537 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4539 return (*self)/(*other);
4541 throw INTERP_KERNEL::Exception(msg);
4546 DataArrayDoubleTuple *aa;
4547 std::vector<double> bb;
4549 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4555 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4556 if(!self->getArray())
4557 throw INTERP_KERNEL::Exception(msg2);
4558 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4559 ret->applyLin(1./val,0);
4560 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4561 ret2->setArray(ret);
4566 if(!self->getArray())
4567 throw INTERP_KERNEL::Exception(msg2);
4568 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4569 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4570 ret2->setArray(ret);
4575 if(!self->getArray())
4576 throw INTERP_KERNEL::Exception(msg2);
4577 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4578 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4579 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4580 ret2->setArray(ret);
4585 if(!self->getArray())
4586 throw INTERP_KERNEL::Exception(msg2);
4587 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4588 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4589 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4590 ret2->setArray(ret);
4594 { throw INTERP_KERNEL::Exception(msg); }
4598 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4600 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4603 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4605 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.";
4606 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4609 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4611 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4613 return (*self)^(*other);
4615 throw INTERP_KERNEL::Exception(msg);
4620 DataArrayDoubleTuple *aa;
4621 std::vector<double> bb;
4623 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4628 if(!self->getArray())
4629 throw INTERP_KERNEL::Exception(msg2);
4630 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4632 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4633 ret2->setArray(ret);
4638 if(!self->getArray())
4639 throw INTERP_KERNEL::Exception(msg2);
4640 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4641 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4642 ret2->setArray(ret);
4647 if(!self->getArray())
4648 throw INTERP_KERNEL::Exception(msg2);
4649 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4650 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4651 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4652 ret2->setArray(ret);
4657 if(!self->getArray())
4658 throw INTERP_KERNEL::Exception(msg2);
4659 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4660 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4661 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4662 ret2->setArray(ret);
4666 { throw INTERP_KERNEL::Exception(msg); }
4670 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4672 return self->negate();
4675 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4677 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.";
4678 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4681 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4683 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4687 Py_XINCREF(trueSelf);
4691 throw INTERP_KERNEL::Exception(msg);
4696 DataArrayDoubleTuple *aa;
4697 std::vector<double> bb;
4699 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4704 if(!self->getArray())
4705 throw INTERP_KERNEL::Exception(msg2);
4706 self->getArray()->applyLin(1.,val);
4707 Py_XINCREF(trueSelf);
4712 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4715 Py_XINCREF(trueSelf);
4720 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4721 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4722 ret2->setArray(aaa);
4724 Py_XINCREF(trueSelf);
4729 if(!self->getArray())
4730 throw INTERP_KERNEL::Exception(msg2);
4731 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4732 self->getArray()->addEqual(aaa);
4733 Py_XINCREF(trueSelf);
4737 { throw INTERP_KERNEL::Exception(msg); }
4741 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4743 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.";
4744 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4747 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4749 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4753 Py_XINCREF(trueSelf);
4757 throw INTERP_KERNEL::Exception(msg);
4762 DataArrayDoubleTuple *aa;
4763 std::vector<double> bb;
4765 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4770 if(!self->getArray())
4771 throw INTERP_KERNEL::Exception(msg2);
4772 self->getArray()->applyLin(1.,-val);
4773 Py_XINCREF(trueSelf);
4778 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4781 Py_XINCREF(trueSelf);
4786 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4787 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4788 ret2->setArray(aaa);
4790 Py_XINCREF(trueSelf);
4795 if(!self->getArray())
4796 throw INTERP_KERNEL::Exception(msg2);
4797 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4798 self->getArray()->substractEqual(aaa);
4799 Py_XINCREF(trueSelf);
4803 { throw INTERP_KERNEL::Exception(msg); }
4807 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4809 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.";
4810 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4813 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4815 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4819 Py_XINCREF(trueSelf);
4823 throw INTERP_KERNEL::Exception(msg);
4828 DataArrayDoubleTuple *aa;
4829 std::vector<double> bb;
4831 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4836 if(!self->getArray())
4837 throw INTERP_KERNEL::Exception(msg2);
4838 self->getArray()->applyLin(val,0);
4839 Py_XINCREF(trueSelf);
4844 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4847 Py_XINCREF(trueSelf);
4852 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4853 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4854 ret2->setArray(aaa);
4856 Py_XINCREF(trueSelf);
4861 if(!self->getArray())
4862 throw INTERP_KERNEL::Exception(msg2);
4863 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4864 self->getArray()->multiplyEqual(aaa);
4865 Py_XINCREF(trueSelf);
4869 { throw INTERP_KERNEL::Exception(msg); }
4873 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4875 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.";
4876 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4879 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4881 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4885 Py_XINCREF(trueSelf);
4889 throw INTERP_KERNEL::Exception(msg);
4894 DataArrayDoubleTuple *aa;
4895 std::vector<double> bb;
4897 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4903 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4904 if(!self->getArray())
4905 throw INTERP_KERNEL::Exception(msg2);
4906 self->getArray()->applyLin(1./val,0);
4907 Py_XINCREF(trueSelf);
4912 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4915 Py_XINCREF(trueSelf);
4920 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4921 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4922 ret2->setArray(aaa);
4924 Py_XINCREF(trueSelf);
4929 if(!self->getArray())
4930 throw INTERP_KERNEL::Exception(msg2);
4931 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4932 self->getArray()->divideEqual(aaa);
4933 Py_XINCREF(trueSelf);
4937 { throw INTERP_KERNEL::Exception(msg); }
4941 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4943 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.";
4944 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4947 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4949 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4953 Py_XINCREF(trueSelf);
4957 throw INTERP_KERNEL::Exception(msg);
4962 DataArrayDoubleTuple *aa;
4963 std::vector<double> bb;
4965 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4970 if(!self->getArray())
4971 throw INTERP_KERNEL::Exception(msg2);
4972 self->getArray()->applyPow(val);
4973 Py_XINCREF(trueSelf);
4978 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4981 Py_XINCREF(trueSelf);
4986 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4987 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4988 ret2->setArray(aaa);
4990 Py_XINCREF(trueSelf);
4995 if(!self->getArray())
4996 throw INTERP_KERNEL::Exception(msg2);
4997 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4998 self->getArray()->powEqual(aaa);
4999 Py_XINCREF(trueSelf);
5003 { throw INTERP_KERNEL::Exception(msg); }
5007 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5009 std::vector<const MEDCouplingFieldDouble *> tmp;
5010 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5011 return MEDCouplingFieldDouble::MergeFields(tmp);
5014 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5016 std::vector<const MEDCouplingFieldDouble *> tmp;
5017 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5018 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5021 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5023 return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5026 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5028 return field_serialize<double>(self);
5031 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5033 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInputGeneral<SinglePyObjExpectToBeAListOfSz2>(cls,args,"MEDCouplingFieldDouble");
5036 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5037 {// put an empty dict in input to say to __new__ to call __init__...
5038 return field__getnewargs__<MEDCouplingFieldDouble>(self);
5041 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5043 return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5046 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5048 field__setstate__<double>(self,inp);
5053 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5056 int getNumberOfFields() const;
5057 MEDCouplingMultiFields *deepCopy() const;
5058 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5059 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5060 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5061 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5062 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5065 std::string __str__() const throw(INTERP_KERNEL::Exception)
5067 return self->simpleRepr();
5069 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5071 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5072 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5074 std::vector<MEDCouplingFieldDouble *> fs(sz);
5075 for(int i=0;i<sz;i++)
5076 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5077 return MEDCouplingMultiFields::New(fs);
5079 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5081 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5082 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5084 std::vector<MEDCouplingFieldDouble *> fs(sz);
5085 for(int i=0;i<sz;i++)
5086 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5087 return MEDCouplingMultiFields::New(fs);
5089 PyObject *getFields() const
5091 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5092 int sz=fields.size();
5093 PyObject *res = PyList_New(sz);
5094 for(int i=0;i<sz;i++)
5098 fields[i]->incrRef();
5099 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5103 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5108 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5110 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5114 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5117 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5119 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5121 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5123 PyObject *res = PyList_New(sz);
5124 for(int i=0;i<sz;i++)
5129 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5133 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5138 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5140 std::vector<int> refs;
5141 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5143 PyObject *res = PyList_New(sz);
5144 for(int i=0;i<sz;i++)
5149 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5153 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5157 PyObject *ret=PyTuple_New(2);
5158 PyTuple_SetItem(ret,0,res);
5159 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5162 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5164 std::vector<DataArrayDouble *> ms=self->getArrays();
5166 PyObject *res = PyList_New(sz);
5167 for(int i=0;i<sz;i++)
5172 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5176 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5181 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5183 std::vector< std::vector<int> > refs;
5184 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5186 PyObject *res = PyList_New(sz);
5187 PyObject *res2 = PyList_New(sz);
5188 for(int i=0;i<sz;i++)
5193 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5197 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5199 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5202 PyObject *ret=PyTuple_New(2);
5203 PyTuple_SetItem(ret,0,res);
5204 PyTuple_SetItem(ret,1,res2);
5210 class MEDCouplingFieldInt : public MEDCouplingField
5213 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5214 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5215 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5216 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5217 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5218 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5219 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5220 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5221 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5222 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5223 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5225 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5227 return MEDCouplingFieldInt::New(type,td);
5230 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5232 return MEDCouplingFieldInt::New(ft,td);
5235 std::string __str__() const throw(INTERP_KERNEL::Exception)
5237 return self->simpleRepr();
5240 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5242 std::ostringstream oss;
5243 self->reprQuickOverview(oss);
5247 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5249 return fieldT_buildSubPart(self,li);
5252 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5254 return fieldT__getitem__(self,li);
5257 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5259 DataArrayInt *ret=self->getArray();
5265 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5268 double tmp0=self->getTime(tmp1,tmp2);
5269 PyObject *res = PyList_New(3);
5270 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5271 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5272 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5276 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5278 return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
5281 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5283 return field_serialize<int>(self);
5286 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5288 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInputGeneral<SinglePyObjExpectToBeAListOfSz2>(cls,args,"MEDCouplingFieldInt");
5291 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5292 {// put an empty dict in input to say to __new__ to call __init__...
5293 return field__getnewargs__<MEDCouplingFieldInt>(self);
5296 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5298 return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
5301 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5303 field__setstate__<int>(self,inp);
5308 class MEDCouplingFieldFloat : public MEDCouplingField
5311 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5312 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5313 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5314 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5315 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5316 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5317 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5318 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5319 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5320 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5321 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5323 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5325 return MEDCouplingFieldFloat::New(type,td);
5328 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5330 return MEDCouplingFieldFloat::New(ft,td);
5333 std::string __str__() const throw(INTERP_KERNEL::Exception)
5335 return self->simpleRepr();
5338 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5340 std::ostringstream oss;
5341 self->reprQuickOverview(oss);
5345 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5347 return fieldT_buildSubPart(self,li);
5350 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5352 return fieldT__getitem__(self,li);
5355 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5357 DataArrayFloat *ret=self->getArray();
5363 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5366 double tmp0=self->getTime(tmp1,tmp2);
5367 PyObject *res = PyList_New(3);
5368 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5369 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5370 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5374 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5376 return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5379 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5381 return field_serialize<float>(self);
5384 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5386 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInputGeneral<SinglePyObjExpectToBeAListOfSz2>(cls,args,"MEDCouplingFieldFloat");
5389 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5390 {// put an empty dict in input to say to __new__ to call __init__...
5391 return field__getnewargs__<MEDCouplingFieldFloat>(self);
5394 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5396 return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5399 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5401 field__setstate__<float>(self,inp);
5406 class MEDCouplingDefinitionTime
5409 MEDCouplingDefinitionTime();
5410 void assign(const MEDCouplingDefinitionTime& other);
5411 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5412 double getTimeResolution() const;
5413 std::vector<double> getHotSpotsTime() const;
5416 std::string __str__() const throw(INTERP_KERNEL::Exception)
5418 std::ostringstream oss;
5419 self->appendRepr(oss);
5423 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5425 int meshId,arrId,arrIdInField,fieldId;
5426 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5427 PyObject *res=PyList_New(4);
5428 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5429 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5430 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5431 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5435 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5437 int meshId,arrId,arrIdInField,fieldId;
5438 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5439 PyObject *res=PyList_New(4);
5440 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5441 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5442 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5443 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5449 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5452 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5453 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5457 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5459 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5460 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5462 std::vector<MEDCouplingFieldDouble *> fs(sz);
5463 for(int i=0;i<sz;i++)
5464 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5465 return MEDCouplingFieldOverTime::New(fs);
5467 std::string __str__() const throw(INTERP_KERNEL::Exception)
5469 return self->simpleRepr();
5471 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5473 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5474 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5476 std::vector<MEDCouplingFieldDouble *> fs(sz);
5477 for(int i=0;i<sz;i++)
5478 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5479 return MEDCouplingFieldOverTime::New(fs);
5484 class MEDCouplingCartesianAMRMesh;
5486 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5489 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5490 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5491 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5494 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5496 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5504 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5507 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5508 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5509 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5512 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5514 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5515 return convertFromVectorPairInt(ret);
5518 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5520 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5521 return convertFromVectorPairInt(ret);
5524 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5526 std::vector< std::pair<int,int> > inp;
5527 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5528 self->addPatch(inp,factors);
5531 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5533 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5535 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5536 if(patchId==mesh->getNumberOfPatches())
5538 std::ostringstream oss;
5539 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5540 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5543 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5549 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5551 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5553 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5554 mesh->removePatch(patchId);
5557 int __len__() const throw(INTERP_KERNEL::Exception)
5559 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5561 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5562 return mesh->getNumberOfPatches();
5567 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5571 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5574 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5575 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5576 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5577 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5578 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5579 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5580 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5581 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5582 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5583 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5584 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5585 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5586 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5588 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5589 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5590 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5591 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5592 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5593 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5594 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5595 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5596 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5597 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5598 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5599 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5600 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5601 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5602 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5603 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5604 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5605 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5606 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5607 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5610 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5612 std::vector< std::pair<int,int> > inp;
5613 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5614 self->addPatch(inp,factors);
5617 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5619 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5621 PyObject *ret = PyList_New(sz);
5622 for(int i=0;i<sz;i++)
5624 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5627 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5632 // agy : don't know why typemap fails here ??? let it in the extend section
5633 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5635 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5638 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5640 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5641 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5647 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5649 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5650 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5656 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5658 std::vector<int> out1;
5659 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5660 PyObject *ret(PyTuple_New(2));
5661 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5662 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5666 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5668 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5670 PyObject *ret = PyList_New(sz);
5671 for(int i=0;i<sz;i++)
5672 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5676 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5678 std::vector<const DataArrayDouble *> inp;
5679 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5680 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5683 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5685 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5691 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5693 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5699 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5701 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5707 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5709 const MEDCouplingIMesh *ret(self->getImageMesh());
5712 return const_cast<MEDCouplingIMesh *>(ret);
5715 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5717 if(patchId==self->getNumberOfPatches())
5719 std::ostringstream oss;
5720 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5721 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5724 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5730 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5732 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5733 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5734 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5737 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5739 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5740 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5741 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5744 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5746 self->removePatch(patchId);
5749 int __len__() const throw(INTERP_KERNEL::Exception)
5751 return self->getNumberOfPatches();
5756 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5760 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5763 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5766 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5768 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5769 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5770 const int *nodeStrctPtr(0);
5771 const double *originPtr(0),*dxyzPtr(0);
5773 std::vector<int> bb0;
5774 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5777 std::vector<double> bb,bb2;
5779 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5780 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5782 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5785 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5787 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5788 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5789 std::vector< std::vector<int> > inp2;
5790 convertPyToVectorOfVectorOfInt(factors,inp2);
5791 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5794 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5796 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5799 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5801 return MEDCouplingCartesianAMRMesh::New(mesh);
5806 class MEDCouplingDataForGodFather : public RefCountObject
5809 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5810 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5811 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5812 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5813 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5814 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5815 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5816 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5817 virtual void alloc() throw(INTERP_KERNEL::Exception);
5818 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5821 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5823 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5831 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5834 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5835 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5836 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5837 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5838 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5839 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5840 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5841 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5842 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5845 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5847 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5848 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5849 MEDCouplingAMRAttribute *ret(0);
5852 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5853 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5855 catch(INTERP_KERNEL::Exception&)
5857 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5858 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5863 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5865 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5868 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5870 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5871 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5877 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5879 std::vector< std::vector<std::string> > compNamesCpp;
5880 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5881 self->spillInfoOnComponents(compNamesCpp);
5884 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5886 std::vector<int> inp0;
5887 if(!fillIntVector(nfs,inp0))
5888 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5889 std::size_t sz(inp0.size());
5890 std::vector<NatureOfField> inp00(sz);
5891 for(std::size_t i=0;i<sz;i++)
5892 inp00[i]=(NatureOfField)inp0[i];
5893 self->spillNatures(inp00);
5896 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5898 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5899 int sz((int)ret.size());
5900 PyObject *retPy(PyList_New(sz));
5901 for(int i=0;i<sz;i++)
5902 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5908 class DenseMatrix : public RefCountObject, public TimeLabel
5911 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5912 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5913 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5914 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5916 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5917 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5918 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5919 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5920 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5921 void transpose() throw(INTERP_KERNEL::Exception);
5923 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5924 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5925 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5928 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5930 return DenseMatrix::New(nbRows,nbCols);
5933 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5935 return DenseMatrix::New(array,nbRows,nbCols);
5938 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5941 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5942 PyObject *ret=PyTuple_New(2);
5943 PyObject *ret0Py=ret0?Py_True:Py_False;
5945 PyTuple_SetItem(ret,0,ret0Py);
5946 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5950 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5952 DataArrayDouble *ret(self->getData());
5958 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5960 return MEDCoupling::DenseMatrix::Add(self,other);
5963 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5965 return MEDCoupling::DenseMatrix::Substract(self,other);
5968 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5970 return MEDCoupling::DenseMatrix::Multiply(self,other);
5973 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5975 return MEDCoupling::DenseMatrix::Multiply(self,other);
5978 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5980 self->addEqual(other);
5981 Py_XINCREF(trueSelf);
5985 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5987 self->substractEqual(other);
5988 Py_XINCREF(trueSelf);
5992 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5994 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6004 __filename=os.environ.get('PYTHONSTARTUP')
6005 if __filename and os.path.isfile(__filename):
6006 exec(open(__filename).read())