1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldTemplate.hxx"
42 #include "MEDCouplingGaussLocalization.hxx"
44 #include "MEDCouplingMultiFields.hxx"
45 #include "MEDCouplingFieldOverTime.hxx"
46 #include "MEDCouplingDefinitionTime.hxx"
47 #include "MEDCouplingFieldDiscretization.hxx"
48 #include "MEDCouplingCartesianAMRMesh.hxx"
49 #include "MEDCouplingAMRAttribute.hxx"
50 #include "MEDCouplingMatrix.hxx"
51 #include "MEDCouplingPartDefinition.hxx"
52 #include "MEDCouplingSkyLineArray.hxx"
53 #include "MEDCouplingTypemaps.i"
55 #include "InterpKernelAutoPtr.hxx"
56 #include "BoxSplittingOptions.hxx"
58 using namespace MEDCoupling;
59 using namespace INTERP_KERNEL;
63 %template(ivec) std::vector<int>;
64 %template(dvec) std::vector<double>;
65 %template(svec) std::vector<std::string>;
68 %typemap(out) MEDCoupling::MEDCouplingMesh*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingMesh*
75 $result=convertMesh($1,$owner);
80 %typemap(out) MEDCoupling::MEDCouplingPointSet*
82 $result=convertMesh($1,$owner);
85 %typemap(out) MEDCouplingPointSet*
87 $result=convertMesh($1,$owner);
92 %typemap(out) MEDCouplingCartesianAMRPatchGen*
94 $result=convertCartesianAMRPatch($1,$owner);
99 %typemap(out) MEDCouplingCartesianAMRMeshGen*
101 $result=convertCartesianAMRMesh($1,$owner);
106 %typemap(out) MEDCouplingDataForGodFather*
108 $result=convertDataForGodFather($1,$owner);
113 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
115 $result=convertMesh($1,$owner);
118 %typemap(out) MEDCoupling1GTUMesh*
120 $result=convertMesh($1,$owner);
125 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
127 $result=convertMesh($1,$owner);
130 %typemap(out) MEDCouplingStructuredMesh*
132 $result=convertMesh($1,$owner);
137 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
139 $result=convertFieldDiscretization($1,$owner);
142 %typemap(out) MEDCouplingFieldDiscretization*
144 $result=convertFieldDiscretization($1,$owner);
149 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
151 $result=convertMultiFields($1,$owner);
154 %typemap(out) MEDCouplingMultiFields*
156 $result=convertMultiFields($1,$owner);
161 %typemap(out) MEDCoupling::PartDefinition*
163 $result=convertPartDefinition($1,$owner);
166 %typemap(out) PartDefinition*
168 $result=convertPartDefinition($1,$owner);
173 %init %{ import_array(); %}
176 %feature("autodoc", "1");
177 %feature("docstring");
179 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
180 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
181 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
236 %newobject MEDCoupling::MEDCouplingFieldInt::New;
237 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
238 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
239 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
240 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
241 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
242 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
243 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
244 %newobject MEDCoupling::MEDCouplingMesh::clone;
245 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
246 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
247 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
248 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
249 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
250 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
251 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
252 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
253 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
254 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
256 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
257 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
258 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
259 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
260 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
261 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
262 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
263 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
264 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
265 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
266 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
271 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
272 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
274 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
275 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
276 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
277 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
278 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
279 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
280 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
281 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
282 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
283 %newobject MEDCoupling::MEDCouplingUMesh::New;
284 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
287 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
288 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
289 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
290 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
291 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
292 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
294 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
295 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
296 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
297 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
299 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
300 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
301 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
302 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
303 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
305 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
306 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
307 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
308 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
309 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
310 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
311 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
312 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
313 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
314 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
315 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
316 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
317 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
318 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
319 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
320 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
321 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
322 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
323 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
324 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
325 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
326 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
327 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
328 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
329 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
330 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
331 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
332 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
333 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
334 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
335 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
336 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
337 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
338 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
339 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
340 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
341 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
342 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
343 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
344 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
345 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
346 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
347 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
349 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
350 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
351 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
352 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
353 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
354 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
355 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
356 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
357 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
358 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
359 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
360 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
361 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
364 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
365 %newobject MEDCoupling::MEDCouplingCMesh::New;
366 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
367 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
368 %newobject MEDCoupling::MEDCouplingIMesh::New;
369 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
370 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
371 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
372 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
373 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
374 %newobject MEDCoupling::MEDCouplingMultiFields::New;
375 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
376 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
378 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
379 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
380 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
381 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
394 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
395 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
396 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
397 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
398 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
399 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
402 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
403 %newobject MEDCoupling::DenseMatrix::New;
404 %newobject MEDCoupling::DenseMatrix::deepCopy;
405 %newobject MEDCoupling::DenseMatrix::shallowCpy;
406 %newobject MEDCoupling::DenseMatrix::getData;
407 %newobject MEDCoupling::DenseMatrix::matVecMult;
408 %newobject MEDCoupling::DenseMatrix::MatVecMult;
409 %newobject MEDCoupling::DenseMatrix::__add__;
410 %newobject MEDCoupling::DenseMatrix::__sub__;
411 %newobject MEDCoupling::DenseMatrix::__mul__;
412 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
413 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
414 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
416 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
417 %feature("unref") MEDCouplingMesh "$this->decrRef();"
418 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
419 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
420 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
421 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
422 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
424 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
425 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingField "$this->decrRef();"
427 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
428 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
429 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
430 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
431 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
433 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
435 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
436 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
437 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
438 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
439 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
440 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
442 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
443 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
444 %feature("unref") DenseMatrix "$this->decrRef();"
445 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
447 %rename(assign) *::operator=;
448 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
449 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
450 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
451 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
455 %rename (InterpKernelException) INTERP_KERNEL::Exception;
457 %include "MEDCouplingRefCountObject.i"
458 %include "MEDCouplingMemArray.i"
460 namespace INTERP_KERNEL
463 * \class BoxSplittingOptions
464 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
466 class BoxSplittingOptions
469 BoxSplittingOptions();
470 void init() throw(INTERP_KERNEL::Exception);
471 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
472 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
473 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
474 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
475 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
476 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
477 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
478 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
479 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
480 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
481 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
482 std::string printOptions() const throw(INTERP_KERNEL::Exception);
485 std::string __str__() const throw(INTERP_KERNEL::Exception)
487 return self->printOptions();
493 namespace MEDCoupling
509 CONST_ON_TIME_INTERVAL = 7
510 } TypeOfTimeDiscretization;
518 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
519 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
521 } MEDCouplingMeshType;
524 class DataArrayDouble;
525 class MEDCouplingUMesh;
526 class MEDCouplingCMesh;
527 class MEDCouplingFieldDouble;
529 %extend RefCountObject
531 std::string getHiddenCppPointer() const
533 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
538 %extend MEDCouplingGaussLocalization
540 std::string __str__() const throw(INTERP_KERNEL::Exception)
542 return self->getStringRepr();
545 std::string __repr__() const throw(INTERP_KERNEL::Exception)
547 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
548 oss << self->getStringRepr();
555 class MEDCouplingMesh : public RefCountObject, public TimeLabel
558 void setName(const std::string& name);
559 std::string getName() const;
560 void setDescription(const std::string& descr);
561 std::string getDescription() const;
562 void setTime(double val, int iteration, int order);
563 void setTimeUnit(const std::string& unit);
564 std::string getTimeUnit() const;
565 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
566 bool isStructured() const throw(INTERP_KERNEL::Exception);
567 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
568 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
569 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
570 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
571 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
572 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
573 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
574 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
575 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
576 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
577 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
578 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
579 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
587 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
588 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
589 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
590 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
591 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
592 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
593 virtual std::string getVTKFileExtension() const;
594 std::string getVTKFileNameOf(const std::string& fileName) const;
596 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
603 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
604 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
605 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
606 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);
607 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
608 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
612 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
613 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
616 std::string __str__() const throw(INTERP_KERNEL::Exception)
618 return self->simpleRepr();
621 PyObject *getTime() throw(INTERP_KERNEL::Exception)
624 double tmp0=self->getTime(tmp1,tmp2);
625 PyObject *res = PyList_New(3);
626 PyList_SetItem(res,0,SWIG_From_double(tmp0));
627 PyList_SetItem(res,1,SWIG_From_int(tmp1));
628 PyList_SetItem(res,2,SWIG_From_int(tmp2));
632 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
634 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
635 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
641 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
645 DataArrayDoubleTuple *aa;
646 std::vector<double> bb;
648 int spaceDim=self->getSpaceDimension();
649 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
650 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
651 return self->getCellContainingPoint(pos,eps);
654 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
658 DataArrayDoubleTuple *aa;
659 std::vector<double> bb;
661 int spaceDim=self->getSpaceDimension();
662 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
663 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
664 MCAuto<DataArrayInt> elts,eltsIndex;
665 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
666 PyObject *ret=PyTuple_New(2);
667 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
668 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
672 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
674 MCAuto<DataArrayInt> elts,eltsIndex;
675 int spaceDim=self->getSpaceDimension();
677 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
678 if (!SWIG_IsOK(res1))
681 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
682 int nbOfPoints=size/spaceDim;
685 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
687 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
691 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
693 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
694 da2->checkAllocated();
695 int size=da2->getNumberOfTuples();
696 int nbOfCompo=da2->getNumberOfComponents();
697 if(nbOfCompo!=spaceDim)
699 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
701 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
703 PyObject *ret=PyTuple_New(2);
704 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
705 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
709 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
713 DataArrayDoubleTuple *aa;
714 std::vector<double> bb;
716 int spaceDim=self->getSpaceDimension();
717 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
718 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
719 std::vector<int> elts;
720 self->getCellsContainingPoint(pos,eps,elts);
721 DataArrayInt *ret=DataArrayInt::New();
722 ret->alloc((int)elts.size(),1);
723 std::copy(elts.begin(),elts.end(),ret->getPointer());
724 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
727 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
729 MCAuto<DataArrayInt> d0=DataArrayInt::New();
730 MCAuto<DataArrayInt> d1=DataArrayInt::New();
731 self->getReverseNodalConnectivity(d0,d1);
732 PyObject *ret=PyTuple_New(2);
733 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
734 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
738 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
741 int v0; std::vector<int> v1;
742 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
743 self->renumberCells(ids,check);
746 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
748 DataArrayInt *cellCor, *nodeCor;
749 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
750 PyObject *res = PyList_New(2);
751 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
752 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
756 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
758 DataArrayInt *cellCor=0,*nodeCor=0;
759 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
760 PyObject *res = PyList_New(2);
761 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
762 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
766 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
768 DataArrayInt *cellCor=0;
769 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
773 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
776 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
777 if (!SWIG_IsOK(res1))
780 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
781 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
785 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
787 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
788 da2->checkAllocated();
789 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
792 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
794 std::vector<int> conn;
795 self->getNodeIdsOfCell(cellId,conn);
796 return convertIntArrToPyList2(conn);
799 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
801 std::vector<double> coo;
802 self->getCoordinatesOfNode(nodeId,coo);
803 return convertDblArrToPyList2(coo);
806 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
810 DataArrayDoubleTuple *aa;
811 std::vector<double> bb;
813 int spaceDim=self->getSpaceDimension();
814 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
815 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
816 self->scale(pointPtr,factor);
819 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
821 int spaceDim=self->getSpaceDimension();
822 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
823 self->getBoundingBox(tmp);
824 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
828 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
831 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
832 PyObject *ret=PyTuple_New(2);
833 PyObject *ret0Py=ret0?Py_True:Py_False;
835 PyTuple_SetItem(ret,0,ret0Py);
836 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
840 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
842 int szArr,sw,iTypppArr;
843 std::vector<int> stdvecTyyppArr;
844 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
845 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
846 if(sw==3)//DataArrayInt
848 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
849 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
850 std::string name=argpt->getName();
852 ret->setName(name.c_str());
854 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
857 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
859 int szArr,sw,iTypppArr;
860 std::vector<int> stdvecTyyppArr;
862 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
863 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
864 if(sw==3)//DataArrayInt
866 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
867 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
868 std::string name=argpt->getName();
870 ret->setName(name.c_str());
873 PyObject *res = PyList_New(2);
874 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
875 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
876 PyList_SetItem(res,0,obj0);
877 PyList_SetItem(res,1,obj1);
881 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
885 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
886 PyObject *res = PyTuple_New(2);
887 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
890 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
892 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
893 PyTuple_SetItem(res,0,obj0);
894 PyTuple_SetItem(res,1,obj1);
898 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
900 std::vector<int> vals=self->getDistributionOfTypes();
902 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
903 PyObject *ret=PyList_New((int)vals.size()/3);
904 for(int j=0;j<(int)vals.size()/3;j++)
906 PyObject *ret1=PyList_New(3);
907 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
908 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
909 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
910 PyList_SetItem(ret,j,ret1);
915 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
917 std::vector<int> code;
918 std::vector<const DataArrayInt *> idsPerType;
919 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
920 convertPyToNewIntArr4(li,1,3,code);
921 return self->checkTypeConsistencyAndContig(code,idsPerType);
924 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
926 std::vector<int> code;
927 std::vector<DataArrayInt *> idsInPflPerType;
928 std::vector<DataArrayInt *> idsPerType;
929 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
930 PyObject *ret=PyTuple_New(3);
933 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
934 PyObject *ret0=PyList_New((int)code.size()/3);
935 for(int j=0;j<(int)code.size()/3;j++)
937 PyObject *ret00=PyList_New(3);
938 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
939 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
940 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
941 PyList_SetItem(ret0,j,ret00);
943 PyTuple_SetItem(ret,0,ret0);
945 PyObject *ret1=PyList_New(idsInPflPerType.size());
946 for(std::size_t j=0;j<idsInPflPerType.size();j++)
947 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
948 PyTuple_SetItem(ret,1,ret1);
949 int n=idsPerType.size();
950 PyObject *ret2=PyList_New(n);
952 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
953 PyTuple_SetItem(ret,2,ret2);
957 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
961 DataArrayDoubleTuple *aa;
962 std::vector<double> bb;
964 int spaceDim=self->getSpaceDimension();
965 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
966 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
967 self->translate(vectorPtr);
970 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
972 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
975 DataArrayDoubleTuple *aa;
976 std::vector<double> bb;
978 int spaceDim=self->getSpaceDimension();
979 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
980 self->rotate(centerPtr,0,alpha);
983 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
985 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
987 DataArrayDouble *a,*a2;
988 DataArrayDoubleTuple *aa,*aa2;
989 std::vector<double> bb,bb2;
991 int spaceDim=self->getSpaceDimension();
992 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
993 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
994 self->rotate(centerPtr,vectorPtr,alpha);
997 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
999 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1000 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1001 PyObject *res=PyList_New(result.size());
1002 for(int i=0;iL!=result.end(); i++, iL++)
1003 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1007 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1009 std::vector<double> a0;
1010 std::vector<int> a1;
1011 std::vector<std::string> a2;
1012 self->getTinySerializationInformation(a0,a1,a2);
1013 PyObject *ret(PyTuple_New(3));
1014 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1015 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1017 PyObject *ret2(PyList_New(sz));
1019 for(int i=0;i<sz;i++)
1020 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1022 PyTuple_SetItem(ret,2,ret2);
1026 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1028 DataArrayInt *a0Tmp(0);
1029 DataArrayDouble *a1Tmp(0);
1030 self->serialize(a0Tmp,a1Tmp);
1031 PyObject *ret(PyTuple_New(2));
1032 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1033 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1037 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1039 std::vector<std::string> littleStrings;
1040 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1043 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1044 {// put an empty dict in input to say to __new__ to call __init__...
1045 PyObject *ret(PyTuple_New(1));
1046 PyObject *ret0(PyDict_New());
1047 PyTuple_SetItem(ret,0,ret0);
1051 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1053 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1054 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1055 PyObject *ret(PyTuple_New(2));
1056 PyTuple_SetItem(ret,0,ret0);
1057 PyTuple_SetItem(ret,1,ret1);
1061 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1063 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1064 if(!PyTuple_Check(inp))
1065 throw INTERP_KERNEL::Exception(MSG);
1066 int sz(PyTuple_Size(inp));
1068 throw INTERP_KERNEL::Exception(MSG);
1069 PyObject *elt0(PyTuple_GetItem(inp,0));
1070 PyObject *elt1(PyTuple_GetItem(inp,1));
1071 std::vector<double> a0;
1072 std::vector<int> a1;
1073 std::vector<std::string> a2;
1074 DataArrayInt *b0(0);
1075 DataArrayDouble *b1(0);
1077 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1078 throw INTERP_KERNEL::Exception(MSG);
1079 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1081 fillArrayWithPyListDbl3(a0py,tmp,a0);
1082 convertPyToNewIntArr3(a1py,a1);
1083 fillStringVector(a2py,a2);
1086 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1087 throw INTERP_KERNEL::Exception(MSG);
1088 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1090 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1091 if(!SWIG_IsOK(status))
1092 throw INTERP_KERNEL::Exception(MSG);
1093 b0=reinterpret_cast<DataArrayInt *>(argp);
1094 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1095 if(!SWIG_IsOK(status))
1096 throw INTERP_KERNEL::Exception(MSG);
1097 b1=reinterpret_cast<DataArrayDouble *>(argp);
1099 // useless here to call resizeForUnserialization because arrays are well resized.
1100 self->unserialization(a0,a1,b0,b1,a2);
1103 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1105 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1106 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1107 return MEDCouplingMesh::MergeMeshes(tmp);
1113 //== MEDCouplingMesh End
1115 %include "NormalizedGeometricTypes"
1116 %include "MEDCouplingNatureOfFieldEnum"
1118 namespace MEDCoupling
1120 class MEDCouplingNatureOfField
1123 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1124 static std::string GetReprNoThrow(NatureOfField nat);
1125 static std::string GetAllPossibilitiesStr();
1129 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1130 // include "MEDCouplingTimeDiscretization.i"
1132 namespace MEDCoupling
1134 class MEDCouplingGaussLocalization
1137 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1138 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1139 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1140 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1141 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1142 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1143 int getDimension() const throw(INTERP_KERNEL::Exception);
1144 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1145 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1146 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1147 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1149 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1150 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1151 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1152 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1153 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1154 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1155 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1156 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1157 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1158 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1159 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1160 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1162 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1166 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1168 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1172 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1174 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1180 class MEDCouplingSkyLineArray
1183 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1185 void set( DataArrayInt* index, DataArrayInt* value );
1186 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1188 int getSuperNumberOf() const;
1189 int getNumberOf() const;
1190 int getLength() const;
1192 DataArrayInt* getSuperIndexArray() const;
1193 DataArrayInt* getIndexArray() const;
1194 DataArrayInt* getValuesArray() const;
1196 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1200 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1202 return MEDCouplingSkyLineArray::New();
1205 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1207 return MEDCouplingSkyLineArray::New(index, value);
1210 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1212 return MEDCouplingSkyLineArray::New(index, value);
1215 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1217 return MEDCouplingSkyLineArray::New(other);
1220 std::string __str__() const throw(INTERP_KERNEL::Exception)
1222 return self->simpleRepr();
1225 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1227 std::vector<int> ret;
1228 self->getSimplePackSafe(absolutePackId,ret);
1229 return convertIntArrToPyList2(ret);
1232 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1234 std::vector<int> vpack, vspIdx, out;
1236 convertPyToNewIntArr3(superPackIndices,vspIdx);
1237 convertPyToNewIntArr3(pack,vpack);
1239 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1240 return convertIntArrToPyList2(out);
1243 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1245 std::vector<int> vpack;
1246 convertPyToNewIntArr3(pack,vpack);
1247 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1250 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1252 std::vector<int> vpack;
1253 convertPyToNewIntArr3(pack,vpack);
1254 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1257 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1259 std::vector<int> vpack;
1260 convertPyToNewIntArr3(pack,vpack);
1261 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1264 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1266 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1267 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1268 self->convertToPolyhedronConn(d0,d1);
1269 PyObject *ret=PyTuple_New(2);
1270 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1271 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1278 %include "MEDCouplingFieldDiscretization.i"
1280 //== MEDCouplingPointSet
1282 namespace MEDCoupling
1284 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1287 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1288 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1289 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1290 void zipCoords() throw(INTERP_KERNEL::Exception);
1291 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1292 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1293 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1294 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1295 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1296 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1297 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1298 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1299 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1300 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1301 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1302 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1303 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1304 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1305 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1306 virtual DataArrayInt *findBoundaryNodes() const;
1307 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1308 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1309 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1310 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1311 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1312 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1313 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1314 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1315 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1318 std::string __str__() const throw(INTERP_KERNEL::Exception)
1320 return self->simpleRepr();
1323 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1326 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1327 PyObject *res = PyList_New(2);
1328 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1329 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1333 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1335 DataArrayInt *comm, *commIndex;
1336 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1337 PyObject *res = PyList_New(2);
1338 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1339 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1343 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1345 DataArrayDouble *ret1=self->getCoords();
1348 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1351 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1353 int szArr,sw,iTypppArr;
1354 std::vector<int> stdvecTyyppArr;
1355 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1356 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1357 if(sw==3)//DataArrayInt
1359 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1360 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1361 std::string name=argpt->getName();
1363 ret->setName(name.c_str());
1365 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1368 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1370 int szArr,sw,iTypppArr;
1371 std::vector<int> stdvecTyyppArr;
1372 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1373 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1374 if(sw==3)//DataArrayInt
1376 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1377 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1378 std::string name=argpt->getName();
1380 ret->setName(name.c_str());
1382 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1385 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1387 int szArr,sw,iTypppArr;
1388 std::vector<int> stdvecTyyppArr;
1389 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1390 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1391 if(sw==3)//DataArrayInt
1393 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1394 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1395 std::string name=argpt->getName();
1397 ret->setName(name.c_str());
1399 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1402 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1404 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1405 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1408 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1410 int szArr,sw,iTypppArr;
1411 std::vector<int> stdvecTyyppArr;
1412 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1413 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1414 if(sw==3)//DataArrayInt
1416 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1417 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1418 std::string name=argpt->getName();
1420 ret->setName(name.c_str());
1422 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1425 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1427 int szArr,sw,iTypppArr;
1428 std::vector<int> stdvecTyyppArr;
1429 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1430 self->renumberNodes(tmp,newNbOfNodes);
1433 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1435 int szArr,sw,iTypppArr;
1436 std::vector<int> stdvecTyyppArr;
1437 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1438 self->renumberNodesCenter(tmp,newNbOfNodes);
1441 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1443 int spaceDim=self->getSpaceDimension();
1445 DataArrayDouble *a,*a2;
1446 DataArrayDoubleTuple *aa,*aa2;
1447 std::vector<double> bb,bb2;
1449 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1450 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1451 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1452 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1453 std::vector<int> nodes;
1454 self->findNodesOnLine(p,v,eps,nodes);
1455 DataArrayInt *ret=DataArrayInt::New();
1456 ret->alloc((int)nodes.size(),1);
1457 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1458 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1460 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1462 int spaceDim=self->getSpaceDimension();
1464 DataArrayDouble *a,*a2;
1465 DataArrayDoubleTuple *aa,*aa2;
1466 std::vector<double> bb,bb2;
1468 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1469 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1470 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1471 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1472 std::vector<int> nodes;
1473 self->findNodesOnPlane(p,v,eps,nodes);
1474 DataArrayInt *ret=DataArrayInt::New();
1475 ret->alloc((int)nodes.size(),1);
1476 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1477 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1480 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1484 DataArrayDoubleTuple *aa;
1485 std::vector<double> bb;
1487 int spaceDim=self->getSpaceDimension();
1488 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1489 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1490 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1491 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1494 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1496 DataArrayInt *c=0,*cI=0;
1500 DataArrayDoubleTuple *aa;
1501 std::vector<double> bb;
1503 int spaceDim=self->getSpaceDimension();
1504 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1505 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1506 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1507 PyObject *ret=PyTuple_New(2);
1508 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1509 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1513 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1515 DataArrayInt *c=0,*cI=0;
1516 int spaceDim=self->getSpaceDimension();
1519 DataArrayDoubleTuple *aa;
1520 std::vector<double> bb;
1523 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1524 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1526 PyObject *ret=PyTuple_New(2);
1527 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1528 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1532 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1536 DataArrayDoubleTuple *aa;
1537 std::vector<double> bb;
1539 int spaceDim=self->getSpaceDimension();
1540 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1541 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1543 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1544 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1547 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1551 std::vector<int> multiVal;
1552 std::pair<int, std::pair<int,int> > slic;
1553 MEDCoupling::DataArrayInt *daIntTyypp=0;
1554 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1558 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1560 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1562 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1564 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1568 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1570 DataArrayInt *v0=0,*v1=0;
1571 self->findCommonCells(compType,startCellId,v0,v1);
1572 PyObject *res = PyList_New(2);
1573 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1574 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1579 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1582 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1583 if (!SWIG_IsOK(res1))
1586 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1587 self->renumberNodesInConn(tmp);
1591 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1593 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1594 da2->checkAllocated();
1595 self->renumberNodesInConn(da2->getConstPointer());
1599 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1602 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1603 PyObject *ret=PyTuple_New(2);
1604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1605 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1609 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1611 DataArrayInt *ret=0;
1613 int szArr,sw,iTypppArr;
1614 std::vector<int> stdvecTyyppArr;
1615 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1616 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1620 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1624 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1625 PyObject *res = PyList_New(3);
1626 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1627 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1628 PyList_SetItem(res,2,SWIG_From_int(ret2));
1632 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1636 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1637 PyObject *res = PyList_New(3);
1638 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1639 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1640 PyList_SetItem(res,2,SWIG_From_int(ret2));
1644 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1647 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1648 if (!SWIG_IsOK(res1))
1651 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1652 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1656 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1658 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1659 da2->checkAllocated();
1660 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1664 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1668 std::vector<int> multiVal;
1669 std::pair<int, std::pair<int,int> > slic;
1670 MEDCoupling::DataArrayInt *daIntTyypp=0;
1671 int nbc=self->getNumberOfCells();
1672 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1679 std::ostringstream oss;
1680 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1681 throw INTERP_KERNEL::Exception(oss.str().c_str());
1684 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1689 int tmp=nbc+singleVal;
1690 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1694 std::ostringstream oss;
1695 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1696 throw INTERP_KERNEL::Exception(oss.str().c_str());
1702 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1706 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1711 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1712 daIntTyypp->checkAllocated();
1713 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1716 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1720 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1723 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1724 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1725 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1726 for(int i=0;i<sz;i++)
1727 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1730 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1733 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1735 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1736 std::vector<double> val3;
1737 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1738 "Rotate2DAlg",2,true,nbNodes);
1740 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1741 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1744 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1747 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1748 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1749 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1750 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1751 for(int i=0;i<sz;i++)
1752 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1755 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1758 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1760 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1761 std::vector<double> val3;
1762 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1763 "Rotate3DAlg",3,true,nbNodes);
1765 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1766 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1767 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1772 //== MEDCouplingPointSet End
1774 class MEDCouplingUMeshCell
1777 INTERP_KERNEL::NormalizedCellType getType() const;
1780 std::string __str__() const throw(INTERP_KERNEL::Exception)
1782 return self->repr();
1785 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1788 const int *r=self->getAllConn(ret2);
1789 PyObject *ret=PyTuple_New(ret2);
1790 for(int i=0;i<ret2;i++)
1791 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1797 class MEDCouplingUMeshCellIterator
1804 MEDCouplingUMeshCell *ret=self->nextt();
1806 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1809 PyErr_SetString(PyExc_StopIteration,"No more data.");
1816 class MEDCouplingUMeshCellByTypeIterator
1819 ~MEDCouplingUMeshCellByTypeIterator();
1824 MEDCouplingUMeshCellEntry *ret=self->nextt();
1826 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1829 PyErr_SetString(PyExc_StopIteration,"No more data.");
1836 class MEDCouplingUMeshCellByTypeEntry
1839 ~MEDCouplingUMeshCellByTypeEntry();
1842 MEDCouplingUMeshCellByTypeIterator *__iter__()
1844 return self->iterator();
1849 class MEDCouplingUMeshCellEntry
1852 INTERP_KERNEL::NormalizedCellType getType() const;
1853 int getNumberOfElems() const;
1856 MEDCouplingUMeshCellIterator *__iter__()
1858 return self->iterator();
1863 //== MEDCouplingUMesh
1865 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1868 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1869 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1870 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1871 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1872 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1873 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1874 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1875 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1876 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1877 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1878 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1879 void computeTypes() throw(INTERP_KERNEL::Exception);
1880 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1881 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1883 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1884 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1885 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1886 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1887 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1888 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1889 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1890 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1891 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1892 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1893 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1894 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1895 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1896 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1897 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1898 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1899 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1900 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1901 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1902 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1903 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1904 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1905 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1906 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1907 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1908 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1909 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1910 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1911 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1912 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1913 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1914 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1915 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1916 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1917 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1918 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1919 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1920 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1921 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1922 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1923 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1924 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1925 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1926 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1927 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1928 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1929 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);
1930 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1931 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1932 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1933 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1934 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1936 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1938 return MEDCouplingUMesh::New();
1941 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1943 return MEDCouplingUMesh::New(meshName,meshDim);
1947 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1949 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1952 std::string __str__() const throw(INTERP_KERNEL::Exception)
1954 return self->simpleRepr();
1957 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1959 std::ostringstream oss;
1960 self->reprQuickOverview(oss);
1964 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1966 return self->cellIterator();
1969 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1971 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1975 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1977 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1978 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1979 PyObject *res=PyList_New(result.size());
1980 for(int i=0;iL!=result.end(); i++, iL++)
1981 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1985 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1989 std::vector<int> multiVal;
1990 std::pair<int, std::pair<int,int> > slic;
1991 MEDCoupling::DataArrayInt *daIntTyypp=0;
1992 int nbc=self->getNumberOfCells();
1993 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2000 std::ostringstream oss;
2001 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2002 throw INTERP_KERNEL::Exception(oss.str().c_str());
2006 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2013 int tmp=nbc+singleVal;
2014 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2019 std::ostringstream oss;
2020 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2021 throw INTERP_KERNEL::Exception(oss.str().c_str());
2027 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2033 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2034 daIntTyypp->checkAllocated();
2035 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2039 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2043 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2047 std::vector<int> multiVal;
2048 std::pair<int, std::pair<int,int> > slic;
2049 MEDCoupling::DataArrayInt *daIntTyypp=0;
2050 int nbc=self->getNumberOfCells();
2051 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2058 std::ostringstream oss;
2059 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2060 throw INTERP_KERNEL::Exception(oss.str().c_str());
2064 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2071 int tmp=nbc+singleVal;
2072 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2077 std::ostringstream oss;
2078 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2079 throw INTERP_KERNEL::Exception(oss.str().c_str());
2085 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2090 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2096 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2097 daIntTyypp->checkAllocated();
2098 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2102 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2106 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2108 int szArr,sw,iTypppArr;
2109 std::vector<int> stdvecTyyppArr;
2110 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2113 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2114 throw INTERP_KERNEL::Exception(oss.str().c_str());
2116 self->insertNextCell(type,size,tmp);
2119 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2121 int szArr,sw,iTypppArr;
2122 std::vector<int> stdvecTyyppArr;
2123 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2124 self->insertNextCell(type,szArr,tmp);
2127 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2129 DataArrayInt *ret=self->getNodalConnectivity();
2134 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2136 DataArrayInt *ret=self->getNodalConnectivityIndex();
2142 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2144 int szArr,sw,iTypppArr;
2145 std::vector<int> stdvecTyyppArr;
2146 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2147 int nbOfDepthPeelingPerformed=0;
2148 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2149 PyObject *res=PyTuple_New(2);
2150 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2155 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2157 DataArrayInt *v0=0,*v1=0;
2158 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2159 PyObject *res = PyList_New(2);
2160 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2169 DataArrayDoubleTuple *aa;
2170 std::vector<double> bb;
2172 int nbOfCompo=self->getSpaceDimension();
2173 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2176 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2177 PyObject *ret=PyTuple_New(2);
2178 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2179 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2183 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2185 DataArrayInt *ret1=0;
2186 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2187 PyObject *ret=PyTuple_New(2);
2188 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2189 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2196 DataArrayInt *ret1(0);
2197 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2198 PyObject *ret=PyTuple_New(3);
2199 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2201 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2205 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2207 std::vector<int> cells;
2208 self->checkButterflyCells(cells,eps);
2209 DataArrayInt *ret=DataArrayInt::New();
2210 ret->alloc((int)cells.size(),1);
2211 std::copy(cells.begin(),cells.end(),ret->getPointer());
2212 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2215 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2217 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2219 PyObject *ret = PyList_New(sz);
2220 for(int i=0;i<sz;i++)
2221 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2225 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2227 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2228 int sz=retCpp.size();
2229 PyObject *ret=PyList_New(sz);
2230 for(int i=0;i<sz;i++)
2231 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2235 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2237 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2238 int sz=retCpp.size();
2239 PyObject *ret=PyList_New(sz);
2240 for(int i=0;i<sz;i++)
2241 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2248 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2249 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2250 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2253 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2256 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2257 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2261 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2264 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2265 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2269 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2271 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2272 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2273 PyObject *ret=PyTuple_New(3);
2274 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2275 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2276 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2282 DataArrayInt *tmp0=0,*tmp1=0;
2283 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2284 PyObject *ret=PyTuple_New(2);
2285 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2286 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2290 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2294 std::vector<int> multiVal;
2295 std::pair<int, std::pair<int,int> > slic;
2296 MEDCoupling::DataArrayInt *daIntTyypp=0;
2297 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2301 return self->duplicateNodes(&singleVal,&singleVal+1);
2303 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2305 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2307 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2311 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2315 std::vector<int> multiVal;
2316 std::pair<int, std::pair<int,int> > slic;
2317 MEDCoupling::DataArrayInt *daIntTyypp=0;
2318 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2322 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2324 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2326 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2328 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2332 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2335 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2336 DataArrayInt *tmp0,*tmp1=0;
2337 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2338 PyObject *ret=PyTuple_New(2);
2339 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2340 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2346 DataArrayInt *ret0=0,*ret1=0;
2347 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2348 PyObject *ret=PyTuple_New(2);
2349 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2350 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2356 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2357 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2358 DataArrayInt *ret1=0,*ret2=0;
2359 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2360 PyObject *ret=PyTuple_New(3);
2361 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2362 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2369 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2370 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2371 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2372 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2375 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2378 std::vector<const MEDCouplingUMesh *> meshes;
2379 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2380 std::vector<DataArrayInt *> corr;
2381 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2383 PyObject *ret1=PyList_New(sz);
2384 for(int i=0;i<sz;i++)
2385 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2386 PyObject *ret=PyList_New(2);
2387 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2388 PyList_SetItem(ret,1,ret1);
2392 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2394 std::vector<MEDCouplingUMesh *> meshes;
2395 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2396 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2399 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2401 std::vector<MEDCouplingUMesh *> meshes;
2402 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2403 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2406 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2410 std::vector<int> multiVal;
2411 std::pair<int, std::pair<int,int> > slic;
2412 MEDCoupling::DataArrayInt *daIntTyypp=0;
2414 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2415 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2419 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2421 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2423 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2425 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2429 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2431 DataArrayInt *arrOut=0,*arrIndexOut=0;
2434 std::vector<int> multiVal;
2435 std::pair<int, std::pair<int,int> > slic;
2436 MEDCoupling::DataArrayInt *daIntTyypp=0;
2438 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2439 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2444 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2449 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2454 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2458 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2460 PyObject *ret=PyTuple_New(2);
2461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2468 DataArrayInt *arrOut=0,*arrIndexOut=0;
2469 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2470 PyObject *ret=PyTuple_New(2);
2471 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2472 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2478 if(!PySlice_Check(slic))
2479 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2480 Py_ssize_t strt=2,stp=2,step=2;
2481 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2483 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2484 arrIndxIn->checkAllocated();
2485 if(arrIndxIn->getNumberOfComponents()!=1)
2486 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2487 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2488 DataArrayInt *arrOut=0,*arrIndexOut=0;
2489 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2490 PyObject *ret=PyTuple_New(2);
2491 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2492 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2496 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2497 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2498 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2500 DataArrayInt *arrOut=0,*arrIndexOut=0;
2503 std::vector<int> multiVal;
2504 std::pair<int, std::pair<int,int> > slic;
2505 MEDCoupling::DataArrayInt *daIntTyypp=0;
2507 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2508 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2513 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2518 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2523 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2527 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2529 PyObject *ret=PyTuple_New(2);
2530 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2531 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2536 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2540 std::vector<int> multiVal;
2541 std::pair<int, std::pair<int,int> > slic;
2542 MEDCoupling::DataArrayInt *daIntTyypp=0;
2544 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2545 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2550 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2555 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2560 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2564 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2568 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2572 DataArrayDoubleTuple *aa;
2573 std::vector<double> bb;
2575 int spaceDim=self->getSpaceDimension();
2576 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2577 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2579 std::vector<int> cells;
2580 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2581 DataArrayInt *ret=DataArrayInt::New();
2582 ret->alloc((int)cells.size(),1);
2583 std::copy(cells.begin(),cells.end(),ret->getPointer());
2584 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2587 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2591 DataArrayDoubleTuple *aa;
2592 std::vector<double> bb;
2594 int spaceDim=self->getSpaceDimension();
2595 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2596 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2597 self->orientCorrectly2DCells(v,polyOnly);
2600 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2602 std::vector<int> cells;
2603 self->arePolyhedronsNotCorrectlyOriented(cells);
2604 DataArrayInt *ret=DataArrayInt::New();
2605 ret->alloc((int)cells.size(),1);
2606 std::copy(cells.begin(),cells.end(),ret->getPointer());
2607 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2610 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2614 self->getFastAveragePlaneOfThis(vec,pos);
2616 std::copy(vec,vec+3,vals);
2617 std::copy(pos,pos+3,vals+3);
2618 return convertDblArrToPyListOfTuple(vals,3,2);
2621 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2623 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2624 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2625 return MEDCouplingUMesh::MergeUMeshes(tmp);
2628 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2631 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2632 PyObject *ret=PyTuple_New(2);
2633 PyObject *ret0Py=ret0?Py_True:Py_False;
2635 PyTuple_SetItem(ret,0,ret0Py);
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2643 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2644 PyObject *ret=PyTuple_New(2);
2645 PyObject *ret0Py=ret0?Py_True:Py_False;
2647 PyTuple_SetItem(ret,0,ret0Py);
2648 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2652 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2654 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2655 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2656 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2657 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2658 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2659 PyObject *ret=PyTuple_New(5);
2660 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2662 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2663 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2664 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2668 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2670 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2671 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2672 PyObject *ret=PyTuple_New(5);
2673 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2675 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2681 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2683 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2684 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2685 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2686 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2687 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2688 PyObject *ret=PyTuple_New(5);
2689 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2691 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2692 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2693 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2697 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2699 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2700 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2701 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2702 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2703 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2704 PyObject *ret=PyTuple_New(5);
2705 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2715 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2716 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2717 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2718 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2719 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2720 PyObject *ret=PyTuple_New(5);
2721 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2722 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2723 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2724 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2725 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2729 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2731 DataArrayInt *neighbors=0,*neighborsIdx=0;
2732 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2733 PyObject *ret=PyTuple_New(2);
2734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2739 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2741 DataArrayInt *neighbors=0,*neighborsIdx=0;
2742 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2743 PyObject *ret=PyTuple_New(2);
2744 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2745 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2749 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2751 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2752 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2753 PyObject *ret=PyTuple_New(2);
2754 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2755 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2759 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2761 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2762 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2763 PyObject *ret=PyTuple_New(2);
2764 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2765 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2769 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2771 DataArrayInt *neighbors=0,*neighborsIdx=0;
2772 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2773 PyObject *ret=PyTuple_New(2);
2774 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2775 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2779 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2781 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2782 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2783 DataArrayInt *d2,*d3,*d4,*dd5;
2784 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2785 PyObject *ret=PyTuple_New(7);
2786 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2787 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2788 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2789 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2791 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2792 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2796 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2799 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2800 da->checkAllocated();
2801 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2804 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2807 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2808 da->checkAllocated();
2809 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2812 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2815 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2816 da->checkAllocated();
2817 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2820 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2823 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2824 da->checkAllocated();
2825 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2826 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2827 PyObject *res = PyList_New(result.size());
2828 for (int i=0;iL!=result.end(); i++, iL++)
2829 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2833 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2836 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2837 da->checkAllocated();
2838 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2839 ret->setName(da->getName().c_str());
2843 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2845 DataArrayInt *cellNb1=0,*cellNb2=0;
2846 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2847 PyObject *ret=PyTuple_New(3);
2848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2850 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2854 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2856 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2857 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2858 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2859 PyObject *ret(PyTuple_New(4));
2860 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2861 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2862 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2869 int spaceDim=self->getSpaceDimension();
2871 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2873 DataArrayDouble *a,*a2;
2874 DataArrayDoubleTuple *aa,*aa2;
2875 std::vector<double> bb,bb2;
2877 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2878 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2879 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2880 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2882 DataArrayInt *cellIds=0;
2883 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2884 PyObject *ret=PyTuple_New(2);
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2890 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2892 int spaceDim=self->getSpaceDimension();
2894 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2896 DataArrayDouble *a,*a2;
2897 DataArrayDoubleTuple *aa,*aa2;
2898 std::vector<double> bb,bb2;
2900 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2901 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2902 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2903 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2905 DataArrayInt *cellIds=0;
2906 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2907 PyObject *ret=PyTuple_New(2);
2908 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2909 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2913 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2916 DataArrayDouble *a,*a2;
2917 DataArrayDoubleTuple *aa,*aa2;
2918 std::vector<double> bb,bb2;
2920 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2921 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2922 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2923 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2924 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2928 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2930 int spaceDim=self->getSpaceDimension();
2932 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2934 DataArrayDouble *a,*a2;
2935 DataArrayDoubleTuple *aa,*aa2;
2936 std::vector<double> bb,bb2;
2938 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2939 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2940 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2941 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2942 return self->getCellIdsCrossingPlane(orig,vect,eps);
2945 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2949 std::vector<int> pos2;
2950 DataArrayInt *pos3=0;
2951 DataArrayIntTuple *pos4=0;
2952 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2957 self->convertToPolyTypes(&pos1,&pos1+1);
2964 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2969 self->convertToPolyTypes(pos3->begin(),pos3->end());
2973 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2977 void convertAllToPoly();
2978 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2979 bool unPolyze() throw(INTERP_KERNEL::Exception);
2980 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2981 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2982 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2985 //== MEDCouplingUMesh End
2987 //== MEDCouplingMappedExtrudedMesh
2989 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2992 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2993 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2994 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2995 int get2DCellIdForExtrusion() const;
2997 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2999 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3002 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3004 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3007 MEDCouplingMappedExtrudedMesh()
3009 return MEDCouplingMappedExtrudedMesh::New();
3012 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3014 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3017 std::string __str__() const throw(INTERP_KERNEL::Exception)
3019 return self->simpleRepr();
3022 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3024 std::ostringstream oss;
3025 self->reprQuickOverview(oss);
3029 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3031 MEDCouplingUMesh *ret=self->getMesh2D();
3034 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3036 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3038 MEDCouplingUMesh *ret=self->getMesh1D();
3041 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3043 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3045 DataArrayInt *ret=self->getMesh3DIds();
3048 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3053 //== MEDCouplingMappedExtrudedMesh End
3055 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3058 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3059 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3060 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3061 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3062 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3063 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3066 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3068 int szArr,sw,iTypppArr;
3069 std::vector<int> stdvecTyyppArr;
3070 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3071 self->insertNextCell(tmp,tmp+szArr);
3074 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3076 DataArrayInt *ret=self->getNodalConnectivity();
3077 if(ret) ret->incrRef();
3081 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3083 std::vector< const MEDCoupling1GTUMesh *> parts;
3084 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3085 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3090 //== MEDCoupling1SGTUMesh
3092 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3095 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3096 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3097 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3098 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3099 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3100 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3101 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3102 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3103 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3106 MEDCoupling1SGTUMesh()
3108 return MEDCoupling1SGTUMesh::New();
3111 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3113 return MEDCoupling1SGTUMesh::New(name,type);
3116 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3118 return MEDCoupling1SGTUMesh::New(m);
3121 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3123 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3126 std::string __str__() const throw(INTERP_KERNEL::Exception)
3128 return self->simpleRepr();
3131 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3133 std::ostringstream oss;
3134 self->reprQuickOverview(oss);
3138 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3140 DataArrayInt *cellPerm(0),*nodePerm(0);
3141 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3142 PyObject *ret(PyTuple_New(3));
3143 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3144 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3145 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3149 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3151 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3152 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3153 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3156 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3158 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3159 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3160 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3165 //== MEDCoupling1SGTUMesh End
3167 //== MEDCoupling1DGTUMesh
3169 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3172 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3173 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3174 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3175 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3176 bool isPacked() const throw(INTERP_KERNEL::Exception);
3179 MEDCoupling1DGTUMesh()
3181 return MEDCoupling1DGTUMesh::New();
3183 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3185 return MEDCoupling1DGTUMesh::New(name,type);
3188 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3190 return MEDCoupling1DGTUMesh::New(m);
3193 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3195 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3198 std::string __str__() const throw(INTERP_KERNEL::Exception)
3200 return self->simpleRepr();
3203 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3205 std::ostringstream oss;
3206 self->reprQuickOverview(oss);
3210 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3212 DataArrayInt *ret=self->getNodalConnectivityIndex();
3213 if(ret) ret->incrRef();
3217 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3219 DataArrayInt *ret1=0,*ret2=0;
3220 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3221 PyObject *ret0Py=ret0?Py_True:Py_False;
3223 PyObject *ret=PyTuple_New(3);
3224 PyTuple_SetItem(ret,0,ret0Py);
3225 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3226 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3230 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3233 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3234 PyObject *ret=PyTuple_New(2);
3235 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3236 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3237 PyTuple_SetItem(ret,1,ret1Py);
3241 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3243 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3244 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3245 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3248 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3250 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3251 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3252 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3255 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3257 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3258 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3259 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3264 //== MEDCoupling1DGTUMeshEnd
3266 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3269 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3270 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3271 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3272 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3273 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3274 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3275 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3276 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3277 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3278 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3279 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3280 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3281 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3282 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3283 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3286 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3288 int tmpp1=-1,tmpp2=-1;
3289 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3290 std::vector< std::pair<int,int> > inp;
3294 for(int i=0;i<tmpp1;i++)
3295 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3300 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3301 inp.resize(tmpp1/2);
3302 for(int i=0;i<tmpp1/2;i++)
3303 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3306 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3307 return self->buildStructuredSubPart(inp);
3310 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3312 std::vector< std::pair<int,int> > inp;
3313 convertPyToVectorPairInt(part,inp);
3315 int szArr,sw,iTypppArr;
3316 std::vector<int> stdvecTyyppArr;
3317 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3318 std::vector<int> tmp5(tmp4,tmp4+szArr);
3320 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3323 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3325 std::vector< std::pair<int,int> > inp;
3326 convertPyToVectorPairInt(part,inp);
3327 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3330 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3332 std::vector< std::pair<int,int> > inp;
3333 convertPyToVectorPairInt(part,inp);
3334 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3337 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3339 std::vector< std::pair<int,int> > inp;
3340 convertPyToVectorPairInt(part,inp);
3341 std::vector<int> stWithGhost;
3342 std::vector< std::pair<int,int> > partWithGhost;
3343 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3344 PyObject *ret(PyTuple_New(2));
3345 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3346 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3350 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3352 std::vector< std::pair<int,int> > inp;
3353 convertPyToVectorPairInt(partCompactFormat,inp);
3354 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3357 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3359 std::vector< std::pair<int,int> > inp;
3360 convertPyToVectorPairInt(partCompactFormat,inp);
3361 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3364 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3366 std::vector< std::pair<int,int> > inp;
3367 convertPyToVectorPairInt(part,inp);
3368 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3371 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3373 int szArr,sw,iTypppArr;
3374 std::vector<int> stdvecTyyppArr;
3375 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3376 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3379 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3381 int szArr,sw,iTypppArr;
3382 std::vector<int> stdvecTyyppArr;
3383 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3384 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3387 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3389 std::vector< std::pair<int,int> > inp;
3390 convertPyToVectorPairInt(partCompactFormat,inp);
3391 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3394 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3396 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3397 PyObject *retPy=PyList_New(ret.size());
3398 for(std::size_t i=0;i<ret.size();i++)
3400 PyObject *tmp=PyTuple_New(2);
3401 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3402 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3403 PyList_SetItem(retPy,i,tmp);
3408 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3410 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3411 convertPyToVectorPairInt(r1,r1Cpp);
3412 convertPyToVectorPairInt(r2,r2Cpp);
3413 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3414 PyObject *retPy=PyList_New(ret.size());
3415 for(std::size_t i=0;i<ret.size();i++)
3417 PyObject *tmp=PyTuple_New(2);
3418 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3419 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3420 PyList_SetItem(retPy,i,tmp);
3425 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3427 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3428 convertPyToVectorPairInt(r1,r1Cpp);
3429 convertPyToVectorPairInt(r2,r2Cpp);
3430 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3433 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3435 int szArr,sw,iTypppArr;
3436 std::vector<int> stdvecTyyppArr;
3437 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3438 int szArr2,sw2,iTypppArr2;
3439 std::vector<int> stdvecTyyppArr2;
3440 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3441 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3442 std::vector< std::pair<int,int> > partCompactFormat;
3443 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3444 PyObject *ret=PyTuple_New(2);
3445 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3446 PyTuple_SetItem(ret,0,ret0Py);
3447 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3448 for(std::size_t i=0;i<partCompactFormat.size();i++)
3450 PyObject *tmp4=PyTuple_New(2);
3451 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3452 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3453 PyList_SetItem(ret1Py,i,tmp4);
3455 PyTuple_SetItem(ret,1,ret1Py);
3459 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3461 std::vector< std::pair<int,int> > param0,param1,ret;
3462 convertPyToVectorPairInt(bigInAbs,param0);
3463 convertPyToVectorPairInt(partOfBigInAbs,param1);
3464 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3465 PyObject *retPy(PyList_New(ret.size()));
3466 for(std::size_t i=0;i<ret.size();i++)
3468 PyObject *tmp(PyTuple_New(2));
3469 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3470 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3471 PyList_SetItem(retPy,i,tmp);
3476 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3478 std::vector< std::pair<int,int> > param0;
3479 convertPyToVectorPairInt(part,param0);
3480 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3481 PyObject *retPy(PyList_New(ret.size()));
3482 for(std::size_t i=0;i<ret.size();i++)
3484 PyObject *tmp(PyTuple_New(2));
3485 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3486 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3487 PyList_SetItem(retPy,i,tmp);
3492 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3494 std::vector< std::pair<int,int> > param0,param1;
3495 convertPyToVectorPairInt(startingFrom,param0);
3496 convertPyToVectorPairInt(goingTo,param1);
3497 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3500 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3502 std::vector< std::pair<int,int> > param0,param1,ret;
3503 convertPyToVectorPairInt(bigInAbs,param0);
3504 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3505 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3506 PyObject *retPy(PyList_New(ret.size()));
3507 for(std::size_t i=0;i<ret.size();i++)
3509 PyObject *tmp(PyTuple_New(2));
3510 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3511 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3512 PyList_SetItem(retPy,i,tmp);
3519 class MEDCouplingCurveLinearMesh;
3521 //== MEDCouplingCMesh
3523 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3526 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3527 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3528 void setCoords(const DataArrayDouble *coordsX,
3529 const DataArrayDouble *coordsY=0,
3530 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3531 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3532 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3534 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3536 return MEDCouplingCMesh::New();
3538 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3540 return MEDCouplingCMesh::New(meshName);
3543 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3545 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3547 std::string __str__() const throw(INTERP_KERNEL::Exception)
3549 return self->simpleRepr();
3551 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3553 std::ostringstream oss;
3554 self->reprQuickOverview(oss);
3557 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3559 DataArrayDouble *ret=self->getCoordsAt(i);
3567 //== MEDCouplingCMesh End
3569 //== MEDCouplingCurveLinearMesh
3571 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3574 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3575 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3576 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3578 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3580 return MEDCouplingCurveLinearMesh::New();
3582 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3584 return MEDCouplingCurveLinearMesh::New(meshName);
3586 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3588 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3590 std::string __str__() const throw(INTERP_KERNEL::Exception)
3592 return self->simpleRepr();
3594 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3596 std::ostringstream oss;
3597 self->reprQuickOverview(oss);
3600 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3602 DataArrayDouble *ret=self->getCoords();
3607 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3609 int szArr,sw,iTypppArr;
3610 std::vector<int> stdvecTyyppArr;
3611 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3612 self->setNodeGridStructure(tmp,tmp+szArr);
3617 //== MEDCouplingCurveLinearMesh End
3619 //== MEDCouplingIMesh
3621 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3624 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3626 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3627 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3628 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3629 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3630 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3631 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3632 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3633 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3634 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3635 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3636 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3641 return MEDCouplingIMesh::New();
3643 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3645 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3646 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3647 const int *nodeStrctPtr(0);
3648 const double *originPtr(0),*dxyzPtr(0);
3650 std::vector<int> bb0;
3651 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3654 std::vector<double> bb,bb2;
3656 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3657 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3659 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3662 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3664 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3667 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3669 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3672 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3675 std::vector<int> bb0;
3676 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3677 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3680 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3682 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3685 DataArrayDoubleTuple *aa;
3686 std::vector<double> bb;
3688 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3689 self->setOrigin(originPtr,originPtr+nbTuples);
3692 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3694 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3697 DataArrayDoubleTuple *aa;
3698 std::vector<double> bb;
3700 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3701 self->setDXYZ(originPtr,originPtr+nbTuples);
3704 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3706 std::vector< std::pair<int,int> > inp;
3707 convertPyToVectorPairInt(fineLocInCoarse,inp);
3708 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3711 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)
3713 std::vector< std::pair<int,int> > inp;
3714 convertPyToVectorPairInt(fineLocInCoarse,inp);
3715 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3718 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3720 std::vector< std::pair<int,int> > inp;
3721 convertPyToVectorPairInt(fineLocInCoarse,inp);
3722 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3725 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)
3727 std::vector< std::pair<int,int> > inp;
3728 convertPyToVectorPairInt(fineLocInCoarse,inp);
3729 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3732 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)
3734 std::vector< std::pair<int,int> > inp;
3735 convertPyToVectorPairInt(fineLocInCoarse,inp);
3736 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3739 std::string __str__() const throw(INTERP_KERNEL::Exception)
3741 return self->simpleRepr();
3743 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3745 std::ostringstream oss;
3746 self->reprQuickOverview(oss);
3752 //== MEDCouplingIMesh End
3756 namespace MEDCoupling
3758 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3761 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3762 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3763 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3764 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3765 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3766 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3767 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3768 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3769 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3770 std::string getName() const throw(INTERP_KERNEL::Exception);
3771 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3772 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3773 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3774 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3775 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3776 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3777 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3778 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3779 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3780 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3781 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3782 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3783 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3784 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3785 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3786 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3788 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3790 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3793 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3796 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3798 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3801 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3804 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3806 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3807 return convertIntArrToPyList3(ret);
3810 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3813 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3814 PyObject *ret=PyTuple_New(2);
3815 PyObject *ret0Py=ret0?Py_True:Py_False;
3817 PyTuple_SetItem(ret,0,ret0Py);
3818 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3822 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3824 DataArrayInt *ret1=0;
3825 MEDCouplingMesh *ret0=0;
3827 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3828 if (!SWIG_IsOK(res1))
3831 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3832 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3836 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3838 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3839 da2->checkAllocated();
3840 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3842 PyObject *res = PyList_New(2);
3843 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3844 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3848 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3850 DataArrayInt *ret1=0;
3852 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3853 PyObject *res=PyTuple_New(2);
3854 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3856 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3859 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3860 PyTuple_SetItem(res,1,res1);
3865 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3868 int v0; std::vector<int> v1;
3869 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3870 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3873 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3874 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
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 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3886 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3888 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3889 da2->checkAllocated();
3890 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3894 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3896 std::vector<int> tmp;
3897 self->getCellIdsHavingGaussLocalization(locId,tmp);
3898 DataArrayInt *ret=DataArrayInt::New();
3899 ret->alloc((int)tmp.size(),1);
3900 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3901 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3904 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3906 std::vector<int> inp0;
3907 convertPyToNewIntArr4(code,1,3,inp0);
3908 std::vector<const DataArrayInt *> inp1;
3909 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3910 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3915 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3918 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3919 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3920 static MEDCouplingFieldTemplate *New(TypeOfField type);
3921 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3922 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3925 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3927 return MEDCouplingFieldTemplate::New(f);
3930 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3932 return MEDCouplingFieldTemplate::New(f);
3935 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3937 return MEDCouplingFieldTemplate::New(type);
3940 std::string __str__() const throw(INTERP_KERNEL::Exception)
3942 return self->simpleRepr();
3945 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3947 std::ostringstream oss;
3948 self->reprQuickOverview(oss);
3954 class MEDCouplingFieldInt;
3956 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3959 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3960 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3961 void setTimeUnit(const std::string& unit);
3962 std::string getTimeUnit() const;
3963 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3964 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3965 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3966 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3967 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3968 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3969 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3970 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3971 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3972 MEDCouplingFieldDouble *deepCopy() const;
3973 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3974 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3975 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3976 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3977 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3978 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3979 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3980 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3981 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3982 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3983 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3984 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3985 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3986 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3987 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3988 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3989 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3990 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3991 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3992 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3993 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3994 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3995 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3996 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3997 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3998 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3999 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4000 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4001 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4002 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4003 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4004 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4005 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4006 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4007 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4008 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4009 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4010 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4011 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4012 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4013 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4014 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4015 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4016 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4017 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4018 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4019 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4020 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4021 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4022 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4023 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4024 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4025 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4026 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4027 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4028 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4029 double getMinValue() const throw(INTERP_KERNEL::Exception);
4030 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4031 double norm2() const throw(INTERP_KERNEL::Exception);
4032 double normMax() const throw(INTERP_KERNEL::Exception);
4033 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4034 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4035 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4036 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4037 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4038 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4039 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4040 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4041 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4042 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4043 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4044 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4045 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4046 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4047 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4048 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4049 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4050 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4051 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4052 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4053 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4054 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4056 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4058 return MEDCouplingFieldDouble::New(type,td);
4061 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4063 return MEDCouplingFieldDouble::New(ft,td);
4066 std::string __str__() const throw(INTERP_KERNEL::Exception)
4068 return self->simpleRepr();
4071 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4073 std::ostringstream oss;
4074 self->reprQuickOverview(oss);
4078 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4080 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4084 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4086 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4090 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4092 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4094 DataArrayDouble *a,*a2;
4095 DataArrayDoubleTuple *aa,*aa2;
4096 std::vector<double> bb,bb2;
4098 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4099 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4100 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4103 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4105 DataArrayDouble *ret=self->getArray();
4111 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4113 std::vector<DataArrayDouble *> arrs=self->getArrays();
4114 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4118 PyObject *ret=PyTuple_New(sz);
4119 for(int i=0;i<sz;i++)
4122 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4124 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4129 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4131 std::vector<const DataArrayDouble *> tmp;
4132 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4134 std::vector<DataArrayDouble *> arrs(sz);
4135 for(int i=0;i<sz;i++)
4136 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4137 self->setArrays(arrs);
4140 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4142 DataArrayDouble *ret=self->getEndArray();
4148 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4152 DataArrayDoubleTuple *aa;
4153 std::vector<double> bb;
4155 const MEDCouplingMesh *mesh=self->getMesh();
4157 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4158 int spaceDim=mesh->getSpaceDimension();
4159 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4160 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4162 int sz=self->getNumberOfComponents();
4163 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4164 self->getValueOn(spaceLoc,res);
4165 return convertDblArrToPyList(res,sz);
4168 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4170 int sz=self->getNumberOfComponents();
4171 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4172 self->getValueOnPos(i,j,k,res);
4173 return convertDblArrToPyList(res,sz);
4176 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4178 const MEDCouplingMesh *mesh(self->getMesh());
4180 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4183 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4184 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4185 mesh->getSpaceDimension(),true,nbPts);
4186 return self->getValueOnMulti(inp,nbPts);
4189 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4193 DataArrayDoubleTuple *aa;
4194 std::vector<double> bb;
4196 const MEDCouplingMesh *mesh=self->getMesh();
4198 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4199 int spaceDim=mesh->getSpaceDimension();
4200 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4201 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4204 int sz=self->getNumberOfComponents();
4205 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4206 self->getValueOn(spaceLoc,time,res);
4207 return convertDblArrToPyList(res,sz);
4210 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4212 if(self->getArray()!=0)
4213 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4216 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4217 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4218 self->setArray(arr);
4222 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4225 double tmp0=self->getTime(tmp1,tmp2);
4226 PyObject *res = PyList_New(3);
4227 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4228 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4229 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4233 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4236 double tmp0=self->getStartTime(tmp1,tmp2);
4237 PyObject *res = PyList_New(3);
4238 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4239 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4240 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4244 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4247 double tmp0=self->getEndTime(tmp1,tmp2);
4248 PyObject *res = PyList_New(3);
4249 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4250 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4251 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4254 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4256 int sz=self->getNumberOfComponents();
4257 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4258 self->accumulate(tmp);
4259 return convertDblArrToPyList(tmp,sz);
4261 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4263 int sz=self->getNumberOfComponents();
4264 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4265 self->integral(isWAbs,tmp);
4266 return convertDblArrToPyList(tmp,sz);
4268 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4270 int sz=self->getNumberOfComponents();
4271 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4272 self->getWeightedAverageValue(tmp,isWAbs);
4273 return convertDblArrToPyList(tmp,sz);
4275 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4277 int sz=self->getNumberOfComponents();
4278 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4280 return convertDblArrToPyList(tmp,sz);
4282 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4284 int sz=self->getNumberOfComponents();
4285 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4287 return convertDblArrToPyList(tmp,sz);
4289 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4291 int szArr,sw,iTypppArr;
4292 std::vector<int> stdvecTyyppArr;
4293 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4294 self->renumberCells(tmp,check);
4297 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4299 int szArr,sw,iTypppArr;
4300 std::vector<int> stdvecTyyppArr;
4301 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4302 self->renumberCellsWithoutMesh(tmp,check);
4305 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4307 int szArr,sw,iTypppArr;
4308 std::vector<int> stdvecTyyppArr;
4309 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4310 self->renumberNodes(tmp,eps);
4313 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4315 int szArr,sw,iTypppArr;
4316 std::vector<int> stdvecTyyppArr;
4317 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4318 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4321 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4325 std::vector<int> multiVal;
4326 std::pair<int, std::pair<int,int> > slic;
4327 MEDCoupling::DataArrayInt *daIntTyypp=0;
4328 const MEDCouplingMesh *mesh=self->getMesh();
4330 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4331 int nbc=mesh->getNumberOfCells();
4332 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4339 std::ostringstream oss;
4340 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4341 throw INTERP_KERNEL::Exception(oss.str().c_str());
4344 return self->buildSubPart(&singleVal,&singleVal+1);
4349 int tmp=nbc+singleVal;
4350 return self->buildSubPart(&tmp,&tmp+1);
4354 std::ostringstream oss;
4355 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4356 throw INTERP_KERNEL::Exception(oss.str().c_str());
4362 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4366 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4371 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4372 daIntTyypp->checkAllocated();
4373 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4376 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4380 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4382 const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
4383 if(PyTuple_Check(li))
4385 Py_ssize_t sz=PyTuple_Size(li);
4387 throw INTERP_KERNEL::Exception(msg);
4388 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4391 std::vector<int> multiVal;
4392 std::pair<int, std::pair<int,int> > slic;
4393 MEDCoupling::DataArrayInt *daIntTyypp=0;
4394 if(!self->getArray())
4395 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4397 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4398 catch(INTERP_KERNEL::Exception& e)
4399 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4400 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4401 DataArrayDouble *ret0Arr=ret0->getArray();
4403 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4408 std::vector<int> v2(1,singleVal);
4409 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4410 ret0->setArray(aarr);
4415 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4416 ret0->setArray(aarr);
4421 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4422 std::vector<int> v2(nbOfComp);
4423 for(int i=0;i<nbOfComp;i++)
4424 v2[i]=slic.first+i*slic.second.second;
4425 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4426 ret0->setArray(aarr);
4430 throw INTERP_KERNEL::Exception(msg);
4435 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4438 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4441 double r1=self->getMaxValue2(tmp);
4442 PyObject *ret=PyTuple_New(2);
4443 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4444 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4448 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4451 double r1=self->getMinValue2(tmp);
4452 PyObject *ret=PyTuple_New(2);
4453 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4454 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4458 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4460 std::vector<int> tmp;
4461 convertPyToNewIntArr3(li,tmp);
4462 return self->keepSelectedComponents(tmp);
4465 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4467 std::vector<int> tmp;
4468 convertPyToNewIntArr3(li,tmp);
4469 self->setSelectedComponents(f,tmp);
4472 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4475 DataArrayDouble *a,*a2;
4476 DataArrayDoubleTuple *aa,*aa2;
4477 std::vector<double> bb,bb2;
4480 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4481 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4482 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4483 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4485 return self->extractSlice3D(orig,vect,eps);
4488 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4490 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4493 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4495 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4498 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4500 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.";
4501 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4504 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4506 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4508 return (*self)-(*other);
4510 throw INTERP_KERNEL::Exception(msg);
4515 DataArrayDoubleTuple *aa;
4516 std::vector<double> bb;
4518 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4523 if(!self->getArray())
4524 throw INTERP_KERNEL::Exception(msg2);
4525 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4526 ret->applyLin(1.,-val);
4527 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4528 ret2->setArray(ret);
4533 if(!self->getArray())
4534 throw INTERP_KERNEL::Exception(msg2);
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4536 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4537 ret2->setArray(ret);
4542 if(!self->getArray())
4543 throw INTERP_KERNEL::Exception(msg2);
4544 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4545 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4546 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 ret2->setArray(ret);
4552 if(!self->getArray())
4553 throw INTERP_KERNEL::Exception(msg2);
4554 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4555 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4556 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4557 ret2->setArray(ret);
4561 { throw INTERP_KERNEL::Exception(msg); }
4565 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4567 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4570 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4572 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4575 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4577 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4580 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4582 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.";
4583 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4586 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4588 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4590 return (*self)/(*other);
4592 throw INTERP_KERNEL::Exception(msg);
4597 DataArrayDoubleTuple *aa;
4598 std::vector<double> bb;
4600 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4606 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4607 if(!self->getArray())
4608 throw INTERP_KERNEL::Exception(msg2);
4609 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4610 ret->applyLin(1./val,0);
4611 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4612 ret2->setArray(ret);
4617 if(!self->getArray())
4618 throw INTERP_KERNEL::Exception(msg2);
4619 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4620 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4621 ret2->setArray(ret);
4626 if(!self->getArray())
4627 throw INTERP_KERNEL::Exception(msg2);
4628 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4629 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4630 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4631 ret2->setArray(ret);
4636 if(!self->getArray())
4637 throw INTERP_KERNEL::Exception(msg2);
4638 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4639 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4640 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4641 ret2->setArray(ret);
4645 { throw INTERP_KERNEL::Exception(msg); }
4649 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4651 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4654 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4656 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.";
4657 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4660 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4662 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4664 return (*self)^(*other);
4666 throw INTERP_KERNEL::Exception(msg);
4671 DataArrayDoubleTuple *aa;
4672 std::vector<double> bb;
4674 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4679 if(!self->getArray())
4680 throw INTERP_KERNEL::Exception(msg2);
4681 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4683 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4684 ret2->setArray(ret);
4689 if(!self->getArray())
4690 throw INTERP_KERNEL::Exception(msg2);
4691 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4692 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4693 ret2->setArray(ret);
4698 if(!self->getArray())
4699 throw INTERP_KERNEL::Exception(msg2);
4700 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4701 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4702 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4703 ret2->setArray(ret);
4708 if(!self->getArray())
4709 throw INTERP_KERNEL::Exception(msg2);
4710 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4711 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4712 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4713 ret2->setArray(ret);
4717 { throw INTERP_KERNEL::Exception(msg); }
4721 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4723 return self->negate();
4726 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4728 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.";
4729 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4732 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4734 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4738 Py_XINCREF(trueSelf);
4742 throw INTERP_KERNEL::Exception(msg);
4747 DataArrayDoubleTuple *aa;
4748 std::vector<double> bb;
4750 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4755 if(!self->getArray())
4756 throw INTERP_KERNEL::Exception(msg2);
4757 self->getArray()->applyLin(1.,val);
4758 Py_XINCREF(trueSelf);
4763 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4766 Py_XINCREF(trueSelf);
4771 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4772 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4773 ret2->setArray(aaa);
4775 Py_XINCREF(trueSelf);
4780 if(!self->getArray())
4781 throw INTERP_KERNEL::Exception(msg2);
4782 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4783 self->getArray()->addEqual(aaa);
4784 Py_XINCREF(trueSelf);
4788 { throw INTERP_KERNEL::Exception(msg); }
4792 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4794 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.";
4795 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4798 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4800 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4804 Py_XINCREF(trueSelf);
4808 throw INTERP_KERNEL::Exception(msg);
4813 DataArrayDoubleTuple *aa;
4814 std::vector<double> bb;
4816 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4821 if(!self->getArray())
4822 throw INTERP_KERNEL::Exception(msg2);
4823 self->getArray()->applyLin(1.,-val);
4824 Py_XINCREF(trueSelf);
4829 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4832 Py_XINCREF(trueSelf);
4837 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4838 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4839 ret2->setArray(aaa);
4841 Py_XINCREF(trueSelf);
4846 if(!self->getArray())
4847 throw INTERP_KERNEL::Exception(msg2);
4848 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4849 self->getArray()->substractEqual(aaa);
4850 Py_XINCREF(trueSelf);
4854 { throw INTERP_KERNEL::Exception(msg); }
4858 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4860 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.";
4861 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4864 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4866 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4870 Py_XINCREF(trueSelf);
4874 throw INTERP_KERNEL::Exception(msg);
4879 DataArrayDoubleTuple *aa;
4880 std::vector<double> bb;
4882 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4887 if(!self->getArray())
4888 throw INTERP_KERNEL::Exception(msg2);
4889 self->getArray()->applyLin(val,0);
4890 Py_XINCREF(trueSelf);
4895 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4898 Py_XINCREF(trueSelf);
4903 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4904 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4905 ret2->setArray(aaa);
4907 Py_XINCREF(trueSelf);
4912 if(!self->getArray())
4913 throw INTERP_KERNEL::Exception(msg2);
4914 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4915 self->getArray()->multiplyEqual(aaa);
4916 Py_XINCREF(trueSelf);
4920 { throw INTERP_KERNEL::Exception(msg); }
4924 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4926 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.";
4927 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4930 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4932 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4936 Py_XINCREF(trueSelf);
4940 throw INTERP_KERNEL::Exception(msg);
4945 DataArrayDoubleTuple *aa;
4946 std::vector<double> bb;
4948 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4954 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4955 if(!self->getArray())
4956 throw INTERP_KERNEL::Exception(msg2);
4957 self->getArray()->applyLin(1./val,0);
4958 Py_XINCREF(trueSelf);
4963 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4966 Py_XINCREF(trueSelf);
4971 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4972 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4973 ret2->setArray(aaa);
4975 Py_XINCREF(trueSelf);
4980 if(!self->getArray())
4981 throw INTERP_KERNEL::Exception(msg2);
4982 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4983 self->getArray()->divideEqual(aaa);
4984 Py_XINCREF(trueSelf);
4988 { throw INTERP_KERNEL::Exception(msg); }
4992 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4994 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.";
4995 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4998 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
5000 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
5004 Py_XINCREF(trueSelf);
5008 throw INTERP_KERNEL::Exception(msg);
5013 DataArrayDoubleTuple *aa;
5014 std::vector<double> bb;
5016 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5021 if(!self->getArray())
5022 throw INTERP_KERNEL::Exception(msg2);
5023 self->getArray()->applyPow(val);
5024 Py_XINCREF(trueSelf);
5029 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5032 Py_XINCREF(trueSelf);
5037 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5038 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5039 ret2->setArray(aaa);
5041 Py_XINCREF(trueSelf);
5046 if(!self->getArray())
5047 throw INTERP_KERNEL::Exception(msg2);
5048 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5049 self->getArray()->powEqual(aaa);
5050 Py_XINCREF(trueSelf);
5054 { throw INTERP_KERNEL::Exception(msg); }
5058 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5060 std::vector<const MEDCouplingFieldDouble *> tmp;
5061 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5062 return MEDCouplingFieldDouble::MergeFields(tmp);
5065 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5067 std::vector<const MEDCouplingFieldDouble *> tmp;
5068 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5069 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5072 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5074 std::vector<double> a0;
5075 std::vector<int> a1;
5076 std::vector<std::string> a2;
5077 self->getTinySerializationDbleInformation(a0);
5078 self->getTinySerializationIntInformation(a1);
5079 self->getTinySerializationStrInformation(a2);
5081 PyObject *ret(PyTuple_New(3));
5082 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
5083 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5085 PyObject *ret2(PyList_New(sz));
5087 for(int i=0;i<sz;i++)
5088 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5090 PyTuple_SetItem(ret,2,ret2);
5094 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5096 DataArrayInt *ret0(0);
5097 std::vector<DataArrayDouble *> ret1;
5098 self->serialize(ret0,ret1);
5101 std::size_t sz(ret1.size());
5102 PyObject *ret(PyTuple_New(2));
5103 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5104 PyObject *ret1Py(PyList_New(sz));
5105 for(std::size_t i=0;i<sz;i++)
5109 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5111 PyTuple_SetItem(ret,1,ret1Py);
5115 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5117 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5118 if(!PyTuple_Check(args))
5119 throw INTERP_KERNEL::Exception(MSG);
5120 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5121 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5122 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5124 PyObject *tmp0(PyTuple_New(1));
5125 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5126 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5128 Py_DECREF(selfMeth);
5129 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5130 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5131 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5133 PyObject *a(PyInt_FromLong(0));
5134 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5137 throw INTERP_KERNEL::Exception(MSG);
5138 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5139 throw INTERP_KERNEL::Exception(MSG);
5140 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5143 Py_DECREF(initMeth);
5148 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5149 {// put an empty dict in input to say to __new__ to call __init__...
5150 self->checkConsistencyLight();
5151 PyObject *ret(PyTuple_New(1));
5152 PyObject *ret0(PyDict_New());
5154 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5155 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5156 PyDict_SetItem(ret0,a,d);
5157 Py_DECREF(a); Py_DECREF(d);
5159 PyTuple_SetItem(ret,0,ret0);
5163 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5165 self->checkConsistencyLight();
5166 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5167 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5168 const MEDCouplingMesh *mesh(self->getMesh());
5171 PyObject *ret(PyTuple_New(3));
5172 PyTuple_SetItem(ret,0,ret0);
5173 PyTuple_SetItem(ret,1,ret1);
5174 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5178 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5180 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5181 if(!PyTuple_Check(inp))
5182 throw INTERP_KERNEL::Exception(MSG);
5183 int sz(PyTuple_Size(inp));
5185 throw INTERP_KERNEL::Exception(MSG);
5187 PyObject *elt2(PyTuple_GetItem(inp,2));
5189 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5190 if(!SWIG_IsOK(status))
5191 throw INTERP_KERNEL::Exception(MSG);
5192 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5194 PyObject *elt0(PyTuple_GetItem(inp,0));
5195 PyObject *elt1(PyTuple_GetItem(inp,1));
5196 std::vector<double> a0;
5197 std::vector<int> a1;
5198 std::vector<std::string> a2;
5199 DataArrayInt *b0(0);
5200 std::vector<DataArrayDouble *>b1;
5202 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5203 throw INTERP_KERNEL::Exception(MSG);
5204 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5206 fillArrayWithPyListDbl3(a0py,tmp,a0);
5207 convertPyToNewIntArr3(a1py,a1);
5208 fillStringVector(a2py,a2);
5211 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5212 throw INTERP_KERNEL::Exception(MSG);
5213 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5215 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5216 if(!SWIG_IsOK(status))
5217 throw INTERP_KERNEL::Exception(MSG);
5218 b0=reinterpret_cast<DataArrayInt *>(argp);
5219 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5221 self->checkForUnserialization(a1,b0,b1);
5222 // useless here to call resizeForUnserialization because arrays are well resized.
5223 self->finishUnserialization(a1,a0,a2);
5228 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5231 int getNumberOfFields() const;
5232 MEDCouplingMultiFields *deepCopy() const;
5233 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5234 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5235 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5236 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5237 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5240 std::string __str__() const throw(INTERP_KERNEL::Exception)
5242 return self->simpleRepr();
5244 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5246 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5247 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5249 std::vector<MEDCouplingFieldDouble *> fs(sz);
5250 for(int i=0;i<sz;i++)
5251 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5252 return MEDCouplingMultiFields::New(fs);
5254 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5256 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5257 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5259 std::vector<MEDCouplingFieldDouble *> fs(sz);
5260 for(int i=0;i<sz;i++)
5261 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5262 return MEDCouplingMultiFields::New(fs);
5264 PyObject *getFields() const
5266 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5267 int sz=fields.size();
5268 PyObject *res = PyList_New(sz);
5269 for(int i=0;i<sz;i++)
5273 fields[i]->incrRef();
5274 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5278 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5283 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5285 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5289 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5292 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5294 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5296 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5298 PyObject *res = PyList_New(sz);
5299 for(int i=0;i<sz;i++)
5304 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5308 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5313 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5315 std::vector<int> refs;
5316 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5318 PyObject *res = PyList_New(sz);
5319 for(int i=0;i<sz;i++)
5324 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5328 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5332 PyObject *ret=PyTuple_New(2);
5333 PyTuple_SetItem(ret,0,res);
5334 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5337 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5339 std::vector<DataArrayDouble *> ms=self->getArrays();
5341 PyObject *res = PyList_New(sz);
5342 for(int i=0;i<sz;i++)
5347 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5351 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5356 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5358 std::vector< std::vector<int> > refs;
5359 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5361 PyObject *res = PyList_New(sz);
5362 PyObject *res2 = PyList_New(sz);
5363 for(int i=0;i<sz;i++)
5368 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5372 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5374 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5377 PyObject *ret=PyTuple_New(2);
5378 PyTuple_SetItem(ret,0,res);
5379 PyTuple_SetItem(ret,1,res2);
5385 class MEDCouplingFieldInt : public MEDCouplingField
5388 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5389 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5390 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5391 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5392 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5393 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5394 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5395 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5396 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5397 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5399 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5401 return MEDCouplingFieldInt::New(type,td);
5404 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5406 return MEDCouplingFieldInt::New(ft,td);
5409 std::string __str__() const throw(INTERP_KERNEL::Exception)
5411 return self->simpleRepr();
5414 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5416 std::ostringstream oss;
5417 self->reprQuickOverview(oss);
5421 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5423 DataArrayInt *ret=self->getArray();
5429 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5432 double tmp0=self->getTime(tmp1,tmp2);
5433 PyObject *res = PyList_New(3);
5434 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5435 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5436 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5442 class MEDCouplingDefinitionTime
5445 MEDCouplingDefinitionTime();
5446 void assign(const MEDCouplingDefinitionTime& other);
5447 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5448 double getTimeResolution() const;
5449 std::vector<double> getHotSpotsTime() const;
5452 std::string __str__() const throw(INTERP_KERNEL::Exception)
5454 std::ostringstream oss;
5455 self->appendRepr(oss);
5459 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5461 int meshId,arrId,arrIdInField,fieldId;
5462 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5463 PyObject *res=PyList_New(4);
5464 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5465 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5466 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5467 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5471 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5473 int meshId,arrId,arrIdInField,fieldId;
5474 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5475 PyObject *res=PyList_New(4);
5476 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5477 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5478 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5479 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5485 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5488 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5489 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5493 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5495 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5496 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5498 std::vector<MEDCouplingFieldDouble *> fs(sz);
5499 for(int i=0;i<sz;i++)
5500 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5501 return MEDCouplingFieldOverTime::New(fs);
5503 std::string __str__() const throw(INTERP_KERNEL::Exception)
5505 return self->simpleRepr();
5507 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5509 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5510 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5512 std::vector<MEDCouplingFieldDouble *> fs(sz);
5513 for(int i=0;i<sz;i++)
5514 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5515 return MEDCouplingFieldOverTime::New(fs);
5520 class MEDCouplingCartesianAMRMesh;
5522 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5525 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5526 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5527 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5530 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5532 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5540 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5543 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5544 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5545 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5548 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5550 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5551 return convertFromVectorPairInt(ret);
5554 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5556 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5557 return convertFromVectorPairInt(ret);
5560 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5562 std::vector< std::pair<int,int> > inp;
5563 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5564 self->addPatch(inp,factors);
5567 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5569 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5571 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5572 if(patchId==mesh->getNumberOfPatches())
5574 std::ostringstream oss;
5575 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5576 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5579 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5585 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5587 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5589 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5590 mesh->removePatch(patchId);
5593 int __len__() const throw(INTERP_KERNEL::Exception)
5595 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5597 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5598 return mesh->getNumberOfPatches();
5603 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5607 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5610 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5611 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5612 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5613 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5614 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5615 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5616 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5617 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5618 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5619 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5620 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5621 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5622 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5624 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5625 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5626 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5627 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5628 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5629 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5630 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5631 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5632 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5633 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5634 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5635 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5636 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5637 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5638 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5639 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5640 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5641 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5642 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5643 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5646 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5648 std::vector< std::pair<int,int> > inp;
5649 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5650 self->addPatch(inp,factors);
5653 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5655 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5657 PyObject *ret = PyList_New(sz);
5658 for(int i=0;i<sz;i++)
5660 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5663 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5668 // agy : don't know why typemap fails here ??? let it in the extend section
5669 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5671 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5674 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5676 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5677 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5683 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5685 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5686 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5692 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5694 std::vector<int> out1;
5695 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5696 PyObject *ret(PyTuple_New(2));
5697 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5698 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5702 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5704 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5706 PyObject *ret = PyList_New(sz);
5707 for(int i=0;i<sz;i++)
5708 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5712 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5714 std::vector<const DataArrayDouble *> inp;
5715 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5716 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5719 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5721 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5727 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5729 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5735 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5737 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5743 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5745 const MEDCouplingIMesh *ret(self->getImageMesh());
5748 return const_cast<MEDCouplingIMesh *>(ret);
5751 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5753 if(patchId==self->getNumberOfPatches())
5755 std::ostringstream oss;
5756 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5757 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5760 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5766 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5768 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5769 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5770 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5773 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5775 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5776 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5777 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5780 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5782 self->removePatch(patchId);
5785 int __len__() const throw(INTERP_KERNEL::Exception)
5787 return self->getNumberOfPatches();
5792 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5796 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5799 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5802 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5804 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5805 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5806 const int *nodeStrctPtr(0);
5807 const double *originPtr(0),*dxyzPtr(0);
5809 std::vector<int> bb0;
5810 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5813 std::vector<double> bb,bb2;
5815 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5816 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5818 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5821 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5823 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5824 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5825 std::vector< std::vector<int> > inp2;
5826 convertPyToVectorOfVectorOfInt(factors,inp2);
5827 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5830 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5832 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5835 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5837 return MEDCouplingCartesianAMRMesh::New(mesh);
5842 class MEDCouplingDataForGodFather : public RefCountObject
5845 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5846 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5847 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5848 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5849 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5850 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5851 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5852 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5853 virtual void alloc() throw(INTERP_KERNEL::Exception);
5854 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5857 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5859 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5867 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5870 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5871 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5872 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5873 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5874 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5875 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5876 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5877 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5878 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5881 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5883 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5884 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5885 MEDCouplingAMRAttribute *ret(0);
5888 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5889 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5891 catch(INTERP_KERNEL::Exception&)
5893 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5894 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5899 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5901 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5904 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5906 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5907 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5913 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5915 std::vector< std::vector<std::string> > compNamesCpp;
5916 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5917 self->spillInfoOnComponents(compNamesCpp);
5920 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5922 std::vector<int> inp0;
5923 if(!fillIntVector(nfs,inp0))
5924 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5925 std::size_t sz(inp0.size());
5926 std::vector<NatureOfField> inp00(sz);
5927 for(std::size_t i=0;i<sz;i++)
5928 inp00[i]=(NatureOfField)inp0[i];
5929 self->spillNatures(inp00);
5932 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5934 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5935 int sz((int)ret.size());
5936 PyObject *retPy(PyList_New(sz));
5937 for(int i=0;i<sz;i++)
5938 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5944 class DenseMatrix : public RefCountObject, public TimeLabel
5947 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5948 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5949 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5950 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5952 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5953 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5954 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5955 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5956 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5957 void transpose() throw(INTERP_KERNEL::Exception);
5959 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5960 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5961 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5964 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5966 return DenseMatrix::New(nbRows,nbCols);
5969 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5971 return DenseMatrix::New(array,nbRows,nbCols);
5974 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5977 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5978 PyObject *ret=PyTuple_New(2);
5979 PyObject *ret0Py=ret0?Py_True:Py_False;
5981 PyTuple_SetItem(ret,0,ret0Py);
5982 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5986 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5988 DataArrayDouble *ret(self->getData());
5994 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5996 return MEDCoupling::DenseMatrix::Add(self,other);
5999 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6001 return MEDCoupling::DenseMatrix::Substract(self,other);
6004 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6006 return MEDCoupling::DenseMatrix::Multiply(self,other);
6009 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6011 return MEDCoupling::DenseMatrix::Multiply(self,other);
6014 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6016 self->addEqual(other);
6017 Py_XINCREF(trueSelf);
6021 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6023 self->substractEqual(other);
6024 Py_XINCREF(trueSelf);
6028 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6030 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6040 __filename=os.environ.get('PYTHONSTARTUP')
6041 if __filename and os.path.isfile(__filename):
6042 execfile(__filename)