1 // Copyright (C) 2007-2015 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 "MEDCouplingFieldTemplate.hxx"
41 #include "MEDCouplingGaussLocalization.hxx"
43 #include "MEDCouplingMultiFields.hxx"
44 #include "MEDCouplingFieldOverTime.hxx"
45 #include "MEDCouplingDefinitionTime.hxx"
46 #include "MEDCouplingFieldDiscretization.hxx"
47 #include "MEDCouplingCartesianAMRMesh.hxx"
48 #include "MEDCouplingAMRAttribute.hxx"
49 #include "MEDCouplingMatrix.hxx"
50 #include "MEDCouplingPartDefinition.hxx"
51 #include "MEDCouplingSkyLineArray.hxx"
52 #include "MEDCouplingTypemaps.i"
54 #include "InterpKernelAutoPtr.hxx"
55 #include "BoxSplittingOptions.hxx"
57 using namespace MEDCoupling;
58 using namespace INTERP_KERNEL;
62 %template(ivec) std::vector<int>;
63 %template(dvec) std::vector<double>;
64 %template(svec) std::vector<std::string>;
67 %typemap(out) MEDCoupling::MEDCouplingMesh*
69 $result=convertMesh($1,$owner);
72 %typemap(out) MEDCouplingMesh*
74 $result=convertMesh($1,$owner);
79 %typemap(out) MEDCoupling::MEDCouplingPointSet*
81 $result=convertMesh($1,$owner);
84 %typemap(out) MEDCouplingPointSet*
86 $result=convertMesh($1,$owner);
91 %typemap(out) MEDCouplingCartesianAMRPatchGen*
93 $result=convertCartesianAMRPatch($1,$owner);
98 %typemap(out) MEDCouplingCartesianAMRMeshGen*
100 $result=convertCartesianAMRMesh($1,$owner);
105 %typemap(out) MEDCouplingDataForGodFather*
107 $result=convertDataForGodFather($1,$owner);
112 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
114 $result=convertMesh($1,$owner);
117 %typemap(out) MEDCoupling1GTUMesh*
119 $result=convertMesh($1,$owner);
124 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
126 $result=convertMesh($1,$owner);
129 %typemap(out) MEDCouplingStructuredMesh*
131 $result=convertMesh($1,$owner);
136 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
138 $result=convertFieldDiscretization($1,$owner);
141 %typemap(out) MEDCouplingFieldDiscretization*
143 $result=convertFieldDiscretization($1,$owner);
148 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
150 $result=convertMultiFields($1,$owner);
153 %typemap(out) MEDCouplingMultiFields*
155 $result=convertMultiFields($1,$owner);
160 %typemap(out) MEDCoupling::PartDefinition*
162 $result=convertPartDefinition($1,$owner);
165 %typemap(out) PartDefinition*
167 $result=convertPartDefinition($1,$owner);
172 %init %{ import_array(); %}
175 %feature("autodoc", "1");
176 %feature("docstring");
178 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
179 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
180 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
181 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
182 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
183 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
184 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
185 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
186 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
187 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
188 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
189 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
190 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
191 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
192 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
193 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
194 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
195 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
196 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
197 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
198 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
199 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
200 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
201 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
202 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
203 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
204 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
205 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
206 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
207 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
208 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
209 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
210 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
211 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
212 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
213 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
214 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
215 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
216 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
217 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
218 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
231 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
232 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
233 %newobject MEDCoupling::MEDCouplingMesh::clone;
234 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
235 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
236 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
237 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
238 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
239 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
240 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
241 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
242 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
243 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
244 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
245 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
246 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
247 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
248 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
249 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
250 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
251 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
252 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
253 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
254 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
255 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
256 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
257 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
258 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
259 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
260 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
261 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
262 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
263 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
264 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
265 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
266 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
267 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
268 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
269 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
270 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
271 %newobject MEDCoupling::MEDCouplingUMesh::New;
272 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
273 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
274 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
275 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
276 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
277 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
278 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
279 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
280 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
281 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
282 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
283 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
284 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
285 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
286 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
287 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
288 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
289 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
290 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
291 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
292 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
293 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
294 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
295 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
296 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
297 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
298 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
299 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
300 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
301 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
302 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
303 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
304 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
305 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
306 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
307 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
308 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
309 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
310 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
311 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
312 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
313 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
314 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
315 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
316 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
317 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
318 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
319 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
320 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
321 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
322 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
323 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
324 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
325 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
326 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
327 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
328 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
329 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
330 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
331 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
332 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
333 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
334 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
335 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
336 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
337 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
338 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
339 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
340 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
341 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
342 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
343 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
344 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
345 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
346 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
347 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
348 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
349 %newobject MEDCoupling::MEDCouplingCMesh::New;
350 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
351 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
352 %newobject MEDCoupling::MEDCouplingIMesh::New;
353 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
354 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
355 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
356 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
357 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
358 %newobject MEDCoupling::MEDCouplingMultiFields::New;
359 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
360 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
361 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
362 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
363 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
364 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
365 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
366 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
367 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
368 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
369 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
370 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
371 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
372 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
373 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
374 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
375 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
376 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
377 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
378 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
379 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
380 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
381 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
382 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
383 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
384 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
385 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
386 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
387 %newobject MEDCoupling::DenseMatrix::New;
388 %newobject MEDCoupling::DenseMatrix::deepCopy;
389 %newobject MEDCoupling::DenseMatrix::shallowCpy;
390 %newobject MEDCoupling::DenseMatrix::getData;
391 %newobject MEDCoupling::DenseMatrix::matVecMult;
392 %newobject MEDCoupling::DenseMatrix::MatVecMult;
393 %newobject MEDCoupling::DenseMatrix::__add__;
394 %newobject MEDCoupling::DenseMatrix::__sub__;
395 %newobject MEDCoupling::DenseMatrix::__mul__;
396 %newobject MEDCoupling::PartDefinition::New;
397 %newobject MEDCoupling::PartDefinition::toDAI;
398 %newobject MEDCoupling::PartDefinition::__add__;
399 %newobject MEDCoupling::PartDefinition::composeWith;
400 %newobject MEDCoupling::PartDefinition::tryToSimplify;
401 %newobject MEDCoupling::DataArrayPartDefinition::New;
402 %newobject MEDCoupling::SlicePartDefinition::New;
404 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
405 %feature("unref") MEDCouplingMesh "$this->decrRef();"
406 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
407 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
408 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
409 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
410 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
411 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
412 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
413 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
414 %feature("unref") MEDCouplingField "$this->decrRef();"
415 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
416 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
417 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
418 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
419 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
420 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
421 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
422 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
423 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
424 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
425 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
426 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
427 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
428 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
429 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
430 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
431 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
432 %feature("unref") DenseMatrix "$this->decrRef();"
433 %feature("unref") PartDefinition "$this->decrRef();"
434 %feature("unref") DataArrayPartDefinition "$this->decrRef();"
435 %feature("unref") SlicePartDefinition "$this->decrRef();"
437 %rename(assign) *::operator=;
438 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
439 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
440 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
441 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
445 %rename (InterpKernelException) INTERP_KERNEL::Exception;
447 %include "MEDCouplingRefCountObject.i"
448 %include "MEDCouplingMemArray.i"
450 namespace INTERP_KERNEL
453 * \class BoxSplittingOptions
454 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
456 class BoxSplittingOptions
459 BoxSplittingOptions();
460 void init() throw(INTERP_KERNEL::Exception);
461 double getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
462 void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
463 double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
464 void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
465 int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
466 void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
467 int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
468 void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
469 int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
470 void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
471 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
472 std::string printOptions() const throw(INTERP_KERNEL::Exception);
475 std::string __str__() const throw(INTERP_KERNEL::Exception)
477 return self->printOptions();
483 namespace MEDCoupling
499 CONST_ON_TIME_INTERVAL = 7
500 } TypeOfTimeDiscretization;
508 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
509 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
511 } MEDCouplingMeshType;
514 class DataArrayDouble;
515 class MEDCouplingUMesh;
516 class MEDCouplingFieldDouble;
518 %extend RefCountObject
520 std::string getHiddenCppPointer() const
522 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
527 %extend MEDCouplingGaussLocalization
529 std::string __str__() const throw(INTERP_KERNEL::Exception)
531 return self->getStringRepr();
534 std::string __repr__() const throw(INTERP_KERNEL::Exception)
536 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
537 oss << self->getStringRepr();
544 class MEDCouplingMesh : public RefCountObject, public TimeLabel
547 void setName(const std::string& name);
548 std::string getName() const;
549 void setDescription(const std::string& descr);
550 std::string getDescription() const;
551 void setTime(double val, int iteration, int order);
552 void setTimeUnit(const std::string& unit);
553 std::string getTimeUnit() const;
554 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
555 bool isStructured() const throw(INTERP_KERNEL::Exception);
556 virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
557 virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
558 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
559 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
560 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
561 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
562 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
563 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
564 virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
565 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
566 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
567 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
568 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
576 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
577 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
578 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
579 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
580 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
581 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
582 virtual std::string getVTKFileExtension() const;
583 std::string getVTKFileNameOf(const std::string& fileName) const;
585 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
587 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
588 virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
589 virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
590 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
591 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
592 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
593 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
594 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
595 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);
596 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
597 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
598 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
599 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
600 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
601 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
602 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
605 std::string __str__() const throw(INTERP_KERNEL::Exception)
607 return self->simpleRepr();
610 PyObject *getTime() throw(INTERP_KERNEL::Exception)
613 double tmp0=self->getTime(tmp1,tmp2);
614 PyObject *res = PyList_New(3);
615 PyList_SetItem(res,0,SWIG_From_double(tmp0));
616 PyList_SetItem(res,1,SWIG_From_int(tmp1));
617 PyList_SetItem(res,2,SWIG_From_int(tmp2));
621 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
625 DataArrayDoubleTuple *aa;
626 std::vector<double> bb;
628 int spaceDim=self->getSpaceDimension();
629 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
630 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
631 return self->getCellContainingPoint(pos,eps);
634 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
638 DataArrayDoubleTuple *aa;
639 std::vector<double> bb;
641 int spaceDim=self->getSpaceDimension();
642 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
643 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
644 MCAuto<DataArrayInt> elts,eltsIndex;
645 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
646 PyObject *ret=PyTuple_New(2);
647 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
648 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
652 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
654 MCAuto<DataArrayInt> elts,eltsIndex;
655 int spaceDim=self->getSpaceDimension();
657 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
658 if (!SWIG_IsOK(res1))
661 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
662 int nbOfPoints=size/spaceDim;
665 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
667 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
671 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
673 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
674 da2->checkAllocated();
675 int size=da2->getNumberOfTuples();
676 int nbOfCompo=da2->getNumberOfComponents();
677 if(nbOfCompo!=spaceDim)
679 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
681 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
683 PyObject *ret=PyTuple_New(2);
684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
689 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
693 DataArrayDoubleTuple *aa;
694 std::vector<double> bb;
696 int spaceDim=self->getSpaceDimension();
697 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
698 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
699 std::vector<int> elts;
700 self->getCellsContainingPoint(pos,eps,elts);
701 DataArrayInt *ret=DataArrayInt::New();
702 ret->alloc((int)elts.size(),1);
703 std::copy(elts.begin(),elts.end(),ret->getPointer());
704 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
707 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
709 MCAuto<DataArrayInt> d0=DataArrayInt::New();
710 MCAuto<DataArrayInt> d1=DataArrayInt::New();
711 self->getReverseNodalConnectivity(d0,d1);
712 PyObject *ret=PyTuple_New(2);
713 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
714 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
718 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
721 int v0; std::vector<int> v1;
722 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
723 self->renumberCells(ids,check);
726 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
728 DataArrayInt *cellCor, *nodeCor;
729 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
730 PyObject *res = PyList_New(2);
731 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
732 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
736 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
738 DataArrayInt *cellCor=0,*nodeCor=0;
739 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
740 PyObject *res = PyList_New(2);
741 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
742 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
746 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
748 DataArrayInt *cellCor=0;
749 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
753 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
756 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
757 if (!SWIG_IsOK(res1))
760 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
761 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
765 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
767 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
768 da2->checkAllocated();
769 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
772 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
774 std::vector<int> conn;
775 self->getNodeIdsOfCell(cellId,conn);
776 return convertIntArrToPyList2(conn);
779 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
781 std::vector<double> coo;
782 self->getCoordinatesOfNode(nodeId,coo);
783 return convertDblArrToPyList2(coo);
786 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
790 DataArrayDoubleTuple *aa;
791 std::vector<double> bb;
793 int spaceDim=self->getSpaceDimension();
794 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
795 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
796 self->scale(pointPtr,factor);
799 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
801 int spaceDim=self->getSpaceDimension();
802 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
803 self->getBoundingBox(tmp);
804 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
808 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
811 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
812 PyObject *ret=PyTuple_New(2);
813 PyObject *ret0Py=ret0?Py_True:Py_False;
815 PyTuple_SetItem(ret,0,ret0Py);
816 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
820 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
822 int szArr,sw,iTypppArr;
823 std::vector<int> stdvecTyyppArr;
824 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
825 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
826 if(sw==3)//DataArrayInt
828 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
829 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
830 std::string name=argpt->getName();
832 ret->setName(name.c_str());
834 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
837 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
839 int szArr,sw,iTypppArr;
840 std::vector<int> stdvecTyyppArr;
842 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
843 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
844 if(sw==3)//DataArrayInt
846 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
847 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
848 std::string name=argpt->getName();
850 ret->setName(name.c_str());
853 PyObject *res = PyList_New(2);
854 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
855 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
856 PyList_SetItem(res,0,obj0);
857 PyList_SetItem(res,1,obj1);
861 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
865 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
866 PyObject *res = PyTuple_New(2);
867 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
870 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
872 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
873 PyTuple_SetItem(res,0,obj0);
874 PyTuple_SetItem(res,1,obj1);
878 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
880 std::vector<int> vals=self->getDistributionOfTypes();
882 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
883 PyObject *ret=PyList_New((int)vals.size()/3);
884 for(int j=0;j<(int)vals.size()/3;j++)
886 PyObject *ret1=PyList_New(3);
887 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
888 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
889 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
890 PyList_SetItem(ret,j,ret1);
895 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
897 std::vector<int> code;
898 std::vector<const DataArrayInt *> idsPerType;
899 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
900 convertPyToNewIntArr4(li,1,3,code);
901 return self->checkTypeConsistencyAndContig(code,idsPerType);
904 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
906 std::vector<int> code;
907 std::vector<DataArrayInt *> idsInPflPerType;
908 std::vector<DataArrayInt *> idsPerType;
909 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
910 PyObject *ret=PyTuple_New(3);
913 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
914 PyObject *ret0=PyList_New((int)code.size()/3);
915 for(int j=0;j<(int)code.size()/3;j++)
917 PyObject *ret00=PyList_New(3);
918 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
919 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
920 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
921 PyList_SetItem(ret0,j,ret00);
923 PyTuple_SetItem(ret,0,ret0);
925 PyObject *ret1=PyList_New(idsInPflPerType.size());
926 for(std::size_t j=0;j<idsInPflPerType.size();j++)
927 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
928 PyTuple_SetItem(ret,1,ret1);
929 int n=idsPerType.size();
930 PyObject *ret2=PyList_New(n);
932 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
933 PyTuple_SetItem(ret,2,ret2);
937 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
941 DataArrayDoubleTuple *aa;
942 std::vector<double> bb;
944 int spaceDim=self->getSpaceDimension();
945 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
946 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
947 self->translate(vectorPtr);
950 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
952 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
955 DataArrayDoubleTuple *aa;
956 std::vector<double> bb;
958 int spaceDim=self->getSpaceDimension();
959 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
960 self->rotate(centerPtr,0,alpha);
963 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
965 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
967 DataArrayDouble *a,*a2;
968 DataArrayDoubleTuple *aa,*aa2;
969 std::vector<double> bb,bb2;
971 int spaceDim=self->getSpaceDimension();
972 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
973 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
974 self->rotate(centerPtr,vectorPtr,alpha);
977 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
979 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
980 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
981 PyObject *res=PyList_New(result.size());
982 for(int i=0;iL!=result.end(); i++, iL++)
983 PyList_SetItem(res,i,PyInt_FromLong(*iL));
987 virtual PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
989 std::vector<double> a0;
991 std::vector<std::string> a2;
992 self->getTinySerializationInformation(a0,a1,a2);
993 PyObject *ret(PyTuple_New(3));
994 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
995 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
997 PyObject *ret2(PyList_New(sz));
999 for(int i=0;i<sz;i++)
1000 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1002 PyTuple_SetItem(ret,2,ret2);
1006 virtual PyObject *serialize() const throw(INTERP_KERNEL::Exception)
1008 DataArrayInt *a0Tmp(0);
1009 DataArrayDouble *a1Tmp(0);
1010 self->serialize(a0Tmp,a1Tmp);
1011 PyObject *ret(PyTuple_New(2));
1012 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1013 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1017 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2) const throw(INTERP_KERNEL::Exception)
1019 std::vector<std::string> littleStrings;
1020 self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1023 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1024 {// put an empty dict in input to say to __new__ to call __init__...
1025 PyObject *ret(PyTuple_New(1));
1026 PyObject *ret0(PyDict_New());
1027 PyTuple_SetItem(ret,0,ret0);
1031 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
1033 PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1034 PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1035 PyObject *ret(PyTuple_New(2));
1036 PyTuple_SetItem(ret,0,ret0);
1037 PyTuple_SetItem(ret,1,ret1);
1041 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1043 static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1044 if(!PyTuple_Check(inp))
1045 throw INTERP_KERNEL::Exception(MSG);
1046 int sz(PyTuple_Size(inp));
1048 throw INTERP_KERNEL::Exception(MSG);
1049 PyObject *elt0(PyTuple_GetItem(inp,0));
1050 PyObject *elt1(PyTuple_GetItem(inp,1));
1051 std::vector<double> a0;
1052 std::vector<int> a1;
1053 std::vector<std::string> a2;
1054 DataArrayInt *b0(0);
1055 DataArrayDouble *b1(0);
1057 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1058 throw INTERP_KERNEL::Exception(MSG);
1059 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1061 fillArrayWithPyListDbl3(a0py,tmp,a0);
1062 convertPyToNewIntArr3(a1py,a1);
1063 fillStringVector(a2py,a2);
1066 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1067 throw INTERP_KERNEL::Exception(MSG);
1068 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1070 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
1071 if(!SWIG_IsOK(status))
1072 throw INTERP_KERNEL::Exception(MSG);
1073 b0=reinterpret_cast<DataArrayInt *>(argp);
1074 status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1075 if(!SWIG_IsOK(status))
1076 throw INTERP_KERNEL::Exception(MSG);
1077 b1=reinterpret_cast<DataArrayDouble *>(argp);
1079 // useless here to call resizeForUnserialization because arrays are well resized.
1080 self->unserialization(a0,a1,b0,b1,a2);
1083 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1085 std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1086 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1087 return MEDCouplingMesh::MergeMeshes(tmp);
1093 //== MEDCouplingMesh End
1095 %include "NormalizedGeometricTypes"
1096 %include "MEDCouplingNatureOfFieldEnum"
1098 namespace MEDCoupling
1100 class MEDCouplingNatureOfField
1103 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1104 static std::string GetReprNoThrow(NatureOfField nat);
1105 static std::string GetAllPossibilitiesStr();
1109 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1110 // include "MEDCouplingTimeDiscretization.i"
1112 namespace MEDCoupling
1114 class MEDCouplingGaussLocalization
1117 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1118 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1119 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1120 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1121 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1122 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1123 int getDimension() const throw(INTERP_KERNEL::Exception);
1124 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1125 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1126 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1127 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1129 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1130 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1131 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1132 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1133 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1134 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1135 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1136 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1137 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1138 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1139 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1140 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1142 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1145 class MEDCouplingSkyLineArray
1148 MEDCouplingSkyLineArray();
1149 MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
1150 MEDCouplingSkyLineArray( DataArrayInt* index, DataArrayInt* value );
1151 MEDCouplingSkyLineArray( const std::vector<int>& index, const std::vector<int>& value );
1153 void set( DataArrayInt* index, DataArrayInt* value );
1154 int getNumberOf() const;
1155 int getLength() const;
1156 DataArrayInt* getIndexArray() const;
1157 DataArrayInt* getValueArray() const;
1160 std::string __str__() const throw(INTERP_KERNEL::Exception)
1162 return self->simpleRepr();
1168 %include "MEDCouplingFieldDiscretization.i"
1170 //== MEDCouplingPointSet
1172 namespace MEDCoupling
1174 class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1177 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1178 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1179 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1180 void zipCoords() throw(INTERP_KERNEL::Exception);
1181 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1182 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1183 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1184 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1185 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1186 virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1187 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1188 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1189 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1190 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1191 virtual DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1192 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1193 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1194 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1195 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1196 virtual DataArrayInt *findBoundaryNodes() const;
1197 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1198 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1199 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1200 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1201 virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1202 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1203 virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
1204 virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
1205 virtual MEDCouplingFieldDouble *computeDiameterField() const throw(INTERP_KERNEL::Exception);
1208 std::string __str__() const throw(INTERP_KERNEL::Exception)
1210 return self->simpleRepr();
1213 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1216 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1217 PyObject *res = PyList_New(2);
1218 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1219 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1223 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1225 DataArrayInt *comm, *commIndex;
1226 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1227 PyObject *res = PyList_New(2);
1228 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1229 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1233 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1235 DataArrayDouble *ret1=self->getCoords();
1238 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1241 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1243 int szArr,sw,iTypppArr;
1244 std::vector<int> stdvecTyyppArr;
1245 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1246 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1247 if(sw==3)//DataArrayInt
1249 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1250 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1251 std::string name=argpt->getName();
1253 ret->setName(name.c_str());
1255 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1258 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1260 int szArr,sw,iTypppArr;
1261 std::vector<int> stdvecTyyppArr;
1262 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1263 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1264 if(sw==3)//DataArrayInt
1266 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1267 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1268 std::string name=argpt->getName();
1270 ret->setName(name.c_str());
1272 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1275 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1277 int szArr,sw,iTypppArr;
1278 std::vector<int> stdvecTyyppArr;
1279 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1280 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1281 if(sw==3)//DataArrayInt
1283 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1284 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1285 std::string name=argpt->getName();
1287 ret->setName(name.c_str());
1289 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1292 virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1294 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1295 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1298 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1300 int szArr,sw,iTypppArr;
1301 std::vector<int> stdvecTyyppArr;
1302 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1303 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1304 if(sw==3)//DataArrayInt
1306 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
1307 DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
1308 std::string name=argpt->getName();
1310 ret->setName(name.c_str());
1312 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1315 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1317 int szArr,sw,iTypppArr;
1318 std::vector<int> stdvecTyyppArr;
1319 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1320 self->renumberNodes(tmp,newNbOfNodes);
1323 void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1325 int szArr,sw,iTypppArr;
1326 std::vector<int> stdvecTyyppArr;
1327 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1328 self->renumberNodesCenter(tmp,newNbOfNodes);
1331 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1333 int spaceDim=self->getSpaceDimension();
1335 DataArrayDouble *a,*a2;
1336 DataArrayDoubleTuple *aa,*aa2;
1337 std::vector<double> bb,bb2;
1339 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1340 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1341 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1342 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1343 std::vector<int> nodes;
1344 self->findNodesOnLine(p,v,eps,nodes);
1345 DataArrayInt *ret=DataArrayInt::New();
1346 ret->alloc((int)nodes.size(),1);
1347 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1348 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1350 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1352 int spaceDim=self->getSpaceDimension();
1354 DataArrayDouble *a,*a2;
1355 DataArrayDoubleTuple *aa,*aa2;
1356 std::vector<double> bb,bb2;
1358 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1359 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1360 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1361 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1362 std::vector<int> nodes;
1363 self->findNodesOnPlane(p,v,eps,nodes);
1364 DataArrayInt *ret=DataArrayInt::New();
1365 ret->alloc((int)nodes.size(),1);
1366 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1367 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1370 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1374 DataArrayDoubleTuple *aa;
1375 std::vector<double> bb;
1377 int spaceDim=self->getSpaceDimension();
1378 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1379 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1380 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1381 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1384 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1386 DataArrayInt *c=0,*cI=0;
1390 DataArrayDoubleTuple *aa;
1391 std::vector<double> bb;
1393 int spaceDim=self->getSpaceDimension();
1394 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1395 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1396 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1397 PyObject *ret=PyTuple_New(2);
1398 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1399 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1403 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1405 DataArrayInt *c=0,*cI=0;
1406 int spaceDim=self->getSpaceDimension();
1409 DataArrayDoubleTuple *aa;
1410 std::vector<double> bb;
1413 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1414 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1416 PyObject *ret=PyTuple_New(2);
1417 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1418 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1426 DataArrayDoubleTuple *aa;
1427 std::vector<double> bb;
1429 int spaceDim=self->getSpaceDimension();
1430 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1431 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1433 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1434 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1437 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1441 std::vector<int> multiVal;
1442 std::pair<int, std::pair<int,int> > slic;
1443 MEDCoupling::DataArrayInt *daIntTyypp=0;
1444 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1448 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1450 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1452 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1454 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1458 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1460 DataArrayInt *v0=0,*v1=0;
1461 self->findCommonCells(compType,startCellId,v0,v1);
1462 PyObject *res = PyList_New(2);
1463 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1464 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1469 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1472 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1473 if (!SWIG_IsOK(res1))
1476 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1477 self->renumberNodesInConn(tmp);
1481 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1483 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1484 da2->checkAllocated();
1485 self->renumberNodesInConn(da2->getConstPointer());
1489 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1492 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1493 PyObject *ret=PyTuple_New(2);
1494 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1495 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1499 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1501 DataArrayInt *ret=0;
1503 int szArr,sw,iTypppArr;
1504 std::vector<int> stdvecTyyppArr;
1505 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1506 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1510 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1514 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1515 PyObject *res = PyList_New(3);
1516 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1517 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1518 PyList_SetItem(res,2,SWIG_From_int(ret2));
1522 virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
1526 DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1527 PyObject *res = PyList_New(3);
1528 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1529 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1530 PyList_SetItem(res,2,SWIG_From_int(ret2));
1534 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1537 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
1538 if (!SWIG_IsOK(res1))
1541 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1542 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1546 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1548 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1549 da2->checkAllocated();
1550 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1554 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1558 std::vector<int> multiVal;
1559 std::pair<int, std::pair<int,int> > slic;
1560 MEDCoupling::DataArrayInt *daIntTyypp=0;
1561 int nbc=self->getNumberOfCells();
1562 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1569 std::ostringstream oss;
1570 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1571 throw INTERP_KERNEL::Exception(oss.str().c_str());
1574 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1579 int tmp=nbc+singleVal;
1580 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1584 std::ostringstream oss;
1585 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1586 throw INTERP_KERNEL::Exception(oss.str().c_str());
1592 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1596 return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1601 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1602 daIntTyypp->checkAllocated();
1603 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1606 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1610 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1613 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1614 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1615 MEDCoupling::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1616 for(int i=0;i<sz;i++)
1617 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1620 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1623 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1625 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1626 std::vector<double> val3;
1627 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1628 "Rotate2DAlg",2,true,nbNodes);
1630 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1631 MEDCoupling::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1634 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1637 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1638 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1639 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1640 MEDCoupling::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1641 for(int i=0;i<sz;i++)
1642 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1645 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1648 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1650 double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1651 std::vector<double> val3;
1652 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1653 "Rotate3DAlg",3,true,nbNodes);
1655 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1656 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1657 MEDCoupling::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1662 //== MEDCouplingPointSet End
1664 class MEDCouplingUMeshCell
1667 INTERP_KERNEL::NormalizedCellType getType() const;
1670 std::string __str__() const throw(INTERP_KERNEL::Exception)
1672 return self->repr();
1675 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1678 const int *r=self->getAllConn(ret2);
1679 PyObject *ret=PyTuple_New(ret2);
1680 for(int i=0;i<ret2;i++)
1681 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1687 class MEDCouplingUMeshCellIterator
1694 MEDCouplingUMeshCell *ret=self->nextt();
1696 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
1699 PyErr_SetString(PyExc_StopIteration,"No more data.");
1706 class MEDCouplingUMeshCellByTypeIterator
1709 ~MEDCouplingUMeshCellByTypeIterator();
1714 MEDCouplingUMeshCellEntry *ret=self->nextt();
1716 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1719 PyErr_SetString(PyExc_StopIteration,"No more data.");
1726 class MEDCouplingUMeshCellByTypeEntry
1729 ~MEDCouplingUMeshCellByTypeEntry();
1732 MEDCouplingUMeshCellByTypeIterator *__iter__()
1734 return self->iterator();
1739 class MEDCouplingUMeshCellEntry
1742 INTERP_KERNEL::NormalizedCellType getType() const;
1743 int getNumberOfElems() const;
1746 MEDCouplingUMeshCellIterator *__iter__()
1748 return self->iterator();
1753 //== MEDCouplingUMesh
1755 class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
1758 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1759 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1760 void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
1761 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1762 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1763 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1764 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1765 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1766 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1767 void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1768 int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
1769 void computeTypes() throw(INTERP_KERNEL::Exception);
1770 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1771 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1773 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1774 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1775 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1776 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1777 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1778 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1779 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1780 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1781 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1782 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1783 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1784 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1785 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1786 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1787 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1788 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1789 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1790 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1791 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1792 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1793 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1794 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1795 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1796 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1797 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1798 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1799 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1800 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1801 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1802 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1803 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1804 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1805 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1806 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1807 MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1808 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1809 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1810 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1811 MEDCouplingSkyLineArray *generateGraph() const throw(INTERP_KERNEL::Exception);
1812 DataArrayInt *orderConsecutiveCells1D() const throw(INTERP_KERNEL::Exception);
1813 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1814 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1815 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1816 void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
1817 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);
1818 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1819 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1820 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1821 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1822 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1824 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1826 return MEDCouplingUMesh::New();
1829 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1831 return MEDCouplingUMesh::New(meshName,meshDim);
1835 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1837 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingUMesh");
1840 std::string __str__() const throw(INTERP_KERNEL::Exception)
1842 return self->simpleRepr();
1845 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1847 std::ostringstream oss;
1848 self->reprQuickOverview(oss);
1852 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1854 return self->cellIterator();
1857 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1859 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1860 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1861 PyObject *res=PyList_New(result.size());
1862 for(int i=0;iL!=result.end(); i++, iL++)
1863 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1867 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1871 std::vector<int> multiVal;
1872 std::pair<int, std::pair<int,int> > slic;
1873 MEDCoupling::DataArrayInt *daIntTyypp=0;
1874 int nbc=self->getNumberOfCells();
1875 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1882 std::ostringstream oss;
1883 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1884 throw INTERP_KERNEL::Exception(oss.str().c_str());
1888 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1895 int tmp=nbc+singleVal;
1896 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1901 std::ostringstream oss;
1902 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1903 throw INTERP_KERNEL::Exception(oss.str().c_str());
1909 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1915 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1916 daIntTyypp->checkAllocated();
1917 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1921 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1925 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1929 std::vector<int> multiVal;
1930 std::pair<int, std::pair<int,int> > slic;
1931 MEDCoupling::DataArrayInt *daIntTyypp=0;
1932 int nbc=self->getNumberOfCells();
1933 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1940 std::ostringstream oss;
1941 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1942 throw INTERP_KERNEL::Exception(oss.str().c_str());
1946 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1953 int tmp=nbc+singleVal;
1954 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1959 std::ostringstream oss;
1960 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1961 throw INTERP_KERNEL::Exception(oss.str().c_str());
1967 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1972 self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1978 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1979 daIntTyypp->checkAllocated();
1980 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1984 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1988 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1990 int szArr,sw,iTypppArr;
1991 std::vector<int> stdvecTyyppArr;
1992 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1995 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1996 throw INTERP_KERNEL::Exception(oss.str().c_str());
1998 self->insertNextCell(type,size,tmp);
2001 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2003 int szArr,sw,iTypppArr;
2004 std::vector<int> stdvecTyyppArr;
2005 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2006 self->insertNextCell(type,szArr,tmp);
2009 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2011 DataArrayInt *ret=self->getNodalConnectivity();
2016 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2018 DataArrayInt *ret=self->getNodalConnectivityIndex();
2024 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2026 int szArr,sw,iTypppArr;
2027 std::vector<int> stdvecTyyppArr;
2028 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2029 int nbOfDepthPeelingPerformed=0;
2030 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2031 PyObject *res=PyTuple_New(2);
2032 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2033 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2037 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2039 DataArrayInt *v0=0,*v1=0;
2040 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2041 PyObject *res = PyList_New(2);
2042 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2043 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2047 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2051 DataArrayDoubleTuple *aa;
2052 std::vector<double> bb;
2054 int nbOfCompo=self->getSpaceDimension();
2055 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2058 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2059 PyObject *ret=PyTuple_New(2);
2060 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2061 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2065 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2067 DataArrayInt *ret1=0;
2068 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2069 PyObject *ret=PyTuple_New(2);
2070 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2071 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2075 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2078 DataArrayInt *ret1(0);
2079 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2080 PyObject *ret=PyTuple_New(3);
2081 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2082 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2083 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2087 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2089 std::vector<int> cells;
2090 self->checkButterflyCells(cells,eps);
2091 DataArrayInt *ret=DataArrayInt::New();
2092 ret->alloc((int)cells.size(),1);
2093 std::copy(cells.begin(),cells.end(),ret->getPointer());
2094 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2097 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2099 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2101 PyObject *ret = PyList_New(sz);
2102 for(int i=0;i<sz;i++)
2103 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2107 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2109 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2110 int sz=retCpp.size();
2111 PyObject *ret=PyList_New(sz);
2112 for(int i=0;i<sz;i++)
2113 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2117 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2120 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2121 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2122 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2125 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2128 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2129 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2133 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2136 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2137 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2141 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2143 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2144 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2145 PyObject *ret=PyTuple_New(3);
2146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2147 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2148 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2154 DataArrayInt *tmp0=0,*tmp1=0;
2155 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2156 PyObject *ret=PyTuple_New(2);
2157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2166 std::vector<int> multiVal;
2167 std::pair<int, std::pair<int,int> > slic;
2168 MEDCoupling::DataArrayInt *daIntTyypp=0;
2169 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2173 return self->duplicateNodes(&singleVal,&singleVal+1);
2175 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2177 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2179 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2183 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2187 std::vector<int> multiVal;
2188 std::pair<int, std::pair<int,int> > slic;
2189 MEDCoupling::DataArrayInt *daIntTyypp=0;
2190 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2194 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2196 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2198 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2200 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2204 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2207 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2208 DataArrayInt *tmp0,*tmp1=0;
2209 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2210 PyObject *ret=PyTuple_New(2);
2211 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2218 DataArrayInt *ret0=0,*ret1=0;
2219 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2220 PyObject *ret=PyTuple_New(2);
2221 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2228 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2229 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2230 DataArrayInt *ret1=0,*ret2=0;
2231 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2232 PyObject *ret=PyTuple_New(3);
2233 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2234 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2235 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2239 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2241 std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2242 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2243 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2244 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2247 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2250 std::vector<const MEDCouplingUMesh *> meshes;
2251 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2252 std::vector<DataArrayInt *> corr;
2253 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2255 PyObject *ret1=PyList_New(sz);
2256 for(int i=0;i<sz;i++)
2257 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2258 PyObject *ret=PyList_New(2);
2259 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2260 PyList_SetItem(ret,1,ret1);
2264 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2266 std::vector<MEDCouplingUMesh *> meshes;
2267 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2268 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2271 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2273 std::vector<MEDCouplingUMesh *> meshes;
2274 convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2275 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2278 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2282 std::vector<int> multiVal;
2283 std::pair<int, std::pair<int,int> > slic;
2284 MEDCoupling::DataArrayInt *daIntTyypp=0;
2286 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2287 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2291 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2293 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2295 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2297 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2301 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2303 DataArrayInt *arrOut=0,*arrIndexOut=0;
2306 std::vector<int> multiVal;
2307 std::pair<int, std::pair<int,int> > slic;
2308 MEDCoupling::DataArrayInt *daIntTyypp=0;
2310 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2311 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2316 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2321 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2326 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2330 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2332 PyObject *ret=PyTuple_New(2);
2333 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2334 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338 static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2340 DataArrayInt *arrOut=0,*arrIndexOut=0;
2341 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2342 PyObject *ret=PyTuple_New(2);
2343 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348 static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2350 if(!PySlice_Check(slic))
2351 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
2352 Py_ssize_t strt=2,stp=2,step=2;
2353 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2355 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
2356 arrIndxIn->checkAllocated();
2357 if(arrIndxIn->getNumberOfComponents()!=1)
2358 throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
2359 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
2360 DataArrayInt *arrOut=0,*arrIndexOut=0;
2361 MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2362 PyObject *ret=PyTuple_New(2);
2363 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2364 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2368 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2369 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2370 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2372 DataArrayInt *arrOut=0,*arrIndexOut=0;
2375 std::vector<int> multiVal;
2376 std::pair<int, std::pair<int,int> > slic;
2377 MEDCoupling::DataArrayInt *daIntTyypp=0;
2379 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2380 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2385 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2390 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2395 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2399 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2401 PyObject *ret=PyTuple_New(2);
2402 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2403 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2407 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2408 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2412 std::vector<int> multiVal;
2413 std::pair<int, std::pair<int,int> > slic;
2414 MEDCoupling::DataArrayInt *daIntTyypp=0;
2416 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2417 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2422 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2427 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2432 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2436 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2440 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2444 DataArrayDoubleTuple *aa;
2445 std::vector<double> bb;
2447 int spaceDim=self->getSpaceDimension();
2448 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2449 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2451 std::vector<int> cells;
2452 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2453 DataArrayInt *ret=DataArrayInt::New();
2454 ret->alloc((int)cells.size(),1);
2455 std::copy(cells.begin(),cells.end(),ret->getPointer());
2456 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2459 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2463 DataArrayDoubleTuple *aa;
2464 std::vector<double> bb;
2466 int spaceDim=self->getSpaceDimension();
2467 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2468 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2469 self->orientCorrectly2DCells(v,polyOnly);
2472 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2474 std::vector<int> cells;
2475 self->arePolyhedronsNotCorrectlyOriented(cells);
2476 DataArrayInt *ret=DataArrayInt::New();
2477 ret->alloc((int)cells.size(),1);
2478 std::copy(cells.begin(),cells.end(),ret->getPointer());
2479 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2482 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2486 self->getFastAveragePlaneOfThis(vec,pos);
2488 std::copy(vec,vec+3,vals);
2489 std::copy(pos,pos+3,vals+3);
2490 return convertDblArrToPyListOfTuple(vals,3,2);
2493 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2495 std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2496 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2497 return MEDCouplingUMesh::MergeUMeshes(tmp);
2500 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2503 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2504 PyObject *ret=PyTuple_New(2);
2505 PyObject *ret0Py=ret0?Py_True:Py_False;
2507 PyTuple_SetItem(ret,0,ret0Py);
2508 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2512 PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2515 bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2516 PyObject *ret=PyTuple_New(2);
2517 PyObject *ret0Py=ret0?Py_True:Py_False;
2519 PyTuple_SetItem(ret,0,ret0Py);
2520 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2526 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2527 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2528 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2529 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2530 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2531 PyObject *ret=PyTuple_New(5);
2532 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2533 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2536 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2542 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2543 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2544 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2545 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2546 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2547 PyObject *ret=PyTuple_New(5);
2548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2552 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2558 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2559 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2560 MCAuto<DataArrayInt> d2=DataArrayInt::New();
2561 MCAuto<DataArrayInt> d3=DataArrayInt::New();
2562 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2563 PyObject *ret=PyTuple_New(5);
2564 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2565 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2567 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2568 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2572 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2574 DataArrayInt *neighbors=0,*neighborsIdx=0;
2575 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2576 PyObject *ret=PyTuple_New(2);
2577 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2578 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2582 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2584 DataArrayInt *neighbors=0,*neighborsIdx=0;
2585 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2586 PyObject *ret=PyTuple_New(2);
2587 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2588 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2592 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2594 DataArrayInt *neighbors=0,*neighborsIdx=0;
2595 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2596 PyObject *ret=PyTuple_New(2);
2597 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2598 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2604 MCAuto<DataArrayInt> d0=DataArrayInt::New();
2605 MCAuto<DataArrayInt> d1=DataArrayInt::New();
2606 DataArrayInt *d2,*d3,*d4,*dd5;
2607 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2608 PyObject *ret=PyTuple_New(7);
2609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2611 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2612 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2613 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2615 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2619 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2622 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2623 da->checkAllocated();
2624 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2627 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2630 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2631 da->checkAllocated();
2632 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2635 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2638 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2639 da->checkAllocated();
2640 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2643 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2646 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2647 da->checkAllocated();
2648 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2649 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2650 PyObject *res = PyList_New(result.size());
2651 for (int i=0;iL!=result.end(); i++, iL++)
2652 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2656 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2659 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2660 da->checkAllocated();
2661 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2662 ret->setName(da->getName().c_str());
2666 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2668 DataArrayInt *cellNb1=0,*cellNb2=0;
2669 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2670 PyObject *ret=PyTuple_New(3);
2671 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2672 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2673 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2677 static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2679 MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2680 DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2681 MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2682 PyObject *ret(PyTuple_New(4));
2683 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2684 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2686 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2692 int spaceDim=self->getSpaceDimension();
2694 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2696 DataArrayDouble *a,*a2;
2697 DataArrayDoubleTuple *aa,*aa2;
2698 std::vector<double> bb,bb2;
2700 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2701 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2702 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2703 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2705 DataArrayInt *cellIds=0;
2706 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2707 PyObject *ret=PyTuple_New(2);
2708 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2715 int spaceDim=self->getSpaceDimension();
2717 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2719 DataArrayDouble *a,*a2;
2720 DataArrayDoubleTuple *aa,*aa2;
2721 std::vector<double> bb,bb2;
2723 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2724 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2725 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2726 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2728 DataArrayInt *cellIds=0;
2729 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2730 PyObject *ret=PyTuple_New(2);
2731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2736 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2738 int spaceDim=self->getSpaceDimension();
2740 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2742 DataArrayDouble *a,*a2;
2743 DataArrayDoubleTuple *aa,*aa2;
2744 std::vector<double> bb,bb2;
2746 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2747 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2748 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2749 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2750 return self->getCellIdsCrossingPlane(orig,vect,eps);
2753 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2757 std::vector<int> pos2;
2758 DataArrayInt *pos3=0;
2759 DataArrayIntTuple *pos4=0;
2760 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2765 self->convertToPolyTypes(&pos1,&pos1+1);
2772 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2777 self->convertToPolyTypes(pos3->begin(),pos3->end());
2781 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2785 void convertAllToPoly();
2786 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2787 bool unPolyze() throw(INTERP_KERNEL::Exception);
2788 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2789 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2790 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2793 //== MEDCouplingUMesh End
2795 //== MEDCouplingMappedExtrudedMesh
2797 class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2800 static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2801 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2803 MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2805 return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2808 MEDCouplingMappedExtrudedMesh()
2810 return MEDCouplingMappedExtrudedMesh::New();
2813 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2815 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2818 std::string __str__() const throw(INTERP_KERNEL::Exception)
2820 return self->simpleRepr();
2823 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2825 std::ostringstream oss;
2826 self->reprQuickOverview(oss);
2830 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2832 MEDCouplingUMesh *ret=self->getMesh2D();
2835 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2837 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2839 MEDCouplingUMesh *ret=self->getMesh1D();
2842 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2844 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2846 DataArrayInt *ret=self->getMesh3DIds();
2849 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2854 //== MEDCouplingMappedExtrudedMesh End
2856 class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2859 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2860 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2861 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2862 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2863 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2864 virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2867 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2869 int szArr,sw,iTypppArr;
2870 std::vector<int> stdvecTyyppArr;
2871 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2872 self->insertNextCell(tmp,tmp+szArr);
2875 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2877 DataArrayInt *ret=self->getNodalConnectivity();
2878 if(ret) ret->incrRef();
2882 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2884 std::vector< const MEDCoupling1GTUMesh *> parts;
2885 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2886 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2891 //== MEDCoupling1SGTUMesh
2893 class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2896 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2897 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2898 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2899 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2900 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2901 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2902 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2903 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2904 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2907 MEDCoupling1SGTUMesh()
2909 return MEDCoupling1SGTUMesh::New();
2912 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2914 return MEDCoupling1SGTUMesh::New(name,type);
2917 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2919 return MEDCoupling1SGTUMesh::New(m);
2922 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2924 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2927 std::string __str__() const throw(INTERP_KERNEL::Exception)
2929 return self->simpleRepr();
2932 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2934 std::ostringstream oss;
2935 self->reprQuickOverview(oss);
2939 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2941 DataArrayInt *cellPerm(0),*nodePerm(0);
2942 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2943 PyObject *ret(PyTuple_New(3));
2944 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2945 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2946 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2950 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2952 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2953 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2954 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2957 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2959 std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2960 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2961 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2966 //== MEDCoupling1SGTUMesh End
2968 //== MEDCoupling1DGTUMesh
2970 class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2973 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2974 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2975 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2976 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2977 bool isPacked() const throw(INTERP_KERNEL::Exception);
2980 MEDCoupling1DGTUMesh()
2982 return MEDCoupling1DGTUMesh::New();
2984 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2986 return MEDCoupling1DGTUMesh::New(name,type);
2989 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2991 return MEDCoupling1DGTUMesh::New(m);
2994 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2996 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
2999 std::string __str__() const throw(INTERP_KERNEL::Exception)
3001 return self->simpleRepr();
3004 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3006 std::ostringstream oss;
3007 self->reprQuickOverview(oss);
3011 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3013 DataArrayInt *ret=self->getNodalConnectivityIndex();
3014 if(ret) ret->incrRef();
3018 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3020 DataArrayInt *ret1=0,*ret2=0;
3021 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3022 PyObject *ret0Py=ret0?Py_True:Py_False;
3024 PyObject *ret=PyTuple_New(3);
3025 PyTuple_SetItem(ret,0,ret0Py);
3026 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3027 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3031 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3034 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3035 PyObject *ret=PyTuple_New(2);
3036 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3037 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3038 PyTuple_SetItem(ret,1,ret1Py);
3042 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3044 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3045 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3046 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3049 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3051 std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3052 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3053 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3056 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3058 std::vector<const MEDCoupling::DataArrayInt *> tmp;
3059 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3060 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3065 //== MEDCoupling1DGTUMeshEnd
3067 class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3070 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3071 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3072 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3073 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3074 double computeSquareness() const throw(INTERP_KERNEL::Exception);
3075 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3076 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3077 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3078 std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3079 std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3080 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3081 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3082 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3083 static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3084 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3087 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3089 int tmpp1=-1,tmpp2=-1;
3090 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3091 std::vector< std::pair<int,int> > inp;
3095 for(int i=0;i<tmpp1;i++)
3096 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3101 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3102 inp.resize(tmpp1/2);
3103 for(int i=0;i<tmpp1/2;i++)
3104 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3107 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3108 return self->buildStructuredSubPart(inp);
3111 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3113 std::vector< std::pair<int,int> > inp;
3114 convertPyToVectorPairInt(part,inp);
3116 int szArr,sw,iTypppArr;
3117 std::vector<int> stdvecTyyppArr;
3118 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3119 std::vector<int> tmp5(tmp4,tmp4+szArr);
3121 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3124 static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3126 std::vector< std::pair<int,int> > inp;
3127 convertPyToVectorPairInt(part,inp);
3128 MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3131 static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3133 std::vector< std::pair<int,int> > inp;
3134 convertPyToVectorPairInt(part,inp);
3135 MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3138 static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3140 std::vector< std::pair<int,int> > inp;
3141 convertPyToVectorPairInt(part,inp);
3142 std::vector<int> stWithGhost;
3143 std::vector< std::pair<int,int> > partWithGhost;
3144 MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3145 PyObject *ret(PyTuple_New(2));
3146 PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3147 PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3151 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3153 std::vector< std::pair<int,int> > inp;
3154 convertPyToVectorPairInt(partCompactFormat,inp);
3155 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3158 static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3160 std::vector< std::pair<int,int> > inp;
3161 convertPyToVectorPairInt(partCompactFormat,inp);
3162 MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3165 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3167 std::vector< std::pair<int,int> > inp;
3168 convertPyToVectorPairInt(part,inp);
3169 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3172 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3174 int szArr,sw,iTypppArr;
3175 std::vector<int> stdvecTyyppArr;
3176 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3177 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3180 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3182 int szArr,sw,iTypppArr;
3183 std::vector<int> stdvecTyyppArr;
3184 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3185 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3188 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3190 std::vector< std::pair<int,int> > inp;
3191 convertPyToVectorPairInt(partCompactFormat,inp);
3192 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3195 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3197 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3198 PyObject *retPy=PyList_New(ret.size());
3199 for(std::size_t i=0;i<ret.size();i++)
3201 PyObject *tmp=PyTuple_New(2);
3202 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3203 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3204 PyList_SetItem(retPy,i,tmp);
3209 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3211 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3212 convertPyToVectorPairInt(r1,r1Cpp);
3213 convertPyToVectorPairInt(r2,r2Cpp);
3214 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3215 PyObject *retPy=PyList_New(ret.size());
3216 for(std::size_t i=0;i<ret.size();i++)
3218 PyObject *tmp=PyTuple_New(2);
3219 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3220 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3221 PyList_SetItem(retPy,i,tmp);
3226 static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3228 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3229 convertPyToVectorPairInt(r1,r1Cpp);
3230 convertPyToVectorPairInt(r2,r2Cpp);
3231 return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3234 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3236 int szArr,sw,iTypppArr;
3237 std::vector<int> stdvecTyyppArr;
3238 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3239 int szArr2,sw2,iTypppArr2;
3240 std::vector<int> stdvecTyyppArr2;
3241 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3242 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3243 std::vector< std::pair<int,int> > partCompactFormat;
3244 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3245 PyObject *ret=PyTuple_New(2);
3246 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3247 PyTuple_SetItem(ret,0,ret0Py);
3248 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3249 for(std::size_t i=0;i<partCompactFormat.size();i++)
3251 PyObject *tmp4=PyTuple_New(2);
3252 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3253 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3254 PyList_SetItem(ret1Py,i,tmp4);
3256 PyTuple_SetItem(ret,1,ret1Py);
3260 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3262 std::vector< std::pair<int,int> > param0,param1,ret;
3263 convertPyToVectorPairInt(bigInAbs,param0);
3264 convertPyToVectorPairInt(partOfBigInAbs,param1);
3265 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3266 PyObject *retPy(PyList_New(ret.size()));
3267 for(std::size_t i=0;i<ret.size();i++)
3269 PyObject *tmp(PyTuple_New(2));
3270 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3271 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3272 PyList_SetItem(retPy,i,tmp);
3277 static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3279 std::vector< std::pair<int,int> > param0;
3280 convertPyToVectorPairInt(part,param0);
3281 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3282 PyObject *retPy(PyList_New(ret.size()));
3283 for(std::size_t i=0;i<ret.size();i++)
3285 PyObject *tmp(PyTuple_New(2));
3286 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3287 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3288 PyList_SetItem(retPy,i,tmp);
3293 static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3295 std::vector< std::pair<int,int> > param0,param1;
3296 convertPyToVectorPairInt(startingFrom,param0);
3297 convertPyToVectorPairInt(goingTo,param1);
3298 return MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3301 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3303 std::vector< std::pair<int,int> > param0,param1,ret;
3304 convertPyToVectorPairInt(bigInAbs,param0);
3305 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3306 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3307 PyObject *retPy(PyList_New(ret.size()));
3308 for(std::size_t i=0;i<ret.size();i++)
3310 PyObject *tmp(PyTuple_New(2));
3311 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3312 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3313 PyList_SetItem(retPy,i,tmp);
3320 class MEDCouplingCurveLinearMesh;
3322 //== MEDCouplingCMesh
3324 class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3327 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3328 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3329 void setCoords(const DataArrayDouble *coordsX,
3330 const DataArrayDouble *coordsY=0,
3331 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3332 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3333 MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3335 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3337 return MEDCouplingCMesh::New();
3339 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3341 return MEDCouplingCMesh::New(meshName);
3344 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3346 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3348 std::string __str__() const throw(INTERP_KERNEL::Exception)
3350 return self->simpleRepr();
3352 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3354 std::ostringstream oss;
3355 self->reprQuickOverview(oss);
3358 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3360 DataArrayDouble *ret=self->getCoordsAt(i);
3368 //== MEDCouplingCMesh End
3370 //== MEDCouplingCurveLinearMesh
3372 class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3375 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3376 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3377 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3379 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3381 return MEDCouplingCurveLinearMesh::New();
3383 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3385 return MEDCouplingCurveLinearMesh::New(meshName);
3387 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3389 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3391 std::string __str__() const throw(INTERP_KERNEL::Exception)
3393 return self->simpleRepr();
3395 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3397 std::ostringstream oss;
3398 self->reprQuickOverview(oss);
3401 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3403 DataArrayDouble *ret=self->getCoords();
3408 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3410 int szArr,sw,iTypppArr;
3411 std::vector<int> stdvecTyyppArr;
3412 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3413 self->setNodeGridStructure(tmp,tmp+szArr);
3418 //== MEDCouplingCurveLinearMesh End
3420 //== MEDCouplingIMesh
3422 class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3425 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3427 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3428 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3429 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3430 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3431 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3432 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3433 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3434 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3435 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3436 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3437 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3442 return MEDCouplingIMesh::New();
3444 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3446 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3447 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3448 const int *nodeStrctPtr(0);
3449 const double *originPtr(0),*dxyzPtr(0);
3451 std::vector<int> bb0;
3452 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3455 std::vector<double> bb,bb2;
3457 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3458 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3460 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3463 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3465 return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3468 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3470 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3473 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3476 std::vector<int> bb0;
3477 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3478 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3481 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3483 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3486 DataArrayDoubleTuple *aa;
3487 std::vector<double> bb;
3489 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3490 self->setOrigin(originPtr,originPtr+nbTuples);
3493 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3495 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3498 DataArrayDoubleTuple *aa;
3499 std::vector<double> bb;
3501 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3502 self->setDXYZ(originPtr,originPtr+nbTuples);
3505 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3507 std::vector< std::pair<int,int> > inp;
3508 convertPyToVectorPairInt(fineLocInCoarse,inp);
3509 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3512 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)
3514 std::vector< std::pair<int,int> > inp;
3515 convertPyToVectorPairInt(fineLocInCoarse,inp);
3516 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3519 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3521 std::vector< std::pair<int,int> > inp;
3522 convertPyToVectorPairInt(fineLocInCoarse,inp);
3523 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3526 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)
3528 std::vector< std::pair<int,int> > inp;
3529 convertPyToVectorPairInt(fineLocInCoarse,inp);
3530 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3533 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)
3535 std::vector< std::pair<int,int> > inp;
3536 convertPyToVectorPairInt(fineLocInCoarse,inp);
3537 MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3540 std::string __str__() const throw(INTERP_KERNEL::Exception)
3542 return self->simpleRepr();
3544 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3546 std::ostringstream oss;
3547 self->reprQuickOverview(oss);
3553 //== MEDCouplingIMesh End
3557 namespace MEDCoupling
3559 class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3562 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3563 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3564 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3565 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3566 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3567 void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3568 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3569 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3570 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3571 std::string getName() const throw(INTERP_KERNEL::Exception);
3572 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3573 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3574 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3575 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3576 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3577 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3578 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3579 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3580 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3581 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3582 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3583 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3584 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3585 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3586 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3587 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3589 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3591 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3594 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3597 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3599 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3602 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3605 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3607 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3608 return convertIntArrToPyList3(ret);
3611 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3614 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3615 PyObject *ret=PyTuple_New(2);
3616 PyObject *ret0Py=ret0?Py_True:Py_False;
3618 PyTuple_SetItem(ret,0,ret0Py);
3619 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3623 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3625 DataArrayInt *ret1=0;
3626 MEDCouplingMesh *ret0=0;
3628 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3629 if (!SWIG_IsOK(res1))
3632 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3633 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3637 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3639 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3640 da2->checkAllocated();
3641 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3643 PyObject *res = PyList_New(2);
3644 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3645 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3649 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3651 DataArrayInt *ret1=0;
3653 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3654 PyObject *res=PyTuple_New(2);
3655 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3657 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3660 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3661 PyTuple_SetItem(res,1,res1);
3666 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3669 int v0; std::vector<int> v1;
3670 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3671 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3674 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3675 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3678 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
3679 if (!SWIG_IsOK(res1))
3682 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3683 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3687 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3689 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3690 da2->checkAllocated();
3691 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3695 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3697 std::vector<int> tmp;
3698 self->getCellIdsHavingGaussLocalization(locId,tmp);
3699 DataArrayInt *ret=DataArrayInt::New();
3700 ret->alloc((int)tmp.size(),1);
3701 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3702 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3705 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3707 std::vector<int> inp0;
3708 convertPyToNewIntArr4(code,1,3,inp0);
3709 std::vector<const DataArrayInt *> inp1;
3710 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3711 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3716 class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3719 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3720 static MEDCouplingFieldTemplate *New(TypeOfField type);
3721 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3722 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3725 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3727 return MEDCouplingFieldTemplate::New(f);
3730 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3732 return MEDCouplingFieldTemplate::New(type);
3735 std::string __str__() const throw(INTERP_KERNEL::Exception)
3737 return self->simpleRepr();
3740 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3742 std::ostringstream oss;
3743 self->reprQuickOverview(oss);
3749 class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3752 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3753 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3754 void setTimeUnit(const std::string& unit);
3755 std::string getTimeUnit() const;
3756 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3757 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3758 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3759 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3760 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3761 std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3762 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3763 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3764 MEDCouplingFieldDouble *deepCopy() const;
3765 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3766 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3767 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3768 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3769 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3770 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3771 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3772 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3773 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3774 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3775 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3776 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3777 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3778 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3779 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3780 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3781 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3782 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3783 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3784 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3785 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3786 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3787 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3788 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3789 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3790 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3791 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3792 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3793 bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3794 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3795 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3796 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3797 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3798 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3799 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3800 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3801 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3802 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3803 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3804 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3805 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3806 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3807 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3808 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3809 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3810 void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3811 void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3812 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3813 void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3814 void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3815 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3816 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3817 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3818 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3819 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3820 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3821 double getMinValue() const throw(INTERP_KERNEL::Exception);
3822 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3823 double norm2() const throw(INTERP_KERNEL::Exception);
3824 double normMax() const throw(INTERP_KERNEL::Exception);
3825 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3826 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3827 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3828 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3829 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3830 DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3831 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3832 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3833 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3834 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3835 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3836 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3837 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3838 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3839 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3840 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3841 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3842 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3843 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3844 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3845 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3846 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3848 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3850 return MEDCouplingFieldDouble::New(type,td);
3853 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3855 return MEDCouplingFieldDouble::New(ft,td);
3858 std::string __str__() const throw(INTERP_KERNEL::Exception)
3860 return self->simpleRepr();
3863 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3865 std::ostringstream oss;
3866 self->reprQuickOverview(oss);
3870 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3872 DataArrayDouble *ret=self->getArray();
3878 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3880 std::vector<DataArrayDouble *> arrs=self->getArrays();
3881 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3885 PyObject *ret=PyTuple_New(sz);
3886 for(int i=0;i<sz;i++)
3889 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3891 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3896 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3898 std::vector<const DataArrayDouble *> tmp;
3899 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3901 std::vector<DataArrayDouble *> arrs(sz);
3902 for(int i=0;i<sz;i++)
3903 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3904 self->setArrays(arrs);
3907 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3909 DataArrayDouble *ret=self->getEndArray();
3915 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3919 DataArrayDoubleTuple *aa;
3920 std::vector<double> bb;
3922 const MEDCouplingMesh *mesh=self->getMesh();
3924 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3925 int spaceDim=mesh->getSpaceDimension();
3926 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3927 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3929 int sz=self->getNumberOfComponents();
3930 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3931 self->getValueOn(spaceLoc,res);
3932 return convertDblArrToPyList(res,sz);
3935 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3937 int sz=self->getNumberOfComponents();
3938 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3939 self->getValueOnPos(i,j,k,res);
3940 return convertDblArrToPyList(res,sz);
3943 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3945 const MEDCouplingMesh *mesh(self->getMesh());
3947 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3950 double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3951 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3952 mesh->getSpaceDimension(),true,nbPts);
3953 return self->getValueOnMulti(inp,nbPts);
3956 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3960 DataArrayDoubleTuple *aa;
3961 std::vector<double> bb;
3963 const MEDCouplingMesh *mesh=self->getMesh();
3965 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3966 int spaceDim=mesh->getSpaceDimension();
3967 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3968 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3971 int sz=self->getNumberOfComponents();
3972 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3973 self->getValueOn(spaceLoc,time,res);
3974 return convertDblArrToPyList(res,sz);
3977 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3979 if(self->getArray()!=0)
3980 MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3983 MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
3984 MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3985 self->setArray(arr);
3989 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3992 double tmp0=self->getTime(tmp1,tmp2);
3993 PyObject *res = PyList_New(3);
3994 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3995 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3996 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4000 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4003 double tmp0=self->getStartTime(tmp1,tmp2);
4004 PyObject *res = PyList_New(3);
4005 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4006 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4007 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4011 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4014 double tmp0=self->getEndTime(tmp1,tmp2);
4015 PyObject *res = PyList_New(3);
4016 PyList_SetItem(res,0,SWIG_From_double(tmp0));
4017 PyList_SetItem(res,1,SWIG_From_int(tmp1));
4018 PyList_SetItem(res,2,SWIG_From_int(tmp2));
4021 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4023 int sz=self->getNumberOfComponents();
4024 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4025 self->accumulate(tmp);
4026 return convertDblArrToPyList(tmp,sz);
4028 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4030 int sz=self->getNumberOfComponents();
4031 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4032 self->integral(isWAbs,tmp);
4033 return convertDblArrToPyList(tmp,sz);
4035 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4037 int sz=self->getNumberOfComponents();
4038 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4039 self->getWeightedAverageValue(tmp,isWAbs);
4040 return convertDblArrToPyList(tmp,sz);
4042 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4044 int sz=self->getNumberOfComponents();
4045 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4047 return convertDblArrToPyList(tmp,sz);
4049 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4051 int sz=self->getNumberOfComponents();
4052 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4054 return convertDblArrToPyList(tmp,sz);
4056 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4058 int szArr,sw,iTypppArr;
4059 std::vector<int> stdvecTyyppArr;
4060 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4061 self->renumberCells(tmp,check);
4064 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4066 int szArr,sw,iTypppArr;
4067 std::vector<int> stdvecTyyppArr;
4068 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4069 self->renumberCellsWithoutMesh(tmp,check);
4072 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4074 int szArr,sw,iTypppArr;
4075 std::vector<int> stdvecTyyppArr;
4076 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4077 self->renumberNodes(tmp,eps);
4080 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4082 int szArr,sw,iTypppArr;
4083 std::vector<int> stdvecTyyppArr;
4084 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4085 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4088 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4092 std::vector<int> multiVal;
4093 std::pair<int, std::pair<int,int> > slic;
4094 MEDCoupling::DataArrayInt *daIntTyypp=0;
4095 const MEDCouplingMesh *mesh=self->getMesh();
4097 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4098 int nbc=mesh->getNumberOfCells();
4099 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4106 std::ostringstream oss;
4107 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4108 throw INTERP_KERNEL::Exception(oss.str().c_str());
4111 return self->buildSubPart(&singleVal,&singleVal+1);
4116 int tmp=nbc+singleVal;
4117 return self->buildSubPart(&tmp,&tmp+1);
4121 std::ostringstream oss;
4122 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4123 throw INTERP_KERNEL::Exception(oss.str().c_str());
4129 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4133 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4138 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4139 daIntTyypp->checkAllocated();
4140 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4143 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4147 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4149 const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
4150 if(PyTuple_Check(li))
4152 Py_ssize_t sz=PyTuple_Size(li);
4154 throw INTERP_KERNEL::Exception(msg);
4155 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4158 std::vector<int> multiVal;
4159 std::pair<int, std::pair<int,int> > slic;
4160 MEDCoupling::DataArrayInt *daIntTyypp=0;
4161 if(!self->getArray())
4162 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4164 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4165 catch(INTERP_KERNEL::Exception& e)
4166 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4167 MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4168 DataArrayDouble *ret0Arr=ret0->getArray();
4170 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4175 std::vector<int> v2(1,singleVal);
4176 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4177 ret0->setArray(aarr);
4182 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4183 ret0->setArray(aarr);
4188 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4189 std::vector<int> v2(nbOfComp);
4190 for(int i=0;i<nbOfComp;i++)
4191 v2[i]=slic.first+i*slic.second.second;
4192 MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4193 ret0->setArray(aarr);
4197 throw INTERP_KERNEL::Exception(msg);
4202 return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4205 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4208 double r1=self->getMaxValue2(tmp);
4209 PyObject *ret=PyTuple_New(2);
4210 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4211 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4215 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4218 double r1=self->getMinValue2(tmp);
4219 PyObject *ret=PyTuple_New(2);
4220 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4221 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4225 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4227 std::vector<int> tmp;
4228 convertPyToNewIntArr3(li,tmp);
4229 return self->keepSelectedComponents(tmp);
4232 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4234 std::vector<int> tmp;
4235 convertPyToNewIntArr3(li,tmp);
4236 self->setSelectedComponents(f,tmp);
4239 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4242 DataArrayDouble *a,*a2;
4243 DataArrayDoubleTuple *aa,*aa2;
4244 std::vector<double> bb,bb2;
4247 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4248 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4249 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4250 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4252 return self->extractSlice3D(orig,vect,eps);
4255 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4257 return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4260 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4262 return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4265 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4267 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.";
4268 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4271 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4273 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4275 return (*self)-(*other);
4277 throw INTERP_KERNEL::Exception(msg);
4282 DataArrayDoubleTuple *aa;
4283 std::vector<double> bb;
4285 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4290 if(!self->getArray())
4291 throw INTERP_KERNEL::Exception(msg2);
4292 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4293 ret->applyLin(1.,-val);
4294 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4295 ret2->setArray(ret);
4300 if(!self->getArray())
4301 throw INTERP_KERNEL::Exception(msg2);
4302 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4303 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4304 ret2->setArray(ret);
4309 if(!self->getArray())
4310 throw INTERP_KERNEL::Exception(msg2);
4311 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4312 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4313 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4314 ret2->setArray(ret);
4319 if(!self->getArray())
4320 throw INTERP_KERNEL::Exception(msg2);
4321 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4322 MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4323 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4324 ret2->setArray(ret);
4328 { throw INTERP_KERNEL::Exception(msg); }
4332 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4334 return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4337 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4339 return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4342 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4344 return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4347 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4349 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.";
4350 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4353 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4355 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4357 return (*self)/(*other);
4359 throw INTERP_KERNEL::Exception(msg);
4364 DataArrayDoubleTuple *aa;
4365 std::vector<double> bb;
4367 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4373 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4374 if(!self->getArray())
4375 throw INTERP_KERNEL::Exception(msg2);
4376 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4377 ret->applyLin(1./val,0);
4378 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4379 ret2->setArray(ret);
4384 if(!self->getArray())
4385 throw INTERP_KERNEL::Exception(msg2);
4386 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4387 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4388 ret2->setArray(ret);
4393 if(!self->getArray())
4394 throw INTERP_KERNEL::Exception(msg2);
4395 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4396 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4397 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4398 ret2->setArray(ret);
4403 if(!self->getArray())
4404 throw INTERP_KERNEL::Exception(msg2);
4405 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4406 MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4407 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4408 ret2->setArray(ret);
4412 { throw INTERP_KERNEL::Exception(msg); }
4416 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4418 return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4421 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4423 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.";
4424 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4427 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4429 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4431 return (*self)^(*other);
4433 throw INTERP_KERNEL::Exception(msg);
4438 DataArrayDoubleTuple *aa;
4439 std::vector<double> bb;
4441 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4446 if(!self->getArray())
4447 throw INTERP_KERNEL::Exception(msg2);
4448 MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4450 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4451 ret2->setArray(ret);
4456 if(!self->getArray())
4457 throw INTERP_KERNEL::Exception(msg2);
4458 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4459 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4460 ret2->setArray(ret);
4465 if(!self->getArray())
4466 throw INTERP_KERNEL::Exception(msg2);
4467 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4468 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4469 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4470 ret2->setArray(ret);
4475 if(!self->getArray())
4476 throw INTERP_KERNEL::Exception(msg2);
4477 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4478 MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4479 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4480 ret2->setArray(ret);
4484 { throw INTERP_KERNEL::Exception(msg); }
4488 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4490 return self->negate();
4493 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4495 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.";
4496 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4499 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4501 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4505 Py_XINCREF(trueSelf);
4509 throw INTERP_KERNEL::Exception(msg);
4514 DataArrayDoubleTuple *aa;
4515 std::vector<double> bb;
4517 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4522 if(!self->getArray())
4523 throw INTERP_KERNEL::Exception(msg2);
4524 self->getArray()->applyLin(1.,val);
4525 Py_XINCREF(trueSelf);
4530 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4533 Py_XINCREF(trueSelf);
4538 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4539 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4540 ret2->setArray(aaa);
4542 Py_XINCREF(trueSelf);
4547 if(!self->getArray())
4548 throw INTERP_KERNEL::Exception(msg2);
4549 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4550 self->getArray()->addEqual(aaa);
4551 Py_XINCREF(trueSelf);
4555 { throw INTERP_KERNEL::Exception(msg); }
4559 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4561 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.";
4562 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4565 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4567 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4571 Py_XINCREF(trueSelf);
4575 throw INTERP_KERNEL::Exception(msg);
4580 DataArrayDoubleTuple *aa;
4581 std::vector<double> bb;
4583 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4588 if(!self->getArray())
4589 throw INTERP_KERNEL::Exception(msg2);
4590 self->getArray()->applyLin(1.,-val);
4591 Py_XINCREF(trueSelf);
4596 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4599 Py_XINCREF(trueSelf);
4604 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4605 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4606 ret2->setArray(aaa);
4608 Py_XINCREF(trueSelf);
4613 if(!self->getArray())
4614 throw INTERP_KERNEL::Exception(msg2);
4615 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4616 self->getArray()->substractEqual(aaa);
4617 Py_XINCREF(trueSelf);
4621 { throw INTERP_KERNEL::Exception(msg); }
4625 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4627 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.";
4628 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4631 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4633 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4637 Py_XINCREF(trueSelf);
4641 throw INTERP_KERNEL::Exception(msg);
4646 DataArrayDoubleTuple *aa;
4647 std::vector<double> bb;
4649 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4654 if(!self->getArray())
4655 throw INTERP_KERNEL::Exception(msg2);
4656 self->getArray()->applyLin(val,0);
4657 Py_XINCREF(trueSelf);
4662 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4665 Py_XINCREF(trueSelf);
4670 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4671 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4672 ret2->setArray(aaa);
4674 Py_XINCREF(trueSelf);
4679 if(!self->getArray())
4680 throw INTERP_KERNEL::Exception(msg2);
4681 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4682 self->getArray()->multiplyEqual(aaa);
4683 Py_XINCREF(trueSelf);
4687 { throw INTERP_KERNEL::Exception(msg); }
4691 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4693 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.";
4694 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4697 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4699 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4703 Py_XINCREF(trueSelf);
4707 throw INTERP_KERNEL::Exception(msg);
4712 DataArrayDoubleTuple *aa;
4713 std::vector<double> bb;
4715 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4721 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4722 if(!self->getArray())
4723 throw INTERP_KERNEL::Exception(msg2);
4724 self->getArray()->applyLin(1./val,0);
4725 Py_XINCREF(trueSelf);
4730 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4733 Py_XINCREF(trueSelf);
4738 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4739 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4740 ret2->setArray(aaa);
4742 Py_XINCREF(trueSelf);
4747 if(!self->getArray())
4748 throw INTERP_KERNEL::Exception(msg2);
4749 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4750 self->getArray()->divideEqual(aaa);
4751 Py_XINCREF(trueSelf);
4755 { throw INTERP_KERNEL::Exception(msg); }
4759 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4761 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.";
4762 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4765 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4767 MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4771 Py_XINCREF(trueSelf);
4775 throw INTERP_KERNEL::Exception(msg);
4780 DataArrayDoubleTuple *aa;
4781 std::vector<double> bb;
4783 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4788 if(!self->getArray())
4789 throw INTERP_KERNEL::Exception(msg2);
4790 self->getArray()->applyPow(val);
4791 Py_XINCREF(trueSelf);
4796 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4799 Py_XINCREF(trueSelf);
4804 MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4805 MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4806 ret2->setArray(aaa);
4808 Py_XINCREF(trueSelf);
4813 if(!self->getArray())
4814 throw INTERP_KERNEL::Exception(msg2);
4815 MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4816 self->getArray()->powEqual(aaa);
4817 Py_XINCREF(trueSelf);
4821 { throw INTERP_KERNEL::Exception(msg); }
4825 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4827 std::vector<const MEDCouplingFieldDouble *> tmp;
4828 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4829 return MEDCouplingFieldDouble::MergeFields(tmp);
4832 static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4834 std::vector<const MEDCouplingFieldDouble *> tmp;
4835 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4836 return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4839 PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4841 std::vector<double> a0;
4842 std::vector<int> a1;
4843 std::vector<std::string> a2;
4844 self->getTinySerializationDbleInformation(a0);
4845 self->getTinySerializationIntInformation(a1);
4846 self->getTinySerializationStrInformation(a2);
4848 PyObject *ret(PyTuple_New(3));
4849 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4850 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4852 PyObject *ret2(PyList_New(sz));
4854 for(int i=0;i<sz;i++)
4855 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4857 PyTuple_SetItem(ret,2,ret2);
4861 PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4863 DataArrayInt *ret0(0);
4864 std::vector<DataArrayDouble *> ret1;
4865 self->serialize(ret0,ret1);
4868 std::size_t sz(ret1.size());
4869 PyObject *ret(PyTuple_New(2));
4870 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4871 PyObject *ret1Py(PyList_New(sz));
4872 for(std::size_t i=0;i<sz;i++)
4876 PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4878 PyTuple_SetItem(ret,1,ret1Py);
4882 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4884 static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4885 if(!PyTuple_Check(args))
4886 throw INTERP_KERNEL::Exception(MSG);
4887 PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4888 PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4889 PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4891 PyObject *tmp0(PyTuple_New(1));
4892 PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4893 PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4895 Py_DECREF(selfMeth);
4896 if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4897 {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4898 PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4900 PyObject *a(PyInt_FromLong(0));
4901 PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4904 throw INTERP_KERNEL::Exception(MSG);
4905 if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4906 throw INTERP_KERNEL::Exception(MSG);
4907 PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4910 Py_DECREF(initMeth);
4915 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4916 {// put an empty dict in input to say to __new__ to call __init__...
4917 self->checkConsistencyLight();
4918 PyObject *ret(PyTuple_New(1));
4919 PyObject *ret0(PyDict_New());
4921 PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4922 PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4923 PyDict_SetItem(ret0,a,d);
4924 Py_DECREF(a); Py_DECREF(d);
4926 PyTuple_SetItem(ret,0,ret0);
4930 PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4932 self->checkConsistencyLight();
4933 PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4934 PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
4935 const MEDCouplingMesh *mesh(self->getMesh());
4938 PyObject *ret(PyTuple_New(3));
4939 PyTuple_SetItem(ret,0,ret0);
4940 PyTuple_SetItem(ret,1,ret1);
4941 PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4945 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4947 static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4948 if(!PyTuple_Check(inp))
4949 throw INTERP_KERNEL::Exception(MSG);
4950 int sz(PyTuple_Size(inp));
4952 throw INTERP_KERNEL::Exception(MSG);
4954 PyObject *elt2(PyTuple_GetItem(inp,2));
4956 int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
4957 if(!SWIG_IsOK(status))
4958 throw INTERP_KERNEL::Exception(MSG);
4959 self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
4961 PyObject *elt0(PyTuple_GetItem(inp,0));
4962 PyObject *elt1(PyTuple_GetItem(inp,1));
4963 std::vector<double> a0;
4964 std::vector<int> a1;
4965 std::vector<std::string> a2;
4966 DataArrayInt *b0(0);
4967 std::vector<DataArrayDouble *>b1;
4969 if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
4970 throw INTERP_KERNEL::Exception(MSG);
4971 PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
4973 fillArrayWithPyListDbl3(a0py,tmp,a0);
4974 convertPyToNewIntArr3(a1py,a1);
4975 fillStringVector(a2py,a2);
4978 if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
4979 throw INTERP_KERNEL::Exception(MSG);
4980 PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
4982 int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
4983 if(!SWIG_IsOK(status))
4984 throw INTERP_KERNEL::Exception(MSG);
4985 b0=reinterpret_cast<DataArrayInt *>(argp);
4986 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
4988 self->checkForUnserialization(a1,b0,b1);
4989 // useless here to call resizeForUnserialization because arrays are well resized.
4990 self->finishUnserialization(a1,a0,a2);
4995 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4998 int getNumberOfFields() const;
4999 MEDCouplingMultiFields *deepCopy() const;
5000 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5001 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5002 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5003 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5004 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5007 std::string __str__() const throw(INTERP_KERNEL::Exception)
5009 return self->simpleRepr();
5011 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5013 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5014 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5016 std::vector<MEDCouplingFieldDouble *> fs(sz);
5017 for(int i=0;i<sz;i++)
5018 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5019 return MEDCouplingMultiFields::New(fs);
5021 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5023 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5024 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5026 std::vector<MEDCouplingFieldDouble *> fs(sz);
5027 for(int i=0;i<sz;i++)
5028 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5029 return MEDCouplingMultiFields::New(fs);
5031 PyObject *getFields() const
5033 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5034 int sz=fields.size();
5035 PyObject *res = PyList_New(sz);
5036 for(int i=0;i<sz;i++)
5040 fields[i]->incrRef();
5041 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5045 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5050 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5052 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5056 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5059 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5061 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5063 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5065 PyObject *res = PyList_New(sz);
5066 for(int i=0;i<sz;i++)
5071 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5075 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5080 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5082 std::vector<int> refs;
5083 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5085 PyObject *res = PyList_New(sz);
5086 for(int i=0;i<sz;i++)
5091 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5095 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5099 PyObject *ret=PyTuple_New(2);
5100 PyTuple_SetItem(ret,0,res);
5101 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5104 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5106 std::vector<DataArrayDouble *> ms=self->getArrays();
5108 PyObject *res = PyList_New(sz);
5109 for(int i=0;i<sz;i++)
5114 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5118 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5123 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5125 std::vector< std::vector<int> > refs;
5126 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5128 PyObject *res = PyList_New(sz);
5129 PyObject *res2 = PyList_New(sz);
5130 for(int i=0;i<sz;i++)
5135 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5139 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5141 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5144 PyObject *ret=PyTuple_New(2);
5145 PyTuple_SetItem(ret,0,res);
5146 PyTuple_SetItem(ret,1,res2);
5152 class MEDCouplingDefinitionTime
5155 MEDCouplingDefinitionTime();
5156 void assign(const MEDCouplingDefinitionTime& other);
5157 bool isEqual(const MEDCouplingDefinitionTime& other) const;
5158 double getTimeResolution() const;
5159 std::vector<double> getHotSpotsTime() const;
5162 std::string __str__() const throw(INTERP_KERNEL::Exception)
5164 std::ostringstream oss;
5165 self->appendRepr(oss);
5169 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5171 int meshId,arrId,arrIdInField,fieldId;
5172 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5173 PyObject *res=PyList_New(4);
5174 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5175 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5176 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5177 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5181 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5183 int meshId,arrId,arrIdInField,fieldId;
5184 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5185 PyObject *res=PyList_New(4);
5186 PyList_SetItem(res,0,PyInt_FromLong(meshId));
5187 PyList_SetItem(res,1,PyInt_FromLong(arrId));
5188 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5189 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5195 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5198 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5199 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5203 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5205 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5206 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5208 std::vector<MEDCouplingFieldDouble *> fs(sz);
5209 for(int i=0;i<sz;i++)
5210 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5211 return MEDCouplingFieldOverTime::New(fs);
5213 std::string __str__() const throw(INTERP_KERNEL::Exception)
5215 return self->simpleRepr();
5217 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5219 std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5220 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5222 std::vector<MEDCouplingFieldDouble *> fs(sz);
5223 for(int i=0;i<sz;i++)
5224 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5225 return MEDCouplingFieldOverTime::New(fs);
5230 class MEDCouplingCartesianAMRMesh;
5232 class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5235 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5236 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5237 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5240 MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5242 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5250 class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5253 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5254 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5255 std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5258 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5260 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5261 return convertFromVectorPairInt(ret);
5264 PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5266 std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5267 return convertFromVectorPairInt(ret);
5270 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5272 std::vector< std::pair<int,int> > inp;
5273 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5274 self->addPatch(inp,factors);
5277 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5279 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5281 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5282 if(patchId==mesh->getNumberOfPatches())
5284 std::ostringstream oss;
5285 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5286 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5289 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5295 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5297 MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5299 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5300 mesh->removePatch(patchId);
5303 int __len__() const throw(INTERP_KERNEL::Exception)
5305 const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5307 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5308 return mesh->getNumberOfPatches();
5313 class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5317 class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5320 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5321 int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5322 std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5323 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5324 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5325 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5326 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5327 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5328 int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5329 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5330 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5331 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5332 virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5334 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5335 int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5336 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5337 DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5338 std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5339 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5340 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5341 void removeAllPatches() throw(INTERP_KERNEL::Exception);
5342 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5343 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5344 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5345 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5346 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5347 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5348 void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5349 void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5350 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5351 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5352 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5353 std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5356 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5358 std::vector< std::pair<int,int> > inp;
5359 convertPyToVectorPairInt(bottomLeftTopRight,inp);
5360 self->addPatch(inp,factors);
5363 PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5365 std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5367 PyObject *ret = PyList_New(sz);
5368 for(int i=0;i<sz;i++)
5370 MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5373 PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5378 // agy : don't know why typemap fails here ??? let it in the extend section
5379 PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5381 return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5384 MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5386 const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5387 MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5393 MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5395 const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5396 MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5402 virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5404 std::vector<int> out1;
5405 std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5406 PyObject *ret(PyTuple_New(2));
5407 PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5408 PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5412 virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5414 std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5416 PyObject *ret = PyList_New(sz);
5417 for(int i=0;i<sz;i++)
5418 PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5422 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5424 std::vector<const DataArrayDouble *> inp;
5425 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5426 return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5429 virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5431 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5437 virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5439 MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5445 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5447 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5453 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5455 const MEDCouplingIMesh *ret(self->getImageMesh());
5458 return const_cast<MEDCouplingIMesh *>(ret);
5461 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5463 if(patchId==self->getNumberOfPatches())
5465 std::ostringstream oss;
5466 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5467 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5470 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5476 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5478 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5479 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5480 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5483 void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5485 std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5486 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5487 self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5490 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5492 self->removePatch(patchId);
5495 int __len__() const throw(INTERP_KERNEL::Exception)
5497 return self->getNumberOfPatches();
5502 class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5506 class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5509 static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5512 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5514 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5515 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5516 const int *nodeStrctPtr(0);
5517 const double *originPtr(0),*dxyzPtr(0);
5519 std::vector<int> bb0;
5520 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5523 std::vector<double> bb,bb2;
5525 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5526 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5528 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5531 void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5533 std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5534 convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5535 std::vector< std::vector<int> > inp2;
5536 convertPyToVectorOfVectorOfInt(factors,inp2);
5537 self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5540 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5542 return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5545 MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5547 return MEDCouplingCartesianAMRMesh::New(mesh);
5552 class MEDCouplingDataForGodFather : public RefCountObject
5555 virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5556 virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5557 virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5558 virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5559 virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5560 virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5561 virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5562 virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5563 virtual void alloc() throw(INTERP_KERNEL::Exception);
5564 virtual void dealloc() throw(INTERP_KERNEL::Exception);
5567 MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5569 MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5577 class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5580 int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5581 MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5582 MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5583 MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5584 MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5585 MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5586 bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5587 MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5588 std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5591 static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5593 std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5594 std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5595 MEDCouplingAMRAttribute *ret(0);
5598 convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5599 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5601 catch(INTERP_KERNEL::Exception&)
5603 convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5604 ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5609 MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5611 return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5614 DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5616 const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5617 DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5623 void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5625 std::vector< std::vector<std::string> > compNamesCpp;
5626 convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5627 self->spillInfoOnComponents(compNamesCpp);
5630 void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5632 std::vector<int> inp0;
5633 if(!fillIntVector(nfs,inp0))
5634 throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5635 std::size_t sz(inp0.size());
5636 std::vector<NatureOfField> inp00(sz);
5637 for(std::size_t i=0;i<sz;i++)
5638 inp00[i]=(NatureOfField)inp0[i];
5639 self->spillNatures(inp00);
5642 PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5644 std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5645 int sz((int)ret.size());
5646 PyObject *retPy(PyList_New(sz));
5647 for(int i=0;i<sz;i++)
5648 PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5654 class DenseMatrix : public RefCountObject, public TimeLabel
5657 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5658 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5659 DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5660 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5662 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5663 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5664 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5665 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5666 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5667 void transpose() throw(INTERP_KERNEL::Exception);
5669 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5670 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5671 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5674 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5676 return DenseMatrix::New(nbRows,nbCols);
5679 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5681 return DenseMatrix::New(array,nbRows,nbCols);
5684 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5687 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5688 PyObject *ret=PyTuple_New(2);
5689 PyObject *ret0Py=ret0?Py_True:Py_False;
5691 PyTuple_SetItem(ret,0,ret0Py);
5692 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5696 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5698 DataArrayDouble *ret(self->getData());
5704 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5706 return MEDCoupling::DenseMatrix::Add(self,other);
5709 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5711 return MEDCoupling::DenseMatrix::Substract(self,other);
5714 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5716 return MEDCoupling::DenseMatrix::Multiply(self,other);
5719 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5721 return MEDCoupling::DenseMatrix::Multiply(self,other);
5724 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5726 self->addEqual(other);
5727 Py_XINCREF(trueSelf);
5731 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5733 self->substractEqual(other);
5734 Py_XINCREF(trueSelf);
5738 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5740 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5747 class PartDefinition : public RefCountObject, public TimeLabel
5750 static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5751 static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5752 virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5753 virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5754 virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5755 virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5756 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5757 virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5760 virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5762 return (*self)+other;
5765 virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5768 bool ret0(self->isEqual(other,ret1));
5769 PyObject *ret=PyTuple_New(2);
5770 PyObject *ret0Py=ret0?Py_True:Py_False;
5772 PyTuple_SetItem(ret,0,ret0Py);
5773 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5777 virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5779 return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5783 virtual ~PartDefinition();
5786 class DataArrayPartDefinition : public PartDefinition
5789 static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5792 DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5794 return DataArrayPartDefinition::New(listOfIds);
5797 std::string __str__() const throw(INTERP_KERNEL::Exception)
5799 return self->getRepr();
5802 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5804 std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5805 oss << self->getRepr();
5810 virtual ~DataArrayPartDefinition();
5813 class SlicePartDefinition : public PartDefinition
5816 static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5817 int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5820 SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5822 return SlicePartDefinition::New(start,stop,step);
5825 PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5828 self->getSlice(a,b,c);
5829 return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5832 std::string __str__() const throw(INTERP_KERNEL::Exception)
5834 return self->getRepr();
5837 std::string __repr__() const throw(INTERP_KERNEL::Exception)
5839 std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5840 oss << self->getRepr();
5845 virtual ~SlicePartDefinition();
5851 __filename=os.environ.get('PYTHONSTARTUP')
5852 if __filename and os.path.isfile(__filename):
5853 execfile(__filename)