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 %init %{ initializeMe(); %}
178 %feature("autodoc", "1");
179 %feature("docstring");
181 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
182 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
183 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
238 %newobject MEDCoupling::MEDCouplingFieldInt::New;
239 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
240 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
241 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
242 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
243 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
244 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
245 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
246 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
247 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
248 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
249 %newobject MEDCoupling::MEDCouplingMesh::clone;
250 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
251 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
252 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
253 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
254 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
255 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
256 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
257 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
258 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
259 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
260 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
261 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
262 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
263 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
264 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
265 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
266 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
267 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
268 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
269 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
270 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
271 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
272 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
273 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
274 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
275 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
276 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
277 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
278 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
279 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
280 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
281 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
282 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
283 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
284 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
285 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
286 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
287 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
288 %newobject MEDCoupling::MEDCouplingUMesh::New;
289 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
290 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
291 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
292 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
294 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
295 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
296 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
297 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
298 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
299 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
300 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
301 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
302 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
303 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
304 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
305 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
306 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
307 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
308 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
309 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
310 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
311 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
312 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
313 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
314 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
315 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
316 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
317 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
318 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
319 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
320 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
321 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
322 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
323 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
324 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
325 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
326 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
327 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
328 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
329 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
330 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
331 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
332 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
333 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
334 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
335 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
336 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
337 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
338 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
339 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
340 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
341 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
342 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
343 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
344 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
345 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
346 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
347 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
348 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
349 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
350 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
351 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
352 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
353 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
354 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
355 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
356 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
357 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
358 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
359 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
360 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
361 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
362 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
363 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
364 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
365 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
366 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
367 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
368 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
369 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
370 %newobject MEDCoupling::MEDCouplingCMesh::New;
371 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
372 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
373 %newobject MEDCoupling::MEDCouplingIMesh::New;
374 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
375 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
376 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
377 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
378 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
379 %newobject MEDCoupling::MEDCouplingMultiFields::New;
380 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
381 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
382 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
383 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
384 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
385 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
386 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
387 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
388 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
389 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
390 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
391 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
394 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
395 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
396 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
397 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
398 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
399 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
400 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
401 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
402 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
403 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
404 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
405 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
406 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
407 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
408 %newobject MEDCoupling::DenseMatrix::New;
409 %newobject MEDCoupling::DenseMatrix::deepCopy;
410 %newobject MEDCoupling::DenseMatrix::shallowCpy;
411 %newobject MEDCoupling::DenseMatrix::getData;
412 %newobject MEDCoupling::DenseMatrix::matVecMult;
413 %newobject MEDCoupling::DenseMatrix::MatVecMult;
414 %newobject MEDCoupling::DenseMatrix::__add__;
415 %newobject MEDCoupling::DenseMatrix::__sub__;
416 %newobject MEDCoupling::DenseMatrix::__mul__;
417 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
418 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
419 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
421 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
422 %feature("unref") MEDCouplingMesh "$this->decrRef();"
423 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
424 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
425 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
426 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
427 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
428 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
429 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
430 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
431 %feature("unref") MEDCouplingField "$this->decrRef();"
432 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
433 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
434 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
435 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
436 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
437 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
438 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
439 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
440 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
441 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
442 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
443 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
444 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
445 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
446 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
447 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
448 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
449 %feature("unref") DenseMatrix "$this->decrRef();"
450 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
452 %rename(assign) *::operator=;
453 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
454 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
455 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
456 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
460 %rename (InterpKernelException) INTERP_KERNEL::Exception;
462 %include "MEDCouplingRefCountObject.i"
463 %include "MEDCouplingMemArray.i"
467 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
468 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
469 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
473 namespace INTERP_KERNEL
476 * \class BoxSplittingOptions
477 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
479 class BoxSplittingOptions
482 BoxSplittingOptions();
483 void init() throw(INTERP_KERNEL::Exception);
484 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
485 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
486 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
487 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
488 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
489 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
490 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
491 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
492 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
493 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
494 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
495 std::string printOptions() const throw(INTERP_KERNEL::Exception);
498 std::string __str__() const throw(INTERP_KERNEL::Exception)
500 return self->printOptions();
506 namespace MEDCoupling
522 CONST_ON_TIME_INTERVAL = 7
523 } TypeOfTimeDiscretization;
531 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
532 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
534 } MEDCouplingMeshType;
537 class DataArrayDouble;
538 class MEDCouplingUMesh;
539 class MEDCouplingCMesh;
540 class MEDCouplingFieldDouble;
542 %extend RefCountObject
544 std::string getHiddenCppPointer() const
546 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
551 %extend MEDCouplingGaussLocalization
553 std::string __str__() const throw(INTERP_KERNEL::Exception)
555 return self->getStringRepr();
558 std::string __repr__() const throw(INTERP_KERNEL::Exception)
560 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
561 oss << self->getStringRepr();
568 class MEDCouplingMesh : public RefCountObject, public TimeLabel
571 void setName(const std::string& name);
572 std::string getName() const;
573 void setDescription(const std::string& descr);
574 std::string getDescription() const;
575 void setTime(double val, int iteration, int order);
576 void setTimeUnit(const std::string& unit);
577 std::string getTimeUnit() const;
578 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
579 bool isStructured() const throw(INTERP_KERNEL::Exception);
580 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
582 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
583 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
584 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
585 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
586 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
587 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
588 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
589 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
590 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
591 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
592 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
593 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
594 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
595 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
596 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
597 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
598 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
599 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
601 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
602 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
603 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
604 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
605 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
606 virtual std::string getVTKFileExtension() const;
607 std::string getVTKFileNameOf(const std::string& fileName) const;
609 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
610 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
611 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
612 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
613 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
614 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
615 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
616 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
617 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
618 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
619 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);
620 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
621 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
622 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
623 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
624 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
625 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
626 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
629 std::string __str__() const throw(INTERP_KERNEL::Exception)
631 return self->simpleRepr();
634 PyObject *getTime() throw(INTERP_KERNEL::Exception)
637 double tmp0=self->getTime(tmp1,tmp2);
638 PyObject *res = PyList_New(3);
639 PyList_SetItem(res,0,SWIG_From_double(tmp0));
640 PyList_SetItem(res,1,SWIG_From_int(tmp1));
641 PyList_SetItem(res,2,SWIG_From_int(tmp2));
645 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
647 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
648 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
654 int getCellContainingPoint(PyObject *p, 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::getCellContainingPoint : ";
663 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
664 return self->getCellContainingPoint(pos,eps);
667 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
671 DataArrayDoubleTuple *aa;
672 std::vector<double> bb;
674 int spaceDim=self->getSpaceDimension();
675 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
676 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
677 MCAuto<DataArrayInt> elts,eltsIndex;
678 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
679 PyObject *ret=PyTuple_New(2);
680 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
681 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
685 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
687 MCAuto<DataArrayInt> elts,eltsIndex;
688 int spaceDim=self->getSpaceDimension();
690 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
691 if (!SWIG_IsOK(res1))
694 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
695 int nbOfPoints=size/spaceDim;
698 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
700 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
704 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
706 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
707 da2->checkAllocated();
708 int size=da2->getNumberOfTuples();
709 int nbOfCompo=da2->getNumberOfComponents();
710 if(nbOfCompo!=spaceDim)
712 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
714 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
716 PyObject *ret=PyTuple_New(2);
717 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
718 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
722 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
726 DataArrayDoubleTuple *aa;
727 std::vector<double> bb;
729 int spaceDim=self->getSpaceDimension();
730 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
731 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
732 std::vector<int> elts;
733 self->getCellsContainingPoint(pos,eps,elts);
734 DataArrayInt *ret=DataArrayInt::New();
735 ret->alloc((int)elts.size(),1);
736 std::copy(elts.begin(),elts.end(),ret->getPointer());
737 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
740 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
742 MCAuto<DataArrayInt> d0=DataArrayInt::New();
743 MCAuto<DataArrayInt> d1=DataArrayInt::New();
744 self->getReverseNodalConnectivity(d0,d1);
745 PyObject *ret=PyTuple_New(2);
746 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
747 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
751 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
754 int v0; std::vector<int> v1;
755 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
756 self->renumberCells(ids,check);
759 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
761 DataArrayInt *cellCor, *nodeCor;
762 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
763 PyObject *res = PyList_New(2);
764 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
765 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
769 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
771 DataArrayInt *cellCor=0,*nodeCor=0;
772 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
773 PyObject *res = PyList_New(2);
774 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
775 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
779 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
781 DataArrayInt *cellCor=0;
782 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
786 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
789 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
790 if (!SWIG_IsOK(res1))
793 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
794 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
798 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
800 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
801 da2->checkAllocated();
802 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
805 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
807 std::vector<int> conn;
808 self->getNodeIdsOfCell(cellId,conn);
809 return convertIntArrToPyList2(conn);
812 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
814 std::vector<double> coo;
815 self->getCoordinatesOfNode(nodeId,coo);
816 return convertDblArrToPyList2(coo);
819 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
823 DataArrayDoubleTuple *aa;
824 std::vector<double> bb;
826 int spaceDim=self->getSpaceDimension();
827 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
828 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
829 self->scale(pointPtr,factor);
832 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
834 int spaceDim=self->getSpaceDimension();
835 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
836 self->getBoundingBox(tmp);
837 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
841 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
844 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
845 PyObject *ret=PyTuple_New(2);
846 PyObject *ret0Py=ret0?Py_True:Py_False;
848 PyTuple_SetItem(ret,0,ret0Py);
849 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
853 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
855 int szArr,sw,iTypppArr;
856 std::vector<int> stdvecTyyppArr;
857 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
858 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
859 if(sw==3)//DataArrayInt
861 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
862 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
863 std::string name=argpt->getName();
865 ret->setName(name.c_str());
867 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
870 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
872 int szArr,sw,iTypppArr;
873 std::vector<int> stdvecTyyppArr;
875 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
876 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
877 if(sw==3)//DataArrayInt
879 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
880 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
881 std::string name=argpt->getName();
883 ret->setName(name.c_str());
886 PyObject *res = PyList_New(2);
887 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
888 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
889 PyList_SetItem(res,0,obj0);
890 PyList_SetItem(res,1,obj1);
894 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
898 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
899 PyObject *res = PyTuple_New(2);
900 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
903 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
905 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
906 PyTuple_SetItem(res,0,obj0);
907 PyTuple_SetItem(res,1,obj1);
911 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
913 std::vector<int> vals=self->getDistributionOfTypes();
915 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
916 PyObject *ret=PyList_New((int)vals.size()/3);
917 for(int j=0;j<(int)vals.size()/3;j++)
919 PyObject *ret1=PyList_New(3);
920 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
921 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
922 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
923 PyList_SetItem(ret,j,ret1);
928 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
930 std::vector<int> code;
931 std::vector<const DataArrayInt *> idsPerType;
932 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
933 convertPyToNewIntArr4(li,1,3,code);
934 return self->checkTypeConsistencyAndContig(code,idsPerType);
937 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
939 std::vector<int> code;
940 std::vector<DataArrayInt *> idsInPflPerType;
941 std::vector<DataArrayInt *> idsPerType;
942 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
943 PyObject *ret=PyTuple_New(3);
946 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
947 PyObject *ret0=PyList_New((int)code.size()/3);
948 for(int j=0;j<(int)code.size()/3;j++)
950 PyObject *ret00=PyList_New(3);
951 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
952 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
953 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
954 PyList_SetItem(ret0,j,ret00);
956 PyTuple_SetItem(ret,0,ret0);
958 PyObject *ret1=PyList_New(idsInPflPerType.size());
959 for(std::size_t j=0;j<idsInPflPerType.size();j++)
960 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
961 PyTuple_SetItem(ret,1,ret1);
962 int n=idsPerType.size();
963 PyObject *ret2=PyList_New(n);
965 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
966 PyTuple_SetItem(ret,2,ret2);
970 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
974 DataArrayDoubleTuple *aa;
975 std::vector<double> bb;
977 int spaceDim=self->getSpaceDimension();
978 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
979 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
980 self->translate(vectorPtr);
983 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
985 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
988 DataArrayDoubleTuple *aa;
989 std::vector<double> bb;
991 int spaceDim=self->getSpaceDimension();
992 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
993 self->rotate(centerPtr,0,alpha);
996 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
998 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1000 DataArrayDouble *a,*a2;
1001 DataArrayDoubleTuple *aa,*aa2;
1002 std::vector<double> bb,bb2;
1004 int spaceDim=self->getSpaceDimension();
1005 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1006 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
1007 self->rotate(centerPtr,vectorPtr,alpha);
1010 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1012 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1013 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1014 PyObject *res=PyList_New(result.size());
1015 for(int i=0;iL!=result.end(); i++, iL++)
1016 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1020 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1022 std::vector<double> a0;
1023 std::vector<int> a1;
1024 std::vector<std::string> a2;
1025 self->getTinySerializationInformation(a0,a1,a2);
1026 PyObject *ret(PyTuple_New(3));
1027 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1028 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1030 PyObject *ret2(PyList_New(sz));
1032 for(int i=0;i<sz;i++)
1033 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1035 PyTuple_SetItem(ret,2,ret2);
1039 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1041 DataArrayInt *a0Tmp(0);
1042 DataArrayDouble *a1Tmp(0);
1043 self->serialize(a0Tmp,a1Tmp);
1044 PyObject *ret(PyTuple_New(2));
1045 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1046 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1050 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1052 std::vector<std::string> littleStrings;
1053 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1056 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1057 {// put an empty dict in input to say to __new__ to call __init__...
1058 PyObject *ret(PyTuple_New(1));
1059 PyObject *ret0(PyDict_New());
1060 PyTuple_SetItem(ret,0,ret0);
1064 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1066 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1067 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1068 PyObject *ret(PyTuple_New(2));
1069 PyTuple_SetItem(ret,0,ret0);
1070 PyTuple_SetItem(ret,1,ret1);
1074 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1076 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1077 if(!PyTuple_Check(inp))
1078 throw INTERP_KERNEL::Exception(MSG);
1079 int sz(PyTuple_Size(inp));
1081 throw INTERP_KERNEL::Exception(MSG);
1082 PyObject *elt0(PyTuple_GetItem(inp,0));
1083 PyObject *elt1(PyTuple_GetItem(inp,1));
1084 std::vector<double> a0;
1085 std::vector<int> a1;
1086 std::vector<std::string> a2;
1087 DataArrayInt *b0(0);
1088 DataArrayDouble *b1(0);
1090 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1091 throw INTERP_KERNEL::Exception(MSG);
1092 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1094 fillArrayWithPyListDbl3(a0py,tmp,a0);
1095 convertPyToNewIntArr3(a1py,a1);
1096 fillStringVector(a2py,a2);
1099 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1100 throw INTERP_KERNEL::Exception(MSG);
1101 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1103 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1104 if(!SWIG_IsOK(status))
1105 throw INTERP_KERNEL::Exception(MSG);
1106 b0=reinterpret_cast<DataArrayInt *>(argp);
1107 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1108 if(!SWIG_IsOK(status))
1109 throw INTERP_KERNEL::Exception(MSG);
1110 b1=reinterpret_cast<DataArrayDouble *>(argp);
1112 // useless here to call resizeForUnserialization because arrays are well resized.
1113 self->unserialization(a0,a1,b0,b1,a2);
1116 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1118 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1119 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1120 return MEDCouplingMesh::MergeMeshes(tmp);
1126 //== MEDCouplingMesh End
1128 %include "NormalizedGeometricTypes"
1129 %include "MEDCouplingNatureOfFieldEnum"
1131 namespace MEDCoupling
1133 class MEDCouplingNatureOfField
1136 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1137 static std::string GetReprNoThrow(NatureOfField nat);
1138 static std::string GetAllPossibilitiesStr();
1142 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1143 // include "MEDCouplingTimeDiscretization.i"
1145 namespace MEDCoupling
1147 class MEDCouplingGaussLocalization
1150 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1151 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1152 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1153 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1154 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1155 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1156 int getDimension() const throw(INTERP_KERNEL::Exception);
1157 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1158 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1159 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1160 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1162 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1163 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1164 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1165 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1166 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1167 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1168 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1169 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1170 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1171 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1172 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1173 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1175 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1179 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1181 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1185 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1187 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1193 class MEDCouplingSkyLineArray
1196 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1198 void set( DataArrayInt* index, DataArrayInt* value );
1199 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1201 int getSuperNumberOf() const;
1202 int getNumberOf() const;
1203 int getLength() const;
1205 DataArrayInt* getSuperIndexArray() const;
1206 DataArrayInt* getIndexArray() const;
1207 DataArrayInt* getValuesArray() const;
1209 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1213 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1215 return MEDCouplingSkyLineArray::New();
1218 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1220 return MEDCouplingSkyLineArray::New(index, value);
1223 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1225 return MEDCouplingSkyLineArray::New(index, value);
1228 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1230 return MEDCouplingSkyLineArray::New(other);
1233 std::string __str__() const throw(INTERP_KERNEL::Exception)
1235 return self->simpleRepr();
1238 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1240 std::vector<int> ret;
1241 self->getSimplePackSafe(absolutePackId,ret);
1242 return convertIntArrToPyList2(ret);
1245 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1247 std::vector<int> vpack, vspIdx, out;
1249 convertPyToNewIntArr3(superPackIndices,vspIdx);
1250 convertPyToNewIntArr3(pack,vpack);
1252 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1253 return convertIntArrToPyList2(out);
1256 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1258 std::vector<int> vpack;
1259 convertPyToNewIntArr3(pack,vpack);
1260 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1263 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1265 std::vector<int> vpack;
1266 convertPyToNewIntArr3(pack,vpack);
1267 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1270 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1272 std::vector<int> vpack;
1273 convertPyToNewIntArr3(pack,vpack);
1274 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1277 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1279 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1280 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1281 self->convertToPolyhedronConn(d0,d1);
1282 PyObject *ret=PyTuple_New(2);
1283 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1284 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1291 %include "MEDCouplingFieldDiscretization.i"
1293 //== MEDCouplingPointSet
1295 namespace MEDCoupling
1297 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1300 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1301 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1302 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1303 void zipCoords() throw(INTERP_KERNEL::Exception);
1304 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1305 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1306 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1307 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1308 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1309 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1310 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1311 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1312 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1313 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1314 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1315 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1316 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1317 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1318 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1319 virtual DataArrayInt *findBoundaryNodes() const;
1320 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1321 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1322 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1323 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1324 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1325 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1326 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1327 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1328 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1331 std::string __str__() const throw(INTERP_KERNEL::Exception)
1333 return self->simpleRepr();
1336 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1339 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1340 PyObject *res = PyList_New(2);
1341 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1342 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1346 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1348 DataArrayInt *comm, *commIndex;
1349 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1350 PyObject *res = PyList_New(2);
1351 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1352 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1356 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1358 DataArrayDouble *ret1=self->getCoords();
1361 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1364 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1366 int szArr,sw,iTypppArr;
1367 std::vector<int> stdvecTyyppArr;
1368 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1369 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1370 if(sw==3)//DataArrayInt
1372 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1373 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1374 std::string name=argpt->getName();
1376 ret->setName(name.c_str());
1378 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1381 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1383 int szArr,sw,iTypppArr;
1384 std::vector<int> stdvecTyyppArr;
1385 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1386 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1387 if(sw==3)//DataArrayInt
1389 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1390 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1391 std::string name=argpt->getName();
1393 ret->setName(name.c_str());
1395 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1398 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1400 int szArr,sw,iTypppArr;
1401 std::vector<int> stdvecTyyppArr;
1402 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1403 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1404 if(sw==3)//DataArrayInt
1406 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1407 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1408 std::string name=argpt->getName();
1410 ret->setName(name.c_str());
1412 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1415 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1417 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1418 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1421 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1423 int szArr,sw,iTypppArr;
1424 std::vector<int> stdvecTyyppArr;
1425 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1426 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1427 if(sw==3)//DataArrayInt
1429 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1430 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1431 std::string name=argpt->getName();
1433 ret->setName(name.c_str());
1435 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1438 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1440 int szArr,sw,iTypppArr;
1441 std::vector<int> stdvecTyyppArr;
1442 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1443 self->renumberNodes(tmp,newNbOfNodes);
1446 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1448 int szArr,sw,iTypppArr;
1449 std::vector<int> stdvecTyyppArr;
1450 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1451 self->renumberNodesCenter(tmp,newNbOfNodes);
1454 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1456 int spaceDim=self->getSpaceDimension();
1458 DataArrayDouble *a,*a2;
1459 DataArrayDoubleTuple *aa,*aa2;
1460 std::vector<double> bb,bb2;
1462 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1463 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1464 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1465 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1466 std::vector<int> nodes;
1467 self->findNodesOnLine(p,v,eps,nodes);
1468 DataArrayInt *ret=DataArrayInt::New();
1469 ret->alloc((int)nodes.size(),1);
1470 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1471 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1473 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1475 int spaceDim=self->getSpaceDimension();
1477 DataArrayDouble *a,*a2;
1478 DataArrayDoubleTuple *aa,*aa2;
1479 std::vector<double> bb,bb2;
1481 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1482 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1483 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1484 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1485 std::vector<int> nodes;
1486 self->findNodesOnPlane(p,v,eps,nodes);
1487 DataArrayInt *ret=DataArrayInt::New();
1488 ret->alloc((int)nodes.size(),1);
1489 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1490 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1493 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1497 DataArrayDoubleTuple *aa;
1498 std::vector<double> bb;
1500 int spaceDim=self->getSpaceDimension();
1501 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1502 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1503 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1504 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1507 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1509 DataArrayInt *c=0,*cI=0;
1513 DataArrayDoubleTuple *aa;
1514 std::vector<double> bb;
1516 int spaceDim=self->getSpaceDimension();
1517 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1518 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1519 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1520 PyObject *ret=PyTuple_New(2);
1521 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1522 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1526 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1528 DataArrayInt *c=0,*cI=0;
1529 int spaceDim=self->getSpaceDimension();
1532 DataArrayDoubleTuple *aa;
1533 std::vector<double> bb;
1536 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1537 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1539 PyObject *ret=PyTuple_New(2);
1540 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1541 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1545 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1549 DataArrayDoubleTuple *aa;
1550 std::vector<double> bb;
1552 int spaceDim=self->getSpaceDimension();
1553 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1554 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1556 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1557 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1560 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1564 std::vector<int> multiVal;
1565 std::pair<int, std::pair<int,int> > slic;
1566 MEDCoupling::DataArrayInt *daIntTyypp=0;
1567 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1571 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1573 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1575 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1577 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1581 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1583 DataArrayInt *v0=0,*v1=0;
1584 self->findCommonCells(compType,startCellId,v0,v1);
1585 PyObject *res = PyList_New(2);
1586 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1587 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1592 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1595 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1596 if (!SWIG_IsOK(res1))
1599 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1600 self->renumberNodesInConn(tmp);
1604 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1606 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1607 da2->checkAllocated();
1608 self->renumberNodesInConn(da2->getConstPointer());
1612 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1615 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1616 PyObject *ret=PyTuple_New(2);
1617 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1618 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1622 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1624 DataArrayInt *ret=0;
1626 int szArr,sw,iTypppArr;
1627 std::vector<int> stdvecTyyppArr;
1628 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1629 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1633 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1637 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1638 PyObject *res = PyList_New(3);
1639 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1640 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1641 PyList_SetItem(res,2,SWIG_From_int(ret2));
1645 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1649 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1650 PyObject *res = PyList_New(3);
1651 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1652 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1653 PyList_SetItem(res,2,SWIG_From_int(ret2));
1657 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1660 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1661 if (!SWIG_IsOK(res1))
1664 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1665 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1669 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1671 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1672 da2->checkAllocated();
1673 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1677 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1681 std::vector<int> multiVal;
1682 std::pair<int, std::pair<int,int> > slic;
1683 MEDCoupling::DataArrayInt *daIntTyypp=0;
1684 int nbc=self->getNumberOfCells();
1685 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1692 std::ostringstream oss;
1693 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1694 throw INTERP_KERNEL::Exception(oss.str().c_str());
1697 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1702 int tmp=nbc+singleVal;
1703 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1707 std::ostringstream oss;
1708 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1709 throw INTERP_KERNEL::Exception(oss.str().c_str());
1715 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1719 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1724 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1725 daIntTyypp->checkAllocated();
1726 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1729 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1733 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1736 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1737 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1738 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1739 for(int i=0;i<sz;i++)
1740 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1743 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1746 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1748 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1749 std::vector<double> val3;
1750 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1751 "Rotate2DAlg",2,true,nbNodes);
1753 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1754 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1757 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1760 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1761 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1762 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1763 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1764 for(int i=0;i<sz;i++)
1765 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1768 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1771 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1773 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1774 std::vector<double> val3;
1775 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1776 "Rotate3DAlg",3,true,nbNodes);
1778 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1779 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1780 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1785 //== MEDCouplingPointSet End
1787 class MEDCouplingUMeshCell
1790 INTERP_KERNEL::NormalizedCellType getType() const;
1793 std::string __str__() const throw(INTERP_KERNEL::Exception)
1795 return self->repr();
1798 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1801 const int *r=self->getAllConn(ret2);
1802 PyObject *ret=PyTuple_New(ret2);
1803 for(int i=0;i<ret2;i++)
1804 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1810 class MEDCouplingUMeshCellIterator
1817 MEDCouplingUMeshCell *ret=self->nextt();
1819 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1822 PyErr_SetString(PyExc_StopIteration,"No more data.");
1829 class MEDCouplingUMeshCellByTypeIterator
1832 ~MEDCouplingUMeshCellByTypeIterator();
1837 MEDCouplingUMeshCellEntry *ret=self->nextt();
1839 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1842 PyErr_SetString(PyExc_StopIteration,"No more data.");
1849 class MEDCouplingUMeshCellByTypeEntry
1852 ~MEDCouplingUMeshCellByTypeEntry();
1855 MEDCouplingUMeshCellByTypeIterator *__iter__()
1857 return self->iterator();
1862 class MEDCouplingUMeshCellEntry
1865 INTERP_KERNEL::NormalizedCellType getType() const;
1866 int getNumberOfElems() const;
1869 MEDCouplingUMeshCellIterator *__iter__()
1871 return self->iterator();
1876 //== MEDCouplingUMesh
1878 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1881 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1882 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1883 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1884 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1885 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1886 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1887 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1888 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1889 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1890 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1891 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1892 void computeTypes() throw(INTERP_KERNEL::Exception);
1893 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1894 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1896 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1897 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1898 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1899 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1900 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1901 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1902 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1903 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1904 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1905 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1906 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1907 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1908 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1909 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1910 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1911 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1912 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1913 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1914 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1915 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1916 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1917 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1918 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1919 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1920 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1921 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1922 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1923 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1924 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1925 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1926 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1927 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1928 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1929 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1930 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1931 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1932 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1933 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1934 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1935 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1936 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1937 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1938 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1939 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1940 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1941 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1942 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);
1943 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1944 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1945 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1946 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1947 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1949 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1951 return MEDCouplingUMesh::New();
1954 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1956 return MEDCouplingUMesh::New(meshName,meshDim);
1960 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1962 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1965 std::string __str__() const throw(INTERP_KERNEL::Exception)
1967 return self->simpleRepr();
1970 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1972 std::ostringstream oss;
1973 self->reprQuickOverview(oss);
1977 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1979 return self->cellIterator();
1982 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1984 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1988 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1990 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1991 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1992 PyObject *res=PyList_New(result.size());
1993 for(int i=0;iL!=result.end(); i++, iL++)
1994 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1998 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2002 std::vector<int> multiVal;
2003 std::pair<int, std::pair<int,int> > slic;
2004 MEDCoupling::DataArrayInt *daIntTyypp=0;
2005 int nbc=self->getNumberOfCells();
2006 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2013 std::ostringstream oss;
2014 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2015 throw INTERP_KERNEL::Exception(oss.str().c_str());
2019 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2026 int tmp=nbc+singleVal;
2027 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2032 std::ostringstream oss;
2033 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2034 throw INTERP_KERNEL::Exception(oss.str().c_str());
2040 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2046 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2047 daIntTyypp->checkAllocated();
2048 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2052 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2056 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2060 std::vector<int> multiVal;
2061 std::pair<int, std::pair<int,int> > slic;
2062 MEDCoupling::DataArrayInt *daIntTyypp=0;
2063 int nbc=self->getNumberOfCells();
2064 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2071 std::ostringstream oss;
2072 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2073 throw INTERP_KERNEL::Exception(oss.str().c_str());
2077 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2084 int tmp=nbc+singleVal;
2085 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2090 std::ostringstream oss;
2091 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2092 throw INTERP_KERNEL::Exception(oss.str().c_str());
2098 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2103 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2109 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2110 daIntTyypp->checkAllocated();
2111 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2115 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2119 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, 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);
2126 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2127 throw INTERP_KERNEL::Exception(oss.str().c_str());
2129 self->insertNextCell(type,size,tmp);
2132 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2134 int szArr,sw,iTypppArr;
2135 std::vector<int> stdvecTyyppArr;
2136 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2137 self->insertNextCell(type,szArr,tmp);
2140 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2142 DataArrayInt *ret=self->getNodalConnectivity();
2147 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2149 DataArrayInt *ret=self->getNodalConnectivityIndex();
2155 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2157 int szArr,sw,iTypppArr;
2158 std::vector<int> stdvecTyyppArr;
2159 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2160 int nbOfDepthPeelingPerformed=0;
2161 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2162 PyObject *res=PyTuple_New(2);
2163 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2168 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2170 DataArrayInt *v0=0,*v1=0;
2171 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2172 PyObject *res = PyList_New(2);
2173 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2174 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2182 DataArrayDoubleTuple *aa;
2183 std::vector<double> bb;
2185 int nbOfCompo=self->getSpaceDimension();
2186 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2189 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2190 PyObject *ret=PyTuple_New(2);
2191 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2192 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2196 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2198 DataArrayInt *ret1=0;
2199 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2200 PyObject *ret=PyTuple_New(2);
2201 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *ret1(0);
2210 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2211 PyObject *ret=PyTuple_New(3);
2212 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2218 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2220 std::vector<int> cells;
2221 self->checkButterflyCells(cells,eps);
2222 DataArrayInt *ret=DataArrayInt::New();
2223 ret->alloc((int)cells.size(),1);
2224 std::copy(cells.begin(),cells.end(),ret->getPointer());
2225 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2228 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2230 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2232 PyObject *ret = PyList_New(sz);
2233 for(int i=0;i<sz;i++)
2234 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2238 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2240 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2241 int sz=retCpp.size();
2242 PyObject *ret=PyList_New(sz);
2243 for(int i=0;i<sz;i++)
2244 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2248 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2250 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2251 int sz=retCpp.size();
2252 PyObject *ret=PyList_New(sz);
2253 for(int i=0;i<sz;i++)
2254 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2258 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2261 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2262 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2263 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2266 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2269 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2270 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2274 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2277 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2278 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2282 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2284 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2285 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2286 PyObject *ret=PyTuple_New(3);
2287 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2288 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2289 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2295 DataArrayInt *tmp0=0,*tmp1=0;
2296 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2297 PyObject *ret=PyTuple_New(2);
2298 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2299 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2307 std::vector<int> multiVal;
2308 std::pair<int, std::pair<int,int> > slic;
2309 MEDCoupling::DataArrayInt *daIntTyypp=0;
2310 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2314 return self->duplicateNodes(&singleVal,&singleVal+1);
2316 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2318 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2320 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2324 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2328 std::vector<int> multiVal;
2329 std::pair<int, std::pair<int,int> > slic;
2330 MEDCoupling::DataArrayInt *daIntTyypp=0;
2331 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2335 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2337 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2339 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2341 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2345 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2348 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2349 DataArrayInt *tmp0,*tmp1=0;
2350 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2359 DataArrayInt *ret0=0,*ret1=0;
2360 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2361 PyObject *ret=PyTuple_New(2);
2362 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(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 DataArrayInt *ret1=0,*ret2=0;
2372 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2373 PyObject *ret=PyTuple_New(3);
2374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2382 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2383 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2384 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2385 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2388 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2391 std::vector<const MEDCouplingUMesh *> meshes;
2392 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2393 std::vector<DataArrayInt *> corr;
2394 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2396 PyObject *ret1=PyList_New(sz);
2397 for(int i=0;i<sz;i++)
2398 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2399 PyObject *ret=PyList_New(2);
2400 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2401 PyList_SetItem(ret,1,ret1);
2405 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2407 std::vector<MEDCouplingUMesh *> meshes;
2408 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2409 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2412 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2414 std::vector<MEDCouplingUMesh *> meshes;
2415 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2416 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2419 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2423 std::vector<int> multiVal;
2424 std::pair<int, std::pair<int,int> > slic;
2425 MEDCoupling::DataArrayInt *daIntTyypp=0;
2427 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2428 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2432 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2434 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2436 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2438 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2442 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2444 DataArrayInt *arrOut=0,*arrIndexOut=0;
2447 std::vector<int> multiVal;
2448 std::pair<int, std::pair<int,int> > slic;
2449 MEDCoupling::DataArrayInt *daIntTyypp=0;
2451 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2452 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2457 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2462 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2467 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2471 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2473 PyObject *ret=PyTuple_New(2);
2474 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2475 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2479 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2481 DataArrayInt *arrOut=0,*arrIndexOut=0;
2482 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2483 PyObject *ret=PyTuple_New(2);
2484 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2485 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2489 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2491 if(!PySlice_Check(slic))
2492 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2493 Py_ssize_t strt=2,stp=2,step=2;
2494 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2496 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2497 arrIndxIn->checkAllocated();
2498 if(arrIndxIn->getNumberOfComponents()!=1)
2499 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2500 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2501 DataArrayInt *arrOut=0,*arrIndexOut=0;
2502 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2503 PyObject *ret=PyTuple_New(2);
2504 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2505 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2509 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2510 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2511 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2513 DataArrayInt *arrOut=0,*arrIndexOut=0;
2516 std::vector<int> multiVal;
2517 std::pair<int, std::pair<int,int> > slic;
2518 MEDCoupling::DataArrayInt *daIntTyypp=0;
2520 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2521 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2526 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2531 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2536 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2540 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2542 PyObject *ret=PyTuple_New(2);
2543 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2548 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2549 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2553 std::vector<int> multiVal;
2554 std::pair<int, std::pair<int,int> > slic;
2555 MEDCoupling::DataArrayInt *daIntTyypp=0;
2557 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2558 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2563 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2568 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2573 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2577 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2581 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2585 DataArrayDoubleTuple *aa;
2586 std::vector<double> bb;
2588 int spaceDim=self->getSpaceDimension();
2589 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2590 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2592 std::vector<int> cells;
2593 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2594 DataArrayInt *ret=DataArrayInt::New();
2595 ret->alloc((int)cells.size(),1);
2596 std::copy(cells.begin(),cells.end(),ret->getPointer());
2597 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2600 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2604 DataArrayDoubleTuple *aa;
2605 std::vector<double> bb;
2607 int spaceDim=self->getSpaceDimension();
2608 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2609 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2610 self->orientCorrectly2DCells(v,polyOnly);
2613 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2615 std::vector<int> cells;
2616 self->arePolyhedronsNotCorrectlyOriented(cells);
2617 DataArrayInt *ret=DataArrayInt::New();
2618 ret->alloc((int)cells.size(),1);
2619 std::copy(cells.begin(),cells.end(),ret->getPointer());
2620 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2623 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2627 self->getFastAveragePlaneOfThis(vec,pos);
2629 std::copy(vec,vec+3,vals);
2630 std::copy(pos,pos+3,vals+3);
2631 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2634 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2636 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2637 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2638 return MEDCouplingUMesh::MergeUMeshes(tmp);
2641 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2644 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2645 PyObject *ret=PyTuple_New(2);
2646 PyObject *ret0Py=ret0?Py_True:Py_False;
2648 PyTuple_SetItem(ret,0,ret0Py);
2649 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2653 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2656 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2657 PyObject *ret=PyTuple_New(2);
2658 PyObject *ret0Py=ret0?Py_True:Py_False;
2660 PyTuple_SetItem(ret,0,ret0Py);
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2667 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2668 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2669 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2670 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2671 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2672 PyObject *ret=PyTuple_New(5);
2673 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2675 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2681 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2683 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2684 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2685 PyObject *ret=PyTuple_New(5);
2686 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2687 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2694 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2696 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2697 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2698 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2699 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2700 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2701 PyObject *ret=PyTuple_New(5);
2702 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2703 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2704 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2705 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2712 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2713 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2714 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2715 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2716 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2717 PyObject *ret=PyTuple_New(5);
2718 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2719 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2720 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2721 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2722 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2726 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2728 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2729 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2730 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2731 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2732 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2733 PyObject *ret=PyTuple_New(5);
2734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2737 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2744 DataArrayInt *neighbors=0,*neighborsIdx=0;
2745 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2746 PyObject *ret=PyTuple_New(2);
2747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2754 DataArrayInt *neighbors=0,*neighborsIdx=0;
2755 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2756 PyObject *ret=PyTuple_New(2);
2757 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2758 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2762 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2764 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2765 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2766 PyObject *ret=PyTuple_New(2);
2767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2772 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2774 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2775 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2776 PyObject *ret=PyTuple_New(2);
2777 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2778 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2784 DataArrayInt *neighbors=0,*neighborsIdx=0;
2785 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2786 PyObject *ret=PyTuple_New(2);
2787 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2788 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2792 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2794 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2795 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2796 DataArrayInt *d2,*d3,*d4,*dd5;
2797 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2798 PyObject *ret=PyTuple_New(7);
2799 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2801 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2802 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2805 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2812 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2813 da->checkAllocated();
2814 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2817 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2820 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2821 da->checkAllocated();
2822 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2825 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2828 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2829 da->checkAllocated();
2830 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2833 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2836 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2837 da->checkAllocated();
2838 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2839 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2840 PyObject *res = PyList_New(result.size());
2841 for (int i=0;iL!=result.end(); i++, iL++)
2842 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2846 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2849 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2850 da->checkAllocated();
2851 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2852 ret->setName(da->getName().c_str());
2856 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2858 DataArrayInt *cellNb1=0,*cellNb2=0;
2859 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2860 PyObject *ret=PyTuple_New(3);
2861 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2862 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2869 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2870 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2871 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2872 PyObject *ret(PyTuple_New(4));
2873 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2874 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2875 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2876 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2880 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2882 int spaceDim=self->getSpaceDimension();
2884 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2886 DataArrayDouble *a,*a2;
2887 DataArrayDoubleTuple *aa,*aa2;
2888 std::vector<double> bb,bb2;
2890 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2891 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2892 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2893 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2895 DataArrayInt *cellIds=0;
2896 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2897 PyObject *ret=PyTuple_New(2);
2898 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2899 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2903 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2905 int spaceDim=self->getSpaceDimension();
2907 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2909 DataArrayDouble *a,*a2;
2910 DataArrayDoubleTuple *aa,*aa2;
2911 std::vector<double> bb,bb2;
2913 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2914 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2915 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2916 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2918 DataArrayInt *cellIds=0;
2919 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2920 PyObject *ret=PyTuple_New(2);
2921 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2922 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2926 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2929 DataArrayDouble *a,*a2;
2930 DataArrayDoubleTuple *aa,*aa2;
2931 std::vector<double> bb,bb2;
2933 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2934 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2935 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2936 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2937 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2941 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2943 int spaceDim=self->getSpaceDimension();
2945 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2947 DataArrayDouble *a,*a2;
2948 DataArrayDoubleTuple *aa,*aa2;
2949 std::vector<double> bb,bb2;
2951 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2952 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2953 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2954 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2955 return self->getCellIdsCrossingPlane(orig,vect,eps);
2958 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2962 std::vector<int> pos2;
2963 DataArrayInt *pos3=0;
2964 DataArrayIntTuple *pos4=0;
2965 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2970 self->convertToPolyTypes(&pos1,&pos1+1);
2977 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2982 self->convertToPolyTypes(pos3->begin(),pos3->end());
2986 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2990 void convertAllToPoly();
2991 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2992 bool unPolyze() throw(INTERP_KERNEL::Exception);
2993 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2994 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2995 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2998 //== MEDCouplingUMesh End
3000 //== MEDCouplingMappedExtrudedMesh
3002 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3005 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3006 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3007 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3008 int get2DCellIdForExtrusion() const;
3010 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3012 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3015 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3017 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3020 MEDCouplingMappedExtrudedMesh()
3022 return MEDCouplingMappedExtrudedMesh::New();
3025 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3027 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3030 std::string __str__() const throw(INTERP_KERNEL::Exception)
3032 return self->simpleRepr();
3035 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3037 std::ostringstream oss;
3038 self->reprQuickOverview(oss);
3042 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3044 MEDCouplingUMesh *ret=self->getMesh2D();
3047 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3049 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3051 MEDCouplingUMesh *ret=self->getMesh1D();
3054 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3056 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3058 DataArrayInt *ret=self->getMesh3DIds();
3061 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3066 //== MEDCouplingMappedExtrudedMesh End
3068 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3071 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3072 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3073 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3074 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3075 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3076 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3079 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3081 int szArr,sw,iTypppArr;
3082 std::vector<int> stdvecTyyppArr;
3083 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3084 self->insertNextCell(tmp,tmp+szArr);
3087 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3089 DataArrayInt *ret=self->getNodalConnectivity();
3090 if(ret) ret->incrRef();
3094 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3096 std::vector< const MEDCoupling1GTUMesh *> parts;
3097 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3098 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3103 //== MEDCoupling1SGTUMesh
3105 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3108 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3109 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3110 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3111 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3112 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3113 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3114 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3115 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3116 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3119 MEDCoupling1SGTUMesh()
3121 return MEDCoupling1SGTUMesh::New();
3124 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3126 return MEDCoupling1SGTUMesh::New(name,type);
3129 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3131 return MEDCoupling1SGTUMesh::New(m);
3134 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3136 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3139 std::string __str__() const throw(INTERP_KERNEL::Exception)
3141 return self->simpleRepr();
3144 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3146 std::ostringstream oss;
3147 self->reprQuickOverview(oss);
3151 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3153 DataArrayInt *cellPerm(0),*nodePerm(0);
3154 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3155 PyObject *ret(PyTuple_New(3));
3156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3157 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3158 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3162 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3164 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3165 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3166 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3169 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3171 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3172 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3173 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3178 //== MEDCoupling1SGTUMesh End
3180 //== MEDCoupling1DGTUMesh
3182 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3185 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3186 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3187 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3188 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3189 bool isPacked() const throw(INTERP_KERNEL::Exception);
3192 MEDCoupling1DGTUMesh()
3194 return MEDCoupling1DGTUMesh::New();
3196 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3198 return MEDCoupling1DGTUMesh::New(name,type);
3201 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3203 return MEDCoupling1DGTUMesh::New(m);
3206 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3208 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3211 std::string __str__() const throw(INTERP_KERNEL::Exception)
3213 return self->simpleRepr();
3216 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3218 std::ostringstream oss;
3219 self->reprQuickOverview(oss);
3223 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3225 DataArrayInt *ret=self->getNodalConnectivityIndex();
3226 if(ret) ret->incrRef();
3230 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3232 DataArrayInt *ret1=0,*ret2=0;
3233 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3234 PyObject *ret0Py=ret0?Py_True:Py_False;
3236 PyObject *ret=PyTuple_New(3);
3237 PyTuple_SetItem(ret,0,ret0Py);
3238 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3239 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3243 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3246 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3247 PyObject *ret=PyTuple_New(2);
3248 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3249 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3250 PyTuple_SetItem(ret,1,ret1Py);
3254 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3256 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3257 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3258 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3261 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3263 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3264 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3265 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3268 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3270 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3271 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3272 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3277 //== MEDCoupling1DGTUMeshEnd
3279 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3282 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3283 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3284 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3285 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3286 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3287 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3288 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3289 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3290 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3291 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3292 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3293 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3294 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3295 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3296 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3299 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3301 int tmpp1=-1,tmpp2=-1;
3302 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3303 std::vector< std::pair<int,int> > inp;
3307 for(int i=0;i<tmpp1;i++)
3308 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3313 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3314 inp.resize(tmpp1/2);
3315 for(int i=0;i<tmpp1/2;i++)
3316 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3319 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3320 return self->buildStructuredSubPart(inp);
3323 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3325 std::vector< std::pair<int,int> > inp;
3326 convertPyToVectorPairInt(part,inp);
3328 int szArr,sw,iTypppArr;
3329 std::vector<int> stdvecTyyppArr;
3330 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3331 std::vector<int> tmp5(tmp4,tmp4+szArr);
3333 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3336 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3338 std::vector< std::pair<int,int> > inp;
3339 convertPyToVectorPairInt(part,inp);
3340 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3343 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3345 std::vector< std::pair<int,int> > inp;
3346 convertPyToVectorPairInt(part,inp);
3347 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3350 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3352 std::vector< std::pair<int,int> > inp;
3353 convertPyToVectorPairInt(part,inp);
3354 std::vector<int> stWithGhost;
3355 std::vector< std::pair<int,int> > partWithGhost;
3356 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3357 PyObject *ret(PyTuple_New(2));
3358 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3359 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3363 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3365 std::vector< std::pair<int,int> > inp;
3366 convertPyToVectorPairInt(partCompactFormat,inp);
3367 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3370 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3372 std::vector< std::pair<int,int> > inp;
3373 convertPyToVectorPairInt(partCompactFormat,inp);
3374 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3377 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3379 std::vector< std::pair<int,int> > inp;
3380 convertPyToVectorPairInt(part,inp);
3381 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3384 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3386 int szArr,sw,iTypppArr;
3387 std::vector<int> stdvecTyyppArr;
3388 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3389 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3392 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3394 int szArr,sw,iTypppArr;
3395 std::vector<int> stdvecTyyppArr;
3396 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3397 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3400 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3402 std::vector< std::pair<int,int> > inp;
3403 convertPyToVectorPairInt(partCompactFormat,inp);
3404 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3407 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3409 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3410 PyObject *retPy=PyList_New(ret.size());
3411 for(std::size_t i=0;i<ret.size();i++)
3413 PyObject *tmp=PyTuple_New(2);
3414 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3415 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3416 PyList_SetItem(retPy,i,tmp);
3421 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3423 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3424 convertPyToVectorPairInt(r1,r1Cpp);
3425 convertPyToVectorPairInt(r2,r2Cpp);
3426 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3427 PyObject *retPy=PyList_New(ret.size());
3428 for(std::size_t i=0;i<ret.size();i++)
3430 PyObject *tmp=PyTuple_New(2);
3431 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3432 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3433 PyList_SetItem(retPy,i,tmp);
3438 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3440 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3441 convertPyToVectorPairInt(r1,r1Cpp);
3442 convertPyToVectorPairInt(r2,r2Cpp);
3443 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3446 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3448 int szArr,sw,iTypppArr;
3449 std::vector<int> stdvecTyyppArr;
3450 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3451 int szArr2,sw2,iTypppArr2;
3452 std::vector<int> stdvecTyyppArr2;
3453 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3454 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3455 std::vector< std::pair<int,int> > partCompactFormat;
3456 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3457 PyObject *ret=PyTuple_New(2);
3458 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3459 PyTuple_SetItem(ret,0,ret0Py);
3460 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3461 for(std::size_t i=0;i<partCompactFormat.size();i++)
3463 PyObject *tmp4=PyTuple_New(2);
3464 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3465 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3466 PyList_SetItem(ret1Py,i,tmp4);
3468 PyTuple_SetItem(ret,1,ret1Py);
3472 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3474 std::vector< std::pair<int,int> > param0,param1,ret;
3475 convertPyToVectorPairInt(bigInAbs,param0);
3476 convertPyToVectorPairInt(partOfBigInAbs,param1);
3477 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3478 PyObject *retPy(PyList_New(ret.size()));
3479 for(std::size_t i=0;i<ret.size();i++)
3481 PyObject *tmp(PyTuple_New(2));
3482 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3483 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3484 PyList_SetItem(retPy,i,tmp);
3489 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3491 std::vector< std::pair<int,int> > param0;
3492 convertPyToVectorPairInt(part,param0);
3493 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3494 PyObject *retPy(PyList_New(ret.size()));
3495 for(std::size_t i=0;i<ret.size();i++)
3497 PyObject *tmp(PyTuple_New(2));
3498 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3499 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3500 PyList_SetItem(retPy,i,tmp);
3505 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3507 std::vector< std::pair<int,int> > param0,param1;
3508 convertPyToVectorPairInt(startingFrom,param0);
3509 convertPyToVectorPairInt(goingTo,param1);
3510 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3513 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3515 std::vector< std::pair<int,int> > param0,param1,ret;
3516 convertPyToVectorPairInt(bigInAbs,param0);
3517 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3518 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3519 PyObject *retPy(PyList_New(ret.size()));
3520 for(std::size_t i=0;i<ret.size();i++)
3522 PyObject *tmp(PyTuple_New(2));
3523 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3524 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3525 PyList_SetItem(retPy,i,tmp);
3532 class MEDCouplingCurveLinearMesh;
3534 //== MEDCouplingCMesh
3536 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3539 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3540 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3541 void setCoords(const DataArrayDouble *coordsX,
3542 const DataArrayDouble *coordsY=0,
3543 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3544 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3545 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3547 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3549 return MEDCouplingCMesh::New();
3551 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3553 return MEDCouplingCMesh::New(meshName);
3556 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3558 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3560 std::string __str__() const throw(INTERP_KERNEL::Exception)
3562 return self->simpleRepr();
3564 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3566 std::ostringstream oss;
3567 self->reprQuickOverview(oss);
3570 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3572 DataArrayDouble *ret=self->getCoordsAt(i);
3580 //== MEDCouplingCMesh End
3582 //== MEDCouplingCurveLinearMesh
3584 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3587 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3588 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3589 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3591 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3593 return MEDCouplingCurveLinearMesh::New();
3595 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3597 return MEDCouplingCurveLinearMesh::New(meshName);
3599 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3601 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3603 std::string __str__() const throw(INTERP_KERNEL::Exception)
3605 return self->simpleRepr();
3607 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3609 std::ostringstream oss;
3610 self->reprQuickOverview(oss);
3613 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3615 DataArrayDouble *ret=self->getCoords();
3620 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3622 int szArr,sw,iTypppArr;
3623 std::vector<int> stdvecTyyppArr;
3624 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3625 self->setNodeGridStructure(tmp,tmp+szArr);
3630 //== MEDCouplingCurveLinearMesh End
3632 //== MEDCouplingIMesh
3634 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3637 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3639 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3640 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3641 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3642 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3643 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3644 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3645 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3646 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3647 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3648 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3649 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3654 return MEDCouplingIMesh::New();
3656 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3658 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3659 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3660 const int *nodeStrctPtr(0);
3661 const double *originPtr(0),*dxyzPtr(0);
3663 std::vector<int> bb0;
3664 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3667 std::vector<double> bb,bb2;
3669 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3670 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3672 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3675 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3677 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3680 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3682 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3685 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3688 std::vector<int> bb0;
3689 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3690 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3693 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3695 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3698 DataArrayDoubleTuple *aa;
3699 std::vector<double> bb;
3701 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3702 self->setOrigin(originPtr,originPtr+nbTuples);
3705 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3707 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3710 DataArrayDoubleTuple *aa;
3711 std::vector<double> bb;
3713 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3714 self->setDXYZ(originPtr,originPtr+nbTuples);
3717 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3719 std::vector< std::pair<int,int> > inp;
3720 convertPyToVectorPairInt(fineLocInCoarse,inp);
3721 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3724 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)
3726 std::vector< std::pair<int,int> > inp;
3727 convertPyToVectorPairInt(fineLocInCoarse,inp);
3728 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3731 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3733 std::vector< std::pair<int,int> > inp;
3734 convertPyToVectorPairInt(fineLocInCoarse,inp);
3735 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3738 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)
3740 std::vector< std::pair<int,int> > inp;
3741 convertPyToVectorPairInt(fineLocInCoarse,inp);
3742 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3745 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)
3747 std::vector< std::pair<int,int> > inp;
3748 convertPyToVectorPairInt(fineLocInCoarse,inp);
3749 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3752 std::string __str__() const throw(INTERP_KERNEL::Exception)
3754 return self->simpleRepr();
3756 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3758 std::ostringstream oss;
3759 self->reprQuickOverview(oss);
3765 //== MEDCouplingIMesh End
3769 namespace MEDCoupling
3771 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3774 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3775 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3776 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3777 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3778 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3779 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3780 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3781 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3782 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3783 std::string getName() const throw(INTERP_KERNEL::Exception);
3784 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3785 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3786 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3787 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3788 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3789 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3790 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3791 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3792 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3793 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3794 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3795 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3796 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3797 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3798 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3799 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3801 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3803 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3806 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3809 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3811 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3814 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3817 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3819 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3820 return convertIntArrToPyList3(ret);
3823 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3826 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3827 PyObject *ret=PyTuple_New(2);
3828 PyObject *ret0Py=ret0?Py_True:Py_False;
3830 PyTuple_SetItem(ret,0,ret0Py);
3831 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3835 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3837 DataArrayInt *ret1=0;
3838 MEDCouplingMesh *ret0=0;
3840 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3841 if (!SWIG_IsOK(res1))
3844 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3845 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3849 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3851 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3852 da2->checkAllocated();
3853 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3855 PyObject *res = PyList_New(2);
3856 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3857 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3861 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3863 DataArrayInt *ret1=0;
3865 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3866 PyObject *res=PyTuple_New(2);
3867 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3869 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3872 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3873 PyTuple_SetItem(res,1,res1);
3878 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3881 int v0; std::vector<int> v1;
3882 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3883 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3886 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3887 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3890 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3891 if (!SWIG_IsOK(res1))
3894 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3895 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3899 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3901 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3902 da2->checkAllocated();
3903 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3907 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3909 std::vector<int> tmp;
3910 self->getCellIdsHavingGaussLocalization(locId,tmp);
3911 DataArrayInt *ret=DataArrayInt::New();
3912 ret->alloc((int)tmp.size(),1);
3913 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3914 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3917 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3919 std::vector<int> inp0;
3920 convertPyToNewIntArr4(code,1,3,inp0);
3921 std::vector<const DataArrayInt *> inp1;
3922 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3923 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3928 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3931 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3932 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3933 static MEDCouplingFieldTemplate *New(TypeOfField type);
3934 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3935 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3938 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3940 return MEDCouplingFieldTemplate::New(f);
3943 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3945 return MEDCouplingFieldTemplate::New(f);
3948 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3950 return MEDCouplingFieldTemplate::New(type);
3953 std::string __str__() const throw(INTERP_KERNEL::Exception)
3955 return self->simpleRepr();
3958 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3960 std::ostringstream oss;
3961 self->reprQuickOverview(oss);
3967 class MEDCouplingFieldInt;
3969 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3972 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3973 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3974 void setTimeUnit(const std::string& unit);
3975 std::string getTimeUnit() const;
3976 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3977 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3978 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3979 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3980 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3981 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3982 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3983 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3984 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3985 MEDCouplingFieldDouble *deepCopy() const;
3986 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3987 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3988 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3989 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3990 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3991 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3992 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3993 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3994 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3995 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3996 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3997 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3998 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3999 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4000 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4001 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4002 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4003 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4004 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4005 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4006 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4007 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4008 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4009 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4010 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4011 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4012 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4013 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4014 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4015 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4016 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4017 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4018 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4019 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4020 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4021 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4022 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4023 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4024 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4025 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4026 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4027 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4028 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4029 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4030 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4031 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4032 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4033 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4034 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4035 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4036 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4037 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4038 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4039 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4040 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4041 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4042 double getMinValue() const throw(INTERP_KERNEL::Exception);
4043 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4044 double norm2() const throw(INTERP_KERNEL::Exception);
4045 double normMax() const throw(INTERP_KERNEL::Exception);
4046 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4047 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4048 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4049 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4050 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4051 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4052 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4053 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4054 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4055 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4056 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4057 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4058 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4059 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4060 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4061 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4062 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4063 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4064 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4065 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4066 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4067 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4069 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4071 return MEDCouplingFieldDouble::New(type,td);
4074 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4076 return MEDCouplingFieldDouble::New(ft,td);
4079 std::string __str__() const throw(INTERP_KERNEL::Exception)
4081 return self->simpleRepr();
4084 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4086 std::ostringstream oss;
4087 self->reprQuickOverview(oss);
4091 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4093 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4097 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4099 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4103 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4105 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4107 DataArrayDouble *a,*a2;
4108 DataArrayDoubleTuple *aa,*aa2;
4109 std::vector<double> bb,bb2;
4111 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4112 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4113 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4116 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4118 DataArrayDouble *ret=self->getArray();
4124 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4126 std::vector<DataArrayDouble *> arrs=self->getArrays();
4127 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4131 PyObject *ret=PyTuple_New(sz);
4132 for(int i=0;i<sz;i++)
4135 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4137 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4142 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4144 std::vector<const DataArrayDouble *> tmp;
4145 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4147 std::vector<DataArrayDouble *> arrs(sz);
4148 for(int i=0;i<sz;i++)
4149 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4150 self->setArrays(arrs);
4153 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4155 DataArrayDouble *ret=self->getEndArray();
4161 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4165 DataArrayDoubleTuple *aa;
4166 std::vector<double> bb;
4168 const MEDCouplingMesh *mesh=self->getMesh();
4170 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4171 int spaceDim=mesh->getSpaceDimension();
4172 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4173 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4175 int sz=self->getNumberOfComponents();
4176 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4177 self->getValueOn(spaceLoc,res);
4178 return convertDblArrToPyList<double>(res,sz);
4181 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4183 int sz=self->getNumberOfComponents();
4184 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4185 self->getValueOnPos(i,j,k,res);
4186 return convertDblArrToPyList<double>(res,sz);
4189 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4191 const MEDCouplingMesh *mesh(self->getMesh());
4193 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4196 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4197 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4198 mesh->getSpaceDimension(),true,nbPts);
4199 return self->getValueOnMulti(inp,nbPts);
4202 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4206 DataArrayDoubleTuple *aa;
4207 std::vector<double> bb;
4209 const MEDCouplingMesh *mesh=self->getMesh();
4211 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4212 int spaceDim=mesh->getSpaceDimension();
4213 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4214 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4217 int sz=self->getNumberOfComponents();
4218 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4219 self->getValueOn(spaceLoc,time,res);
4220 return convertDblArrToPyList<double>(res,sz);
4223 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4225 if(self->getArray()!=0)
4226 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4229 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4230 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4231 self->setArray(arr);
4235 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4238 double tmp0=self->getTime(tmp1,tmp2);
4239 PyObject *res = PyList_New(3);
4240 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4241 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4242 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4246 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4249 double tmp0=self->getStartTime(tmp1,tmp2);
4250 PyObject *res = PyList_New(3);
4251 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4252 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4253 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4257 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4260 double tmp0=self->getEndTime(tmp1,tmp2);
4261 PyObject *res = PyList_New(3);
4262 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4263 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4264 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4267 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4269 int sz=self->getNumberOfComponents();
4270 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4271 self->accumulate(tmp);
4272 return convertDblArrToPyList<double>(tmp,sz);
4274 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4276 int sz=self->getNumberOfComponents();
4277 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4278 self->integral(isWAbs,tmp);
4279 return convertDblArrToPyList<double>(tmp,sz);
4281 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4283 int sz=self->getNumberOfComponents();
4284 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4285 self->getWeightedAverageValue(tmp,isWAbs);
4286 return convertDblArrToPyList<double>(tmp,sz);
4288 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4290 int sz=self->getNumberOfComponents();
4291 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4293 return convertDblArrToPyList<double>(tmp,sz);
4295 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4297 int sz=self->getNumberOfComponents();
4298 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4300 return convertDblArrToPyList<double>(tmp,sz);
4302 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4304 int szArr,sw,iTypppArr;
4305 std::vector<int> stdvecTyyppArr;
4306 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4307 self->renumberCells(tmp,check);
4310 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4312 int szArr,sw,iTypppArr;
4313 std::vector<int> stdvecTyyppArr;
4314 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4315 self->renumberCellsWithoutMesh(tmp,check);
4318 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4320 int szArr,sw,iTypppArr;
4321 std::vector<int> stdvecTyyppArr;
4322 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4323 self->renumberNodes(tmp,eps);
4326 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4328 int szArr,sw,iTypppArr;
4329 std::vector<int> stdvecTyyppArr;
4330 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4331 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4334 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4336 return fieldT_buildSubPart(self,li);
4339 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4341 return fieldT__getitem__(self,li);
4344 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4347 double r1=self->getMaxValue2(tmp);
4348 PyObject *ret=PyTuple_New(2);
4349 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4350 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4354 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4357 double r1=self->getMinValue2(tmp);
4358 PyObject *ret=PyTuple_New(2);
4359 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4360 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4364 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4366 std::vector<int> tmp;
4367 convertPyToNewIntArr3(li,tmp);
4368 return self->keepSelectedComponents(tmp);
4371 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4373 std::vector<int> tmp;
4374 convertPyToNewIntArr3(li,tmp);
4375 self->setSelectedComponents(f,tmp);
4378 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4381 DataArrayDouble *a,*a2;
4382 DataArrayDoubleTuple *aa,*aa2;
4383 std::vector<double> bb,bb2;
4386 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4387 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4388 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4389 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4391 return self->extractSlice3D(orig,vect,eps);
4394 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4399 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4401 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4404 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4406 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.";
4407 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4410 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4412 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4414 return (*self)-(*other);
4416 throw INTERP_KERNEL::Exception(msg);
4421 DataArrayDoubleTuple *aa;
4422 std::vector<double> bb;
4424 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4429 if(!self->getArray())
4430 throw INTERP_KERNEL::Exception(msg2);
4431 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4432 ret->applyLin(1.,-val);
4433 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4434 ret2->setArray(ret);
4439 if(!self->getArray())
4440 throw INTERP_KERNEL::Exception(msg2);
4441 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4442 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4443 ret2->setArray(ret);
4448 if(!self->getArray())
4449 throw INTERP_KERNEL::Exception(msg2);
4450 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4451 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4452 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4453 ret2->setArray(ret);
4458 if(!self->getArray())
4459 throw INTERP_KERNEL::Exception(msg2);
4460 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4461 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4462 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4463 ret2->setArray(ret);
4467 { throw INTERP_KERNEL::Exception(msg); }
4471 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4473 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4476 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4478 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4481 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4483 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4486 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4488 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.";
4489 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4492 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4494 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4496 return (*self)/(*other);
4498 throw INTERP_KERNEL::Exception(msg);
4503 DataArrayDoubleTuple *aa;
4504 std::vector<double> bb;
4506 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4512 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4513 if(!self->getArray())
4514 throw INTERP_KERNEL::Exception(msg2);
4515 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4516 ret->applyLin(1./val,0);
4517 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4518 ret2->setArray(ret);
4523 if(!self->getArray())
4524 throw INTERP_KERNEL::Exception(msg2);
4525 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4526 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4527 ret2->setArray(ret);
4532 if(!self->getArray())
4533 throw INTERP_KERNEL::Exception(msg2);
4534 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4535 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
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=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4545 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4546 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 ret2->setArray(ret);
4551 { throw INTERP_KERNEL::Exception(msg); }
4555 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4557 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4560 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4562 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.";
4563 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4566 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4568 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4570 return (*self)^(*other);
4572 throw INTERP_KERNEL::Exception(msg);
4577 DataArrayDoubleTuple *aa;
4578 std::vector<double> bb;
4580 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4585 if(!self->getArray())
4586 throw INTERP_KERNEL::Exception(msg2);
4587 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4589 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4590 ret2->setArray(ret);
4595 if(!self->getArray())
4596 throw INTERP_KERNEL::Exception(msg2);
4597 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4598 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4599 ret2->setArray(ret);
4604 if(!self->getArray())
4605 throw INTERP_KERNEL::Exception(msg2);
4606 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4607 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4608 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4609 ret2->setArray(ret);
4614 if(!self->getArray())
4615 throw INTERP_KERNEL::Exception(msg2);
4616 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4617 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4618 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4619 ret2->setArray(ret);
4623 { throw INTERP_KERNEL::Exception(msg); }
4627 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4629 return self->negate();
4632 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4634 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.";
4635 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4638 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4640 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4644 Py_XINCREF(trueSelf);
4648 throw INTERP_KERNEL::Exception(msg);
4653 DataArrayDoubleTuple *aa;
4654 std::vector<double> bb;
4656 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4661 if(!self->getArray())
4662 throw INTERP_KERNEL::Exception(msg2);
4663 self->getArray()->applyLin(1.,val);
4664 Py_XINCREF(trueSelf);
4669 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4672 Py_XINCREF(trueSelf);
4677 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4678 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4679 ret2->setArray(aaa);
4681 Py_XINCREF(trueSelf);
4686 if(!self->getArray())
4687 throw INTERP_KERNEL::Exception(msg2);
4688 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4689 self->getArray()->addEqual(aaa);
4690 Py_XINCREF(trueSelf);
4694 { throw INTERP_KERNEL::Exception(msg); }
4698 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4700 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.";
4701 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4704 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4706 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4710 Py_XINCREF(trueSelf);
4714 throw INTERP_KERNEL::Exception(msg);
4719 DataArrayDoubleTuple *aa;
4720 std::vector<double> bb;
4722 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4727 if(!self->getArray())
4728 throw INTERP_KERNEL::Exception(msg2);
4729 self->getArray()->applyLin(1.,-val);
4730 Py_XINCREF(trueSelf);
4735 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4738 Py_XINCREF(trueSelf);
4743 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4744 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4745 ret2->setArray(aaa);
4747 Py_XINCREF(trueSelf);
4752 if(!self->getArray())
4753 throw INTERP_KERNEL::Exception(msg2);
4754 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4755 self->getArray()->substractEqual(aaa);
4756 Py_XINCREF(trueSelf);
4760 { throw INTERP_KERNEL::Exception(msg); }
4764 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4766 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.";
4767 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4770 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4772 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4776 Py_XINCREF(trueSelf);
4780 throw INTERP_KERNEL::Exception(msg);
4785 DataArrayDoubleTuple *aa;
4786 std::vector<double> bb;
4788 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4793 if(!self->getArray())
4794 throw INTERP_KERNEL::Exception(msg2);
4795 self->getArray()->applyLin(val,0);
4796 Py_XINCREF(trueSelf);
4801 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4804 Py_XINCREF(trueSelf);
4809 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4810 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4811 ret2->setArray(aaa);
4813 Py_XINCREF(trueSelf);
4818 if(!self->getArray())
4819 throw INTERP_KERNEL::Exception(msg2);
4820 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4821 self->getArray()->multiplyEqual(aaa);
4822 Py_XINCREF(trueSelf);
4826 { throw INTERP_KERNEL::Exception(msg); }
4830 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4832 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.";
4833 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4836 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4838 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4842 Py_XINCREF(trueSelf);
4846 throw INTERP_KERNEL::Exception(msg);
4851 DataArrayDoubleTuple *aa;
4852 std::vector<double> bb;
4854 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4860 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4861 if(!self->getArray())
4862 throw INTERP_KERNEL::Exception(msg2);
4863 self->getArray()->applyLin(1./val,0);
4864 Py_XINCREF(trueSelf);
4869 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4872 Py_XINCREF(trueSelf);
4877 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4878 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4879 ret2->setArray(aaa);
4881 Py_XINCREF(trueSelf);
4886 if(!self->getArray())
4887 throw INTERP_KERNEL::Exception(msg2);
4888 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4889 self->getArray()->divideEqual(aaa);
4890 Py_XINCREF(trueSelf);
4894 { throw INTERP_KERNEL::Exception(msg); }
4898 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4900 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.";
4901 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4904 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4906 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4910 Py_XINCREF(trueSelf);
4914 throw INTERP_KERNEL::Exception(msg);
4919 DataArrayDoubleTuple *aa;
4920 std::vector<double> bb;
4922 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4927 if(!self->getArray())
4928 throw INTERP_KERNEL::Exception(msg2);
4929 self->getArray()->applyPow(val);
4930 Py_XINCREF(trueSelf);
4935 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4938 Py_XINCREF(trueSelf);
4943 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4944 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4945 ret2->setArray(aaa);
4947 Py_XINCREF(trueSelf);
4952 if(!self->getArray())
4953 throw INTERP_KERNEL::Exception(msg2);
4954 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4955 self->getArray()->powEqual(aaa);
4956 Py_XINCREF(trueSelf);
4960 { throw INTERP_KERNEL::Exception(msg); }
4964 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4966 std::vector<const MEDCouplingFieldDouble *> tmp;
4967 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4968 return MEDCouplingFieldDouble::MergeFields(tmp);
4971 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4973 std::vector<const MEDCouplingFieldDouble *> tmp;
4974 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4975 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4978 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4980 std::vector<double> a0;
4981 std::vector<int> a1;
4982 std::vector<std::string> a2;
4983 self->getTinySerializationDbleInformation(a0);
4984 self->getTinySerializationIntInformation(a1);
4985 self->getTinySerializationStrInformation(a2);
4987 PyObject *ret(PyTuple_New(3));
4988 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4989 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4991 PyObject *ret2(PyList_New(sz));
4993 for(int i=0;i<sz;i++)
4994 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4996 PyTuple_SetItem(ret,2,ret2);
5000 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5002 DataArrayInt *ret0(0);
5003 std::vector<DataArrayDouble *> ret1;
5004 self->serialize(ret0,ret1);
5007 std::size_t sz(ret1.size());
5008 PyObject *ret(PyTuple_New(2));
5009 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5010 PyObject *ret1Py(PyList_New(sz));
5011 for(std::size_t i=0;i<sz;i++)
5015 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5017 PyTuple_SetItem(ret,1,ret1Py);
5021 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5023 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5024 if(!PyTuple_Check(args))
5025 throw INTERP_KERNEL::Exception(MSG);
5026 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5027 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5028 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5030 PyObject *tmp0(PyTuple_New(1));
5031 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5032 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5034 Py_DECREF(selfMeth);
5035 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5036 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5037 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5039 PyObject *a(PyInt_FromLong(0));
5040 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5043 throw INTERP_KERNEL::Exception(MSG);
5044 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5045 throw INTERP_KERNEL::Exception(MSG);
5046 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5049 Py_DECREF(initMeth);
5054 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5055 {// put an empty dict in input to say to __new__ to call __init__...
5056 self->checkConsistencyLight();
5057 PyObject *ret(PyTuple_New(1));
5058 PyObject *ret0(PyDict_New());
5060 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5061 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5062 PyDict_SetItem(ret0,a,d);
5063 Py_DECREF(a); Py_DECREF(d);
5065 PyTuple_SetItem(ret,0,ret0);
5069 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5071 self->checkConsistencyLight();
5072 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5073 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5074 const MEDCouplingMesh *mesh(self->getMesh());
5077 PyObject *ret(PyTuple_New(3));
5078 PyTuple_SetItem(ret,0,ret0);
5079 PyTuple_SetItem(ret,1,ret1);
5080 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5084 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5086 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5087 if(!PyTuple_Check(inp))
5088 throw INTERP_KERNEL::Exception(MSG);
5089 int sz(PyTuple_Size(inp));
5091 throw INTERP_KERNEL::Exception(MSG);
5093 PyObject *elt2(PyTuple_GetItem(inp,2));
5095 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5096 if(!SWIG_IsOK(status))
5097 throw INTERP_KERNEL::Exception(MSG);
5098 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5100 PyObject *elt0(PyTuple_GetItem(inp,0));
5101 PyObject *elt1(PyTuple_GetItem(inp,1));
5102 std::vector<double> a0;
5103 std::vector<int> a1;
5104 std::vector<std::string> a2;
5105 DataArrayInt *b0(0);
5106 std::vector<DataArrayDouble *>b1;
5108 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5109 throw INTERP_KERNEL::Exception(MSG);
5110 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5112 fillArrayWithPyListDbl3(a0py,tmp,a0);
5113 convertPyToNewIntArr3(a1py,a1);
5114 fillStringVector(a2py,a2);
5117 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5118 throw INTERP_KERNEL::Exception(MSG);
5119 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5121 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5122 if(!SWIG_IsOK(status))
5123 throw INTERP_KERNEL::Exception(MSG);
5124 b0=reinterpret_cast<DataArrayInt *>(argp);
5125 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5127 self->checkForUnserialization(a1,b0,b1);
5128 // useless here to call resizeForUnserialization because arrays are well resized.
5129 self->finishUnserialization(a1,a0,a2);
5134 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5137 int getNumberOfFields() const;
5138 MEDCouplingMultiFields *deepCopy() const;
5139 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5140 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5141 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5142 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5143 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5146 std::string __str__() const throw(INTERP_KERNEL::Exception)
5148 return self->simpleRepr();
5150 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5152 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5153 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5155 std::vector<MEDCouplingFieldDouble *> fs(sz);
5156 for(int i=0;i<sz;i++)
5157 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5158 return MEDCouplingMultiFields::New(fs);
5160 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5162 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5163 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5165 std::vector<MEDCouplingFieldDouble *> fs(sz);
5166 for(int i=0;i<sz;i++)
5167 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5168 return MEDCouplingMultiFields::New(fs);
5170 PyObject *getFields() const
5172 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5173 int sz=fields.size();
5174 PyObject *res = PyList_New(sz);
5175 for(int i=0;i<sz;i++)
5179 fields[i]->incrRef();
5180 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5184 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5189 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5191 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5195 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5198 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5200 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5202 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5204 PyObject *res = PyList_New(sz);
5205 for(int i=0;i<sz;i++)
5210 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5214 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5219 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5221 std::vector<int> refs;
5222 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5224 PyObject *res = PyList_New(sz);
5225 for(int i=0;i<sz;i++)
5230 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5234 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5238 PyObject *ret=PyTuple_New(2);
5239 PyTuple_SetItem(ret,0,res);
5240 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5243 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5245 std::vector<DataArrayDouble *> ms=self->getArrays();
5247 PyObject *res = PyList_New(sz);
5248 for(int i=0;i<sz;i++)
5253 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5257 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5262 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5264 std::vector< std::vector<int> > refs;
5265 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5267 PyObject *res = PyList_New(sz);
5268 PyObject *res2 = PyList_New(sz);
5269 for(int i=0;i<sz;i++)
5274 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5278 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5280 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5283 PyObject *ret=PyTuple_New(2);
5284 PyTuple_SetItem(ret,0,res);
5285 PyTuple_SetItem(ret,1,res2);
5291 class MEDCouplingFieldInt : public MEDCouplingField
5294 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5295 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5296 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5297 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5298 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5299 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5300 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5301 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5302 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5303 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5304 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5306 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5308 return MEDCouplingFieldInt::New(type,td);
5311 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5313 return MEDCouplingFieldInt::New(ft,td);
5316 std::string __str__() const throw(INTERP_KERNEL::Exception)
5318 return self->simpleRepr();
5321 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5323 std::ostringstream oss;
5324 self->reprQuickOverview(oss);
5328 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5330 return fieldT_buildSubPart(self,li);
5333 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5335 return fieldT__getitem__(self,li);
5338 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5340 DataArrayInt *ret=self->getArray();
5346 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5349 double tmp0=self->getTime(tmp1,tmp2);
5350 PyObject *res = PyList_New(3);
5351 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5352 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5353 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5359 class MEDCouplingDefinitionTime
5362 MEDCouplingDefinitionTime();
5363 void assign(const MEDCouplingDefinitionTime& other);
5364 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5365 double getTimeResolution() const;
5366 std::vector<double> getHotSpotsTime() const;
5369 std::string __str__() const throw(INTERP_KERNEL::Exception)
5371 std::ostringstream oss;
5372 self->appendRepr(oss);
5376 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5378 int meshId,arrId,arrIdInField,fieldId;
5379 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5380 PyObject *res=PyList_New(4);
5381 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5382 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5383 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5384 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5388 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5390 int meshId,arrId,arrIdInField,fieldId;
5391 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5392 PyObject *res=PyList_New(4);
5393 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5394 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5395 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5396 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5402 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5405 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5406 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5410 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5412 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5413 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5415 std::vector<MEDCouplingFieldDouble *> fs(sz);
5416 for(int i=0;i<sz;i++)
5417 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5418 return MEDCouplingFieldOverTime::New(fs);
5420 std::string __str__() const throw(INTERP_KERNEL::Exception)
5422 return self->simpleRepr();
5424 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5426 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5427 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5429 std::vector<MEDCouplingFieldDouble *> fs(sz);
5430 for(int i=0;i<sz;i++)
5431 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5432 return MEDCouplingFieldOverTime::New(fs);
5437 class MEDCouplingCartesianAMRMesh;
5439 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5442 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5443 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5444 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5447 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5449 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5457 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5460 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5461 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5462 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5465 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5467 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5468 return convertFromVectorPairInt(ret);
5471 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5473 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5474 return convertFromVectorPairInt(ret);
5477 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5479 std::vector< std::pair<int,int> > inp;
5480 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5481 self->addPatch(inp,factors);
5484 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5486 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5488 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5489 if(patchId==mesh->getNumberOfPatches())
5491 std::ostringstream oss;
5492 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5493 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5496 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5502 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5504 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5506 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5507 mesh->removePatch(patchId);
5510 int __len__() const throw(INTERP_KERNEL::Exception)
5512 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5514 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5515 return mesh->getNumberOfPatches();
5520 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5524 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5527 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5528 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5529 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5530 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5531 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5532 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5533 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5534 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5535 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5536 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5537 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5538 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5539 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5541 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5542 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5543 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5544 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5545 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5546 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5547 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5548 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5549 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5550 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5551 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5552 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5553 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5554 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5555 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5556 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5557 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5558 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5559 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5560 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5563 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5565 std::vector< std::pair<int,int> > inp;
5566 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5567 self->addPatch(inp,factors);
5570 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5572 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5574 PyObject *ret = PyList_New(sz);
5575 for(int i=0;i<sz;i++)
5577 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5580 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5585 // agy : don't know why typemap fails here ??? let it in the extend section
5586 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5588 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5591 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5593 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5594 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5600 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5602 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5603 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5609 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5611 std::vector<int> out1;
5612 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5613 PyObject *ret(PyTuple_New(2));
5614 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5615 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5619 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5621 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5623 PyObject *ret = PyList_New(sz);
5624 for(int i=0;i<sz;i++)
5625 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5629 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5631 std::vector<const DataArrayDouble *> inp;
5632 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5633 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5636 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5638 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5644 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5646 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5652 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5654 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5660 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5662 const MEDCouplingIMesh *ret(self->getImageMesh());
5665 return const_cast<MEDCouplingIMesh *>(ret);
5668 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5670 if(patchId==self->getNumberOfPatches())
5672 std::ostringstream oss;
5673 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5674 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5677 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5683 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5685 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5686 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5687 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5690 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5692 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5693 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5694 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5697 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5699 self->removePatch(patchId);
5702 int __len__() const throw(INTERP_KERNEL::Exception)
5704 return self->getNumberOfPatches();
5709 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5713 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5716 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5719 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5721 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5722 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5723 const int *nodeStrctPtr(0);
5724 const double *originPtr(0),*dxyzPtr(0);
5726 std::vector<int> bb0;
5727 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5730 std::vector<double> bb,bb2;
5732 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5733 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5735 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5738 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5740 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5741 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5742 std::vector< std::vector<int> > inp2;
5743 convertPyToVectorOfVectorOfInt(factors,inp2);
5744 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5747 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5749 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5752 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5754 return MEDCouplingCartesianAMRMesh::New(mesh);
5759 class MEDCouplingDataForGodFather : public RefCountObject
5762 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5763 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5764 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5765 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5766 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5767 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5768 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5769 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5770 virtual void alloc() throw(INTERP_KERNEL::Exception);
5771 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5774 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5776 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5784 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5787 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5788 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5789 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5790 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5791 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5792 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5793 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5794 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5795 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5798 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5800 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5801 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5802 MEDCouplingAMRAttribute *ret(0);
5805 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5806 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5808 catch(INTERP_KERNEL::Exception&)
5810 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5811 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5816 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5818 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5821 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5823 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5824 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5830 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5832 std::vector< std::vector<std::string> > compNamesCpp;
5833 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5834 self->spillInfoOnComponents(compNamesCpp);
5837 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5839 std::vector<int> inp0;
5840 if(!fillIntVector(nfs,inp0))
5841 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5842 std::size_t sz(inp0.size());
5843 std::vector<NatureOfField> inp00(sz);
5844 for(std::size_t i=0;i<sz;i++)
5845 inp00[i]=(NatureOfField)inp0[i];
5846 self->spillNatures(inp00);
5849 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5851 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5852 int sz((int)ret.size());
5853 PyObject *retPy(PyList_New(sz));
5854 for(int i=0;i<sz;i++)
5855 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5861 class DenseMatrix : public RefCountObject, public TimeLabel
5864 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5865 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5866 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5867 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5869 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5870 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5871 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5872 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5873 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5874 void transpose() throw(INTERP_KERNEL::Exception);
5876 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5877 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5878 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5881 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5883 return DenseMatrix::New(nbRows,nbCols);
5886 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5888 return DenseMatrix::New(array,nbRows,nbCols);
5891 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5894 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5895 PyObject *ret=PyTuple_New(2);
5896 PyObject *ret0Py=ret0?Py_True:Py_False;
5898 PyTuple_SetItem(ret,0,ret0Py);
5899 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5903 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5905 DataArrayDouble *ret(self->getData());
5911 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5913 return MEDCoupling::DenseMatrix::Add(self,other);
5916 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5918 return MEDCoupling::DenseMatrix::Substract(self,other);
5921 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5923 return MEDCoupling::DenseMatrix::Multiply(self,other);
5926 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5928 return MEDCoupling::DenseMatrix::Multiply(self,other);
5931 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5933 self->addEqual(other);
5934 Py_XINCREF(trueSelf);
5938 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5940 self->substractEqual(other);
5941 Py_XINCREF(trueSelf);
5945 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5947 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5957 __filename=os.environ.get('PYTHONSTARTUP')
5958 if __filename and os.path.isfile(__filename):
5959 execfile(__filename)