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"
469 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
470 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
474 namespace INTERP_KERNEL
477 * \class BoxSplittingOptions
478 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
480 class BoxSplittingOptions
483 BoxSplittingOptions();
484 void init() throw(INTERP_KERNEL::Exception);
485 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
486 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
487 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
488 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
489 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
490 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
491 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
492 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
493 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
494 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
495 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
496 std::string printOptions() const throw(INTERP_KERNEL::Exception);
499 std::string __str__() const throw(INTERP_KERNEL::Exception)
501 return self->printOptions();
507 namespace MEDCoupling
523 CONST_ON_TIME_INTERVAL = 7
524 } TypeOfTimeDiscretization;
532 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
533 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
535 } MEDCouplingMeshType;
538 class DataArrayDouble;
539 class MEDCouplingUMesh;
540 class MEDCouplingCMesh;
541 class MEDCouplingFieldDouble;
543 %extend RefCountObject
545 std::string getHiddenCppPointer() const
547 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
552 %extend MEDCouplingGaussLocalization
554 std::string __str__() const throw(INTERP_KERNEL::Exception)
556 return self->getStringRepr();
559 std::string __repr__() const throw(INTERP_KERNEL::Exception)
561 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
562 oss << self->getStringRepr();
569 class MEDCouplingMesh : public RefCountObject, public TimeLabel
572 void setName(const std::string& name);
573 std::string getName() const;
574 void setDescription(const std::string& descr);
575 std::string getDescription() const;
576 void setTime(double val, int iteration, int order);
577 void setTimeUnit(const std::string& unit);
578 std::string getTimeUnit() const;
579 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
580 bool isStructured() const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
583 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
584 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
585 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
586 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
587 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
588 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
589 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
590 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
591 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
592 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
593 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
594 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
595 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
596 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
597 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
598 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
599 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
600 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
602 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
603 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
604 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
605 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
606 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
607 virtual std::string getVTKFileExtension() const;
608 std::string getVTKFileNameOf(const std::string& fileName) const;
610 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
611 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
612 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
613 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
614 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
615 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
616 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
617 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
618 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
619 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
620 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);
621 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
622 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
623 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
624 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
625 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
626 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
627 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
630 std::string __str__() const throw(INTERP_KERNEL::Exception)
632 return self->simpleRepr();
635 PyObject *getTime() throw(INTERP_KERNEL::Exception)
638 double tmp0=self->getTime(tmp1,tmp2);
639 PyObject *res = PyList_New(3);
640 PyList_SetItem(res,0,SWIG_From_double(tmp0));
641 PyList_SetItem(res,1,SWIG_From_int(tmp1));
642 PyList_SetItem(res,2,SWIG_From_int(tmp2));
646 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
648 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
649 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
655 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
659 DataArrayDoubleTuple *aa;
660 std::vector<double> bb;
662 int spaceDim=self->getSpaceDimension();
663 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
664 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
665 return self->getCellContainingPoint(pos,eps);
668 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
672 DataArrayDoubleTuple *aa;
673 std::vector<double> bb;
675 int spaceDim=self->getSpaceDimension();
676 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
677 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
678 MCAuto<DataArrayInt> elts,eltsIndex;
679 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
680 PyObject *ret=PyTuple_New(2);
681 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
682 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
686 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
688 MCAuto<DataArrayInt> elts,eltsIndex;
689 int spaceDim=self->getSpaceDimension();
691 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
692 if (!SWIG_IsOK(res1))
695 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
696 int nbOfPoints=size/spaceDim;
699 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
701 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
705 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
707 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
708 da2->checkAllocated();
709 int size=da2->getNumberOfTuples();
710 int nbOfCompo=da2->getNumberOfComponents();
711 if(nbOfCompo!=spaceDim)
713 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
715 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
717 PyObject *ret=PyTuple_New(2);
718 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
719 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
723 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
727 DataArrayDoubleTuple *aa;
728 std::vector<double> bb;
730 int spaceDim=self->getSpaceDimension();
731 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
732 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
733 std::vector<int> elts;
734 self->getCellsContainingPoint(pos,eps,elts);
735 DataArrayInt *ret=DataArrayInt::New();
736 ret->alloc((int)elts.size(),1);
737 std::copy(elts.begin(),elts.end(),ret->getPointer());
738 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
741 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
743 MCAuto<DataArrayInt> d0=DataArrayInt::New();
744 MCAuto<DataArrayInt> d1=DataArrayInt::New();
745 self->getReverseNodalConnectivity(d0,d1);
746 PyObject *ret=PyTuple_New(2);
747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
752 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
755 int v0; std::vector<int> v1;
756 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
757 self->renumberCells(ids,check);
760 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
762 DataArrayInt *cellCor, *nodeCor;
763 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
764 PyObject *res = PyList_New(2);
765 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
766 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
770 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
772 DataArrayInt *cellCor=0,*nodeCor=0;
773 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
774 PyObject *res = PyList_New(2);
775 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
776 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
780 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
782 DataArrayInt *cellCor=0;
783 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
787 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
790 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
791 if (!SWIG_IsOK(res1))
794 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
795 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
799 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
801 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
802 da2->checkAllocated();
803 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
806 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
808 std::vector<int> conn;
809 self->getNodeIdsOfCell(cellId,conn);
810 return convertIntArrToPyList2(conn);
813 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
815 std::vector<double> coo;
816 self->getCoordinatesOfNode(nodeId,coo);
817 return convertDblArrToPyList2(coo);
820 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
824 DataArrayDoubleTuple *aa;
825 std::vector<double> bb;
827 int spaceDim=self->getSpaceDimension();
828 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
829 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
830 self->scale(pointPtr,factor);
833 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
835 int spaceDim=self->getSpaceDimension();
836 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
837 self->getBoundingBox(tmp);
838 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
842 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
845 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
846 PyObject *ret=PyTuple_New(2);
847 PyObject *ret0Py=ret0?Py_True:Py_False;
849 PyTuple_SetItem(ret,0,ret0Py);
850 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
854 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
856 int szArr,sw,iTypppArr;
857 std::vector<int> stdvecTyyppArr;
858 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
859 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
860 if(sw==3)//DataArrayInt
862 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
863 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
864 std::string name=argpt->getName();
866 ret->setName(name.c_str());
868 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
871 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
873 int szArr,sw,iTypppArr;
874 std::vector<int> stdvecTyyppArr;
876 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
877 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
878 if(sw==3)//DataArrayInt
880 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
881 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
882 std::string name=argpt->getName();
884 ret->setName(name.c_str());
887 PyObject *res = PyList_New(2);
888 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
889 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
890 PyList_SetItem(res,0,obj0);
891 PyList_SetItem(res,1,obj1);
895 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
899 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
900 PyObject *res = PyTuple_New(2);
901 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
904 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
906 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
907 PyTuple_SetItem(res,0,obj0);
908 PyTuple_SetItem(res,1,obj1);
912 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
914 std::vector<int> vals=self->getDistributionOfTypes();
916 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
917 PyObject *ret=PyList_New((int)vals.size()/3);
918 for(int j=0;j<(int)vals.size()/3;j++)
920 PyObject *ret1=PyList_New(3);
921 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
922 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
923 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
924 PyList_SetItem(ret,j,ret1);
929 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
931 std::vector<int> code;
932 std::vector<const DataArrayInt *> idsPerType;
933 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
934 convertPyToNewIntArr4(li,1,3,code);
935 return self->checkTypeConsistencyAndContig(code,idsPerType);
938 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
940 std::vector<int> code;
941 std::vector<DataArrayInt *> idsInPflPerType;
942 std::vector<DataArrayInt *> idsPerType;
943 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
944 PyObject *ret=PyTuple_New(3);
947 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
948 PyObject *ret0=PyList_New((int)code.size()/3);
949 for(int j=0;j<(int)code.size()/3;j++)
951 PyObject *ret00=PyList_New(3);
952 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
953 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
954 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
955 PyList_SetItem(ret0,j,ret00);
957 PyTuple_SetItem(ret,0,ret0);
959 PyObject *ret1=PyList_New(idsInPflPerType.size());
960 for(std::size_t j=0;j<idsInPflPerType.size();j++)
961 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
962 PyTuple_SetItem(ret,1,ret1);
963 int n=idsPerType.size();
964 PyObject *ret2=PyList_New(n);
966 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
967 PyTuple_SetItem(ret,2,ret2);
971 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
975 DataArrayDoubleTuple *aa;
976 std::vector<double> bb;
978 int spaceDim=self->getSpaceDimension();
979 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
980 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
981 self->translate(vectorPtr);
984 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
986 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
989 DataArrayDoubleTuple *aa;
990 std::vector<double> bb;
992 int spaceDim=self->getSpaceDimension();
993 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
994 self->rotate(centerPtr,0,alpha);
997 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
999 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1001 DataArrayDouble *a,*a2;
1002 DataArrayDoubleTuple *aa,*aa2;
1003 std::vector<double> bb,bb2;
1005 int spaceDim=self->getSpaceDimension();
1006 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1007 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
1008 self->rotate(centerPtr,vectorPtr,alpha);
1011 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1013 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1014 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1015 PyObject *res=PyList_New(result.size());
1016 for(int i=0;iL!=result.end(); i++, iL++)
1017 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1021 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1023 std::vector<double> a0;
1024 std::vector<int> a1;
1025 std::vector<std::string> a2;
1026 self->getTinySerializationInformation(a0,a1,a2);
1027 PyObject *ret(PyTuple_New(3));
1028 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1029 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1031 PyObject *ret2(PyList_New(sz));
1033 for(int i=0;i<sz;i++)
1034 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1036 PyTuple_SetItem(ret,2,ret2);
1040 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1042 DataArrayInt *a0Tmp(0);
1043 DataArrayDouble *a1Tmp(0);
1044 self->serialize(a0Tmp,a1Tmp);
1045 PyObject *ret(PyTuple_New(2));
1046 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1047 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1051 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1053 std::vector<std::string> littleStrings;
1054 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1057 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1058 {// put an empty dict in input to say to __new__ to call __init__...
1059 PyObject *ret(PyTuple_New(1));
1060 PyObject *ret0(PyDict_New());
1061 PyTuple_SetItem(ret,0,ret0);
1065 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1067 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1068 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1069 PyObject *ret(PyTuple_New(2));
1070 PyTuple_SetItem(ret,0,ret0);
1071 PyTuple_SetItem(ret,1,ret1);
1075 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1077 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1078 if(!PyTuple_Check(inp))
1079 throw INTERP_KERNEL::Exception(MSG);
1080 int sz(PyTuple_Size(inp));
1082 throw INTERP_KERNEL::Exception(MSG);
1083 PyObject *elt0(PyTuple_GetItem(inp,0));
1084 PyObject *elt1(PyTuple_GetItem(inp,1));
1085 std::vector<double> a0;
1086 std::vector<int> a1;
1087 std::vector<std::string> a2;
1088 DataArrayInt *b0(0);
1089 DataArrayDouble *b1(0);
1091 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1092 throw INTERP_KERNEL::Exception(MSG);
1093 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1095 fillArrayWithPyListDbl3(a0py,tmp,a0);
1096 convertPyToNewIntArr3(a1py,a1);
1097 fillStringVector(a2py,a2);
1100 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1101 throw INTERP_KERNEL::Exception(MSG);
1102 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1104 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1105 if(!SWIG_IsOK(status))
1106 throw INTERP_KERNEL::Exception(MSG);
1107 b0=reinterpret_cast<DataArrayInt *>(argp);
1108 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1109 if(!SWIG_IsOK(status))
1110 throw INTERP_KERNEL::Exception(MSG);
1111 b1=reinterpret_cast<DataArrayDouble *>(argp);
1113 // useless here to call resizeForUnserialization because arrays are well resized.
1114 self->unserialization(a0,a1,b0,b1,a2);
1117 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1119 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1120 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1121 return MEDCouplingMesh::MergeMeshes(tmp);
1127 //== MEDCouplingMesh End
1129 %include "NormalizedGeometricTypes"
1130 %include "MEDCouplingNatureOfFieldEnum"
1132 namespace MEDCoupling
1134 class MEDCouplingNatureOfField
1137 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1138 static std::string GetReprNoThrow(NatureOfField nat);
1139 static std::string GetAllPossibilitiesStr();
1143 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1144 // include "MEDCouplingTimeDiscretization.i"
1146 namespace MEDCoupling
1148 class MEDCouplingGaussLocalization
1151 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1152 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1153 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1154 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1155 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1156 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1157 int getDimension() const throw(INTERP_KERNEL::Exception);
1158 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1159 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1160 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1161 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1163 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1164 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1165 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1166 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1167 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1168 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1169 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1170 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1171 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1172 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1173 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1174 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1176 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1180 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1182 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1186 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1188 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1194 class MEDCouplingSkyLineArray
1197 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1199 void set( DataArrayInt* index, DataArrayInt* value );
1200 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1202 int getSuperNumberOf() const;
1203 int getNumberOf() const;
1204 int getLength() const;
1206 DataArrayInt* getSuperIndexArray() const;
1207 DataArrayInt* getIndexArray() const;
1208 DataArrayInt* getValuesArray() const;
1210 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1214 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1216 return MEDCouplingSkyLineArray::New();
1219 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1221 return MEDCouplingSkyLineArray::New(index, value);
1224 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1226 return MEDCouplingSkyLineArray::New(index, value);
1229 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1231 return MEDCouplingSkyLineArray::New(other);
1234 std::string __str__() const throw(INTERP_KERNEL::Exception)
1236 return self->simpleRepr();
1239 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1241 std::vector<int> ret;
1242 self->getSimplePackSafe(absolutePackId,ret);
1243 return convertIntArrToPyList2(ret);
1246 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1248 std::vector<int> vpack, vspIdx, out;
1250 convertPyToNewIntArr3(superPackIndices,vspIdx);
1251 convertPyToNewIntArr3(pack,vpack);
1253 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1254 return convertIntArrToPyList2(out);
1257 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1259 std::vector<int> vpack;
1260 convertPyToNewIntArr3(pack,vpack);
1261 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1264 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1266 std::vector<int> vpack;
1267 convertPyToNewIntArr3(pack,vpack);
1268 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1271 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1273 std::vector<int> vpack;
1274 convertPyToNewIntArr3(pack,vpack);
1275 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1278 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1280 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1281 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1282 self->convertToPolyhedronConn(d0,d1);
1283 PyObject *ret=PyTuple_New(2);
1284 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1285 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1292 %include "MEDCouplingFieldDiscretization.i"
1294 //== MEDCouplingPointSet
1296 namespace MEDCoupling
1298 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1301 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1302 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1303 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1304 void zipCoords() throw(INTERP_KERNEL::Exception);
1305 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1306 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1307 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1308 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1309 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1310 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1311 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1312 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1313 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1314 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1315 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1316 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1317 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1318 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1319 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1320 virtual DataArrayInt *findBoundaryNodes() const;
1321 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1322 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1323 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1324 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1325 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1326 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1327 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1328 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1329 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1332 std::string __str__() const throw(INTERP_KERNEL::Exception)
1334 return self->simpleRepr();
1337 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1340 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1341 PyObject *res = PyList_New(2);
1342 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1343 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1347 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1349 DataArrayInt *comm, *commIndex;
1350 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1351 PyObject *res = PyList_New(2);
1352 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1353 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1357 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1359 DataArrayDouble *ret1=self->getCoords();
1362 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1365 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1367 int szArr,sw,iTypppArr;
1368 std::vector<int> stdvecTyyppArr;
1369 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1370 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1371 if(sw==3)//DataArrayInt
1373 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1374 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1375 std::string name=argpt->getName();
1377 ret->setName(name.c_str());
1379 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1382 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1384 int szArr,sw,iTypppArr;
1385 std::vector<int> stdvecTyyppArr;
1386 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1387 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1388 if(sw==3)//DataArrayInt
1390 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1391 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1392 std::string name=argpt->getName();
1394 ret->setName(name.c_str());
1396 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1399 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1401 int szArr,sw,iTypppArr;
1402 std::vector<int> stdvecTyyppArr;
1403 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1404 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1405 if(sw==3)//DataArrayInt
1407 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1408 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1409 std::string name=argpt->getName();
1411 ret->setName(name.c_str());
1413 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1416 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1418 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1419 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1422 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1424 int szArr,sw,iTypppArr;
1425 std::vector<int> stdvecTyyppArr;
1426 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1427 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1428 if(sw==3)//DataArrayInt
1430 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1431 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1432 std::string name=argpt->getName();
1434 ret->setName(name.c_str());
1436 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1439 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1441 int szArr,sw,iTypppArr;
1442 std::vector<int> stdvecTyyppArr;
1443 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1444 self->renumberNodes(tmp,newNbOfNodes);
1447 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1449 int szArr,sw,iTypppArr;
1450 std::vector<int> stdvecTyyppArr;
1451 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1452 self->renumberNodesCenter(tmp,newNbOfNodes);
1455 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1457 int spaceDim=self->getSpaceDimension();
1459 DataArrayDouble *a,*a2;
1460 DataArrayDoubleTuple *aa,*aa2;
1461 std::vector<double> bb,bb2;
1463 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1464 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1465 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1466 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1467 std::vector<int> nodes;
1468 self->findNodesOnLine(p,v,eps,nodes);
1469 DataArrayInt *ret=DataArrayInt::New();
1470 ret->alloc((int)nodes.size(),1);
1471 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1472 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1474 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1476 int spaceDim=self->getSpaceDimension();
1478 DataArrayDouble *a,*a2;
1479 DataArrayDoubleTuple *aa,*aa2;
1480 std::vector<double> bb,bb2;
1482 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1483 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1484 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1485 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1486 std::vector<int> nodes;
1487 self->findNodesOnPlane(p,v,eps,nodes);
1488 DataArrayInt *ret=DataArrayInt::New();
1489 ret->alloc((int)nodes.size(),1);
1490 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1491 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1494 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1498 DataArrayDoubleTuple *aa;
1499 std::vector<double> bb;
1501 int spaceDim=self->getSpaceDimension();
1502 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1503 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1504 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1505 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1508 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1510 DataArrayInt *c=0,*cI=0;
1514 DataArrayDoubleTuple *aa;
1515 std::vector<double> bb;
1517 int spaceDim=self->getSpaceDimension();
1518 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1519 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1520 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1521 PyObject *ret=PyTuple_New(2);
1522 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1523 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1527 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1529 DataArrayInt *c=0,*cI=0;
1530 int spaceDim=self->getSpaceDimension();
1533 DataArrayDoubleTuple *aa;
1534 std::vector<double> bb;
1537 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1538 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1540 PyObject *ret=PyTuple_New(2);
1541 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1542 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1546 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1550 DataArrayDoubleTuple *aa;
1551 std::vector<double> bb;
1553 int spaceDim=self->getSpaceDimension();
1554 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1555 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1557 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1558 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1561 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1565 std::vector<int> multiVal;
1566 std::pair<int, std::pair<int,int> > slic;
1567 MEDCoupling::DataArrayInt *daIntTyypp=0;
1568 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1572 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1574 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1576 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1578 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1582 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1584 DataArrayInt *v0=0,*v1=0;
1585 self->findCommonCells(compType,startCellId,v0,v1);
1586 PyObject *res = PyList_New(2);
1587 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1588 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1596 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1597 if (!SWIG_IsOK(res1))
1600 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1601 self->renumberNodesInConn(tmp);
1605 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1607 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1608 da2->checkAllocated();
1609 self->renumberNodesInConn(da2->getConstPointer());
1613 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1616 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1617 PyObject *ret=PyTuple_New(2);
1618 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1619 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1623 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1625 DataArrayInt *ret=0;
1627 int szArr,sw,iTypppArr;
1628 std::vector<int> stdvecTyyppArr;
1629 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1630 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1634 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1638 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1639 PyObject *res = PyList_New(3);
1640 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1641 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1642 PyList_SetItem(res,2,SWIG_From_int(ret2));
1646 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1650 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1651 PyObject *res = PyList_New(3);
1652 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1653 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1654 PyList_SetItem(res,2,SWIG_From_int(ret2));
1658 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1661 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1662 if (!SWIG_IsOK(res1))
1665 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1666 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1670 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1672 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1673 da2->checkAllocated();
1674 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1678 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1682 std::vector<int> multiVal;
1683 std::pair<int, std::pair<int,int> > slic;
1684 MEDCoupling::DataArrayInt *daIntTyypp=0;
1685 int nbc=self->getNumberOfCells();
1686 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1693 std::ostringstream oss;
1694 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1695 throw INTERP_KERNEL::Exception(oss.str().c_str());
1698 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1703 int tmp=nbc+singleVal;
1704 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1708 std::ostringstream oss;
1709 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1710 throw INTERP_KERNEL::Exception(oss.str().c_str());
1716 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1720 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1725 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1726 daIntTyypp->checkAllocated();
1727 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1730 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1734 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1737 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1738 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1739 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1740 for(int i=0;i<sz;i++)
1741 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1744 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1747 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1749 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1750 std::vector<double> val3;
1751 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1752 "Rotate2DAlg",2,true,nbNodes);
1754 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1755 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1758 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1761 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1762 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1763 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1764 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1765 for(int i=0;i<sz;i++)
1766 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1769 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1772 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1774 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1775 std::vector<double> val3;
1776 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1777 "Rotate3DAlg",3,true,nbNodes);
1779 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1780 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1781 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1786 //== MEDCouplingPointSet End
1788 class MEDCouplingUMeshCell
1791 INTERP_KERNEL::NormalizedCellType getType() const;
1794 std::string __str__() const throw(INTERP_KERNEL::Exception)
1796 return self->repr();
1799 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1802 const int *r=self->getAllConn(ret2);
1803 PyObject *ret=PyTuple_New(ret2);
1804 for(int i=0;i<ret2;i++)
1805 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1811 class MEDCouplingUMeshCellIterator
1818 MEDCouplingUMeshCell *ret=self->nextt();
1820 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1823 PyErr_SetString(PyExc_StopIteration,"No more data.");
1830 class MEDCouplingUMeshCellByTypeIterator
1833 ~MEDCouplingUMeshCellByTypeIterator();
1838 MEDCouplingUMeshCellEntry *ret=self->nextt();
1840 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1843 PyErr_SetString(PyExc_StopIteration,"No more data.");
1850 class MEDCouplingUMeshCellByTypeEntry
1853 ~MEDCouplingUMeshCellByTypeEntry();
1856 MEDCouplingUMeshCellByTypeIterator *__iter__()
1858 return self->iterator();
1863 class MEDCouplingUMeshCellEntry
1866 INTERP_KERNEL::NormalizedCellType getType() const;
1867 int getNumberOfElems() const;
1870 MEDCouplingUMeshCellIterator *__iter__()
1872 return self->iterator();
1877 //== MEDCouplingUMesh
1879 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1882 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1883 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1884 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1885 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1886 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1887 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1888 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1889 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1890 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1891 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1892 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1893 void computeTypes() throw(INTERP_KERNEL::Exception);
1894 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1895 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1897 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1898 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1899 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1900 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1901 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1902 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1903 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1904 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1905 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1906 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1907 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1908 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1909 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1910 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1911 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1912 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1913 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1914 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1915 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1916 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1917 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1918 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1919 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1920 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1921 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1922 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1923 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1924 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1925 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1926 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1927 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1928 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1929 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1930 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1931 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1932 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1933 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1934 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1935 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1936 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1937 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1938 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1939 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1940 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1941 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1942 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1943 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);
1944 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1945 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1946 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1947 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1948 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1950 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1952 return MEDCouplingUMesh::New();
1955 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1957 return MEDCouplingUMesh::New(meshName,meshDim);
1961 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1963 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1966 std::string __str__() const throw(INTERP_KERNEL::Exception)
1968 return self->simpleRepr();
1971 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1973 std::ostringstream oss;
1974 self->reprQuickOverview(oss);
1978 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1980 return self->cellIterator();
1983 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1985 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
1989 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1991 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1992 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1993 PyObject *res=PyList_New(result.size());
1994 for(int i=0;iL!=result.end(); i++, iL++)
1995 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1999 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2003 std::vector<int> multiVal;
2004 std::pair<int, std::pair<int,int> > slic;
2005 MEDCoupling::DataArrayInt *daIntTyypp=0;
2006 int nbc=self->getNumberOfCells();
2007 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2014 std::ostringstream oss;
2015 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2016 throw INTERP_KERNEL::Exception(oss.str().c_str());
2020 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2027 int tmp=nbc+singleVal;
2028 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2033 std::ostringstream oss;
2034 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2035 throw INTERP_KERNEL::Exception(oss.str().c_str());
2041 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2047 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2048 daIntTyypp->checkAllocated();
2049 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2053 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2057 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2061 std::vector<int> multiVal;
2062 std::pair<int, std::pair<int,int> > slic;
2063 MEDCoupling::DataArrayInt *daIntTyypp=0;
2064 int nbc=self->getNumberOfCells();
2065 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2072 std::ostringstream oss;
2073 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2074 throw INTERP_KERNEL::Exception(oss.str().c_str());
2078 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2085 int tmp=nbc+singleVal;
2086 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2091 std::ostringstream oss;
2092 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2093 throw INTERP_KERNEL::Exception(oss.str().c_str());
2099 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2104 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2110 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2111 daIntTyypp->checkAllocated();
2112 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2116 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2120 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2122 int szArr,sw,iTypppArr;
2123 std::vector<int> stdvecTyyppArr;
2124 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2127 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2128 throw INTERP_KERNEL::Exception(oss.str().c_str());
2130 self->insertNextCell(type,size,tmp);
2133 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2135 int szArr,sw,iTypppArr;
2136 std::vector<int> stdvecTyyppArr;
2137 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2138 self->insertNextCell(type,szArr,tmp);
2141 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2143 DataArrayInt *ret=self->getNodalConnectivity();
2148 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2150 DataArrayInt *ret=self->getNodalConnectivityIndex();
2156 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2158 int szArr,sw,iTypppArr;
2159 std::vector<int> stdvecTyyppArr;
2160 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2161 int nbOfDepthPeelingPerformed=0;
2162 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2163 PyObject *res=PyTuple_New(2);
2164 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2169 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2171 DataArrayInt *v0=0,*v1=0;
2172 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2173 PyObject *res = PyList_New(2);
2174 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2179 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2183 DataArrayDoubleTuple *aa;
2184 std::vector<double> bb;
2186 int nbOfCompo=self->getSpaceDimension();
2187 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2190 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2191 PyObject *ret=PyTuple_New(2);
2192 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2193 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2197 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2199 DataArrayInt *ret1=0;
2200 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2201 PyObject *ret=PyTuple_New(2);
2202 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2203 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2210 DataArrayInt *ret1(0);
2211 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2212 PyObject *ret=PyTuple_New(3);
2213 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2215 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2219 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2221 std::vector<int> cells;
2222 self->checkButterflyCells(cells,eps);
2223 DataArrayInt *ret=DataArrayInt::New();
2224 ret->alloc((int)cells.size(),1);
2225 std::copy(cells.begin(),cells.end(),ret->getPointer());
2226 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2229 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2231 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2233 PyObject *ret = PyList_New(sz);
2234 for(int i=0;i<sz;i++)
2235 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2239 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2241 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2242 int sz=retCpp.size();
2243 PyObject *ret=PyList_New(sz);
2244 for(int i=0;i<sz;i++)
2245 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2249 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2251 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2252 int sz=retCpp.size();
2253 PyObject *ret=PyList_New(sz);
2254 for(int i=0;i<sz;i++)
2255 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2262 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2263 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2264 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2267 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2270 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2271 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2275 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2278 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2279 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2283 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2285 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2286 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2287 PyObject *ret=PyTuple_New(3);
2288 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2289 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2290 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2294 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2296 DataArrayInt *tmp0=0,*tmp1=0;
2297 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2298 PyObject *ret=PyTuple_New(2);
2299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2300 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2304 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2308 std::vector<int> multiVal;
2309 std::pair<int, std::pair<int,int> > slic;
2310 MEDCoupling::DataArrayInt *daIntTyypp=0;
2311 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2315 return self->duplicateNodes(&singleVal,&singleVal+1);
2317 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2319 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2321 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2325 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2329 std::vector<int> multiVal;
2330 std::pair<int, std::pair<int,int> > slic;
2331 MEDCoupling::DataArrayInt *daIntTyypp=0;
2332 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2336 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2338 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2340 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2342 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2346 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2349 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2350 DataArrayInt *tmp0,*tmp1=0;
2351 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2352 PyObject *ret=PyTuple_New(2);
2353 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2360 DataArrayInt *ret0=0,*ret1=0;
2361 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2362 PyObject *ret=PyTuple_New(2);
2363 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2364 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2368 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2370 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2371 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2372 DataArrayInt *ret1=0,*ret2=0;
2373 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2374 PyObject *ret=PyTuple_New(3);
2375 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2381 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2383 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2384 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2385 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2386 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2389 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2392 std::vector<const MEDCouplingUMesh *> meshes;
2393 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2394 std::vector<DataArrayInt *> corr;
2395 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2397 PyObject *ret1=PyList_New(sz);
2398 for(int i=0;i<sz;i++)
2399 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 PyObject *ret=PyList_New(2);
2401 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2402 PyList_SetItem(ret,1,ret1);
2406 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2408 std::vector<MEDCouplingUMesh *> meshes;
2409 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2410 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2413 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2415 std::vector<MEDCouplingUMesh *> meshes;
2416 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2417 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2420 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2424 std::vector<int> multiVal;
2425 std::pair<int, std::pair<int,int> > slic;
2426 MEDCoupling::DataArrayInt *daIntTyypp=0;
2428 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2429 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2433 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2435 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2437 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2439 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2443 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2445 DataArrayInt *arrOut=0,*arrIndexOut=0;
2448 std::vector<int> multiVal;
2449 std::pair<int, std::pair<int,int> > slic;
2450 MEDCoupling::DataArrayInt *daIntTyypp=0;
2452 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2453 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2458 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2463 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2468 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2472 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2474 PyObject *ret=PyTuple_New(2);
2475 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2480 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2482 DataArrayInt *arrOut=0,*arrIndexOut=0;
2483 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2484 PyObject *ret=PyTuple_New(2);
2485 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2490 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2492 if(!PySlice_Check(slic))
2493 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2494 Py_ssize_t strt=2,stp=2,step=2;
2495 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2497 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2498 arrIndxIn->checkAllocated();
2499 if(arrIndxIn->getNumberOfComponents()!=1)
2500 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2501 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2502 DataArrayInt *arrOut=0,*arrIndexOut=0;
2503 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2504 PyObject *ret=PyTuple_New(2);
2505 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2510 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2511 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2512 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2514 DataArrayInt *arrOut=0,*arrIndexOut=0;
2517 std::vector<int> multiVal;
2518 std::pair<int, std::pair<int,int> > slic;
2519 MEDCoupling::DataArrayInt *daIntTyypp=0;
2521 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2522 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2527 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2532 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2537 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2541 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2543 PyObject *ret=PyTuple_New(2);
2544 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2549 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2550 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2554 std::vector<int> multiVal;
2555 std::pair<int, std::pair<int,int> > slic;
2556 MEDCoupling::DataArrayInt *daIntTyypp=0;
2558 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2559 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2564 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2569 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2574 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2578 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2582 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2586 DataArrayDoubleTuple *aa;
2587 std::vector<double> bb;
2589 int spaceDim=self->getSpaceDimension();
2590 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2591 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2593 std::vector<int> cells;
2594 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2595 DataArrayInt *ret=DataArrayInt::New();
2596 ret->alloc((int)cells.size(),1);
2597 std::copy(cells.begin(),cells.end(),ret->getPointer());
2598 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2601 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2605 DataArrayDoubleTuple *aa;
2606 std::vector<double> bb;
2608 int spaceDim=self->getSpaceDimension();
2609 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2610 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2611 self->orientCorrectly2DCells(v,polyOnly);
2614 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2616 std::vector<int> cells;
2617 self->arePolyhedronsNotCorrectlyOriented(cells);
2618 DataArrayInt *ret=DataArrayInt::New();
2619 ret->alloc((int)cells.size(),1);
2620 std::copy(cells.begin(),cells.end(),ret->getPointer());
2621 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2624 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2628 self->getFastAveragePlaneOfThis(vec,pos);
2630 std::copy(vec,vec+3,vals);
2631 std::copy(pos,pos+3,vals+3);
2632 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2635 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2637 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2638 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2639 return MEDCouplingUMesh::MergeUMeshes(tmp);
2642 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2645 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2646 PyObject *ret=PyTuple_New(2);
2647 PyObject *ret0Py=ret0?Py_True:Py_False;
2649 PyTuple_SetItem(ret,0,ret0Py);
2650 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2654 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2657 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2658 PyObject *ret=PyTuple_New(2);
2659 PyObject *ret0Py=ret0?Py_True:Py_False;
2661 PyTuple_SetItem(ret,0,ret0Py);
2662 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2666 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2668 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2669 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2670 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2671 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2672 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2673 PyObject *ret=PyTuple_New(5);
2674 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2676 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2678 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2682 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2684 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2685 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2686 PyObject *ret=PyTuple_New(5);
2687 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2691 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2695 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2697 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2698 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2699 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2700 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2701 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2702 PyObject *ret=PyTuple_New(5);
2703 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2704 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2705 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2707 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2713 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2714 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2715 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2716 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2717 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2718 PyObject *ret=PyTuple_New(5);
2719 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2720 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2721 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2722 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2723 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2727 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2729 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2730 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2731 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2732 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2733 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2734 PyObject *ret=PyTuple_New(5);
2735 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2736 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2737 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2739 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2743 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2745 DataArrayInt *neighbors=0,*neighborsIdx=0;
2746 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2747 PyObject *ret=PyTuple_New(2);
2748 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2755 DataArrayInt *neighbors=0,*neighborsIdx=0;
2756 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2757 PyObject *ret=PyTuple_New(2);
2758 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2759 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2763 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2765 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2766 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2767 PyObject *ret=PyTuple_New(2);
2768 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2769 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2773 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2775 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2776 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2777 PyObject *ret=PyTuple_New(2);
2778 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2779 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2783 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2785 DataArrayInt *neighbors=0,*neighborsIdx=0;
2786 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2787 PyObject *ret=PyTuple_New(2);
2788 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2789 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2793 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2795 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2796 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2797 DataArrayInt *d2,*d3,*d4,*dd5;
2798 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2799 PyObject *ret=PyTuple_New(7);
2800 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2801 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2802 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2803 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2805 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2806 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2810 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2813 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2814 da->checkAllocated();
2815 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2818 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2821 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2822 da->checkAllocated();
2823 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2826 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2829 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2830 da->checkAllocated();
2831 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2834 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2837 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2838 da->checkAllocated();
2839 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2840 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2841 PyObject *res = PyList_New(result.size());
2842 for (int i=0;iL!=result.end(); i++, iL++)
2843 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2847 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2850 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2851 da->checkAllocated();
2852 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2853 ret->setName(da->getName().c_str());
2857 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2859 DataArrayInt *cellNb1=0,*cellNb2=0;
2860 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2861 PyObject *ret=PyTuple_New(3);
2862 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2863 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2864 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2868 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2870 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2871 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2872 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2873 PyObject *ret(PyTuple_New(4));
2874 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2875 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2876 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2877 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2881 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2883 int spaceDim=self->getSpaceDimension();
2885 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2887 DataArrayDouble *a,*a2;
2888 DataArrayDoubleTuple *aa,*aa2;
2889 std::vector<double> bb,bb2;
2891 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2892 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2893 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2894 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2896 DataArrayInt *cellIds=0;
2897 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2898 PyObject *ret=PyTuple_New(2);
2899 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2900 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2904 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2906 int spaceDim=self->getSpaceDimension();
2908 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2910 DataArrayDouble *a,*a2;
2911 DataArrayDoubleTuple *aa,*aa2;
2912 std::vector<double> bb,bb2;
2914 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2915 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2916 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2917 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2919 DataArrayInt *cellIds=0;
2920 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2921 PyObject *ret=PyTuple_New(2);
2922 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2923 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2927 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2930 DataArrayDouble *a,*a2;
2931 DataArrayDoubleTuple *aa,*aa2;
2932 std::vector<double> bb,bb2;
2934 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2935 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2936 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2937 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2938 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2942 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2944 int spaceDim=self->getSpaceDimension();
2946 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2948 DataArrayDouble *a,*a2;
2949 DataArrayDoubleTuple *aa,*aa2;
2950 std::vector<double> bb,bb2;
2952 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2953 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2954 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2955 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2956 return self->getCellIdsCrossingPlane(orig,vect,eps);
2959 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2963 std::vector<int> pos2;
2964 DataArrayInt *pos3=0;
2965 DataArrayIntTuple *pos4=0;
2966 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2971 self->convertToPolyTypes(&pos1,&pos1+1);
2978 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2983 self->convertToPolyTypes(pos3->begin(),pos3->end());
2987 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2991 void convertAllToPoly();
2992 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2993 bool unPolyze() throw(INTERP_KERNEL::Exception);
2994 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2995 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2996 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2999 //== MEDCouplingUMesh End
3001 //== MEDCouplingMappedExtrudedMesh
3003 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3006 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3007 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3008 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3009 int get2DCellIdForExtrusion() const;
3011 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3013 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3016 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3018 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3021 MEDCouplingMappedExtrudedMesh()
3023 return MEDCouplingMappedExtrudedMesh::New();
3026 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3028 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3031 std::string __str__() const throw(INTERP_KERNEL::Exception)
3033 return self->simpleRepr();
3036 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3038 std::ostringstream oss;
3039 self->reprQuickOverview(oss);
3043 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3045 MEDCouplingUMesh *ret=self->getMesh2D();
3048 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3050 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3052 MEDCouplingUMesh *ret=self->getMesh1D();
3055 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3057 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3059 DataArrayInt *ret=self->getMesh3DIds();
3062 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3067 //== MEDCouplingMappedExtrudedMesh End
3069 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3072 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3073 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3074 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3075 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3076 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3077 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3080 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3082 int szArr,sw,iTypppArr;
3083 std::vector<int> stdvecTyyppArr;
3084 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3085 self->insertNextCell(tmp,tmp+szArr);
3088 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3090 DataArrayInt *ret=self->getNodalConnectivity();
3091 if(ret) ret->incrRef();
3095 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3097 std::vector< const MEDCoupling1GTUMesh *> parts;
3098 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3099 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3104 //== MEDCoupling1SGTUMesh
3106 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3109 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3110 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3111 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3112 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3113 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3114 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3115 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3116 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3117 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3120 MEDCoupling1SGTUMesh()
3122 return MEDCoupling1SGTUMesh::New();
3125 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3127 return MEDCoupling1SGTUMesh::New(name,type);
3130 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3132 return MEDCoupling1SGTUMesh::New(m);
3135 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3137 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3140 std::string __str__() const throw(INTERP_KERNEL::Exception)
3142 return self->simpleRepr();
3145 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3147 std::ostringstream oss;
3148 self->reprQuickOverview(oss);
3152 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3154 DataArrayInt *cellPerm(0),*nodePerm(0);
3155 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3156 PyObject *ret(PyTuple_New(3));
3157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3159 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3163 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3165 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3166 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3167 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3170 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3172 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3173 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3174 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3179 //== MEDCoupling1SGTUMesh End
3181 //== MEDCoupling1DGTUMesh
3183 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3186 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3187 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3188 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3189 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3190 bool isPacked() const throw(INTERP_KERNEL::Exception);
3193 MEDCoupling1DGTUMesh()
3195 return MEDCoupling1DGTUMesh::New();
3197 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3199 return MEDCoupling1DGTUMesh::New(name,type);
3202 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3204 return MEDCoupling1DGTUMesh::New(m);
3207 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3209 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3212 std::string __str__() const throw(INTERP_KERNEL::Exception)
3214 return self->simpleRepr();
3217 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3219 std::ostringstream oss;
3220 self->reprQuickOverview(oss);
3224 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3226 DataArrayInt *ret=self->getNodalConnectivityIndex();
3227 if(ret) ret->incrRef();
3231 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3233 DataArrayInt *ret1=0,*ret2=0;
3234 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3235 PyObject *ret0Py=ret0?Py_True:Py_False;
3237 PyObject *ret=PyTuple_New(3);
3238 PyTuple_SetItem(ret,0,ret0Py);
3239 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3240 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3244 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3247 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3248 PyObject *ret=PyTuple_New(2);
3249 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3250 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3251 PyTuple_SetItem(ret,1,ret1Py);
3255 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3257 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3258 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3259 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3262 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3264 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3265 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3266 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3269 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3271 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3272 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3273 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3278 //== MEDCoupling1DGTUMeshEnd
3280 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3283 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3284 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3285 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3286 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3287 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3288 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3289 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3290 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3291 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3292 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3293 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3294 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3295 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3296 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3297 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3300 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3302 int tmpp1=-1,tmpp2=-1;
3303 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3304 std::vector< std::pair<int,int> > inp;
3308 for(int i=0;i<tmpp1;i++)
3309 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3314 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3315 inp.resize(tmpp1/2);
3316 for(int i=0;i<tmpp1/2;i++)
3317 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3320 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3321 return self->buildStructuredSubPart(inp);
3324 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3326 std::vector< std::pair<int,int> > inp;
3327 convertPyToVectorPairInt(part,inp);
3329 int szArr,sw,iTypppArr;
3330 std::vector<int> stdvecTyyppArr;
3331 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3332 std::vector<int> tmp5(tmp4,tmp4+szArr);
3334 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3337 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3339 std::vector< std::pair<int,int> > inp;
3340 convertPyToVectorPairInt(part,inp);
3341 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3344 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3346 std::vector< std::pair<int,int> > inp;
3347 convertPyToVectorPairInt(part,inp);
3348 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3351 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3353 std::vector< std::pair<int,int> > inp;
3354 convertPyToVectorPairInt(part,inp);
3355 std::vector<int> stWithGhost;
3356 std::vector< std::pair<int,int> > partWithGhost;
3357 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3358 PyObject *ret(PyTuple_New(2));
3359 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3360 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3364 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3366 std::vector< std::pair<int,int> > inp;
3367 convertPyToVectorPairInt(partCompactFormat,inp);
3368 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3371 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3373 std::vector< std::pair<int,int> > inp;
3374 convertPyToVectorPairInt(partCompactFormat,inp);
3375 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3378 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3380 std::vector< std::pair<int,int> > inp;
3381 convertPyToVectorPairInt(part,inp);
3382 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3385 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3387 int szArr,sw,iTypppArr;
3388 std::vector<int> stdvecTyyppArr;
3389 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3390 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3393 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3395 int szArr,sw,iTypppArr;
3396 std::vector<int> stdvecTyyppArr;
3397 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3398 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3401 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3403 std::vector< std::pair<int,int> > inp;
3404 convertPyToVectorPairInt(partCompactFormat,inp);
3405 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3408 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3410 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3411 PyObject *retPy=PyList_New(ret.size());
3412 for(std::size_t i=0;i<ret.size();i++)
3414 PyObject *tmp=PyTuple_New(2);
3415 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3416 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3417 PyList_SetItem(retPy,i,tmp);
3422 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3424 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3425 convertPyToVectorPairInt(r1,r1Cpp);
3426 convertPyToVectorPairInt(r2,r2Cpp);
3427 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3428 PyObject *retPy=PyList_New(ret.size());
3429 for(std::size_t i=0;i<ret.size();i++)
3431 PyObject *tmp=PyTuple_New(2);
3432 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3433 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3434 PyList_SetItem(retPy,i,tmp);
3439 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3441 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3442 convertPyToVectorPairInt(r1,r1Cpp);
3443 convertPyToVectorPairInt(r2,r2Cpp);
3444 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3447 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3449 int szArr,sw,iTypppArr;
3450 std::vector<int> stdvecTyyppArr;
3451 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3452 int szArr2,sw2,iTypppArr2;
3453 std::vector<int> stdvecTyyppArr2;
3454 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3455 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3456 std::vector< std::pair<int,int> > partCompactFormat;
3457 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3458 PyObject *ret=PyTuple_New(2);
3459 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3460 PyTuple_SetItem(ret,0,ret0Py);
3461 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3462 for(std::size_t i=0;i<partCompactFormat.size();i++)
3464 PyObject *tmp4=PyTuple_New(2);
3465 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3466 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3467 PyList_SetItem(ret1Py,i,tmp4);
3469 PyTuple_SetItem(ret,1,ret1Py);
3473 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3475 std::vector< std::pair<int,int> > param0,param1,ret;
3476 convertPyToVectorPairInt(bigInAbs,param0);
3477 convertPyToVectorPairInt(partOfBigInAbs,param1);
3478 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3479 PyObject *retPy(PyList_New(ret.size()));
3480 for(std::size_t i=0;i<ret.size();i++)
3482 PyObject *tmp(PyTuple_New(2));
3483 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3484 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3485 PyList_SetItem(retPy,i,tmp);
3490 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3492 std::vector< std::pair<int,int> > param0;
3493 convertPyToVectorPairInt(part,param0);
3494 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3495 PyObject *retPy(PyList_New(ret.size()));
3496 for(std::size_t i=0;i<ret.size();i++)
3498 PyObject *tmp(PyTuple_New(2));
3499 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3500 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3501 PyList_SetItem(retPy,i,tmp);
3506 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3508 std::vector< std::pair<int,int> > param0,param1;
3509 convertPyToVectorPairInt(startingFrom,param0);
3510 convertPyToVectorPairInt(goingTo,param1);
3511 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3514 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3516 std::vector< std::pair<int,int> > param0,param1,ret;
3517 convertPyToVectorPairInt(bigInAbs,param0);
3518 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3519 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3520 PyObject *retPy(PyList_New(ret.size()));
3521 for(std::size_t i=0;i<ret.size();i++)
3523 PyObject *tmp(PyTuple_New(2));
3524 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3525 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3526 PyList_SetItem(retPy,i,tmp);
3533 class MEDCouplingCurveLinearMesh;
3535 //== MEDCouplingCMesh
3537 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3540 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3541 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3542 void setCoords(const DataArrayDouble *coordsX,
3543 const DataArrayDouble *coordsY=0,
3544 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3545 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3546 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3548 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3550 return MEDCouplingCMesh::New();
3552 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3554 return MEDCouplingCMesh::New(meshName);
3557 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3559 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3561 std::string __str__() const throw(INTERP_KERNEL::Exception)
3563 return self->simpleRepr();
3565 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3567 std::ostringstream oss;
3568 self->reprQuickOverview(oss);
3571 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3573 DataArrayDouble *ret=self->getCoordsAt(i);
3581 //== MEDCouplingCMesh End
3583 //== MEDCouplingCurveLinearMesh
3585 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3588 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3589 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3590 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3592 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3594 return MEDCouplingCurveLinearMesh::New();
3596 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3598 return MEDCouplingCurveLinearMesh::New(meshName);
3600 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3602 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3604 std::string __str__() const throw(INTERP_KERNEL::Exception)
3606 return self->simpleRepr();
3608 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3610 std::ostringstream oss;
3611 self->reprQuickOverview(oss);
3614 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3616 DataArrayDouble *ret=self->getCoords();
3621 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3623 int szArr,sw,iTypppArr;
3624 std::vector<int> stdvecTyyppArr;
3625 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3626 self->setNodeGridStructure(tmp,tmp+szArr);
3631 //== MEDCouplingCurveLinearMesh End
3633 //== MEDCouplingIMesh
3635 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3638 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3640 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3641 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3642 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3643 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3644 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3645 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3646 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3647 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3648 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3649 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3650 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3655 return MEDCouplingIMesh::New();
3657 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3659 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3660 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3661 const int *nodeStrctPtr(0);
3662 const double *originPtr(0),*dxyzPtr(0);
3664 std::vector<int> bb0;
3665 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3668 std::vector<double> bb,bb2;
3670 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3671 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3673 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3676 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3678 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3681 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3683 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3686 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3689 std::vector<int> bb0;
3690 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3691 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3694 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3696 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3699 DataArrayDoubleTuple *aa;
3700 std::vector<double> bb;
3702 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3703 self->setOrigin(originPtr,originPtr+nbTuples);
3706 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3708 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3711 DataArrayDoubleTuple *aa;
3712 std::vector<double> bb;
3714 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3715 self->setDXYZ(originPtr,originPtr+nbTuples);
3718 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3720 std::vector< std::pair<int,int> > inp;
3721 convertPyToVectorPairInt(fineLocInCoarse,inp);
3722 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3725 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)
3727 std::vector< std::pair<int,int> > inp;
3728 convertPyToVectorPairInt(fineLocInCoarse,inp);
3729 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3732 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3734 std::vector< std::pair<int,int> > inp;
3735 convertPyToVectorPairInt(fineLocInCoarse,inp);
3736 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3739 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)
3741 std::vector< std::pair<int,int> > inp;
3742 convertPyToVectorPairInt(fineLocInCoarse,inp);
3743 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3746 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)
3748 std::vector< std::pair<int,int> > inp;
3749 convertPyToVectorPairInt(fineLocInCoarse,inp);
3750 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3753 std::string __str__() const throw(INTERP_KERNEL::Exception)
3755 return self->simpleRepr();
3757 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3759 std::ostringstream oss;
3760 self->reprQuickOverview(oss);
3766 //== MEDCouplingIMesh End
3770 namespace MEDCoupling
3772 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3775 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3776 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3777 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3778 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3779 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3780 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3781 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3782 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3783 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3784 std::string getName() const throw(INTERP_KERNEL::Exception);
3785 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3786 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3787 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3788 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3789 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3790 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3791 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3792 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3793 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3794 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3795 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3796 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3797 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3798 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3799 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3800 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3802 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3804 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3807 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3810 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3812 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3815 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3818 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3820 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3821 return convertIntArrToPyList3(ret);
3824 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3827 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3828 PyObject *ret=PyTuple_New(2);
3829 PyObject *ret0Py=ret0?Py_True:Py_False;
3831 PyTuple_SetItem(ret,0,ret0Py);
3832 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3836 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3838 DataArrayInt *ret1=0;
3839 MEDCouplingMesh *ret0=0;
3841 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3842 if (!SWIG_IsOK(res1))
3845 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3846 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3850 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3852 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3853 da2->checkAllocated();
3854 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3856 PyObject *res = PyList_New(2);
3857 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3858 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3862 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3864 DataArrayInt *ret1=0;
3866 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3867 PyObject *res=PyTuple_New(2);
3868 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3870 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3873 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3874 PyTuple_SetItem(res,1,res1);
3879 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3882 int v0; std::vector<int> v1;
3883 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3884 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3887 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3888 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3891 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3892 if (!SWIG_IsOK(res1))
3895 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3896 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3900 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3902 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3903 da2->checkAllocated();
3904 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3908 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3910 std::vector<int> tmp;
3911 self->getCellIdsHavingGaussLocalization(locId,tmp);
3912 DataArrayInt *ret=DataArrayInt::New();
3913 ret->alloc((int)tmp.size(),1);
3914 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3915 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3918 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3920 std::vector<int> inp0;
3921 convertPyToNewIntArr4(code,1,3,inp0);
3922 std::vector<const DataArrayInt *> inp1;
3923 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3924 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3929 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3932 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3933 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3934 static MEDCouplingFieldTemplate *New(TypeOfField type);
3935 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3936 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3939 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3941 return MEDCouplingFieldTemplate::New(f);
3944 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3946 return MEDCouplingFieldTemplate::New(f);
3949 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3951 return MEDCouplingFieldTemplate::New(type);
3954 std::string __str__() const throw(INTERP_KERNEL::Exception)
3956 return self->simpleRepr();
3959 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3961 std::ostringstream oss;
3962 self->reprQuickOverview(oss);
3968 class MEDCouplingFieldInt;
3970 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3973 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3974 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3975 void setTimeUnit(const std::string& unit);
3976 std::string getTimeUnit() const;
3977 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3978 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3979 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3980 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3981 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3982 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3983 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3984 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3985 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3986 MEDCouplingFieldDouble *deepCopy() const;
3987 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3988 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3989 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3990 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3991 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3992 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3993 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3994 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3995 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3996 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3997 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3998 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3999 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4000 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4001 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4002 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4003 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4004 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4005 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4006 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4007 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4008 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4009 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4010 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4011 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4012 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4013 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4014 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4015 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4016 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4017 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4018 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4019 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4020 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4021 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4022 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4023 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4024 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4025 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4026 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4027 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4028 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4029 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4030 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4031 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4032 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4033 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4034 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4035 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4036 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4037 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4038 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4039 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4040 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4041 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4042 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4043 double getMinValue() const throw(INTERP_KERNEL::Exception);
4044 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4045 double norm2() const throw(INTERP_KERNEL::Exception);
4046 double normMax() const throw(INTERP_KERNEL::Exception);
4047 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4048 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4049 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4050 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4051 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4052 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4053 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4054 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4055 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4056 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4057 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4058 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4059 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4060 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4061 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4062 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4063 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4064 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4065 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4066 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4067 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4068 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4070 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4072 return MEDCouplingFieldDouble::New(type,td);
4075 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4077 return MEDCouplingFieldDouble::New(ft,td);
4080 std::string __str__() const throw(INTERP_KERNEL::Exception)
4082 return self->simpleRepr();
4085 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4087 std::ostringstream oss;
4088 self->reprQuickOverview(oss);
4092 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4094 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4098 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4100 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4104 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4106 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4108 DataArrayDouble *a,*a2;
4109 DataArrayDoubleTuple *aa,*aa2;
4110 std::vector<double> bb,bb2;
4112 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4113 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4114 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4117 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4119 DataArrayDouble *ret=self->getArray();
4125 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4127 std::vector<DataArrayDouble *> arrs=self->getArrays();
4128 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4132 PyObject *ret=PyTuple_New(sz);
4133 for(int i=0;i<sz;i++)
4136 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4138 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4143 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4145 std::vector<const DataArrayDouble *> tmp;
4146 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4148 std::vector<DataArrayDouble *> arrs(sz);
4149 for(int i=0;i<sz;i++)
4150 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4151 self->setArrays(arrs);
4154 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4156 DataArrayDouble *ret=self->getEndArray();
4162 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4166 DataArrayDoubleTuple *aa;
4167 std::vector<double> bb;
4169 const MEDCouplingMesh *mesh=self->getMesh();
4171 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4172 int spaceDim=mesh->getSpaceDimension();
4173 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4174 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4176 int sz=self->getNumberOfComponents();
4177 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4178 self->getValueOn(spaceLoc,res);
4179 return convertDblArrToPyList<double>(res,sz);
4182 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4184 int sz=self->getNumberOfComponents();
4185 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4186 self->getValueOnPos(i,j,k,res);
4187 return convertDblArrToPyList<double>(res,sz);
4190 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4192 const MEDCouplingMesh *mesh(self->getMesh());
4194 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4197 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4198 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4199 mesh->getSpaceDimension(),true,nbPts);
4200 return self->getValueOnMulti(inp,nbPts);
4203 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4207 DataArrayDoubleTuple *aa;
4208 std::vector<double> bb;
4210 const MEDCouplingMesh *mesh=self->getMesh();
4212 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4213 int spaceDim=mesh->getSpaceDimension();
4214 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4215 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4218 int sz=self->getNumberOfComponents();
4219 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4220 self->getValueOn(spaceLoc,time,res);
4221 return convertDblArrToPyList<double>(res,sz);
4224 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4226 if(self->getArray()!=0)
4227 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4230 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4231 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4232 self->setArray(arr);
4236 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4239 double tmp0=self->getTime(tmp1,tmp2);
4240 PyObject *res = PyList_New(3);
4241 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4242 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4243 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4247 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4250 double tmp0=self->getStartTime(tmp1,tmp2);
4251 PyObject *res = PyList_New(3);
4252 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4253 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4254 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4258 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4261 double tmp0=self->getEndTime(tmp1,tmp2);
4262 PyObject *res = PyList_New(3);
4263 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4264 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4265 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4268 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4270 int sz=self->getNumberOfComponents();
4271 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4272 self->accumulate(tmp);
4273 return convertDblArrToPyList<double>(tmp,sz);
4275 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4277 int sz=self->getNumberOfComponents();
4278 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4279 self->integral(isWAbs,tmp);
4280 return convertDblArrToPyList<double>(tmp,sz);
4282 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4284 int sz=self->getNumberOfComponents();
4285 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4286 self->getWeightedAverageValue(tmp,isWAbs);
4287 return convertDblArrToPyList<double>(tmp,sz);
4289 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4291 int sz=self->getNumberOfComponents();
4292 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4294 return convertDblArrToPyList<double>(tmp,sz);
4296 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4298 int sz=self->getNumberOfComponents();
4299 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4301 return convertDblArrToPyList<double>(tmp,sz);
4303 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4305 int szArr,sw,iTypppArr;
4306 std::vector<int> stdvecTyyppArr;
4307 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4308 self->renumberCells(tmp,check);
4311 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4313 int szArr,sw,iTypppArr;
4314 std::vector<int> stdvecTyyppArr;
4315 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4316 self->renumberCellsWithoutMesh(tmp,check);
4319 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4321 int szArr,sw,iTypppArr;
4322 std::vector<int> stdvecTyyppArr;
4323 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4324 self->renumberNodes(tmp,eps);
4327 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4329 int szArr,sw,iTypppArr;
4330 std::vector<int> stdvecTyyppArr;
4331 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4332 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4335 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4337 return fieldT_buildSubPart(self,li);
4340 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4342 return fieldT__getitem__(self,li);
4345 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4348 double r1=self->getMaxValue2(tmp);
4349 PyObject *ret=PyTuple_New(2);
4350 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4351 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4355 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4358 double r1=self->getMinValue2(tmp);
4359 PyObject *ret=PyTuple_New(2);
4360 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4361 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4365 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4367 std::vector<int> tmp;
4368 convertPyToNewIntArr3(li,tmp);
4369 return self->keepSelectedComponents(tmp);
4372 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4374 std::vector<int> tmp;
4375 convertPyToNewIntArr3(li,tmp);
4376 self->setSelectedComponents(f,tmp);
4379 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4382 DataArrayDouble *a,*a2;
4383 DataArrayDoubleTuple *aa,*aa2;
4384 std::vector<double> bb,bb2;
4387 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4388 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4389 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4390 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4392 return self->extractSlice3D(orig,vect,eps);
4395 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4397 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4400 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4402 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4405 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4407 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.";
4408 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4411 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4413 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4415 return (*self)-(*other);
4417 throw INTERP_KERNEL::Exception(msg);
4422 DataArrayDoubleTuple *aa;
4423 std::vector<double> bb;
4425 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4430 if(!self->getArray())
4431 throw INTERP_KERNEL::Exception(msg2);
4432 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4433 ret->applyLin(1.,-val);
4434 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4435 ret2->setArray(ret);
4440 if(!self->getArray())
4441 throw INTERP_KERNEL::Exception(msg2);
4442 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4443 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4444 ret2->setArray(ret);
4449 if(!self->getArray())
4450 throw INTERP_KERNEL::Exception(msg2);
4451 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4452 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4453 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4454 ret2->setArray(ret);
4459 if(!self->getArray())
4460 throw INTERP_KERNEL::Exception(msg2);
4461 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4462 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4463 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4464 ret2->setArray(ret);
4468 { throw INTERP_KERNEL::Exception(msg); }
4472 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4474 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4477 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4479 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4482 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4484 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4487 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4489 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.";
4490 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4493 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4495 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4497 return (*self)/(*other);
4499 throw INTERP_KERNEL::Exception(msg);
4504 DataArrayDoubleTuple *aa;
4505 std::vector<double> bb;
4507 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4513 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4514 if(!self->getArray())
4515 throw INTERP_KERNEL::Exception(msg2);
4516 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4517 ret->applyLin(1./val,0);
4518 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4519 ret2->setArray(ret);
4524 if(!self->getArray())
4525 throw INTERP_KERNEL::Exception(msg2);
4526 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4527 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4528 ret2->setArray(ret);
4533 if(!self->getArray())
4534 throw INTERP_KERNEL::Exception(msg2);
4535 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4536 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4537 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4538 ret2->setArray(ret);
4543 if(!self->getArray())
4544 throw INTERP_KERNEL::Exception(msg2);
4545 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4546 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4547 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4548 ret2->setArray(ret);
4552 { throw INTERP_KERNEL::Exception(msg); }
4556 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4558 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4561 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4563 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.";
4564 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4567 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4569 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4571 return (*self)^(*other);
4573 throw INTERP_KERNEL::Exception(msg);
4578 DataArrayDoubleTuple *aa;
4579 std::vector<double> bb;
4581 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4586 if(!self->getArray())
4587 throw INTERP_KERNEL::Exception(msg2);
4588 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4590 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4591 ret2->setArray(ret);
4596 if(!self->getArray())
4597 throw INTERP_KERNEL::Exception(msg2);
4598 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4599 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4600 ret2->setArray(ret);
4605 if(!self->getArray())
4606 throw INTERP_KERNEL::Exception(msg2);
4607 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4608 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4609 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4610 ret2->setArray(ret);
4615 if(!self->getArray())
4616 throw INTERP_KERNEL::Exception(msg2);
4617 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4618 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4619 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4620 ret2->setArray(ret);
4624 { throw INTERP_KERNEL::Exception(msg); }
4628 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4630 return self->negate();
4633 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4635 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.";
4636 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4639 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4641 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4645 Py_XINCREF(trueSelf);
4649 throw INTERP_KERNEL::Exception(msg);
4654 DataArrayDoubleTuple *aa;
4655 std::vector<double> bb;
4657 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4662 if(!self->getArray())
4663 throw INTERP_KERNEL::Exception(msg2);
4664 self->getArray()->applyLin(1.,val);
4665 Py_XINCREF(trueSelf);
4670 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4673 Py_XINCREF(trueSelf);
4678 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4679 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4680 ret2->setArray(aaa);
4682 Py_XINCREF(trueSelf);
4687 if(!self->getArray())
4688 throw INTERP_KERNEL::Exception(msg2);
4689 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4690 self->getArray()->addEqual(aaa);
4691 Py_XINCREF(trueSelf);
4695 { throw INTERP_KERNEL::Exception(msg); }
4699 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4701 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.";
4702 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4705 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4707 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4711 Py_XINCREF(trueSelf);
4715 throw INTERP_KERNEL::Exception(msg);
4720 DataArrayDoubleTuple *aa;
4721 std::vector<double> bb;
4723 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4728 if(!self->getArray())
4729 throw INTERP_KERNEL::Exception(msg2);
4730 self->getArray()->applyLin(1.,-val);
4731 Py_XINCREF(trueSelf);
4736 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4739 Py_XINCREF(trueSelf);
4744 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4745 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4746 ret2->setArray(aaa);
4748 Py_XINCREF(trueSelf);
4753 if(!self->getArray())
4754 throw INTERP_KERNEL::Exception(msg2);
4755 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4756 self->getArray()->substractEqual(aaa);
4757 Py_XINCREF(trueSelf);
4761 { throw INTERP_KERNEL::Exception(msg); }
4765 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4767 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.";
4768 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4771 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4773 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4777 Py_XINCREF(trueSelf);
4781 throw INTERP_KERNEL::Exception(msg);
4786 DataArrayDoubleTuple *aa;
4787 std::vector<double> bb;
4789 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4794 if(!self->getArray())
4795 throw INTERP_KERNEL::Exception(msg2);
4796 self->getArray()->applyLin(val,0);
4797 Py_XINCREF(trueSelf);
4802 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4805 Py_XINCREF(trueSelf);
4810 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4811 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4812 ret2->setArray(aaa);
4814 Py_XINCREF(trueSelf);
4819 if(!self->getArray())
4820 throw INTERP_KERNEL::Exception(msg2);
4821 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4822 self->getArray()->multiplyEqual(aaa);
4823 Py_XINCREF(trueSelf);
4827 { throw INTERP_KERNEL::Exception(msg); }
4831 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4833 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.";
4834 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4837 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4839 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4843 Py_XINCREF(trueSelf);
4847 throw INTERP_KERNEL::Exception(msg);
4852 DataArrayDoubleTuple *aa;
4853 std::vector<double> bb;
4855 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4861 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4862 if(!self->getArray())
4863 throw INTERP_KERNEL::Exception(msg2);
4864 self->getArray()->applyLin(1./val,0);
4865 Py_XINCREF(trueSelf);
4870 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4873 Py_XINCREF(trueSelf);
4878 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4879 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4880 ret2->setArray(aaa);
4882 Py_XINCREF(trueSelf);
4887 if(!self->getArray())
4888 throw INTERP_KERNEL::Exception(msg2);
4889 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4890 self->getArray()->divideEqual(aaa);
4891 Py_XINCREF(trueSelf);
4895 { throw INTERP_KERNEL::Exception(msg); }
4899 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4901 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.";
4902 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4905 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4907 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4911 Py_XINCREF(trueSelf);
4915 throw INTERP_KERNEL::Exception(msg);
4920 DataArrayDoubleTuple *aa;
4921 std::vector<double> bb;
4923 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4928 if(!self->getArray())
4929 throw INTERP_KERNEL::Exception(msg2);
4930 self->getArray()->applyPow(val);
4931 Py_XINCREF(trueSelf);
4936 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4939 Py_XINCREF(trueSelf);
4944 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4945 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4946 ret2->setArray(aaa);
4948 Py_XINCREF(trueSelf);
4953 if(!self->getArray())
4954 throw INTERP_KERNEL::Exception(msg2);
4955 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4956 self->getArray()->powEqual(aaa);
4957 Py_XINCREF(trueSelf);
4961 { throw INTERP_KERNEL::Exception(msg); }
4965 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4967 std::vector<const MEDCouplingFieldDouble *> tmp;
4968 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4969 return MEDCouplingFieldDouble::MergeFields(tmp);
4972 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4974 std::vector<const MEDCouplingFieldDouble *> tmp;
4975 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4976 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4979 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4981 std::vector<double> a0;
4982 std::vector<int> a1;
4983 std::vector<std::string> a2;
4984 self->getTinySerializationDbleInformation(a0);
4985 self->getTinySerializationIntInformation(a1);
4986 self->getTinySerializationStrInformation(a2);
4988 PyObject *ret(PyTuple_New(3));
4989 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4990 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4992 PyObject *ret2(PyList_New(sz));
4994 for(int i=0;i<sz;i++)
4995 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4997 PyTuple_SetItem(ret,2,ret2);
5001 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5003 DataArrayInt *ret0(0);
5004 std::vector<DataArrayDouble *> ret1;
5005 self->serialize(ret0,ret1);
5008 std::size_t sz(ret1.size());
5009 PyObject *ret(PyTuple_New(2));
5010 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5011 PyObject *ret1Py(PyList_New(sz));
5012 for(std::size_t i=0;i<sz;i++)
5016 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5018 PyTuple_SetItem(ret,1,ret1Py);
5022 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5024 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5025 if(!PyTuple_Check(args))
5026 throw INTERP_KERNEL::Exception(MSG);
5027 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5028 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5029 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5031 PyObject *tmp0(PyTuple_New(1));
5032 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5033 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5035 Py_DECREF(selfMeth);
5036 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5037 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5038 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5040 PyObject *a(PyInt_FromLong(0));
5041 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5044 throw INTERP_KERNEL::Exception(MSG);
5045 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5046 throw INTERP_KERNEL::Exception(MSG);
5047 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5050 Py_DECREF(initMeth);
5055 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5056 {// put an empty dict in input to say to __new__ to call __init__...
5057 self->checkConsistencyLight();
5058 PyObject *ret(PyTuple_New(1));
5059 PyObject *ret0(PyDict_New());
5061 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5062 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5063 PyDict_SetItem(ret0,a,d);
5064 Py_DECREF(a); Py_DECREF(d);
5066 PyTuple_SetItem(ret,0,ret0);
5070 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5072 self->checkConsistencyLight();
5073 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5074 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5075 const MEDCouplingMesh *mesh(self->getMesh());
5078 PyObject *ret(PyTuple_New(3));
5079 PyTuple_SetItem(ret,0,ret0);
5080 PyTuple_SetItem(ret,1,ret1);
5081 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5085 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5087 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5088 if(!PyTuple_Check(inp))
5089 throw INTERP_KERNEL::Exception(MSG);
5090 int sz(PyTuple_Size(inp));
5092 throw INTERP_KERNEL::Exception(MSG);
5094 PyObject *elt2(PyTuple_GetItem(inp,2));
5096 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5097 if(!SWIG_IsOK(status))
5098 throw INTERP_KERNEL::Exception(MSG);
5099 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5101 PyObject *elt0(PyTuple_GetItem(inp,0));
5102 PyObject *elt1(PyTuple_GetItem(inp,1));
5103 std::vector<double> a0;
5104 std::vector<int> a1;
5105 std::vector<std::string> a2;
5106 DataArrayInt *b0(0);
5107 std::vector<DataArrayDouble *>b1;
5109 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5110 throw INTERP_KERNEL::Exception(MSG);
5111 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5113 fillArrayWithPyListDbl3(a0py,tmp,a0);
5114 convertPyToNewIntArr3(a1py,a1);
5115 fillStringVector(a2py,a2);
5118 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5119 throw INTERP_KERNEL::Exception(MSG);
5120 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5122 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5123 if(!SWIG_IsOK(status))
5124 throw INTERP_KERNEL::Exception(MSG);
5125 b0=reinterpret_cast<DataArrayInt *>(argp);
5126 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5128 self->checkForUnserialization(a1,b0,b1);
5129 // useless here to call resizeForUnserialization because arrays are well resized.
5130 self->finishUnserialization(a1,a0,a2);
5135 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5138 int getNumberOfFields() const;
5139 MEDCouplingMultiFields *deepCopy() const;
5140 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5141 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5142 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5143 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5144 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5147 std::string __str__() const throw(INTERP_KERNEL::Exception)
5149 return self->simpleRepr();
5151 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5153 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5154 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5156 std::vector<MEDCouplingFieldDouble *> fs(sz);
5157 for(int i=0;i<sz;i++)
5158 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5159 return MEDCouplingMultiFields::New(fs);
5161 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5163 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5164 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5166 std::vector<MEDCouplingFieldDouble *> fs(sz);
5167 for(int i=0;i<sz;i++)
5168 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5169 return MEDCouplingMultiFields::New(fs);
5171 PyObject *getFields() const
5173 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5174 int sz=fields.size();
5175 PyObject *res = PyList_New(sz);
5176 for(int i=0;i<sz;i++)
5180 fields[i]->incrRef();
5181 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5185 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5190 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5192 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5196 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5199 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5201 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5203 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5205 PyObject *res = PyList_New(sz);
5206 for(int i=0;i<sz;i++)
5211 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5215 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5220 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5222 std::vector<int> refs;
5223 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5225 PyObject *res = PyList_New(sz);
5226 for(int i=0;i<sz;i++)
5231 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5235 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5239 PyObject *ret=PyTuple_New(2);
5240 PyTuple_SetItem(ret,0,res);
5241 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5244 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5246 std::vector<DataArrayDouble *> ms=self->getArrays();
5248 PyObject *res = PyList_New(sz);
5249 for(int i=0;i<sz;i++)
5254 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5258 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5263 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5265 std::vector< std::vector<int> > refs;
5266 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5268 PyObject *res = PyList_New(sz);
5269 PyObject *res2 = PyList_New(sz);
5270 for(int i=0;i<sz;i++)
5275 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5279 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5281 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5284 PyObject *ret=PyTuple_New(2);
5285 PyTuple_SetItem(ret,0,res);
5286 PyTuple_SetItem(ret,1,res2);
5292 class MEDCouplingFieldInt : public MEDCouplingField
5295 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5296 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5297 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5298 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5299 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5300 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5301 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5302 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5303 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5304 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5305 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5307 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5309 return MEDCouplingFieldInt::New(type,td);
5312 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5314 return MEDCouplingFieldInt::New(ft,td);
5317 std::string __str__() const throw(INTERP_KERNEL::Exception)
5319 return self->simpleRepr();
5322 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5324 std::ostringstream oss;
5325 self->reprQuickOverview(oss);
5329 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5331 return fieldT_buildSubPart(self,li);
5334 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5336 return fieldT__getitem__(self,li);
5339 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5341 DataArrayInt *ret=self->getArray();
5347 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5350 double tmp0=self->getTime(tmp1,tmp2);
5351 PyObject *res = PyList_New(3);
5352 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5353 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5354 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5360 class MEDCouplingDefinitionTime
5363 MEDCouplingDefinitionTime();
5364 void assign(const MEDCouplingDefinitionTime& other);
5365 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5366 double getTimeResolution() const;
5367 std::vector<double> getHotSpotsTime() const;
5370 std::string __str__() const throw(INTERP_KERNEL::Exception)
5372 std::ostringstream oss;
5373 self->appendRepr(oss);
5377 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5379 int meshId,arrId,arrIdInField,fieldId;
5380 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5381 PyObject *res=PyList_New(4);
5382 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5383 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5384 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5385 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5389 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5391 int meshId,arrId,arrIdInField,fieldId;
5392 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5393 PyObject *res=PyList_New(4);
5394 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5395 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5396 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5397 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5403 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5406 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5407 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5411 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5413 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5414 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5416 std::vector<MEDCouplingFieldDouble *> fs(sz);
5417 for(int i=0;i<sz;i++)
5418 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5419 return MEDCouplingFieldOverTime::New(fs);
5421 std::string __str__() const throw(INTERP_KERNEL::Exception)
5423 return self->simpleRepr();
5425 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5427 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5428 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5430 std::vector<MEDCouplingFieldDouble *> fs(sz);
5431 for(int i=0;i<sz;i++)
5432 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5433 return MEDCouplingFieldOverTime::New(fs);
5438 class MEDCouplingCartesianAMRMesh;
5440 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5443 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5444 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5445 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5448 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5450 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5458 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5461 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5462 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5463 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5466 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5468 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5469 return convertFromVectorPairInt(ret);
5472 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5474 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5475 return convertFromVectorPairInt(ret);
5478 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5480 std::vector< std::pair<int,int> > inp;
5481 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5482 self->addPatch(inp,factors);
5485 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5487 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5489 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5490 if(patchId==mesh->getNumberOfPatches())
5492 std::ostringstream oss;
5493 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5494 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5497 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5503 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5505 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5507 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5508 mesh->removePatch(patchId);
5511 int __len__() const throw(INTERP_KERNEL::Exception)
5513 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5515 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5516 return mesh->getNumberOfPatches();
5521 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5525 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5528 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5529 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5530 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5531 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5532 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5533 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5534 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5535 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5536 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5537 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5538 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5539 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5540 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5542 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5543 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5544 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5545 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5546 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5547 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5548 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5549 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5550 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5551 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5552 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5553 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5554 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5555 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5556 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5557 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5558 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5559 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5560 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5561 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5564 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5566 std::vector< std::pair<int,int> > inp;
5567 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5568 self->addPatch(inp,factors);
5571 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5573 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5575 PyObject *ret = PyList_New(sz);
5576 for(int i=0;i<sz;i++)
5578 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5581 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5586 // agy : don't know why typemap fails here ??? let it in the extend section
5587 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5589 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5592 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5594 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5595 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5601 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5603 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5604 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5610 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5612 std::vector<int> out1;
5613 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5614 PyObject *ret(PyTuple_New(2));
5615 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5616 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5620 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5622 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5624 PyObject *ret = PyList_New(sz);
5625 for(int i=0;i<sz;i++)
5626 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5630 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5632 std::vector<const DataArrayDouble *> inp;
5633 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5634 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5637 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5639 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5645 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5647 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5653 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5655 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5661 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5663 const MEDCouplingIMesh *ret(self->getImageMesh());
5666 return const_cast<MEDCouplingIMesh *>(ret);
5669 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5671 if(patchId==self->getNumberOfPatches())
5673 std::ostringstream oss;
5674 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5675 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5678 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5684 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5686 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5687 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5688 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5691 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5693 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5694 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5695 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5698 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5700 self->removePatch(patchId);
5703 int __len__() const throw(INTERP_KERNEL::Exception)
5705 return self->getNumberOfPatches();
5710 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5714 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5717 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5720 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5722 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5723 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5724 const int *nodeStrctPtr(0);
5725 const double *originPtr(0),*dxyzPtr(0);
5727 std::vector<int> bb0;
5728 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5731 std::vector<double> bb,bb2;
5733 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5734 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5736 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5739 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5741 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5742 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5743 std::vector< std::vector<int> > inp2;
5744 convertPyToVectorOfVectorOfInt(factors,inp2);
5745 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5748 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5750 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5753 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5755 return MEDCouplingCartesianAMRMesh::New(mesh);
5760 class MEDCouplingDataForGodFather : public RefCountObject
5763 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5764 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5765 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5766 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5767 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5768 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5769 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5770 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5771 virtual void alloc() throw(INTERP_KERNEL::Exception);
5772 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5775 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5777 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5785 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5788 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5789 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5790 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5791 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5792 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5793 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5794 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5795 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5796 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5799 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5801 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5802 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5803 MEDCouplingAMRAttribute *ret(0);
5806 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5807 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5809 catch(INTERP_KERNEL::Exception&)
5811 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5812 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5817 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5819 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5822 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5824 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5825 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5831 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5833 std::vector< std::vector<std::string> > compNamesCpp;
5834 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5835 self->spillInfoOnComponents(compNamesCpp);
5838 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5840 std::vector<int> inp0;
5841 if(!fillIntVector(nfs,inp0))
5842 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5843 std::size_t sz(inp0.size());
5844 std::vector<NatureOfField> inp00(sz);
5845 for(std::size_t i=0;i<sz;i++)
5846 inp00[i]=(NatureOfField)inp0[i];
5847 self->spillNatures(inp00);
5850 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5852 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5853 int sz((int)ret.size());
5854 PyObject *retPy(PyList_New(sz));
5855 for(int i=0;i<sz;i++)
5856 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5862 class DenseMatrix : public RefCountObject, public TimeLabel
5865 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5866 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5867 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5868 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5870 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5871 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5872 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5873 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5874 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5875 void transpose() throw(INTERP_KERNEL::Exception);
5877 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5878 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5879 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5882 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5884 return DenseMatrix::New(nbRows,nbCols);
5887 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5889 return DenseMatrix::New(array,nbRows,nbCols);
5892 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5895 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5896 PyObject *ret=PyTuple_New(2);
5897 PyObject *ret0Py=ret0?Py_True:Py_False;
5899 PyTuple_SetItem(ret,0,ret0Py);
5900 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5904 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5906 DataArrayDouble *ret(self->getData());
5912 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5914 return MEDCoupling::DenseMatrix::Add(self,other);
5917 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5919 return MEDCoupling::DenseMatrix::Substract(self,other);
5922 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5924 return MEDCoupling::DenseMatrix::Multiply(self,other);
5927 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5929 return MEDCoupling::DenseMatrix::Multiply(self,other);
5932 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5934 self->addEqual(other);
5935 Py_XINCREF(trueSelf);
5939 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5941 self->substractEqual(other);
5942 Py_XINCREF(trueSelf);
5946 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5948 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5958 __filename=os.environ.get('PYTHONSTARTUP')
5959 if __filename and os.path.isfile(__filename):
5960 execfile(__filename)