1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #ifdef WITH_DOCSTRINGS
24 %include MEDCoupling_doc.i
31 #include "MEDCouplingMemArray.hxx"
32 #include "MEDCouplingUMesh.hxx"
33 #include "MEDCouplingMappedExtrudedMesh.hxx"
34 #include "MEDCouplingCMesh.hxx"
35 #include "MEDCouplingIMesh.hxx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt.hxx"
41 #include "MEDCouplingFieldFloat.hxx"
42 #include "MEDCouplingFieldTemplate.hxx"
43 #include "MEDCouplingGaussLocalization.hxx"
45 #include "MEDCouplingMultiFields.hxx"
46 #include "MEDCouplingFieldOverTime.hxx"
47 #include "MEDCouplingDefinitionTime.hxx"
48 #include "MEDCouplingFieldDiscretization.hxx"
49 #include "MEDCouplingCartesianAMRMesh.hxx"
50 #include "MEDCouplingAMRAttribute.hxx"
51 #include "MEDCouplingMatrix.hxx"
52 #include "MEDCouplingPartDefinition.hxx"
53 #include "MEDCouplingSkyLineArray.hxx"
54 #include "MEDCouplingTypemaps.i"
56 #include "InterpKernelAutoPtr.hxx"
57 #include "BoxSplittingOptions.hxx"
59 using namespace MEDCoupling;
60 using namespace INTERP_KERNEL;
64 %template(ivec) std::vector<int>;
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
69 %typemap(out) MEDCoupling::MEDCouplingMesh*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingMesh*
76 $result=convertMesh($1,$owner);
81 %typemap(out) MEDCoupling::MEDCouplingPointSet*
83 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCouplingPointSet*
88 $result=convertMesh($1,$owner);
93 %typemap(out) MEDCouplingCartesianAMRPatchGen*
95 $result=convertCartesianAMRPatch($1,$owner);
100 %typemap(out) MEDCouplingCartesianAMRMeshGen*
102 $result=convertCartesianAMRMesh($1,$owner);
107 %typemap(out) MEDCouplingDataForGodFather*
109 $result=convertDataForGodFather($1,$owner);
114 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
116 $result=convertMesh($1,$owner);
119 %typemap(out) MEDCoupling1GTUMesh*
121 $result=convertMesh($1,$owner);
126 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
128 $result=convertMesh($1,$owner);
131 %typemap(out) MEDCouplingStructuredMesh*
133 $result=convertMesh($1,$owner);
138 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
140 $result=convertFieldDiscretization($1,$owner);
143 %typemap(out) MEDCouplingFieldDiscretization*
145 $result=convertFieldDiscretization($1,$owner);
150 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
152 $result=convertMultiFields($1,$owner);
155 %typemap(out) MEDCouplingMultiFields*
157 $result=convertMultiFields($1,$owner);
162 %typemap(out) MEDCoupling::PartDefinition*
164 $result=convertPartDefinition($1,$owner);
167 %typemap(out) PartDefinition*
169 $result=convertPartDefinition($1,$owner);
174 %init %{ import_array(); %}
177 %init %{ initializeMe(); %}
179 %feature("autodoc", "1");
180 %feature("docstring");
182 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
183 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
184 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
239 %newobject MEDCoupling::MEDCouplingFieldInt::New;
240 %newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
241 %newobject MEDCoupling::MEDCouplingFieldInt::getArray;
242 %newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
243 %newobject MEDCoupling::MEDCouplingFieldInt::clone;
244 %newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
245 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
246 %newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
247 %newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
248 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
249 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
250 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
251 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
252 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
253 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
254 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
255 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
256 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
257 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
258 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
259 %newobject MEDCoupling::MEDCouplingMesh::clone;
260 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
261 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
262 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
263 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
264 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
265 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
266 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
267 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
268 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
269 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
270 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
271 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
272 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
273 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
274 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
275 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
276 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
277 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
278 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
279 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
280 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
281 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
282 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
283 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
284 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
285 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
286 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
287 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
288 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
289 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
290 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
291 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
292 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
293 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
294 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
295 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
296 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
297 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
298 %newobject MEDCoupling::MEDCouplingUMesh::New;
299 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
300 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
301 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
302 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
303 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
304 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
305 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
306 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
307 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
308 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
309 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
310 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
311 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
312 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
313 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
314 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
315 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
316 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
317 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
318 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
319 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
320 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
321 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
322 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
323 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
324 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
325 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
326 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
327 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
328 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
329 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
330 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
331 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
332 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
333 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
334 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
335 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
336 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
337 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
338 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
339 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
340 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
341 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
342 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
343 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
344 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
345 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
346 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
347 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
348 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
349 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
350 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
351 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
352 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
353 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
354 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
355 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
356 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
357 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
358 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
359 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
360 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
361 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
362 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
363 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
364 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
365 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
366 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
367 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
368 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
369 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
370 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
371 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
372 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
373 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
374 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
375 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
376 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
377 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
378 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
379 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
380 %newobject MEDCoupling::MEDCouplingCMesh::New;
381 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
382 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
383 %newobject MEDCoupling::MEDCouplingIMesh::New;
384 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
385 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
386 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
387 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
388 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
389 %newobject MEDCoupling::MEDCouplingMultiFields::New;
390 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
391 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
392 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
393 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
394 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
395 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
396 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
397 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
398 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
399 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
400 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
401 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
402 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
403 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
404 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
405 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
406 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
407 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
408 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
409 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
410 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
411 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
412 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
413 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
414 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
415 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
416 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
417 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
418 %newobject MEDCoupling::DenseMatrix::New;
419 %newobject MEDCoupling::DenseMatrix::deepCopy;
420 %newobject MEDCoupling::DenseMatrix::shallowCpy;
421 %newobject MEDCoupling::DenseMatrix::getData;
422 %newobject MEDCoupling::DenseMatrix::matVecMult;
423 %newobject MEDCoupling::DenseMatrix::MatVecMult;
424 %newobject MEDCoupling::DenseMatrix::__add__;
425 %newobject MEDCoupling::DenseMatrix::__sub__;
426 %newobject MEDCoupling::DenseMatrix::__mul__;
427 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
428 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
429 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
431 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
432 %feature("unref") MEDCouplingMesh "$this->decrRef();"
433 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
434 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
435 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
436 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
437 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
438 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
439 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
440 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
441 %feature("unref") MEDCouplingField "$this->decrRef();"
442 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
443 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
444 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
445 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
446 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
447 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
448 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
449 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
450 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
451 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
452 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
453 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
454 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
455 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
456 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
457 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
458 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
459 %feature("unref") DenseMatrix "$this->decrRef();"
460 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
462 %rename(assign) *::operator=;
463 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
464 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
465 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
466 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
470 %rename (InterpKernelException) INTERP_KERNEL::Exception;
472 %include "MEDCouplingRefCountObject.i"
473 %include "MEDCouplingMemArray.i"
477 {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
478 SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
479 SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
480 SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
481 SWIGTITraits<int>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayIntTuple;
485 namespace INTERP_KERNEL
488 * \class BoxSplittingOptions
489 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
491 class BoxSplittingOptions
494 BoxSplittingOptions();
495 void init() throw(INTERP_KERNEL::Exception);
496 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
497 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
498 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
499 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
500 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
501 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
502 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
503 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
504 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
505 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
506 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
507 std::string printOptions() const throw(INTERP_KERNEL::Exception);
510 std::string __str__() const throw(INTERP_KERNEL::Exception)
512 return self->printOptions();
518 namespace MEDCoupling
534 CONST_ON_TIME_INTERVAL = 7
535 } TypeOfTimeDiscretization;
543 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
544 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
546 } MEDCouplingMeshType;
549 class DataArrayDouble;
550 class MEDCouplingUMesh;
551 class MEDCouplingCMesh;
552 class MEDCouplingFieldDouble;
554 %extend RefCountObject
556 std::string getHiddenCppPointer() const
558 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
563 %extend MEDCouplingGaussLocalization
565 std::string __str__() const throw(INTERP_KERNEL::Exception)
567 return self->getStringRepr();
570 std::string __repr__() const throw(INTERP_KERNEL::Exception)
572 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
573 oss << self->getStringRepr();
580 class MEDCouplingMesh : public RefCountObject, public TimeLabel
583 void setName(const std::string& name);
584 std::string getName() const;
585 void setDescription(const std::string& descr);
586 std::string getDescription() const;
587 void setTime(double val, int iteration, int order);
588 void setTimeUnit(const std::string& unit);
589 std::string getTimeUnit() const;
590 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
591 bool isStructured() const throw(INTERP_KERNEL::Exception);
592 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
593 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
594 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
595 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
596 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
597 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
598 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
599 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
600 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
601 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
602 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
603 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
604 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
605 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
606 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
607 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
608 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
609 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
610 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
611 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
612 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
613 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
614 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
615 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
616 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
617 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
618 virtual std::string getVTKFileExtension() const;
619 std::string getVTKFileNameOf(const std::string& fileName) const;
621 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
622 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
623 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
624 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
625 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
626 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
627 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
628 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
629 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
630 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
631 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);
632 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
633 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
634 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
635 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
636 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
637 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
638 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
641 std::string __str__() const throw(INTERP_KERNEL::Exception)
643 return self->simpleRepr();
646 PyObject *getTime() throw(INTERP_KERNEL::Exception)
649 double tmp0=self->getTime(tmp1,tmp2);
650 PyObject *res = PyList_New(3);
651 PyList_SetItem(res,0,SWIG_From_double(tmp0));
652 PyList_SetItem(res,1,SWIG_From_int(tmp1));
653 PyList_SetItem(res,2,SWIG_From_int(tmp2));
657 DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const throw(INTERP_KERNEL::Exception)
659 const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
660 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
666 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
670 DataArrayDoubleTuple *aa;
671 std::vector<double> bb;
673 int spaceDim=self->getSpaceDimension();
674 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
675 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
676 return self->getCellContainingPoint(pos,eps);
679 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
683 DataArrayDoubleTuple *aa;
684 std::vector<double> bb;
686 int spaceDim=self->getSpaceDimension();
687 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
688 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
689 MCAuto<DataArrayInt> elts,eltsIndex;
690 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
691 PyObject *ret=PyTuple_New(2);
692 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
693 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
697 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
699 MCAuto<DataArrayInt> elts,eltsIndex;
700 int spaceDim=self->getSpaceDimension();
702 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
703 if (!SWIG_IsOK(res1))
706 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
707 int nbOfPoints=size/spaceDim;
710 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
712 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
716 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
718 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
719 da2->checkAllocated();
720 int size=da2->getNumberOfTuples();
721 int nbOfCompo=da2->getNumberOfComponents();
722 if(nbOfCompo!=spaceDim)
724 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
726 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
728 PyObject *ret=PyTuple_New(2);
729 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
730 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
734 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
738 DataArrayDoubleTuple *aa;
739 std::vector<double> bb;
741 int spaceDim=self->getSpaceDimension();
742 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
743 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
744 std::vector<int> elts;
745 self->getCellsContainingPoint(pos,eps,elts);
746 DataArrayInt *ret=DataArrayInt::New();
747 ret->alloc((int)elts.size(),1);
748 std::copy(elts.begin(),elts.end(),ret->getPointer());
749 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
752 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
754 MCAuto<DataArrayInt> d0=DataArrayInt::New();
755 MCAuto<DataArrayInt> d1=DataArrayInt::New();
756 self->getReverseNodalConnectivity(d0,d1);
757 PyObject *ret=PyTuple_New(2);
758 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
759 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
763 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
766 int v0; std::vector<int> v1;
767 const int *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
768 self->renumberCells(ids,check);
771 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
773 DataArrayInt *cellCor, *nodeCor;
774 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
775 PyObject *res = PyList_New(2);
776 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
777 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
781 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
783 DataArrayInt *cellCor=0,*nodeCor=0;
784 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
785 PyObject *res = PyList_New(2);
786 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
787 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
791 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
793 DataArrayInt *cellCor=0;
794 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
798 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
801 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
802 if (!SWIG_IsOK(res1))
805 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
806 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
810 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
812 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
813 da2->checkAllocated();
814 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
817 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
819 std::vector<int> conn;
820 self->getNodeIdsOfCell(cellId,conn);
821 return convertIntArrToPyList2(conn);
824 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
826 std::vector<double> coo;
827 self->getCoordinatesOfNode(nodeId,coo);
828 return convertDblArrToPyList2(coo);
831 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
835 DataArrayDoubleTuple *aa;
836 std::vector<double> bb;
838 int spaceDim=self->getSpaceDimension();
839 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
840 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
841 self->scale(pointPtr,factor);
844 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
846 int spaceDim=self->getSpaceDimension();
847 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
848 self->getBoundingBox(tmp);
849 PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
853 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
856 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
857 PyObject *ret=PyTuple_New(2);
858 PyObject *ret0Py=ret0?Py_True:Py_False;
860 PyTuple_SetItem(ret,0,ret0Py);
861 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
865 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
867 int szArr,sw,iTypppArr;
868 std::vector<int> stdvecTyyppArr;
869 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
870 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
871 if(sw==3)//DataArrayInt
873 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
874 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
875 std::string name=argpt->getName();
877 ret->setName(name.c_str());
879 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
882 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
884 int szArr,sw,iTypppArr;
885 std::vector<int> stdvecTyyppArr;
887 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
888 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
889 if(sw==3)//DataArrayInt
891 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
892 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
893 std::string name=argpt->getName();
895 ret->setName(name.c_str());
898 PyObject *res = PyList_New(2);
899 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
900 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
901 PyList_SetItem(res,0,obj0);
902 PyList_SetItem(res,1,obj1);
906 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
910 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
911 PyObject *res = PyTuple_New(2);
912 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
915 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
917 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
918 PyTuple_SetItem(res,0,obj0);
919 PyTuple_SetItem(res,1,obj1);
923 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
925 std::vector<int> vals=self->getDistributionOfTypes();
927 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
928 PyObject *ret=PyList_New((int)vals.size()/3);
929 for(int j=0;j<(int)vals.size()/3;j++)
931 PyObject *ret1=PyList_New(3);
932 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
933 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
934 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
935 PyList_SetItem(ret,j,ret1);
940 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
942 std::vector<int> code;
943 std::vector<const DataArrayInt *> idsPerType;
944 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
945 convertPyToNewIntArr4(li,1,3,code);
946 return self->checkTypeConsistencyAndContig(code,idsPerType);
949 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
951 std::vector<int> code;
952 std::vector<DataArrayInt *> idsInPflPerType;
953 std::vector<DataArrayInt *> idsPerType;
954 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
955 PyObject *ret=PyTuple_New(3);
958 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
959 PyObject *ret0=PyList_New((int)code.size()/3);
960 for(int j=0;j<(int)code.size()/3;j++)
962 PyObject *ret00=PyList_New(3);
963 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
964 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
965 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
966 PyList_SetItem(ret0,j,ret00);
968 PyTuple_SetItem(ret,0,ret0);
970 PyObject *ret1=PyList_New(idsInPflPerType.size());
971 for(std::size_t j=0;j<idsInPflPerType.size();j++)
972 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
973 PyTuple_SetItem(ret,1,ret1);
974 int n=idsPerType.size();
975 PyObject *ret2=PyList_New(n);
977 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
978 PyTuple_SetItem(ret,2,ret2);
982 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
986 DataArrayDoubleTuple *aa;
987 std::vector<double> bb;
989 int spaceDim=self->getSpaceDimension();
990 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
991 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
992 self->translate(vectorPtr);
995 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
997 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1000 DataArrayDoubleTuple *aa;
1001 std::vector<double> bb;
1003 int spaceDim=self->getSpaceDimension();
1004 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1005 self->rotate(centerPtr,0,alpha);
1008 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1010 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1012 DataArrayDouble *a,*a2;
1013 DataArrayDoubleTuple *aa,*aa2;
1014 std::vector<double> bb,bb2;
1016 int spaceDim=self->getSpaceDimension();
1017 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1018 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
1019 self->rotate(centerPtr,vectorPtr,alpha);
1022 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1024 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1025 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1026 PyObject *res=PyList_New(result.size());
1027 for(int i=0;iL!=result.end(); i++, iL++)
1028 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1032 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
1034 std::vector<double> a0;
1035 std::vector<int> a1;
1036 std::vector<std::string> a2;
1037 self->getTinySerializationInformation(a0,a1,a2);
1038 PyObject *ret(PyTuple_New(3));
1039 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1040 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1042 PyObject *ret2(PyList_New(sz));
1044 for(int i=0;i<sz;i++)
1045 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1047 PyTuple_SetItem(ret,2,ret2);
1051 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1053 DataArrayInt *a0Tmp(0);
1054 DataArrayDouble *a1Tmp(0);
1055 self->serialize(a0Tmp,a1Tmp);
1056 PyObject *ret(PyTuple_New(2));
1057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1058 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1062 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1064 std::vector<std::string> littleStrings;
1065 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1068 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1069 {// put an empty dict in input to say to __new__ to call __init__...
1070 PyObject *ret(PyTuple_New(1));
1071 PyObject *ret0(PyDict_New());
1072 PyTuple_SetItem(ret,0,ret0);
1076 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1078 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1079 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1080 PyObject *ret(PyTuple_New(2));
1081 PyTuple_SetItem(ret,0,ret0);
1082 PyTuple_SetItem(ret,1,ret1);
1086 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1088 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1089 if(!PyTuple_Check(inp))
1090 throw INTERP_KERNEL::Exception(MSG);
1091 int sz(PyTuple_Size(inp));
1093 throw INTERP_KERNEL::Exception(MSG);
1094 PyObject *elt0(PyTuple_GetItem(inp,0));
1095 PyObject *elt1(PyTuple_GetItem(inp,1));
1096 std::vector<double> a0;
1097 std::vector<int> a1;
1098 std::vector<std::string> a2;
1099 DataArrayInt *b0(0);
1100 DataArrayDouble *b1(0);
1102 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1103 throw INTERP_KERNEL::Exception(MSG);
1104 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1106 fillArrayWithPyListDbl3(a0py,tmp,a0);
1107 convertPyToNewIntArr3(a1py,a1);
1108 fillStringVector(a2py,a2);
1111 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1112 throw INTERP_KERNEL::Exception(MSG);
1113 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1115 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1116 if(!SWIG_IsOK(status))
1117 throw INTERP_KERNEL::Exception(MSG);
1118 b0=reinterpret_cast<DataArrayInt *>(argp);
1119 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1120 if(!SWIG_IsOK(status))
1121 throw INTERP_KERNEL::Exception(MSG);
1122 b1=reinterpret_cast<DataArrayDouble *>(argp);
1124 // useless here to call resizeForUnserialization because arrays are well resized.
1125 self->unserialization(a0,a1,b0,b1,a2);
1128 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1130 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1131 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1132 return MEDCouplingMesh::MergeMeshes(tmp);
1138 //== MEDCouplingMesh End
1140 %include "NormalizedGeometricTypes"
1141 %include "MEDCouplingNatureOfFieldEnum"
1143 namespace MEDCoupling
1145 class MEDCouplingNatureOfField
1148 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1149 static std::string GetReprNoThrow(NatureOfField nat);
1150 static std::string GetAllPossibilitiesStr();
1154 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1155 // include "MEDCouplingTimeDiscretization.i"
1157 namespace MEDCoupling
1159 class MEDCouplingGaussLocalization
1162 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1163 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1164 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1165 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1166 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1167 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1168 int getDimension() const throw(INTERP_KERNEL::Exception);
1169 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1170 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1171 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1172 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1174 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1175 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1176 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1177 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1178 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1179 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1180 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1181 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1182 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1183 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1184 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1185 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1187 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1191 DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
1193 MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1197 MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
1199 MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1205 class MEDCouplingSkyLineArray
1208 static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayInt* c, const DataArrayInt* cI ) throw(INTERP_KERNEL::Exception);
1210 void set( DataArrayInt* index, DataArrayInt* value );
1211 void set3( DataArrayInt* superIndex, DataArrayInt* index, DataArrayInt* value );
1213 int getSuperNumberOf() const;
1214 int getNumberOf() const;
1215 int getLength() const;
1217 DataArrayInt* getSuperIndexArray() const;
1218 DataArrayInt* getIndexArray() const;
1219 DataArrayInt* getValuesArray() const;
1221 void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception);
1225 MEDCouplingSkyLineArray() throw(INTERP_KERNEL::Exception)
1227 return MEDCouplingSkyLineArray::New();
1230 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value) throw(INTERP_KERNEL::Exception)
1232 return MEDCouplingSkyLineArray::New(index, value);
1235 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value ) throw(INTERP_KERNEL::Exception)
1237 return MEDCouplingSkyLineArray::New(index, value);
1240 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other ) throw(INTERP_KERNEL::Exception)
1242 return MEDCouplingSkyLineArray::New(other);
1245 std::string __str__() const throw(INTERP_KERNEL::Exception)
1247 return self->simpleRepr();
1250 PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception)
1252 std::vector<int> ret;
1253 self->getSimplePackSafe(absolutePackId,ret);
1254 return convertIntArrToPyList2(ret);
1257 PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const throw(INTERP_KERNEL::Exception)
1259 std::vector<int> vpack, vspIdx, out;
1261 convertPyToNewIntArr3(superPackIndices,vspIdx);
1262 convertPyToNewIntArr3(pack,vpack);
1264 self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1265 return convertIntArrToPyList2(out);
1268 void pushBackPack(const int i, PyObject *pack) throw(INTERP_KERNEL::Exception)
1270 std::vector<int> vpack;
1271 convertPyToNewIntArr3(pack,vpack);
1272 self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1275 void replaceSimplePack(const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1277 std::vector<int> vpack;
1278 convertPyToNewIntArr3(pack,vpack);
1279 self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1282 void replacePack(const int superIdx, const int idx, PyObject *pack) throw(INTERP_KERNEL::Exception)
1284 std::vector<int> vpack;
1285 convertPyToNewIntArr3(pack,vpack);
1286 self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1289 PyObject *convertToPolyhedronConn() const throw(INTERP_KERNEL::Exception)
1291 MCAuto<DataArrayInt> d0=DataArrayInt::New();
1292 MCAuto<DataArrayInt> d1=DataArrayInt::New();
1293 self->convertToPolyhedronConn(d0,d1);
1294 PyObject *ret=PyTuple_New(2);
1295 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1296 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1303 %include "MEDCouplingFieldDiscretization.i"
1305 //== MEDCouplingPointSet
1307 namespace MEDCoupling
1309 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1312 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1313 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1314 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1315 void zipCoords() throw(INTERP_KERNEL::Exception);
1316 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1317 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1318 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1319 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1320 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1321 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1322 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1323 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1324 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1325 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1326 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1327 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1328 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1329 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1330 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1331 virtual DataArrayInt *findBoundaryNodes() const;
1332 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1333 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1334 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1335 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1336 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1337 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1338 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1339 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1340 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1343 std::string __str__() const throw(INTERP_KERNEL::Exception)
1345 return self->simpleRepr();
1348 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1351 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1352 PyObject *res = PyList_New(2);
1353 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1354 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1358 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1360 DataArrayInt *comm, *commIndex;
1361 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1362 PyObject *res = PyList_New(2);
1363 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1364 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1368 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1370 DataArrayDouble *ret1=self->getCoords();
1373 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1376 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1378 int szArr,sw,iTypppArr;
1379 std::vector<int> stdvecTyyppArr;
1380 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1381 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1382 if(sw==3)//DataArrayInt
1384 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1385 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1386 std::string name=argpt->getName();
1388 ret->setName(name.c_str());
1390 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1393 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1395 int szArr,sw,iTypppArr;
1396 std::vector<int> stdvecTyyppArr;
1397 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1398 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1399 if(sw==3)//DataArrayInt
1401 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1402 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1403 std::string name=argpt->getName();
1405 ret->setName(name.c_str());
1407 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1410 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1412 int szArr,sw,iTypppArr;
1413 std::vector<int> stdvecTyyppArr;
1414 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1415 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1416 if(sw==3)//DataArrayInt
1418 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1419 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1420 std::string name=argpt->getName();
1422 ret->setName(name.c_str());
1424 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1427 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1429 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1430 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1433 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1435 int szArr,sw,iTypppArr;
1436 std::vector<int> stdvecTyyppArr;
1437 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1438 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1439 if(sw==3)//DataArrayInt
1441 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1442 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1443 std::string name=argpt->getName();
1445 ret->setName(name.c_str());
1447 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1450 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1452 int szArr,sw,iTypppArr;
1453 std::vector<int> stdvecTyyppArr;
1454 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1455 self->renumberNodes(tmp,newNbOfNodes);
1458 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1460 int szArr,sw,iTypppArr;
1461 std::vector<int> stdvecTyyppArr;
1462 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1463 self->renumberNodesCenter(tmp,newNbOfNodes);
1466 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1468 int spaceDim=self->getSpaceDimension();
1470 DataArrayDouble *a,*a2;
1471 DataArrayDoubleTuple *aa,*aa2;
1472 std::vector<double> bb,bb2;
1474 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1475 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1476 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1477 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1478 std::vector<int> nodes;
1479 self->findNodesOnLine(p,v,eps,nodes);
1480 DataArrayInt *ret=DataArrayInt::New();
1481 ret->alloc((int)nodes.size(),1);
1482 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1483 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1485 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1487 int spaceDim=self->getSpaceDimension();
1489 DataArrayDouble *a,*a2;
1490 DataArrayDoubleTuple *aa,*aa2;
1491 std::vector<double> bb,bb2;
1493 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1494 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1495 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1496 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1497 std::vector<int> nodes;
1498 self->findNodesOnPlane(p,v,eps,nodes);
1499 DataArrayInt *ret=DataArrayInt::New();
1500 ret->alloc((int)nodes.size(),1);
1501 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1502 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1505 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1509 DataArrayDoubleTuple *aa;
1510 std::vector<double> bb;
1512 int spaceDim=self->getSpaceDimension();
1513 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1514 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1515 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1516 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1519 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1521 DataArrayInt *c=0,*cI=0;
1525 DataArrayDoubleTuple *aa;
1526 std::vector<double> bb;
1528 int spaceDim=self->getSpaceDimension();
1529 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1530 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1531 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1532 PyObject *ret=PyTuple_New(2);
1533 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1534 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1538 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1540 DataArrayInt *c=0,*cI=0;
1541 int spaceDim=self->getSpaceDimension();
1544 DataArrayDoubleTuple *aa;
1545 std::vector<double> bb;
1548 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1549 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1551 PyObject *ret=PyTuple_New(2);
1552 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1553 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1557 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1561 DataArrayDoubleTuple *aa;
1562 std::vector<double> bb;
1564 int spaceDim=self->getSpaceDimension();
1565 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1566 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1568 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1569 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1572 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1576 std::vector<int> multiVal;
1577 std::pair<int, std::pair<int,int> > slic;
1578 MEDCoupling::DataArrayInt *daIntTyypp=0;
1579 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1583 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1585 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1587 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1589 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1593 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1595 DataArrayInt *v0=0,*v1=0;
1596 self->findCommonCells(compType,startCellId,v0,v1);
1597 PyObject *res = PyList_New(2);
1598 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1599 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1604 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1607 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1608 if (!SWIG_IsOK(res1))
1611 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1612 self->renumberNodesInConn(tmp);
1616 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1618 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1619 da2->checkAllocated();
1620 self->renumberNodesInConn(da2->getConstPointer());
1624 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1627 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1628 PyObject *ret=PyTuple_New(2);
1629 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1630 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1634 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1636 DataArrayInt *ret=0;
1638 int szArr,sw,iTypppArr;
1639 std::vector<int> stdvecTyyppArr;
1640 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1641 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1645 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1649 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1650 PyObject *res = PyList_New(3);
1651 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1652 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1653 PyList_SetItem(res,2,SWIG_From_int(ret2));
1657 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1661 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1662 PyObject *res = PyList_New(3);
1663 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1664 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1665 PyList_SetItem(res,2,SWIG_From_int(ret2));
1669 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1672 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1673 if (!SWIG_IsOK(res1))
1676 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1677 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1681 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1683 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1684 da2->checkAllocated();
1685 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1689 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1693 std::vector<int> multiVal;
1694 std::pair<int, std::pair<int,int> > slic;
1695 MEDCoupling::DataArrayInt *daIntTyypp=0;
1696 int nbc=self->getNumberOfCells();
1697 convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1704 std::ostringstream oss;
1705 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1706 throw INTERP_KERNEL::Exception(oss.str().c_str());
1709 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1714 int tmp=nbc+singleVal;
1715 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1719 std::ostringstream oss;
1720 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1721 throw INTERP_KERNEL::Exception(oss.str().c_str());
1727 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1731 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1736 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1737 daIntTyypp->checkAllocated();
1738 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1741 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1745 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1748 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1749 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1750 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1751 for(int i=0;i<sz;i++)
1752 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1755 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1758 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1760 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1761 std::vector<double> val3;
1762 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1763 "Rotate2DAlg",2,true,nbNodes);
1765 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1766 MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1769 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1772 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1773 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1774 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1775 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1776 for(int i=0;i<sz;i++)
1777 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1780 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1783 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1785 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1786 std::vector<double> val3;
1787 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1788 "Rotate3DAlg",3,true,nbNodes);
1790 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1791 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1792 MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1797 //== MEDCouplingPointSet End
1799 class MEDCouplingUMeshCell
1802 INTERP_KERNEL::NormalizedCellType getType() const;
1805 std::string __str__() const throw(INTERP_KERNEL::Exception)
1807 return self->repr();
1810 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1813 const int *r=self->getAllConn(ret2);
1814 PyObject *ret=PyTuple_New(ret2);
1815 for(int i=0;i<ret2;i++)
1816 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1822 class MEDCouplingUMeshCellIterator
1829 MEDCouplingUMeshCell *ret=self->nextt();
1831 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1834 PyErr_SetString(PyExc_StopIteration,"No more data.");
1841 class MEDCouplingUMeshCellByTypeIterator
1844 ~MEDCouplingUMeshCellByTypeIterator();
1849 MEDCouplingUMeshCellEntry *ret=self->nextt();
1851 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1854 PyErr_SetString(PyExc_StopIteration,"No more data.");
1861 class MEDCouplingUMeshCellByTypeEntry
1864 ~MEDCouplingUMeshCellByTypeEntry();
1867 MEDCouplingUMeshCellByTypeIterator *__iter__()
1869 return self->iterator();
1874 class MEDCouplingUMeshCellEntry
1877 INTERP_KERNEL::NormalizedCellType getType() const;
1878 int getNumberOfElems() const;
1881 MEDCouplingUMeshCellIterator *__iter__()
1883 return self->iterator();
1888 //== MEDCouplingUMesh
1890 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1893 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1894 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1895 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1896 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1897 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1898 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1899 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1900 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1901 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1902 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1903 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1904 void computeTypes() throw(INTERP_KERNEL::Exception);
1905 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1906 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1908 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1909 DataArrayInt *conformize3D(double eps) throw(INTERP_KERNEL::Exception);
1910 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1911 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1912 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1913 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1914 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1915 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1916 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1917 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1918 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1919 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1920 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1921 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1922 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1923 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1924 MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1925 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1926 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1927 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1928 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1929 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1930 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1931 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1932 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1933 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1934 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1935 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1936 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1937 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1938 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1939 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1940 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1941 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1942 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1943 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1944 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1945 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1946 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1947 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1948 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1949 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1950 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1951 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1952 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1953 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1954 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);
1955 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1956 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1957 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1958 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1959 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1961 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1963 return MEDCouplingUMesh::New();
1966 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1968 return MEDCouplingUMesh::New(meshName,meshDim);
1972 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1974 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1977 std::string __str__() const throw(INTERP_KERNEL::Exception)
1979 return self->simpleRepr();
1982 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1984 std::ostringstream oss;
1985 self->reprQuickOverview(oss);
1989 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1991 return self->cellIterator();
1994 static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
1996 MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2000 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
2002 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2003 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2004 PyObject *res=PyList_New(result.size());
2005 for(int i=0;iL!=result.end(); i++, iL++)
2006 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2010 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2014 std::vector<int> multiVal;
2015 std::pair<int, std::pair<int,int> > slic;
2016 MEDCoupling::DataArrayInt *daIntTyypp=0;
2017 int nbc=self->getNumberOfCells();
2018 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2025 std::ostringstream oss;
2026 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2027 throw INTERP_KERNEL::Exception(oss.str().c_str());
2031 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2038 int tmp=nbc+singleVal;
2039 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2044 std::ostringstream oss;
2045 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2046 throw INTERP_KERNEL::Exception(oss.str().c_str());
2052 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2058 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2059 daIntTyypp->checkAllocated();
2060 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2064 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2068 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2072 std::vector<int> multiVal;
2073 std::pair<int, std::pair<int,int> > slic;
2074 MEDCoupling::DataArrayInt *daIntTyypp=0;
2075 int nbc=self->getNumberOfCells();
2076 convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2083 std::ostringstream oss;
2084 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2085 throw INTERP_KERNEL::Exception(oss.str().c_str());
2089 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2096 int tmp=nbc+singleVal;
2097 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2102 std::ostringstream oss;
2103 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2104 throw INTERP_KERNEL::Exception(oss.str().c_str());
2110 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2115 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2121 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2122 daIntTyypp->checkAllocated();
2123 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2127 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2131 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2133 int szArr,sw,iTypppArr;
2134 std::vector<int> stdvecTyyppArr;
2135 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2138 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2139 throw INTERP_KERNEL::Exception(oss.str().c_str());
2141 self->insertNextCell(type,size,tmp);
2144 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2146 int szArr,sw,iTypppArr;
2147 std::vector<int> stdvecTyyppArr;
2148 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2149 self->insertNextCell(type,szArr,tmp);
2152 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2154 DataArrayInt *ret=self->getNodalConnectivity();
2159 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2161 DataArrayInt *ret=self->getNodalConnectivityIndex();
2167 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2169 int szArr,sw,iTypppArr;
2170 std::vector<int> stdvecTyyppArr;
2171 const int *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2172 int nbOfDepthPeelingPerformed=0;
2173 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2174 PyObject *res=PyTuple_New(2);
2175 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2180 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2182 DataArrayInt *v0=0,*v1=0;
2183 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2184 PyObject *res = PyList_New(2);
2185 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2194 DataArrayDoubleTuple *aa;
2195 std::vector<double> bb;
2197 int nbOfCompo=self->getSpaceDimension();
2198 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2201 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2202 PyObject *ret=PyTuple_New(2);
2203 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2204 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2208 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2210 DataArrayInt *ret1=0;
2211 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2212 PyObject *ret=PyTuple_New(2);
2213 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2221 DataArrayInt *ret1(0);
2222 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2223 PyObject *ret=PyTuple_New(3);
2224 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2225 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2230 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2232 std::vector<int> cells;
2233 self->checkButterflyCells(cells,eps);
2234 DataArrayInt *ret=DataArrayInt::New();
2235 ret->alloc((int)cells.size(),1);
2236 std::copy(cells.begin(),cells.end(),ret->getPointer());
2237 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2240 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2242 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2244 PyObject *ret = PyList_New(sz);
2245 for(int i=0;i<sz;i++)
2246 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2250 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2252 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2253 int sz=retCpp.size();
2254 PyObject *ret=PyList_New(sz);
2255 for(int i=0;i<sz;i++)
2256 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2260 static PyObject *PartitionBySpreadZone(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2262 std::vector<DataArrayInt *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2263 int sz=retCpp.size();
2264 PyObject *ret=PyList_New(sz);
2265 for(int i=0;i<sz;i++)
2266 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2270 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2273 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2274 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2275 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2278 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2281 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2282 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2286 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2289 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2290 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2294 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2296 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2297 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2298 PyObject *ret=PyTuple_New(3);
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 ));
2301 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2305 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2307 DataArrayInt *tmp0=0,*tmp1=0;
2308 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2309 PyObject *ret=PyTuple_New(2);
2310 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2311 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2315 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2319 std::vector<int> multiVal;
2320 std::pair<int, std::pair<int,int> > slic;
2321 MEDCoupling::DataArrayInt *daIntTyypp=0;
2322 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2326 return self->duplicateNodes(&singleVal,&singleVal+1);
2328 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2330 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2332 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2336 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2340 std::vector<int> multiVal;
2341 std::pair<int, std::pair<int,int> > slic;
2342 MEDCoupling::DataArrayInt *daIntTyypp=0;
2343 convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2347 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2349 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2351 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2353 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2357 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2360 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2361 DataArrayInt *tmp0,*tmp1=0;
2362 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2363 PyObject *ret=PyTuple_New(2);
2364 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2365 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2369 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2371 DataArrayInt *ret0=0,*ret1=0;
2372 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2373 PyObject *ret=PyTuple_New(2);
2374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2379 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2381 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2382 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2383 DataArrayInt *ret1=0,*ret2=0;
2384 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2385 PyObject *ret=PyTuple_New(3);
2386 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2387 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2388 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2392 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2394 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2395 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2396 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2397 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2400 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2403 std::vector<const MEDCouplingUMesh *> meshes;
2404 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2405 std::vector<DataArrayInt *> corr;
2406 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2408 PyObject *ret1=PyList_New(sz);
2409 for(int i=0;i<sz;i++)
2410 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2411 PyObject *ret=PyList_New(2);
2412 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2413 PyList_SetItem(ret,1,ret1);
2417 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2419 std::vector<MEDCouplingUMesh *> meshes;
2420 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2421 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2424 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2426 std::vector<MEDCouplingUMesh *> meshes;
2427 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2428 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2431 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2435 std::vector<int> multiVal;
2436 std::pair<int, std::pair<int,int> > slic;
2437 MEDCoupling::DataArrayInt *daIntTyypp=0;
2439 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2440 convertIntStarOrSliceLikePyObjToCpp(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2444 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2446 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2448 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2450 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2454 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2456 DataArrayInt *arrOut=0,*arrIndexOut=0;
2459 std::vector<int> multiVal;
2460 std::pair<int, std::pair<int,int> > slic;
2461 MEDCoupling::DataArrayInt *daIntTyypp=0;
2463 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2464 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2469 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2474 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2479 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2483 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2485 PyObject *ret=PyTuple_New(2);
2486 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2487 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2491 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2493 DataArrayInt *arrOut=0,*arrIndexOut=0;
2494 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2495 PyObject *ret=PyTuple_New(2);
2496 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2497 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2501 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2503 if(!PySlice_Check(slic))
2504 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2505 Py_ssize_t strt=2,stp=2,step=2;
2506 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2508 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2509 arrIndxIn->checkAllocated();
2510 if(arrIndxIn->getNumberOfComponents()!=1)
2511 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2512 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2513 DataArrayInt *arrOut=0,*arrIndexOut=0;
2514 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2515 PyObject *ret=PyTuple_New(2);
2516 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2517 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2521 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2522 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2523 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2525 DataArrayInt *arrOut=0,*arrIndexOut=0;
2528 std::vector<int> multiVal;
2529 std::pair<int, std::pair<int,int> > slic;
2530 MEDCoupling::DataArrayInt *daIntTyypp=0;
2532 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2533 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2538 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2543 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2548 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2552 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2554 PyObject *ret=PyTuple_New(2);
2555 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2561 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2565 std::vector<int> multiVal;
2566 std::pair<int, std::pair<int,int> > slic;
2567 MEDCoupling::DataArrayInt *daIntTyypp=0;
2569 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2570 convertIntStarOrSliceLikePyObjToCpp(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2575 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2580 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2585 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2589 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2593 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2597 DataArrayDoubleTuple *aa;
2598 std::vector<double> bb;
2600 int spaceDim=self->getSpaceDimension();
2601 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2602 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2604 std::vector<int> cells;
2605 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2606 DataArrayInt *ret=DataArrayInt::New();
2607 ret->alloc((int)cells.size(),1);
2608 std::copy(cells.begin(),cells.end(),ret->getPointer());
2609 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2612 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2616 DataArrayDoubleTuple *aa;
2617 std::vector<double> bb;
2619 int spaceDim=self->getSpaceDimension();
2620 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2621 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2622 self->orientCorrectly2DCells(v,polyOnly);
2625 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2627 std::vector<int> cells;
2628 self->arePolyhedronsNotCorrectlyOriented(cells);
2629 DataArrayInt *ret=DataArrayInt::New();
2630 ret->alloc((int)cells.size(),1);
2631 std::copy(cells.begin(),cells.end(),ret->getPointer());
2632 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2635 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2639 self->getFastAveragePlaneOfThis(vec,pos);
2641 std::copy(vec,vec+3,vals);
2642 std::copy(pos,pos+3,vals+3);
2643 return convertDblArrToPyListOfTuple<double>(vals,3,2);
2646 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2648 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2649 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2650 return MEDCouplingUMesh::MergeUMeshes(tmp);
2653 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2656 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2657 PyObject *ret=PyTuple_New(2);
2658 PyObject *ret0Py=ret0?Py_True:Py_False;
2660 PyTuple_SetItem(ret,0,ret0Py);
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2668 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2669 PyObject *ret=PyTuple_New(2);
2670 PyObject *ret0Py=ret0?Py_True:Py_False;
2672 PyTuple_SetItem(ret,0,ret0Py);
2673 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2679 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2680 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2681 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2682 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2683 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2684 PyObject *ret=PyTuple_New(5);
2685 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2686 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2688 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2693 PyObject *explodeIntoEdges() const throw(INTERP_KERNEL::Exception)
2695 MCAuto<DataArrayInt> desc,descIndex,revDesc,revDescIndx;
2696 MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2697 PyObject *ret=PyTuple_New(5);
2698 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2702 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2706 PyObject *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2708 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2709 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2710 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2711 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2712 MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2713 PyObject *ret=PyTuple_New(5);
2714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2715 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2716 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2717 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2718 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2722 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2724 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2725 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2726 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2727 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2728 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2729 PyObject *ret=PyTuple_New(5);
2730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2733 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2734 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2738 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2740 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2741 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2742 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2743 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2744 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2745 PyObject *ret=PyTuple_New(5);
2746 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2747 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2749 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2750 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2754 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2756 DataArrayInt *neighbors=0,*neighborsIdx=0;
2757 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2758 PyObject *ret=PyTuple_New(2);
2759 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2760 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2764 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2766 DataArrayInt *neighbors=0,*neighborsIdx=0;
2767 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2768 PyObject *ret=PyTuple_New(2);
2769 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2770 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2774 PyObject *computeEnlargedNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2776 MCAuto<DataArrayInt> neighbors,neighborsIdx;
2777 self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2778 PyObject *ret=PyTuple_New(2);
2779 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2784 PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2786 MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2787 self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2788 PyObject *ret=PyTuple_New(2);
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2794 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2796 DataArrayInt *neighbors=0,*neighborsIdx=0;
2797 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2798 PyObject *ret=PyTuple_New(2);
2799 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2806 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2807 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2808 DataArrayInt *d2,*d3,*d4,*dd5;
2809 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2810 PyObject *ret=PyTuple_New(7);
2811 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2812 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2817 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2821 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2824 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2825 da->checkAllocated();
2826 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2829 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2832 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2833 da->checkAllocated();
2834 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2837 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2840 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2841 da->checkAllocated();
2842 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2845 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2848 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2849 da->checkAllocated();
2850 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2851 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2852 PyObject *res = PyList_New(result.size());
2853 for (int i=0;iL!=result.end(); i++, iL++)
2854 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2858 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2861 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2862 da->checkAllocated();
2863 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2864 ret->setName(da->getName().c_str());
2868 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2870 DataArrayInt *cellNb1=0,*cellNb2=0;
2871 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2872 PyObject *ret=PyTuple_New(3);
2873 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2874 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2875 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2879 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2881 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2882 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2883 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2884 PyObject *ret(PyTuple_New(4));
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2892 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2894 int spaceDim=self->getSpaceDimension();
2896 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2898 DataArrayDouble *a,*a2;
2899 DataArrayDoubleTuple *aa,*aa2;
2900 std::vector<double> bb,bb2;
2902 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2903 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2904 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2905 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2907 DataArrayInt *cellIds=0;
2908 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2909 PyObject *ret=PyTuple_New(2);
2910 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2911 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2915 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2917 int spaceDim=self->getSpaceDimension();
2919 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2921 DataArrayDouble *a,*a2;
2922 DataArrayDoubleTuple *aa,*aa2;
2923 std::vector<double> bb,bb2;
2925 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2926 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2927 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2928 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2930 DataArrayInt *cellIds=0;
2931 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2932 PyObject *ret=PyTuple_New(2);
2933 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2934 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2938 MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2941 DataArrayDouble *a,*a2;
2942 DataArrayDoubleTuple *aa,*aa2;
2943 std::vector<double> bb,bb2;
2945 const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2946 const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2947 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2948 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2949 MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2953 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2955 int spaceDim=self->getSpaceDimension();
2957 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2959 DataArrayDouble *a,*a2;
2960 DataArrayDoubleTuple *aa,*aa2;
2961 std::vector<double> bb,bb2;
2963 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2964 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2965 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2966 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2967 return self->getCellIdsCrossingPlane(orig,vect,eps);
2970 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2974 std::vector<int> pos2;
2975 DataArrayInt *pos3=0;
2976 DataArrayIntTuple *pos4=0;
2977 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2982 self->convertToPolyTypes(&pos1,&pos1+1);
2989 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2994 self->convertToPolyTypes(pos3->begin(),pos3->end());
2998 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3002 void convertAllToPoly();
3003 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3004 bool unPolyze() throw(INTERP_KERNEL::Exception);
3005 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3006 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3007 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3010 //== MEDCouplingUMesh End
3012 //== MEDCouplingMappedExtrudedMesh
3014 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3017 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3018 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
3019 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3020 int get2DCellIdForExtrusion() const;
3022 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3024 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3027 MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
3029 return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3032 MEDCouplingMappedExtrudedMesh()
3034 return MEDCouplingMappedExtrudedMesh::New();
3037 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3039 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
3042 std::string __str__() const throw(INTERP_KERNEL::Exception)
3044 return self->simpleRepr();
3047 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3049 std::ostringstream oss;
3050 self->reprQuickOverview(oss);
3054 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3056 MEDCouplingUMesh *ret=self->getMesh2D();
3059 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3061 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3063 MEDCouplingUMesh *ret=self->getMesh1D();
3066 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3068 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3070 DataArrayInt *ret=self->getMesh3DIds();
3073 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3078 //== MEDCouplingMappedExtrudedMesh End
3080 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3083 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3084 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3085 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3086 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3087 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3088 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3091 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3093 int szArr,sw,iTypppArr;
3094 std::vector<int> stdvecTyyppArr;
3095 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3096 self->insertNextCell(tmp,tmp+szArr);
3099 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3101 DataArrayInt *ret=self->getNodalConnectivity();
3102 if(ret) ret->incrRef();
3106 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3108 std::vector< const MEDCoupling1GTUMesh *> parts;
3109 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3110 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3115 //== MEDCoupling1SGTUMesh
3117 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3120 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3121 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3122 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3123 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3124 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3125 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3126 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3127 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3128 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3131 MEDCoupling1SGTUMesh()
3133 return MEDCoupling1SGTUMesh::New();
3136 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3138 return MEDCoupling1SGTUMesh::New(name,type);
3141 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3143 return MEDCoupling1SGTUMesh::New(m);
3146 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3148 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3151 std::string __str__() const throw(INTERP_KERNEL::Exception)
3153 return self->simpleRepr();
3156 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3158 std::ostringstream oss;
3159 self->reprQuickOverview(oss);
3163 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3165 DataArrayInt *cellPerm(0),*nodePerm(0);
3166 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3167 PyObject *ret(PyTuple_New(3));
3168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3170 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3174 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3176 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3177 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3178 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3181 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3183 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3184 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3185 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3190 //== MEDCoupling1SGTUMesh End
3192 //== MEDCoupling1DGTUMesh
3194 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3197 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3198 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3199 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3200 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3201 bool isPacked() const throw(INTERP_KERNEL::Exception);
3204 MEDCoupling1DGTUMesh()
3206 return MEDCoupling1DGTUMesh::New();
3208 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3210 return MEDCoupling1DGTUMesh::New(name,type);
3213 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3215 return MEDCoupling1DGTUMesh::New(m);
3218 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3220 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3223 std::string __str__() const throw(INTERP_KERNEL::Exception)
3225 return self->simpleRepr();
3228 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3230 std::ostringstream oss;
3231 self->reprQuickOverview(oss);
3235 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3237 DataArrayInt *ret=self->getNodalConnectivityIndex();
3238 if(ret) ret->incrRef();
3242 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3244 DataArrayInt *ret1=0,*ret2=0;
3245 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3246 PyObject *ret0Py=ret0?Py_True:Py_False;
3248 PyObject *ret=PyTuple_New(3);
3249 PyTuple_SetItem(ret,0,ret0Py);
3250 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3251 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3255 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3258 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3259 PyObject *ret=PyTuple_New(2);
3260 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3261 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3262 PyTuple_SetItem(ret,1,ret1Py);
3266 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3268 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3269 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3270 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3273 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3275 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3276 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3277 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3280 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3282 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3283 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3284 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3289 //== MEDCoupling1DGTUMeshEnd
3291 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3294 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3295 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3296 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3297 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3298 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3299 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3300 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3301 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3302 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3303 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3304 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3305 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3306 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3307 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3308 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3311 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3313 int tmpp1=-1,tmpp2=-1;
3314 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3315 std::vector< std::pair<int,int> > inp;
3319 for(int i=0;i<tmpp1;i++)
3320 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3325 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3326 inp.resize(tmpp1/2);
3327 for(int i=0;i<tmpp1/2;i++)
3328 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3331 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3332 return self->buildStructuredSubPart(inp);
3335 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3337 std::vector< std::pair<int,int> > inp;
3338 convertPyToVectorPairInt(part,inp);
3340 int szArr,sw,iTypppArr;
3341 std::vector<int> stdvecTyyppArr;
3342 const int *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3343 std::vector<int> tmp5(tmp4,tmp4+szArr);
3345 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3348 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3350 std::vector< std::pair<int,int> > inp;
3351 convertPyToVectorPairInt(part,inp);
3352 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3355 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3357 std::vector< std::pair<int,int> > inp;
3358 convertPyToVectorPairInt(part,inp);
3359 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3362 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3364 std::vector< std::pair<int,int> > inp;
3365 convertPyToVectorPairInt(part,inp);
3366 std::vector<int> stWithGhost;
3367 std::vector< std::pair<int,int> > partWithGhost;
3368 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3369 PyObject *ret(PyTuple_New(2));
3370 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3371 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3375 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3377 std::vector< std::pair<int,int> > inp;
3378 convertPyToVectorPairInt(partCompactFormat,inp);
3379 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3382 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3384 std::vector< std::pair<int,int> > inp;
3385 convertPyToVectorPairInt(partCompactFormat,inp);
3386 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3389 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3391 std::vector< std::pair<int,int> > inp;
3392 convertPyToVectorPairInt(part,inp);
3393 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3396 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3398 int szArr,sw,iTypppArr;
3399 std::vector<int> stdvecTyyppArr;
3400 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3401 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3404 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3406 int szArr,sw,iTypppArr;
3407 std::vector<int> stdvecTyyppArr;
3408 const int *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3409 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3412 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3414 std::vector< std::pair<int,int> > inp;
3415 convertPyToVectorPairInt(partCompactFormat,inp);
3416 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3419 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3421 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3422 PyObject *retPy=PyList_New(ret.size());
3423 for(std::size_t i=0;i<ret.size();i++)
3425 PyObject *tmp=PyTuple_New(2);
3426 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3427 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3428 PyList_SetItem(retPy,i,tmp);
3433 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3435 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3436 convertPyToVectorPairInt(r1,r1Cpp);
3437 convertPyToVectorPairInt(r2,r2Cpp);
3438 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3439 PyObject *retPy=PyList_New(ret.size());
3440 for(std::size_t i=0;i<ret.size();i++)
3442 PyObject *tmp=PyTuple_New(2);
3443 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3444 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3445 PyList_SetItem(retPy,i,tmp);
3450 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3452 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3453 convertPyToVectorPairInt(r1,r1Cpp);
3454 convertPyToVectorPairInt(r2,r2Cpp);
3455 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3458 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3460 int szArr,sw,iTypppArr;
3461 std::vector<int> stdvecTyyppArr;
3462 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3463 int szArr2,sw2,iTypppArr2;
3464 std::vector<int> stdvecTyyppArr2;
3465 const int *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3466 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3467 std::vector< std::pair<int,int> > partCompactFormat;
3468 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3469 PyObject *ret=PyTuple_New(2);
3470 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3471 PyTuple_SetItem(ret,0,ret0Py);
3472 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3473 for(std::size_t i=0;i<partCompactFormat.size();i++)
3475 PyObject *tmp4=PyTuple_New(2);
3476 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3477 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3478 PyList_SetItem(ret1Py,i,tmp4);
3480 PyTuple_SetItem(ret,1,ret1Py);
3484 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3486 std::vector< std::pair<int,int> > param0,param1,ret;
3487 convertPyToVectorPairInt(bigInAbs,param0);
3488 convertPyToVectorPairInt(partOfBigInAbs,param1);
3489 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3490 PyObject *retPy(PyList_New(ret.size()));
3491 for(std::size_t i=0;i<ret.size();i++)
3493 PyObject *tmp(PyTuple_New(2));
3494 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3495 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3496 PyList_SetItem(retPy,i,tmp);
3501 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3503 std::vector< std::pair<int,int> > param0;
3504 convertPyToVectorPairInt(part,param0);
3505 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3506 PyObject *retPy(PyList_New(ret.size()));
3507 for(std::size_t i=0;i<ret.size();i++)
3509 PyObject *tmp(PyTuple_New(2));
3510 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3511 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3512 PyList_SetItem(retPy,i,tmp);
3517 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3519 std::vector< std::pair<int,int> > param0,param1;
3520 convertPyToVectorPairInt(startingFrom,param0);
3521 convertPyToVectorPairInt(goingTo,param1);
3522 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3525 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3527 std::vector< std::pair<int,int> > param0,param1,ret;
3528 convertPyToVectorPairInt(bigInAbs,param0);
3529 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3530 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3531 PyObject *retPy(PyList_New(ret.size()));
3532 for(std::size_t i=0;i<ret.size();i++)
3534 PyObject *tmp(PyTuple_New(2));
3535 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3536 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3537 PyList_SetItem(retPy,i,tmp);
3544 class MEDCouplingCurveLinearMesh;
3546 //== MEDCouplingCMesh
3548 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3551 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3552 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3553 void setCoords(const DataArrayDouble *coordsX,
3554 const DataArrayDouble *coordsY=0,
3555 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3556 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3557 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3559 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3561 return MEDCouplingCMesh::New();
3563 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3565 return MEDCouplingCMesh::New(meshName);
3568 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3570 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3572 std::string __str__() const throw(INTERP_KERNEL::Exception)
3574 return self->simpleRepr();
3576 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3578 std::ostringstream oss;
3579 self->reprQuickOverview(oss);
3582 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3584 DataArrayDouble *ret=self->getCoordsAt(i);
3592 //== MEDCouplingCMesh End
3594 //== MEDCouplingCurveLinearMesh
3596 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3599 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3600 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3601 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3603 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3605 return MEDCouplingCurveLinearMesh::New();
3607 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3609 return MEDCouplingCurveLinearMesh::New(meshName);
3611 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3613 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3615 std::string __str__() const throw(INTERP_KERNEL::Exception)
3617 return self->simpleRepr();
3619 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3621 std::ostringstream oss;
3622 self->reprQuickOverview(oss);
3625 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3627 DataArrayDouble *ret=self->getCoords();
3632 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3634 int szArr,sw,iTypppArr;
3635 std::vector<int> stdvecTyyppArr;
3636 const int *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3637 self->setNodeGridStructure(tmp,tmp+szArr);
3642 //== MEDCouplingCurveLinearMesh End
3644 //== MEDCouplingIMesh
3646 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3649 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3651 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3652 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3653 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3654 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3655 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3656 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3657 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3658 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3659 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3660 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3661 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3666 return MEDCouplingIMesh::New();
3668 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3670 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3671 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3672 const int *nodeStrctPtr(0);
3673 const double *originPtr(0),*dxyzPtr(0);
3675 std::vector<int> bb0;
3676 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3679 std::vector<double> bb,bb2;
3681 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3682 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3684 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3687 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3689 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3692 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3694 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3697 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3700 std::vector<int> bb0;
3701 const int *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3702 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3705 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3707 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3710 DataArrayDoubleTuple *aa;
3711 std::vector<double> bb;
3713 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3714 self->setOrigin(originPtr,originPtr+nbTuples);
3717 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3719 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3722 DataArrayDoubleTuple *aa;
3723 std::vector<double> bb;
3725 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3726 self->setDXYZ(originPtr,originPtr+nbTuples);
3729 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3731 std::vector< std::pair<int,int> > inp;
3732 convertPyToVectorPairInt(fineLocInCoarse,inp);
3733 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3736 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)
3738 std::vector< std::pair<int,int> > inp;
3739 convertPyToVectorPairInt(fineLocInCoarse,inp);
3740 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3743 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3745 std::vector< std::pair<int,int> > inp;
3746 convertPyToVectorPairInt(fineLocInCoarse,inp);
3747 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3750 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)
3752 std::vector< std::pair<int,int> > inp;
3753 convertPyToVectorPairInt(fineLocInCoarse,inp);
3754 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3757 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)
3759 std::vector< std::pair<int,int> > inp;
3760 convertPyToVectorPairInt(fineLocInCoarse,inp);
3761 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3764 std::string __str__() const throw(INTERP_KERNEL::Exception)
3766 return self->simpleRepr();
3768 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3770 std::ostringstream oss;
3771 self->reprQuickOverview(oss);
3777 //== MEDCouplingIMesh End
3781 namespace MEDCoupling
3783 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3786 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3787 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3788 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3789 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3790 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3791 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3792 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3793 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3794 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3795 std::string getName() const throw(INTERP_KERNEL::Exception);
3796 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3797 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3798 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3799 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3800 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3801 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3802 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3803 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3804 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3805 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3806 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3807 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3808 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3809 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3810 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3811 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3813 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3815 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3818 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3821 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3823 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3826 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3829 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3831 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3832 return convertIntArrToPyList3(ret);
3835 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3838 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3839 PyObject *ret=PyTuple_New(2);
3840 PyObject *ret0Py=ret0?Py_True:Py_False;
3842 PyTuple_SetItem(ret,0,ret0Py);
3843 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3847 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3849 DataArrayInt *ret1=0;
3850 MEDCouplingMesh *ret0=0;
3852 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3853 if (!SWIG_IsOK(res1))
3856 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3857 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3861 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3863 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3864 da2->checkAllocated();
3865 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3867 PyObject *res = PyList_New(2);
3868 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3869 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3873 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3875 DataArrayInt *ret1=0;
3877 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3878 PyObject *res=PyTuple_New(2);
3879 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3881 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3884 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3885 PyTuple_SetItem(res,1,res1);
3890 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3893 int v0; std::vector<int> v1;
3894 const int *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3895 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3898 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3899 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3902 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3903 if (!SWIG_IsOK(res1))
3906 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3907 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3911 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3913 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3914 da2->checkAllocated();
3915 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3919 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3921 std::vector<int> tmp;
3922 self->getCellIdsHavingGaussLocalization(locId,tmp);
3923 DataArrayInt *ret=DataArrayInt::New();
3924 ret->alloc((int)tmp.size(),1);
3925 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3926 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3929 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3931 std::vector<int> inp0;
3932 convertPyToNewIntArr4(code,1,3,inp0);
3933 std::vector<const DataArrayInt *> inp1;
3934 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3935 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3940 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3943 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3944 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception);
3945 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3946 static MEDCouplingFieldTemplate *New(TypeOfField type);
3947 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3948 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3951 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3953 return MEDCouplingFieldTemplate::New(f);
3956 MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f) throw(INTERP_KERNEL::Exception)
3958 return MEDCouplingFieldTemplate::New(f);
3961 MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3963 return MEDCouplingFieldTemplate::New(f);
3966 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3968 return MEDCouplingFieldTemplate::New(type);
3971 std::string __str__() const throw(INTERP_KERNEL::Exception)
3973 return self->simpleRepr();
3976 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3978 std::ostringstream oss;
3979 self->reprQuickOverview(oss);
3985 class MEDCouplingFieldInt;
3987 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3990 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3991 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3992 void setTimeUnit(const std::string& unit);
3993 std::string getTimeUnit() const;
3994 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3995 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3996 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3997 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3998 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3999 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
4000 MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
4001 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4002 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4003 MEDCouplingFieldDouble *deepCopy() const;
4004 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
4005 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
4006 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
4007 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
4008 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
4009 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
4010 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
4011 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4012 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
4013 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4014 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4015 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
4016 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
4017 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
4018 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
4019 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
4020 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
4021 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
4022 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4023 void setIteration(int it) throw(INTERP_KERNEL::Exception);
4024 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
4025 void setOrder(int order) throw(INTERP_KERNEL::Exception);
4026 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
4027 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
4028 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
4029 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4030 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
4031 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4032 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4033 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4034 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
4035 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
4036 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
4037 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
4038 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
4039 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
4040 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
4041 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
4042 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
4043 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
4044 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
4045 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
4046 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
4047 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
4048 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4049 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4050 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4051 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4052 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
4053 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4054 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4055 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4056 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4057 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4058 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4059 double getMaxValue() const throw(INTERP_KERNEL::Exception);
4060 double getMinValue() const throw(INTERP_KERNEL::Exception);
4061 double getAverageValue() const throw(INTERP_KERNEL::Exception);
4062 double norm2() const throw(INTERP_KERNEL::Exception);
4063 double normMax() const throw(INTERP_KERNEL::Exception);
4064 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4065 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4066 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4067 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4068 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4069 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4070 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4071 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4072 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4073 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4074 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4075 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4076 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4077 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4078 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4079 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4080 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4081 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4082 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4083 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4084 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4085 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4087 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4089 return MEDCouplingFieldDouble::New(type,td);
4092 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4094 return MEDCouplingFieldDouble::New(ft,td);
4097 std::string __str__() const throw(INTERP_KERNEL::Exception)
4099 return self->simpleRepr();
4102 std::string __repr__() const throw(INTERP_KERNEL::Exception)
4104 std::ostringstream oss;
4105 self->reprQuickOverview(oss);
4109 MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4111 MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4115 MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4117 MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4121 MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4123 const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4125 DataArrayDouble *a,*a2;
4126 DataArrayDoubleTuple *aa,*aa2;
4127 std::vector<double> bb,bb2;
4129 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4130 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4131 return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4134 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4136 DataArrayDouble *ret=self->getArray();
4142 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4144 std::vector<DataArrayDouble *> arrs=self->getArrays();
4145 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4149 PyObject *ret=PyTuple_New(sz);
4150 for(int i=0;i<sz;i++)
4153 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4155 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4160 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4162 std::vector<const DataArrayDouble *> tmp;
4163 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4165 std::vector<DataArrayDouble *> arrs(sz);
4166 for(int i=0;i<sz;i++)
4167 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4168 self->setArrays(arrs);
4171 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4173 DataArrayDouble *ret=self->getEndArray();
4179 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4183 DataArrayDoubleTuple *aa;
4184 std::vector<double> bb;
4186 const MEDCouplingMesh *mesh=self->getMesh();
4188 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4189 int spaceDim=mesh->getSpaceDimension();
4190 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4191 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4193 int sz=self->getNumberOfComponents();
4194 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4195 self->getValueOn(spaceLoc,res);
4196 return convertDblArrToPyList<double>(res,sz);
4199 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4201 int sz=self->getNumberOfComponents();
4202 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4203 self->getValueOnPos(i,j,k,res);
4204 return convertDblArrToPyList<double>(res,sz);
4207 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4209 const MEDCouplingMesh *mesh(self->getMesh());
4211 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4214 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4215 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4216 mesh->getSpaceDimension(),true,nbPts);
4217 return self->getValueOnMulti(inp,nbPts);
4220 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4224 DataArrayDoubleTuple *aa;
4225 std::vector<double> bb;
4227 const MEDCouplingMesh *mesh=self->getMesh();
4229 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4230 int spaceDim=mesh->getSpaceDimension();
4231 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4232 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4235 int sz=self->getNumberOfComponents();
4236 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4237 self->getValueOn(spaceLoc,time,res);
4238 return convertDblArrToPyList<double>(res,sz);
4241 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4243 if(self->getArray()!=0)
4244 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4247 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4248 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4249 self->setArray(arr);
4253 PyObject *getTime() throw(INTERP_KERNEL::Exception)
4256 double tmp0=self->getTime(tmp1,tmp2);
4257 PyObject *res = PyList_New(3);
4258 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4259 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4260 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4264 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4267 double tmp0=self->getStartTime(tmp1,tmp2);
4268 PyObject *res = PyList_New(3);
4269 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4270 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4271 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4275 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4278 double tmp0=self->getEndTime(tmp1,tmp2);
4279 PyObject *res = PyList_New(3);
4280 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4281 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4282 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4285 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4287 int sz=self->getNumberOfComponents();
4288 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4289 self->accumulate(tmp);
4290 return convertDblArrToPyList<double>(tmp,sz);
4292 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4294 int sz=self->getNumberOfComponents();
4295 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4296 self->integral(isWAbs,tmp);
4297 return convertDblArrToPyList<double>(tmp,sz);
4299 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4301 int sz=self->getNumberOfComponents();
4302 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4303 self->getWeightedAverageValue(tmp,isWAbs);
4304 return convertDblArrToPyList<double>(tmp,sz);
4306 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4308 int sz=self->getNumberOfComponents();
4309 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4311 return convertDblArrToPyList<double>(tmp,sz);
4313 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4315 int sz=self->getNumberOfComponents();
4316 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4318 return convertDblArrToPyList<double>(tmp,sz);
4320 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4322 int szArr,sw,iTypppArr;
4323 std::vector<int> stdvecTyyppArr;
4324 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4325 self->renumberCells(tmp,check);
4328 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4330 int szArr,sw,iTypppArr;
4331 std::vector<int> stdvecTyyppArr;
4332 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4333 self->renumberCellsWithoutMesh(tmp,check);
4336 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4338 int szArr,sw,iTypppArr;
4339 std::vector<int> stdvecTyyppArr;
4340 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4341 self->renumberNodes(tmp,eps);
4344 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4346 int szArr,sw,iTypppArr;
4347 std::vector<int> stdvecTyyppArr;
4348 const int *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4349 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4352 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4354 return fieldT_buildSubPart(self,li);
4357 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4359 return fieldT__getitem__(self,li);
4362 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4365 double r1=self->getMaxValue2(tmp);
4366 PyObject *ret=PyTuple_New(2);
4367 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4368 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4372 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4375 double r1=self->getMinValue2(tmp);
4376 PyObject *ret=PyTuple_New(2);
4377 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4378 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4382 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4384 std::vector<int> tmp;
4385 convertPyToNewIntArr3(li,tmp);
4386 return self->keepSelectedComponents(tmp);
4389 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4391 std::vector<int> tmp;
4392 convertPyToNewIntArr3(li,tmp);
4393 self->setSelectedComponents(f,tmp);
4396 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4399 DataArrayDouble *a,*a2;
4400 DataArrayDoubleTuple *aa,*aa2;
4401 std::vector<double> bb,bb2;
4404 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4405 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4406 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4407 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4409 return self->extractSlice3D(orig,vect,eps);
4412 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4414 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4417 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4419 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4422 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4424 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.";
4425 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4428 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4430 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4432 return (*self)-(*other);
4434 throw INTERP_KERNEL::Exception(msg);
4439 DataArrayDoubleTuple *aa;
4440 std::vector<double> bb;
4442 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4447 if(!self->getArray())
4448 throw INTERP_KERNEL::Exception(msg2);
4449 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4450 ret->applyLin(1.,-val);
4451 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4452 ret2->setArray(ret);
4457 if(!self->getArray())
4458 throw INTERP_KERNEL::Exception(msg2);
4459 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4460 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4461 ret2->setArray(ret);
4466 if(!self->getArray())
4467 throw INTERP_KERNEL::Exception(msg2);
4468 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4469 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4470 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4471 ret2->setArray(ret);
4476 if(!self->getArray())
4477 throw INTERP_KERNEL::Exception(msg2);
4478 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4479 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4480 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4481 ret2->setArray(ret);
4485 { throw INTERP_KERNEL::Exception(msg); }
4489 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4491 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4494 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4496 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4499 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4501 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4504 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4506 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.";
4507 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4510 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4512 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4514 return (*self)/(*other);
4516 throw INTERP_KERNEL::Exception(msg);
4521 DataArrayDoubleTuple *aa;
4522 std::vector<double> bb;
4524 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4530 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4531 if(!self->getArray())
4532 throw INTERP_KERNEL::Exception(msg2);
4533 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4534 ret->applyLin(1./val,0);
4535 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4536 ret2->setArray(ret);
4541 if(!self->getArray())
4542 throw INTERP_KERNEL::Exception(msg2);
4543 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4544 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4545 ret2->setArray(ret);
4550 if(!self->getArray())
4551 throw INTERP_KERNEL::Exception(msg2);
4552 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4553 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4554 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4555 ret2->setArray(ret);
4560 if(!self->getArray())
4561 throw INTERP_KERNEL::Exception(msg2);
4562 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4563 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4564 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4565 ret2->setArray(ret);
4569 { throw INTERP_KERNEL::Exception(msg); }
4573 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4575 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4578 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4580 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.";
4581 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4584 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4586 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4588 return (*self)^(*other);
4590 throw INTERP_KERNEL::Exception(msg);
4595 DataArrayDoubleTuple *aa;
4596 std::vector<double> bb;
4598 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4603 if(!self->getArray())
4604 throw INTERP_KERNEL::Exception(msg2);
4605 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4607 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4608 ret2->setArray(ret);
4613 if(!self->getArray())
4614 throw INTERP_KERNEL::Exception(msg2);
4615 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4616 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4617 ret2->setArray(ret);
4622 if(!self->getArray())
4623 throw INTERP_KERNEL::Exception(msg2);
4624 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4625 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4626 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4627 ret2->setArray(ret);
4632 if(!self->getArray())
4633 throw INTERP_KERNEL::Exception(msg2);
4634 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4635 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4636 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4637 ret2->setArray(ret);
4641 { throw INTERP_KERNEL::Exception(msg); }
4645 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4647 return self->negate();
4650 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4652 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.";
4653 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4656 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4658 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4662 Py_XINCREF(trueSelf);
4666 throw INTERP_KERNEL::Exception(msg);
4671 DataArrayDoubleTuple *aa;
4672 std::vector<double> bb;
4674 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4679 if(!self->getArray())
4680 throw INTERP_KERNEL::Exception(msg2);
4681 self->getArray()->applyLin(1.,val);
4682 Py_XINCREF(trueSelf);
4687 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4690 Py_XINCREF(trueSelf);
4695 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4696 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4697 ret2->setArray(aaa);
4699 Py_XINCREF(trueSelf);
4704 if(!self->getArray())
4705 throw INTERP_KERNEL::Exception(msg2);
4706 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4707 self->getArray()->addEqual(aaa);
4708 Py_XINCREF(trueSelf);
4712 { throw INTERP_KERNEL::Exception(msg); }
4716 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4718 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.";
4719 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4722 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4724 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4728 Py_XINCREF(trueSelf);
4732 throw INTERP_KERNEL::Exception(msg);
4737 DataArrayDoubleTuple *aa;
4738 std::vector<double> bb;
4740 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4745 if(!self->getArray())
4746 throw INTERP_KERNEL::Exception(msg2);
4747 self->getArray()->applyLin(1.,-val);
4748 Py_XINCREF(trueSelf);
4753 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4756 Py_XINCREF(trueSelf);
4761 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4762 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4763 ret2->setArray(aaa);
4765 Py_XINCREF(trueSelf);
4770 if(!self->getArray())
4771 throw INTERP_KERNEL::Exception(msg2);
4772 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4773 self->getArray()->substractEqual(aaa);
4774 Py_XINCREF(trueSelf);
4778 { throw INTERP_KERNEL::Exception(msg); }
4782 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4784 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.";
4785 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4788 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4790 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4794 Py_XINCREF(trueSelf);
4798 throw INTERP_KERNEL::Exception(msg);
4803 DataArrayDoubleTuple *aa;
4804 std::vector<double> bb;
4806 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4811 if(!self->getArray())
4812 throw INTERP_KERNEL::Exception(msg2);
4813 self->getArray()->applyLin(val,0);
4814 Py_XINCREF(trueSelf);
4819 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4822 Py_XINCREF(trueSelf);
4827 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4828 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4829 ret2->setArray(aaa);
4831 Py_XINCREF(trueSelf);
4836 if(!self->getArray())
4837 throw INTERP_KERNEL::Exception(msg2);
4838 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4839 self->getArray()->multiplyEqual(aaa);
4840 Py_XINCREF(trueSelf);
4844 { throw INTERP_KERNEL::Exception(msg); }
4848 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4850 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.";
4851 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4854 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4856 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4860 Py_XINCREF(trueSelf);
4864 throw INTERP_KERNEL::Exception(msg);
4869 DataArrayDoubleTuple *aa;
4870 std::vector<double> bb;
4872 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4878 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4879 if(!self->getArray())
4880 throw INTERP_KERNEL::Exception(msg2);
4881 self->getArray()->applyLin(1./val,0);
4882 Py_XINCREF(trueSelf);
4887 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4890 Py_XINCREF(trueSelf);
4895 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4896 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4897 ret2->setArray(aaa);
4899 Py_XINCREF(trueSelf);
4904 if(!self->getArray())
4905 throw INTERP_KERNEL::Exception(msg2);
4906 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4907 self->getArray()->divideEqual(aaa);
4908 Py_XINCREF(trueSelf);
4912 { throw INTERP_KERNEL::Exception(msg); }
4916 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4918 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.";
4919 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4922 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4924 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4928 Py_XINCREF(trueSelf);
4932 throw INTERP_KERNEL::Exception(msg);
4937 DataArrayDoubleTuple *aa;
4938 std::vector<double> bb;
4940 convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4945 if(!self->getArray())
4946 throw INTERP_KERNEL::Exception(msg2);
4947 self->getArray()->applyPow(val);
4948 Py_XINCREF(trueSelf);
4953 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4956 Py_XINCREF(trueSelf);
4961 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4962 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4963 ret2->setArray(aaa);
4965 Py_XINCREF(trueSelf);
4970 if(!self->getArray())
4971 throw INTERP_KERNEL::Exception(msg2);
4972 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4973 self->getArray()->powEqual(aaa);
4974 Py_XINCREF(trueSelf);
4978 { throw INTERP_KERNEL::Exception(msg); }
4982 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4984 std::vector<const MEDCouplingFieldDouble *> tmp;
4985 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4986 return MEDCouplingFieldDouble::MergeFields(tmp);
4989 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4991 std::vector<const MEDCouplingFieldDouble *> tmp;
4992 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4993 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4996 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4998 std::vector<double> a0;
4999 std::vector<int> a1;
5000 std::vector<std::string> a2;
5001 self->getTinySerializationDbleInformation(a0);
5002 self->getTinySerializationIntInformation(a1);
5003 self->getTinySerializationStrInformation(a2);
5005 PyObject *ret(PyTuple_New(3));
5006 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
5007 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5009 PyObject *ret2(PyList_New(sz));
5011 for(int i=0;i<sz;i++)
5012 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5014 PyTuple_SetItem(ret,2,ret2);
5018 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5020 DataArrayInt *ret0(0);
5021 std::vector<DataArrayDouble *> ret1;
5022 self->serialize(ret0,ret1);
5025 std::size_t sz(ret1.size());
5026 PyObject *ret(PyTuple_New(2));
5027 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5028 PyObject *ret1Py(PyList_New(sz));
5029 for(std::size_t i=0;i<sz;i++)
5033 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5035 PyTuple_SetItem(ret,1,ret1Py);
5039 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5041 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5042 if(!PyTuple_Check(args))
5043 throw INTERP_KERNEL::Exception(MSG);
5044 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5045 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5046 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5048 PyObject *tmp0(PyTuple_New(1));
5049 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5050 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5052 Py_DECREF(selfMeth);
5053 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5054 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5055 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5057 PyObject *a(PyInt_FromLong(0));
5058 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5061 throw INTERP_KERNEL::Exception(MSG);
5062 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5063 throw INTERP_KERNEL::Exception(MSG);
5064 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5067 Py_DECREF(initMeth);
5072 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5073 {// put an empty dict in input to say to __new__ to call __init__...
5074 self->checkConsistencyLight();
5075 PyObject *ret(PyTuple_New(1));
5076 PyObject *ret0(PyDict_New());
5078 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5079 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5080 PyDict_SetItem(ret0,a,d);
5081 Py_DECREF(a); Py_DECREF(d);
5083 PyTuple_SetItem(ret,0,ret0);
5087 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5089 self->checkConsistencyLight();
5090 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5091 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5092 const MEDCouplingMesh *mesh(self->getMesh());
5095 PyObject *ret(PyTuple_New(3));
5096 PyTuple_SetItem(ret,0,ret0);
5097 PyTuple_SetItem(ret,1,ret1);
5098 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5102 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5104 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5105 if(!PyTuple_Check(inp))
5106 throw INTERP_KERNEL::Exception(MSG);
5107 int sz(PyTuple_Size(inp));
5109 throw INTERP_KERNEL::Exception(MSG);
5111 PyObject *elt2(PyTuple_GetItem(inp,2));
5113 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5114 if(!SWIG_IsOK(status))
5115 throw INTERP_KERNEL::Exception(MSG);
5116 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5118 PyObject *elt0(PyTuple_GetItem(inp,0));
5119 PyObject *elt1(PyTuple_GetItem(inp,1));
5120 std::vector<double> a0;
5121 std::vector<int> a1;
5122 std::vector<std::string> a2;
5123 DataArrayInt *b0(0);
5124 std::vector<DataArrayDouble *>b1;
5126 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5127 throw INTERP_KERNEL::Exception(MSG);
5128 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5130 fillArrayWithPyListDbl3(a0py,tmp,a0);
5131 convertPyToNewIntArr3(a1py,a1);
5132 fillStringVector(a2py,a2);
5135 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5136 throw INTERP_KERNEL::Exception(MSG);
5137 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5139 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5140 if(!SWIG_IsOK(status))
5141 throw INTERP_KERNEL::Exception(MSG);
5142 b0=reinterpret_cast<DataArrayInt *>(argp);
5143 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5145 self->checkForUnserialization(a1,b0,b1);
5146 // useless here to call resizeForUnserialization because arrays are well resized.
5147 self->finishUnserialization(a1,a0,a2);
5152 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5155 int getNumberOfFields() const;
5156 MEDCouplingMultiFields *deepCopy() const;
5157 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5158 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5159 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5160 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5161 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5164 std::string __str__() const throw(INTERP_KERNEL::Exception)
5166 return self->simpleRepr();
5168 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5170 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5171 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5173 std::vector<MEDCouplingFieldDouble *> fs(sz);
5174 for(int i=0;i<sz;i++)
5175 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5176 return MEDCouplingMultiFields::New(fs);
5178 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5180 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5181 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5183 std::vector<MEDCouplingFieldDouble *> fs(sz);
5184 for(int i=0;i<sz;i++)
5185 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5186 return MEDCouplingMultiFields::New(fs);
5188 PyObject *getFields() const
5190 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5191 int sz=fields.size();
5192 PyObject *res = PyList_New(sz);
5193 for(int i=0;i<sz;i++)
5197 fields[i]->incrRef();
5198 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5202 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5207 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5209 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5213 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5216 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5218 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5220 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5222 PyObject *res = PyList_New(sz);
5223 for(int i=0;i<sz;i++)
5228 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5232 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5237 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5239 std::vector<int> refs;
5240 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5242 PyObject *res = PyList_New(sz);
5243 for(int i=0;i<sz;i++)
5248 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5252 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5256 PyObject *ret=PyTuple_New(2);
5257 PyTuple_SetItem(ret,0,res);
5258 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5261 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5263 std::vector<DataArrayDouble *> ms=self->getArrays();
5265 PyObject *res = PyList_New(sz);
5266 for(int i=0;i<sz;i++)
5271 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5275 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5280 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5282 std::vector< std::vector<int> > refs;
5283 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5285 PyObject *res = PyList_New(sz);
5286 PyObject *res2 = PyList_New(sz);
5287 for(int i=0;i<sz;i++)
5292 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5296 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5298 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5301 PyObject *ret=PyTuple_New(2);
5302 PyTuple_SetItem(ret,0,res);
5303 PyTuple_SetItem(ret,1,res2);
5309 class MEDCouplingFieldInt : public MEDCouplingField
5312 static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5313 static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5314 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5315 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5316 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5317 void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5318 MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5319 MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5320 MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5321 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5322 MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5324 MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5326 return MEDCouplingFieldInt::New(type,td);
5329 MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5331 return MEDCouplingFieldInt::New(ft,td);
5334 std::string __str__() const throw(INTERP_KERNEL::Exception)
5336 return self->simpleRepr();
5339 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5341 std::ostringstream oss;
5342 self->reprQuickOverview(oss);
5346 MEDCouplingFieldInt *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5348 return fieldT_buildSubPart(self,li);
5351 MEDCouplingFieldInt *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5353 return fieldT__getitem__(self,li);
5356 DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5358 DataArrayInt *ret=self->getArray();
5364 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5367 double tmp0=self->getTime(tmp1,tmp2);
5368 PyObject *res = PyList_New(3);
5369 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5370 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5371 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5377 class MEDCouplingFieldFloat : public MEDCouplingField
5380 static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5381 static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5382 void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5383 std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5384 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5385 void setArray(DataArrayFloat *array) throw(INTERP_KERNEL::Exception);
5386 MEDCouplingFieldFloat *deepCopy() const throw(INTERP_KERNEL::Exception);
5387 MEDCouplingFieldFloat *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5388 MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5389 MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5390 MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
5392 MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5394 return MEDCouplingFieldFloat::New(type,td);
5397 MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5399 return MEDCouplingFieldFloat::New(ft,td);
5402 std::string __str__() const throw(INTERP_KERNEL::Exception)
5404 return self->simpleRepr();
5407 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5409 std::ostringstream oss;
5410 self->reprQuickOverview(oss);
5414 MEDCouplingFieldFloat *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
5416 return fieldT_buildSubPart(self,li);
5419 MEDCouplingFieldFloat *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
5421 return fieldT__getitem__(self,li);
5424 DataArrayFloat *getArray() throw(INTERP_KERNEL::Exception)
5426 DataArrayFloat *ret=self->getArray();
5432 PyObject *getTime() throw(INTERP_KERNEL::Exception)
5435 double tmp0=self->getTime(tmp1,tmp2);
5436 PyObject *res = PyList_New(3);
5437 PyList_SetItem(res,0,SWIG_From_double(tmp0));
5438 PyList_SetItem(res,1,SWIG_From_int(tmp1));
5439 PyList_SetItem(res,2,SWIG_From_int(tmp2));
5445 class MEDCouplingDefinitionTime
5448 MEDCouplingDefinitionTime();
5449 void assign(const MEDCouplingDefinitionTime& other);
5450 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5451 double getTimeResolution() const;
5452 std::vector<double> getHotSpotsTime() const;
5455 std::string __str__() const throw(INTERP_KERNEL::Exception)
5457 std::ostringstream oss;
5458 self->appendRepr(oss);
5462 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5464 int meshId,arrId,arrIdInField,fieldId;
5465 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5466 PyObject *res=PyList_New(4);
5467 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5468 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5469 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5470 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5474 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5476 int meshId,arrId,arrIdInField,fieldId;
5477 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5478 PyObject *res=PyList_New(4);
5479 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5480 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5481 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5482 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5488 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5491 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5492 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5496 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5498 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5499 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5501 std::vector<MEDCouplingFieldDouble *> fs(sz);
5502 for(int i=0;i<sz;i++)
5503 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5504 return MEDCouplingFieldOverTime::New(fs);
5506 std::string __str__() const throw(INTERP_KERNEL::Exception)
5508 return self->simpleRepr();
5510 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5512 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5513 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5515 std::vector<MEDCouplingFieldDouble *> fs(sz);
5516 for(int i=0;i<sz;i++)
5517 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5518 return MEDCouplingFieldOverTime::New(fs);
5523 class MEDCouplingCartesianAMRMesh;
5525 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5528 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5529 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5530 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5533 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5535 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5543 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5546 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5547 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5548 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5551 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5553 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5554 return convertFromVectorPairInt(ret);
5557 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5559 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5560 return convertFromVectorPairInt(ret);
5563 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5565 std::vector< std::pair<int,int> > inp;
5566 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5567 self->addPatch(inp,factors);
5570 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5572 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5574 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5575 if(patchId==mesh->getNumberOfPatches())
5577 std::ostringstream oss;
5578 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5579 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5582 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5588 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5590 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5592 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5593 mesh->removePatch(patchId);
5596 int __len__() const throw(INTERP_KERNEL::Exception)
5598 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5600 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5601 return mesh->getNumberOfPatches();
5606 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5610 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5613 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5614 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5615 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5616 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5617 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5618 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5619 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5620 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5621 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5622 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5623 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5624 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5625 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5627 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5628 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5629 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5630 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5631 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5632 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5633 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5634 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5635 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5636 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5637 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5638 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5639 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5640 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5641 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5642 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5643 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5644 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5645 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5646 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5649 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5651 std::vector< std::pair<int,int> > inp;
5652 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5653 self->addPatch(inp,factors);
5656 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5658 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5660 PyObject *ret = PyList_New(sz);
5661 for(int i=0;i<sz;i++)
5663 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5666 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5671 // agy : don't know why typemap fails here ??? let it in the extend section
5672 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5674 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5677 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5679 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5680 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5686 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5688 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5689 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5695 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5697 std::vector<int> out1;
5698 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5699 PyObject *ret(PyTuple_New(2));
5700 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5701 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5705 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5707 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5709 PyObject *ret = PyList_New(sz);
5710 for(int i=0;i<sz;i++)
5711 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5715 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5717 std::vector<const DataArrayDouble *> inp;
5718 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5719 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5722 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5724 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5730 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5732 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5738 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5740 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5746 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5748 const MEDCouplingIMesh *ret(self->getImageMesh());
5751 return const_cast<MEDCouplingIMesh *>(ret);
5754 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5756 if(patchId==self->getNumberOfPatches())
5758 std::ostringstream oss;
5759 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5760 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5763 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5769 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5771 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5772 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5773 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5776 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5778 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5779 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5780 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5783 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5785 self->removePatch(patchId);
5788 int __len__() const throw(INTERP_KERNEL::Exception)
5790 return self->getNumberOfPatches();
5795 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5799 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5802 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5805 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5807 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5808 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5809 const int *nodeStrctPtr(0);
5810 const double *originPtr(0),*dxyzPtr(0);
5812 std::vector<int> bb0;
5813 nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5816 std::vector<double> bb,bb2;
5818 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5819 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5821 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5824 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5826 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5827 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5828 std::vector< std::vector<int> > inp2;
5829 convertPyToVectorOfVectorOfInt(factors,inp2);
5830 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5833 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5835 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5838 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5840 return MEDCouplingCartesianAMRMesh::New(mesh);
5845 class MEDCouplingDataForGodFather : public RefCountObject
5848 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5849 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5850 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5851 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5852 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5853 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5854 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5855 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5856 virtual void alloc() throw(INTERP_KERNEL::Exception);
5857 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5860 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5862 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5870 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5873 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5874 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5875 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5876 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5877 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5878 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5879 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5880 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5881 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5884 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5886 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5887 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5888 MEDCouplingAMRAttribute *ret(0);
5891 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5892 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5894 catch(INTERP_KERNEL::Exception&)
5896 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5897 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5902 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5904 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5907 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5909 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5910 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5916 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5918 std::vector< std::vector<std::string> > compNamesCpp;
5919 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5920 self->spillInfoOnComponents(compNamesCpp);
5923 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5925 std::vector<int> inp0;
5926 if(!fillIntVector(nfs,inp0))
5927 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5928 std::size_t sz(inp0.size());
5929 std::vector<NatureOfField> inp00(sz);
5930 for(std::size_t i=0;i<sz;i++)
5931 inp00[i]=(NatureOfField)inp0[i];
5932 self->spillNatures(inp00);
5935 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5937 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5938 int sz((int)ret.size());
5939 PyObject *retPy(PyList_New(sz));
5940 for(int i=0;i<sz;i++)
5941 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5947 class DenseMatrix : public RefCountObject, public TimeLabel
5950 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5951 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5952 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5953 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5955 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5956 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5957 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5958 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5959 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5960 void transpose() throw(INTERP_KERNEL::Exception);
5962 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5963 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5964 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5967 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5969 return DenseMatrix::New(nbRows,nbCols);
5972 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5974 return DenseMatrix::New(array,nbRows,nbCols);
5977 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5980 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5981 PyObject *ret=PyTuple_New(2);
5982 PyObject *ret0Py=ret0?Py_True:Py_False;
5984 PyTuple_SetItem(ret,0,ret0Py);
5985 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5989 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5991 DataArrayDouble *ret(self->getData());
5997 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5999 return MEDCoupling::DenseMatrix::Add(self,other);
6002 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6004 return MEDCoupling::DenseMatrix::Substract(self,other);
6007 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6009 return MEDCoupling::DenseMatrix::Multiply(self,other);
6012 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
6014 return MEDCoupling::DenseMatrix::Multiply(self,other);
6017 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6019 self->addEqual(other);
6020 Py_XINCREF(trueSelf);
6024 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
6026 self->substractEqual(other);
6027 Py_XINCREF(trueSelf);
6031 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6033 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6043 __filename=os.environ.get('PYTHONSTARTUP')
6044 if __filename and os.path.isfile(__filename):
6045 execfile(__filename)