1 // Copyright (C) 2007-2014 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)
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingCurveLinearMesh.hxx"
32 #include "MEDCoupling1GTUMesh.hxx"
33 #include "MEDCouplingField.hxx"
34 #include "MEDCouplingFieldDouble.hxx"
35 #include "MEDCouplingFieldTemplate.hxx"
36 #include "MEDCouplingGaussLocalization.hxx"
37 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
38 #include "MEDCouplingMultiFields.hxx"
39 #include "MEDCouplingFieldOverTime.hxx"
40 #include "MEDCouplingDefinitionTime.hxx"
41 #include "MEDCouplingFieldDiscretization.hxx"
42 #include "MEDCouplingTypemaps.i"
44 #include "InterpKernelAutoPtr.hxx"
46 using namespace ParaMEDMEM;
47 using namespace INTERP_KERNEL;
51 %template(ivec) std::vector<int>;
52 %template(dvec) std::vector<double>;
53 %template(svec) std::vector<std::string>;
56 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
58 $result=convertMesh($1,$owner);
61 %typemap(out) MEDCouplingMesh*
63 $result=convertMesh($1,$owner);
68 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
70 $result=convertMesh($1,$owner);
73 %typemap(out) MEDCouplingPointSet*
75 $result=convertMesh($1,$owner);
81 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
83 $result=convertMesh($1,$owner);
86 %typemap(out) MEDCoupling1GTUMesh*
88 $result=convertMesh($1,$owner);
93 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
95 $result=convertMesh($1,$owner);
98 %typemap(out) MEDCouplingStructuredMesh*
100 $result=convertMesh($1,$owner);
105 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
107 $result=convertFieldDiscretization($1,$owner);
110 %typemap(out) MEDCouplingFieldDiscretization*
112 $result=convertFieldDiscretization($1,$owner);
117 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
119 $result=convertMultiFields($1,$owner);
122 %typemap(out) MEDCouplingMultiFields*
124 $result=convertMultiFields($1,$owner);
129 %init %{ import_array(); %}
132 %feature("autodoc", "1");
133 %feature("docstring");
135 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
136 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
137 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
138 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
139 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
140 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
141 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
143 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
144 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
145 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
146 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
147 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
148 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
149 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
150 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
151 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
152 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
153 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
154 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
155 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
156 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
157 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
158 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
159 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
160 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
161 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
162 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
163 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
164 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
165 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
166 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
167 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
168 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
169 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
170 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
171 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
172 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
173 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
174 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
188 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
189 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
190 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
191 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
192 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
193 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
194 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
195 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
196 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
197 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
198 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
199 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
200 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
201 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
202 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
203 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
204 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
205 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
206 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
207 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
208 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
209 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
210 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
211 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
212 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
213 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
214 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
215 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
216 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
217 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
218 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
219 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
220 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
221 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
222 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
223 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
224 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
225 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
226 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
227 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
228 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
229 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
230 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
231 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
232 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
233 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
234 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
235 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
236 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
237 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
238 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
239 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
240 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
241 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
242 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
243 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
244 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
245 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
246 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
247 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
248 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
249 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
250 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
251 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
252 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
253 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
254 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
255 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
256 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
257 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
258 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
259 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
260 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
261 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
262 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
263 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
275 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
276 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
277 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
278 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
279 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
280 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
281 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
282 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
283 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
284 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
285 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
286 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
287 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
288 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
289 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
290 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
291 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
292 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
293 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
294 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
295 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
296 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
297 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
298 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
299 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
300 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
301 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
302 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
303 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
304 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
305 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
306 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
308 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
309 %feature("unref") MEDCouplingMesh "$this->decrRef();"
310 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
311 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
312 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
313 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
314 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
315 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
316 %feature("unref") MEDCouplingField "$this->decrRef();"
317 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
318 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
319 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
320 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
321 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
322 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
323 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
324 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
325 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
327 %rename(assign) *::operator=;
328 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
329 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
330 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
331 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
335 %rename (InterpKernelException) INTERP_KERNEL::Exception;
337 %include "MEDCouplingRefCountObject.i"
338 %include "MEDCouplingMemArray.i"
356 CONST_ON_TIME_INTERVAL = 7
357 } TypeOfTimeDiscretization;
365 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
366 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11
367 } MEDCouplingMeshType;
370 class DataArrayDouble;
371 class MEDCouplingUMesh;
372 class MEDCouplingFieldDouble;
374 %extend RefCountObject
376 std::string getHiddenCppPointer() const
378 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
383 %extend MEDCouplingGaussLocalization
385 std::string __str__() const throw(INTERP_KERNEL::Exception)
387 return self->getStringRepr();
390 std::string __repr__() const throw(INTERP_KERNEL::Exception)
392 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
393 oss << self->getStringRepr();
400 class MEDCouplingMesh : public RefCountObject, public TimeLabel
403 void setName(const std::string& name);
404 std::string getName() const;
405 void setDescription(const std::string& descr);
406 std::string getDescription() const;
407 void setTime(double val, int iteration, int order);
408 void setTimeUnit(const std::string& unit);
409 std::string getTimeUnit() const;
410 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
411 bool isStructured() const throw(INTERP_KERNEL::Exception);
412 virtual MEDCouplingMesh *deepCpy() const;
413 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
414 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
415 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
416 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
417 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
418 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
419 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
420 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
421 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
422 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
423 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
424 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
425 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
426 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
427 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
428 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
429 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
430 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
431 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
432 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
433 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
434 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
435 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
436 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
437 void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
439 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
440 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
441 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
442 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
443 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
444 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
445 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
446 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
447 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
448 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
449 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
450 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
451 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
452 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
453 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
454 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
455 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
458 std::string __str__() const throw(INTERP_KERNEL::Exception)
460 return self->simpleRepr();
463 PyObject *getTime() throw(INTERP_KERNEL::Exception)
466 double tmp0=self->getTime(tmp1,tmp2);
467 PyObject *res = PyList_New(3);
468 PyList_SetItem(res,0,SWIG_From_double(tmp0));
469 PyList_SetItem(res,1,SWIG_From_int(tmp1));
470 PyList_SetItem(res,2,SWIG_From_int(tmp2));
474 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
478 DataArrayDoubleTuple *aa;
479 std::vector<double> bb;
481 int spaceDim=self->getSpaceDimension();
482 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
483 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
484 return self->getCellContainingPoint(pos,eps);
487 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
491 DataArrayDoubleTuple *aa;
492 std::vector<double> bb;
494 int spaceDim=self->getSpaceDimension();
495 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
496 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
498 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
499 PyObject *ret=PyTuple_New(2);
500 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
501 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
505 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
507 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
508 int spaceDim=self->getSpaceDimension();
510 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
511 if (!SWIG_IsOK(res1))
514 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
515 int nbOfPoints=size/spaceDim;
518 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
520 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
524 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
526 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
527 da2->checkAllocated();
528 int size=da2->getNumberOfTuples();
529 int nbOfCompo=da2->getNumberOfComponents();
530 if(nbOfCompo!=spaceDim)
532 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
534 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
536 PyObject *ret=PyTuple_New(2);
537 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
538 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
542 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
546 DataArrayDoubleTuple *aa;
547 std::vector<double> bb;
549 int spaceDim=self->getSpaceDimension();
550 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
551 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
552 std::vector<int> elts;
553 self->getCellsContainingPoint(pos,eps,elts);
554 DataArrayInt *ret=DataArrayInt::New();
555 ret->alloc((int)elts.size(),1);
556 std::copy(elts.begin(),elts.end(),ret->getPointer());
557 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
560 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
562 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
563 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
564 self->getReverseNodalConnectivity(d0,d1);
565 PyObject *ret=PyTuple_New(2);
566 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
567 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
571 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
574 int v0; std::vector<int> v1;
575 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
576 self->renumberCells(ids,check);
579 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
581 DataArrayInt *cellCor, *nodeCor;
582 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
583 PyObject *res = PyList_New(2);
584 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
585 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
589 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
591 DataArrayInt *cellCor=0,*nodeCor=0;
592 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
593 PyObject *res = PyList_New(2);
594 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
595 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
599 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
601 DataArrayInt *cellCor=0;
602 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
606 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
609 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
610 if (!SWIG_IsOK(res1))
613 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
614 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
618 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
620 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
621 da2->checkAllocated();
622 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
625 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
627 std::vector<int> conn;
628 self->getNodeIdsOfCell(cellId,conn);
629 return convertIntArrToPyList2(conn);
632 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
634 std::vector<double> coo;
635 self->getCoordinatesOfNode(nodeId,coo);
636 return convertDblArrToPyList2(coo);
639 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
643 DataArrayDoubleTuple *aa;
644 std::vector<double> bb;
646 int spaceDim=self->getSpaceDimension();
647 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
648 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
649 self->scale(pointPtr,factor);
652 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
654 int spaceDim=self->getSpaceDimension();
655 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
656 self->getBoundingBox(tmp);
657 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
661 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
664 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
665 PyObject *ret=PyTuple_New(2);
666 PyObject *ret0Py=ret0?Py_True:Py_False;
668 PyTuple_SetItem(ret,0,ret0Py);
669 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
673 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
675 int szArr,sw,iTypppArr;
676 std::vector<int> stdvecTyyppArr;
677 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
678 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
679 if(sw==3)//DataArrayInt
681 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
682 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
683 std::string name=argpt->getName();
685 ret->setName(name.c_str());
687 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
690 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
692 int szArr,sw,iTypppArr;
693 std::vector<int> stdvecTyyppArr;
695 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
696 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
697 if(sw==3)//DataArrayInt
699 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
700 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
701 std::string name=argpt->getName();
703 ret->setName(name.c_str());
706 PyObject *res = PyList_New(2);
707 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
708 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
709 PyList_SetItem(res,0,obj0);
710 PyList_SetItem(res,1,obj1);
714 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
718 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
719 PyObject *res = PyTuple_New(2);
720 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
723 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
725 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
726 PyTuple_SetItem(res,0,obj0);
727 PyTuple_SetItem(res,1,obj1);
731 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
733 std::vector<int> vals=self->getDistributionOfTypes();
735 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
736 PyObject *ret=PyList_New((int)vals.size()/3);
737 for(int j=0;j<(int)vals.size()/3;j++)
739 PyObject *ret1=PyList_New(3);
740 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
741 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
742 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
743 PyList_SetItem(ret,j,ret1);
748 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
750 std::vector<int> code;
751 std::vector<const DataArrayInt *> idsPerType;
752 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
753 convertPyToNewIntArr4(li,1,3,code);
754 return self->checkTypeConsistencyAndContig(code,idsPerType);
757 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
759 std::vector<int> code;
760 std::vector<DataArrayInt *> idsInPflPerType;
761 std::vector<DataArrayInt *> idsPerType;
762 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
763 PyObject *ret=PyTuple_New(3);
766 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
767 PyObject *ret0=PyList_New((int)code.size()/3);
768 for(int j=0;j<(int)code.size()/3;j++)
770 PyObject *ret00=PyList_New(3);
771 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
772 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
773 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
774 PyList_SetItem(ret0,j,ret00);
776 PyTuple_SetItem(ret,0,ret0);
778 PyObject *ret1=PyList_New(idsInPflPerType.size());
779 for(std::size_t j=0;j<idsInPflPerType.size();j++)
780 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
781 PyTuple_SetItem(ret,1,ret1);
782 int n=idsPerType.size();
783 PyObject *ret2=PyList_New(n);
785 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
786 PyTuple_SetItem(ret,2,ret2);
790 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
794 DataArrayDoubleTuple *aa;
795 std::vector<double> bb;
797 int spaceDim=self->getSpaceDimension();
798 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
799 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
800 self->translate(vectorPtr);
803 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
805 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
808 DataArrayDoubleTuple *aa;
809 std::vector<double> bb;
811 int spaceDim=self->getSpaceDimension();
812 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
813 self->rotate(centerPtr,0,alpha);
816 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
818 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
820 DataArrayDouble *a,*a2;
821 DataArrayDoubleTuple *aa,*aa2;
822 std::vector<double> bb,bb2;
824 int spaceDim=self->getSpaceDimension();
825 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
826 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
827 self->rotate(centerPtr,vectorPtr,alpha);
830 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
832 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
833 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
834 PyObject *res=PyList_New(result.size());
835 for(int i=0;iL!=result.end(); i++, iL++)
836 PyList_SetItem(res,i,PyInt_FromLong(*iL));
840 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
842 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
843 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
844 return MEDCouplingMesh::MergeMeshes(tmp);
850 //== MEDCouplingMesh End
852 %include "NormalizedGeometricTypes"
853 %include "MEDCouplingNatureOfFieldEnum"
857 class MEDCouplingNatureOfField
860 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
861 static std::string GetReprNoThrow(NatureOfField nat);
862 static std::string GetAllPossibilitiesStr();
866 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
867 // include "MEDCouplingTimeDiscretization.i"
871 class MEDCouplingGaussLocalization
874 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
875 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
876 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
877 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
878 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
879 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
880 int getDimension() const throw(INTERP_KERNEL::Exception);
881 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
882 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
883 void checkCoherency() const throw(INTERP_KERNEL::Exception);
884 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
886 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
887 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
888 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
889 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
890 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
891 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
892 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
893 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
894 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
895 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
896 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
897 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
899 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
903 %include "MEDCouplingFieldDiscretization.i"
905 //== MEDCouplingPointSet
909 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
912 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
913 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
914 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
915 void zipCoords() throw(INTERP_KERNEL::Exception);
916 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
917 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
918 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
919 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
920 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
921 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
922 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
923 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
924 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
925 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
926 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
927 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
928 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
929 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
930 virtual DataArrayInt *findBoundaryNodes() const;
931 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
932 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
933 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
934 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
935 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
936 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
939 std::string __str__() const throw(INTERP_KERNEL::Exception)
941 return self->simpleRepr();
944 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
947 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
948 PyObject *res = PyList_New(2);
949 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
950 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
954 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
956 DataArrayInt *comm, *commIndex;
957 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
958 PyObject *res = PyList_New(2);
959 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
960 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
964 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
966 DataArrayDouble *ret1=self->getCoords();
969 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
972 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
974 int szArr,sw,iTypppArr;
975 std::vector<int> stdvecTyyppArr;
976 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
977 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
978 if(sw==3)//DataArrayInt
980 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
981 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
982 std::string name=argpt->getName();
984 ret->setName(name.c_str());
986 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
989 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
991 int szArr,sw,iTypppArr;
992 std::vector<int> stdvecTyyppArr;
993 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
994 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
995 if(sw==3)//DataArrayInt
997 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
998 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
999 std::string name=argpt->getName();
1001 ret->setName(name.c_str());
1003 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1006 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1008 int szArr,sw,iTypppArr;
1009 std::vector<int> stdvecTyyppArr;
1010 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1011 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1012 if(sw==3)//DataArrayInt
1014 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1015 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1016 std::string name=argpt->getName();
1018 ret->setName(name.c_str());
1020 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1023 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1025 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1026 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1029 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1031 int szArr,sw,iTypppArr;
1032 std::vector<int> stdvecTyyppArr;
1033 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1034 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1035 if(sw==3)//DataArrayInt
1037 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1038 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1039 std::string name=argpt->getName();
1041 ret->setName(name.c_str());
1043 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1046 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1048 int szArr,sw,iTypppArr;
1049 std::vector<int> stdvecTyyppArr;
1050 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1051 self->renumberNodes(tmp,newNbOfNodes);
1054 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1056 int szArr,sw,iTypppArr;
1057 std::vector<int> stdvecTyyppArr;
1058 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1059 self->renumberNodes2(tmp,newNbOfNodes);
1062 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1064 int spaceDim=self->getSpaceDimension();
1066 DataArrayDouble *a,*a2;
1067 DataArrayDoubleTuple *aa,*aa2;
1068 std::vector<double> bb,bb2;
1070 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1071 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1072 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1073 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1074 std::vector<int> nodes;
1075 self->findNodesOnLine(p,v,eps,nodes);
1076 DataArrayInt *ret=DataArrayInt::New();
1077 ret->alloc((int)nodes.size(),1);
1078 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1079 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1081 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1083 int spaceDim=self->getSpaceDimension();
1085 DataArrayDouble *a,*a2;
1086 DataArrayDoubleTuple *aa,*aa2;
1087 std::vector<double> bb,bb2;
1089 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1090 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1091 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1092 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1093 std::vector<int> nodes;
1094 self->findNodesOnPlane(p,v,eps,nodes);
1095 DataArrayInt *ret=DataArrayInt::New();
1096 ret->alloc((int)nodes.size(),1);
1097 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1098 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1101 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1105 DataArrayDoubleTuple *aa;
1106 std::vector<double> bb;
1108 int spaceDim=self->getSpaceDimension();
1109 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1110 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1111 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1112 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1115 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1117 DataArrayInt *c=0,*cI=0;
1121 DataArrayDoubleTuple *aa;
1122 std::vector<double> bb;
1124 int spaceDim=self->getSpaceDimension();
1125 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1126 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1127 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1128 PyObject *ret=PyTuple_New(2);
1129 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1130 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1134 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1136 DataArrayInt *c=0,*cI=0;
1137 int spaceDim=self->getSpaceDimension();
1140 DataArrayDoubleTuple *aa;
1141 std::vector<double> bb;
1144 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1145 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1147 PyObject *ret=PyTuple_New(2);
1148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1153 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1157 DataArrayDoubleTuple *aa;
1158 std::vector<double> bb;
1160 int spaceDim=self->getSpaceDimension();
1161 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1162 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1164 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1165 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1168 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1172 std::vector<int> multiVal;
1173 std::pair<int, std::pair<int,int> > slic;
1174 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1175 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1179 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1181 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1183 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1185 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1189 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1191 DataArrayInt *v0=0,*v1=0;
1192 self->findCommonCells(compType,startCellId,v0,v1);
1193 PyObject *res = PyList_New(2);
1194 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1195 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1200 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1203 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1204 if (!SWIG_IsOK(res1))
1207 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1208 self->renumberNodesInConn(tmp);
1212 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1214 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1215 da2->checkAllocated();
1216 self->renumberNodesInConn(da2->getConstPointer());
1220 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1223 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1224 PyObject *ret=PyTuple_New(2);
1225 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1226 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1230 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1232 DataArrayInt *ret=0;
1234 int szArr,sw,iTypppArr;
1235 std::vector<int> stdvecTyyppArr;
1236 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1237 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1241 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1245 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1246 PyObject *res = PyList_New(3);
1247 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1248 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1249 PyList_SetItem(res,2,SWIG_From_int(ret2));
1253 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1257 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1258 PyObject *res = PyList_New(3);
1259 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1260 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1261 PyList_SetItem(res,2,SWIG_From_int(ret2));
1265 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1268 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1269 if (!SWIG_IsOK(res1))
1272 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1273 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1277 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1279 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1280 da2->checkAllocated();
1281 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1285 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1289 std::vector<int> multiVal;
1290 std::pair<int, std::pair<int,int> > slic;
1291 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1292 int nbc=self->getNumberOfCells();
1293 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1300 std::ostringstream oss;
1301 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1302 throw INTERP_KERNEL::Exception(oss.str().c_str());
1305 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1310 int tmp=nbc+singleVal;
1311 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1315 std::ostringstream oss;
1316 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1317 throw INTERP_KERNEL::Exception(oss.str().c_str());
1323 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1327 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1332 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1333 daIntTyypp->checkAllocated();
1334 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1337 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1341 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1344 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1345 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1346 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1347 for(int i=0;i<sz;i++)
1348 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1351 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1354 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1356 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1357 std::vector<double> val3;
1358 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1359 "Rotate2DAlg",2,true,nbNodes);
1361 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1362 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1365 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1368 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1369 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1370 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1371 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1372 for(int i=0;i<sz;i++)
1373 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1376 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1379 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1381 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1382 std::vector<double> val3;
1383 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1384 "Rotate3DAlg",3,true,nbNodes);
1386 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1387 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1388 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1393 //== MEDCouplingPointSet End
1395 class MEDCouplingUMeshCell
1398 INTERP_KERNEL::NormalizedCellType getType() const;
1401 std::string __str__() const throw(INTERP_KERNEL::Exception)
1403 return self->repr();
1406 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1409 const int *r=self->getAllConn(ret2);
1410 PyObject *ret=PyTuple_New(ret2);
1411 for(int i=0;i<ret2;i++)
1412 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1418 class MEDCouplingUMeshCellIterator
1425 MEDCouplingUMeshCell *ret=self->nextt();
1427 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1430 PyErr_SetString(PyExc_StopIteration,"No more data.");
1437 class MEDCouplingUMeshCellByTypeIterator
1440 ~MEDCouplingUMeshCellByTypeIterator();
1445 MEDCouplingUMeshCellEntry *ret=self->nextt();
1447 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1450 PyErr_SetString(PyExc_StopIteration,"No more data.");
1457 class MEDCouplingUMeshCellByTypeEntry
1460 ~MEDCouplingUMeshCellByTypeEntry();
1463 MEDCouplingUMeshCellByTypeIterator *__iter__()
1465 return self->iterator();
1470 class MEDCouplingUMeshCellEntry
1473 INTERP_KERNEL::NormalizedCellType getType() const;
1474 int getNumberOfElems() const;
1477 MEDCouplingUMeshCellIterator *__iter__()
1479 return self->iterator();
1484 //== MEDCouplingUMesh
1486 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1489 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1490 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1491 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1492 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1493 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1494 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1495 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1496 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1497 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1498 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1499 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1500 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1501 void computeTypes() throw(INTERP_KERNEL::Exception);
1502 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1503 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1505 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1506 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1507 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1508 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1509 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1510 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1511 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1512 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1513 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1514 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1515 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1516 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1517 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1518 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1519 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1520 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1521 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1522 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1523 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1524 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1525 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1526 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1527 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1528 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1529 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1530 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1531 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1532 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1533 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1534 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1535 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1536 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1537 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1538 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1539 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1540 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1541 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1542 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1543 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1544 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1545 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1546 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1547 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);
1548 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1549 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1550 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1551 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1552 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1554 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1556 return MEDCouplingUMesh::New();
1559 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1561 return MEDCouplingUMesh::New(meshName,meshDim);
1564 std::string __str__() const throw(INTERP_KERNEL::Exception)
1566 return self->simpleRepr();
1569 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1571 std::ostringstream oss;
1572 self->reprQuickOverview(oss);
1576 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1578 return self->cellIterator();
1581 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1583 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1584 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1585 PyObject *res=PyList_New(result.size());
1586 for(int i=0;iL!=result.end(); i++, iL++)
1587 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1591 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1595 std::vector<int> multiVal;
1596 std::pair<int, std::pair<int,int> > slic;
1597 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1598 int nbc=self->getNumberOfCells();
1599 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1606 std::ostringstream oss;
1607 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1608 throw INTERP_KERNEL::Exception(oss.str().c_str());
1612 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1619 int tmp=nbc+singleVal;
1620 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1625 std::ostringstream oss;
1626 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1627 throw INTERP_KERNEL::Exception(oss.str().c_str());
1633 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1639 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1640 daIntTyypp->checkAllocated();
1641 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1645 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1649 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1653 std::vector<int> multiVal;
1654 std::pair<int, std::pair<int,int> > slic;
1655 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1656 int nbc=self->getNumberOfCells();
1657 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1664 std::ostringstream oss;
1665 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1666 throw INTERP_KERNEL::Exception(oss.str().c_str());
1670 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1677 int tmp=nbc+singleVal;
1678 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1683 std::ostringstream oss;
1684 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1685 throw INTERP_KERNEL::Exception(oss.str().c_str());
1691 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1696 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1702 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1703 daIntTyypp->checkAllocated();
1704 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1708 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1712 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1714 int szArr,sw,iTypppArr;
1715 std::vector<int> stdvecTyyppArr;
1716 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1719 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1720 throw INTERP_KERNEL::Exception(oss.str().c_str());
1722 self->insertNextCell(type,size,tmp);
1725 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1727 int szArr,sw,iTypppArr;
1728 std::vector<int> stdvecTyyppArr;
1729 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1730 self->insertNextCell(type,szArr,tmp);
1733 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1735 DataArrayInt *ret=self->getNodalConnectivity();
1740 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1742 DataArrayInt *ret=self->getNodalConnectivityIndex();
1748 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1750 int szArr,sw,iTypppArr;
1751 std::vector<int> stdvecTyyppArr;
1752 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1753 int nbOfDepthPeelingPerformed=0;
1754 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1755 PyObject *res=PyTuple_New(2);
1756 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1757 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1761 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1763 DataArrayInt *v0=0,*v1=0;
1764 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1765 PyObject *res = PyList_New(2);
1766 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1767 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1771 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1775 DataArrayDoubleTuple *aa;
1776 std::vector<double> bb;
1778 int nbOfCompo=self->getSpaceDimension();
1779 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1782 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1783 PyObject *ret=PyTuple_New(2);
1784 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1785 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1789 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1791 DataArrayInt *ret1=0;
1792 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1793 PyObject *ret=PyTuple_New(2);
1794 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1795 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1799 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1802 DataArrayInt *ret1(0);
1803 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1804 PyObject *ret=PyTuple_New(3);
1805 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1806 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1807 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1811 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1813 std::vector<int> cells;
1814 self->checkButterflyCells(cells,eps);
1815 DataArrayInt *ret=DataArrayInt::New();
1816 ret->alloc((int)cells.size(),1);
1817 std::copy(cells.begin(),cells.end(),ret->getPointer());
1818 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1821 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1823 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1825 PyObject *ret = PyList_New(sz);
1826 for(int i=0;i<sz;i++)
1827 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1831 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1833 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1834 int sz=retCpp.size();
1835 PyObject *ret=PyList_New(sz);
1836 for(int i=0;i<sz;i++)
1837 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1841 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1844 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1845 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1846 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1849 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1852 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1853 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1857 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1860 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1861 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1865 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1867 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1868 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1869 PyObject *ret=PyTuple_New(3);
1870 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1871 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1872 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1876 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1878 DataArrayInt *tmp0=0,*tmp1=0;
1879 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1880 PyObject *ret=PyTuple_New(2);
1881 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1882 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1886 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1890 std::vector<int> multiVal;
1891 std::pair<int, std::pair<int,int> > slic;
1892 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1893 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1897 return self->duplicateNodes(&singleVal,&singleVal+1);
1899 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1901 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1903 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1907 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1911 std::vector<int> multiVal;
1912 std::pair<int, std::pair<int,int> > slic;
1913 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1914 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1918 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1920 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1922 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1924 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1928 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1931 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1932 DataArrayInt *tmp0,*tmp1=0;
1933 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1934 PyObject *ret=PyTuple_New(2);
1935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1940 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
1942 DataArrayInt *ret0=0,*ret1=0;
1943 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
1944 PyObject *ret=PyTuple_New(2);
1945 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1946 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1950 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1952 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1953 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1954 DataArrayInt *ret1=0,*ret2=0;
1955 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1956 PyObject *ret=PyTuple_New(3);
1957 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1958 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1959 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1963 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1965 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1966 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1967 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1968 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1971 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1974 std::vector<const MEDCouplingUMesh *> meshes;
1975 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1976 std::vector<DataArrayInt *> corr;
1977 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1979 PyObject *ret1=PyList_New(sz);
1980 for(int i=0;i<sz;i++)
1981 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1982 PyObject *ret=PyList_New(2);
1983 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1984 PyList_SetItem(ret,1,ret1);
1988 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1990 std::vector<MEDCouplingUMesh *> meshes;
1991 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1992 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1995 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1997 std::vector<MEDCouplingUMesh *> meshes;
1998 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1999 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2002 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2006 std::vector<int> multiVal;
2007 std::pair<int, std::pair<int,int> > slic;
2008 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2010 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2011 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2015 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2017 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2019 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2021 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2025 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2027 DataArrayInt *arrOut=0,*arrIndexOut=0;
2030 std::vector<int> multiVal;
2031 std::pair<int, std::pair<int,int> > slic;
2032 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2034 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2035 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2040 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2045 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2050 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2054 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2056 PyObject *ret=PyTuple_New(2);
2057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2058 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2062 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2064 DataArrayInt *arrOut=0,*arrIndexOut=0;
2065 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2066 PyObject *ret=PyTuple_New(2);
2067 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2068 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2072 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2074 if(!PySlice_Check(slic))
2075 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2076 Py_ssize_t strt=2,stp=2,step=2;
2077 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2079 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2080 arrIndxIn->checkAllocated();
2081 if(arrIndxIn->getNumberOfComponents()!=1)
2082 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2083 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2084 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2085 DataArrayInt *arrOut=0,*arrIndexOut=0;
2086 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2087 PyObject *ret=PyTuple_New(2);
2088 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2093 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2094 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2095 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2097 DataArrayInt *arrOut=0,*arrIndexOut=0;
2100 std::vector<int> multiVal;
2101 std::pair<int, std::pair<int,int> > slic;
2102 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2104 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2105 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2110 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2115 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2120 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2124 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2126 PyObject *ret=PyTuple_New(2);
2127 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2128 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2132 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2133 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2137 std::vector<int> multiVal;
2138 std::pair<int, std::pair<int,int> > slic;
2139 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2141 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2142 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2147 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2152 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2157 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2161 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2165 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2169 DataArrayDoubleTuple *aa;
2170 std::vector<double> bb;
2172 int spaceDim=self->getSpaceDimension();
2173 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2174 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2176 std::vector<int> cells;
2177 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2178 DataArrayInt *ret=DataArrayInt::New();
2179 ret->alloc((int)cells.size(),1);
2180 std::copy(cells.begin(),cells.end(),ret->getPointer());
2181 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2184 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2188 DataArrayDoubleTuple *aa;
2189 std::vector<double> bb;
2191 int spaceDim=self->getSpaceDimension();
2192 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2193 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2194 self->orientCorrectly2DCells(v,polyOnly);
2197 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2199 std::vector<int> cells;
2200 self->arePolyhedronsNotCorrectlyOriented(cells);
2201 DataArrayInt *ret=DataArrayInt::New();
2202 ret->alloc((int)cells.size(),1);
2203 std::copy(cells.begin(),cells.end(),ret->getPointer());
2204 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2207 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2211 self->getFastAveragePlaneOfThis(vec,pos);
2213 std::copy(vec,vec+3,vals);
2214 std::copy(pos,pos+3,vals+3);
2215 return convertDblArrToPyListOfTuple(vals,3,2);
2218 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2220 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2221 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2222 return MEDCouplingUMesh::MergeUMeshes(tmp);
2225 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2228 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2229 PyObject *ret=PyTuple_New(2);
2230 PyObject *ret0Py=ret0?Py_True:Py_False;
2232 PyTuple_SetItem(ret,0,ret0Py);
2233 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2237 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2240 bool ret0=self->areCellsIncludedIn2(other,ret1);
2241 PyObject *ret=PyTuple_New(2);
2242 PyObject *ret0Py=ret0?Py_True:Py_False;
2244 PyTuple_SetItem(ret,0,ret0Py);
2245 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2249 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2251 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2252 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2253 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2254 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2255 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2256 PyObject *ret=PyTuple_New(5);
2257 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2258 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2260 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2261 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2265 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2267 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2268 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2269 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2270 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2271 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2272 PyObject *ret=PyTuple_New(5);
2273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2274 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2275 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2276 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2277 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2283 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2284 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2285 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2286 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2287 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2288 PyObject *ret=PyTuple_New(5);
2289 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2290 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2291 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2292 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2297 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2299 DataArrayInt *neighbors=0,*neighborsIdx=0;
2300 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2301 PyObject *ret=PyTuple_New(2);
2302 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2307 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2309 DataArrayInt *neighbors=0,*neighborsIdx=0;
2310 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2311 PyObject *ret=PyTuple_New(2);
2312 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2313 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2319 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2320 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2321 DataArrayInt *d2,*d3,*d4,*dd5;
2322 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2323 PyObject *ret=PyTuple_New(7);
2324 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2325 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2326 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2327 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2328 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2329 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2330 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2334 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2337 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2338 da->checkAllocated();
2339 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2342 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2345 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2346 da->checkAllocated();
2347 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2350 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2353 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2354 da->checkAllocated();
2355 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2358 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2361 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2362 da->checkAllocated();
2363 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2364 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2365 PyObject *res = PyList_New(result.size());
2366 for (int i=0;iL!=result.end(); i++, iL++)
2367 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2371 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2374 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2375 da->checkAllocated();
2376 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2377 ret->setName(da->getName().c_str());
2381 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2383 DataArrayInt *cellNb1=0,*cellNb2=0;
2384 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2385 PyObject *ret=PyTuple_New(3);
2386 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2387 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2388 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2392 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2394 int spaceDim=self->getSpaceDimension();
2396 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2398 DataArrayDouble *a,*a2;
2399 DataArrayDoubleTuple *aa,*aa2;
2400 std::vector<double> bb,bb2;
2402 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2403 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2404 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2405 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2407 DataArrayInt *cellIds=0;
2408 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2409 PyObject *ret=PyTuple_New(2);
2410 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2411 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2417 int spaceDim=self->getSpaceDimension();
2419 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2421 DataArrayDouble *a,*a2;
2422 DataArrayDoubleTuple *aa,*aa2;
2423 std::vector<double> bb,bb2;
2425 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2426 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2427 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2428 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2430 DataArrayInt *cellIds=0;
2431 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2432 PyObject *ret=PyTuple_New(2);
2433 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2434 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2438 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2440 int spaceDim=self->getSpaceDimension();
2442 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2444 DataArrayDouble *a,*a2;
2445 DataArrayDoubleTuple *aa,*aa2;
2446 std::vector<double> bb,bb2;
2448 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2449 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2450 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2451 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2452 return self->getCellIdsCrossingPlane(orig,vect,eps);
2455 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2459 std::vector<int> pos2;
2460 DataArrayInt *pos3=0;
2461 DataArrayIntTuple *pos4=0;
2462 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2467 self->convertToPolyTypes(&pos1,&pos1+1);
2474 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2479 self->convertToPolyTypes(pos3->begin(),pos3->end());
2483 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2487 void convertAllToPoly();
2488 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2489 bool unPolyze() throw(INTERP_KERNEL::Exception);
2490 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2491 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2492 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2495 //== MEDCouplingUMesh End
2497 //== MEDCouplingExtrudedMesh
2499 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2502 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2503 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2505 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2507 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2510 std::string __str__() const throw(INTERP_KERNEL::Exception)
2512 return self->simpleRepr();
2515 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2517 std::ostringstream oss;
2518 self->reprQuickOverview(oss);
2522 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2524 MEDCouplingUMesh *ret=self->getMesh2D();
2527 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2529 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2531 MEDCouplingUMesh *ret=self->getMesh1D();
2534 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2536 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2538 DataArrayInt *ret=self->getMesh3DIds();
2541 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2546 //== MEDCouplingExtrudedMesh End
2548 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2551 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2552 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2553 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2554 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2555 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2556 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2559 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2561 int szArr,sw,iTypppArr;
2562 std::vector<int> stdvecTyyppArr;
2563 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2564 self->insertNextCell(tmp,tmp+szArr);
2567 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2569 DataArrayInt *ret=self->getNodalConnectivity();
2570 if(ret) ret->incrRef();
2574 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2576 std::vector< const MEDCoupling1GTUMesh *> parts;
2577 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2578 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2583 //== MEDCoupling1SGTUMesh
2585 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2588 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2589 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2590 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2591 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2592 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2593 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2594 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2595 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2596 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2599 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2601 return MEDCoupling1SGTUMesh::New(name,type);
2604 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2606 return MEDCoupling1SGTUMesh::New(m);
2609 std::string __str__() const throw(INTERP_KERNEL::Exception)
2611 return self->simpleRepr();
2614 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2616 std::ostringstream oss;
2617 self->reprQuickOverview(oss);
2621 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2623 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2624 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2625 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2628 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2630 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2631 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2632 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2637 //== MEDCoupling1SGTUMesh End
2639 //== MEDCoupling1DGTUMesh
2641 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2644 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2645 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2646 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2647 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2648 bool isPacked() const throw(INTERP_KERNEL::Exception);
2651 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2653 return MEDCoupling1DGTUMesh::New(name,type);
2656 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2658 return MEDCoupling1DGTUMesh::New(m);
2661 std::string __str__() const throw(INTERP_KERNEL::Exception)
2663 return self->simpleRepr();
2666 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2668 std::ostringstream oss;
2669 self->reprQuickOverview(oss);
2673 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2675 DataArrayInt *ret=self->getNodalConnectivityIndex();
2676 if(ret) ret->incrRef();
2680 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2682 DataArrayInt *ret1=0,*ret2=0;
2683 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2684 PyObject *ret0Py=ret0?Py_True:Py_False;
2686 PyObject *ret=PyTuple_New(3);
2687 PyTuple_SetItem(ret,0,ret0Py);
2688 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2693 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2696 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2697 PyObject *ret=PyTuple_New(2);
2698 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2699 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2700 PyTuple_SetItem(ret,1,ret1Py);
2704 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2706 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2707 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2708 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2711 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2713 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2714 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2715 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2718 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2720 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2721 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2722 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2727 //== MEDCoupling1DGTUMeshEnd
2729 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2732 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2733 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2734 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2735 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2736 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2737 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2740 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2742 int tmpp1=-1,tmpp2=-1;
2743 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2744 std::vector< std::pair<int,int> > inp;
2748 for(int i=0;i<tmpp1;i++)
2749 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2754 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2755 inp.resize(tmpp1/2);
2756 for(int i=0;i<tmpp1/2;i++)
2757 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2760 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2761 return self->buildStructuredSubPart(inp);
2764 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2766 int tmpp1=-1,tmpp2=-1;
2767 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2768 std::vector< std::pair<int,int> > inp;
2772 for(int i=0;i<tmpp1;i++)
2773 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2778 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
2779 inp.resize(tmpp1/2);
2780 for(int i=0;i<tmpp1/2;i++)
2781 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2784 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
2786 int szArr,sw,iTypppArr;
2787 std::vector<int> stdvecTyyppArr;
2788 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2789 std::vector<int> tmp5(tmp4,tmp4+szArr);
2791 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2794 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2796 int szArr,sw,iTypppArr;
2797 std::vector<int> stdvecTyyppArr;
2798 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2799 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2802 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2804 int szArr,sw,iTypppArr;
2805 std::vector<int> stdvecTyyppArr;
2806 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2807 int szArr2,sw2,iTypppArr2;
2808 std::vector<int> stdvecTyyppArr2;
2809 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
2810 std::vector<int> tmp3(tmp2,tmp2+szArr2);
2811 std::vector< std::pair<int,int> > partCompactFormat;
2812 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
2813 PyObject *ret=PyTuple_New(2);
2814 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
2815 PyTuple_SetItem(ret,0,ret0Py);
2816 PyObject *ret1Py=PyList_New(partCompactFormat.size());
2817 for(std::size_t i=0;i<partCompactFormat.size();i++)
2819 PyObject *tmp4=PyTuple_New(2);
2820 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
2821 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
2822 PyList_SetItem(ret1Py,i,tmp4);
2824 PyTuple_SetItem(ret,1,ret1Py);
2830 //== MEDCouplingCMesh
2832 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2835 static MEDCouplingCMesh *New();
2836 static MEDCouplingCMesh *New(const std::string& meshName);
2837 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2838 void setCoords(const DataArrayDouble *coordsX,
2839 const DataArrayDouble *coordsY=0,
2840 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2841 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2845 return MEDCouplingCMesh::New();
2847 MEDCouplingCMesh(const std::string& meshName)
2849 return MEDCouplingCMesh::New(meshName);
2851 std::string __str__() const throw(INTERP_KERNEL::Exception)
2853 return self->simpleRepr();
2855 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2857 std::ostringstream oss;
2858 self->reprQuickOverview(oss);
2861 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2863 DataArrayDouble *ret=self->getCoordsAt(i);
2871 //== MEDCouplingCMesh End
2873 //== MEDCouplingCurveLinearMesh
2875 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2878 static MEDCouplingCurveLinearMesh *New();
2879 static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
2880 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2881 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2883 MEDCouplingCurveLinearMesh()
2885 return MEDCouplingCurveLinearMesh::New();
2887 MEDCouplingCurveLinearMesh(const std::string& meshName)
2889 return MEDCouplingCurveLinearMesh::New(meshName);
2891 std::string __str__() const throw(INTERP_KERNEL::Exception)
2893 return self->simpleRepr();
2895 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2897 std::ostringstream oss;
2898 self->reprQuickOverview(oss);
2901 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2903 DataArrayDouble *ret=self->getCoords();
2908 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2910 int szArr,sw,iTypppArr;
2911 std::vector<int> stdvecTyyppArr;
2912 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2913 self->setNodeGridStructure(tmp,tmp+szArr);
2918 //== MEDCouplingCurveLinearMesh End
2921 namespace ParaMEDMEM
2923 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
2926 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
2927 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
2928 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2929 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2930 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
2931 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
2932 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2933 std::string getDescription() const throw(INTERP_KERNEL::Exception);
2934 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
2935 std::string getName() const throw(INTERP_KERNEL::Exception);
2936 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
2937 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
2938 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
2939 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
2940 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
2941 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
2942 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
2943 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
2944 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
2945 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
2946 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
2947 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
2948 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
2949 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
2950 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
2951 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
2953 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
2955 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
2958 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
2961 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
2963 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
2966 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
2969 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
2971 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
2972 return convertIntArrToPyList3(ret);
2975 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
2978 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
2979 PyObject *ret=PyTuple_New(2);
2980 PyObject *ret0Py=ret0?Py_True:Py_False;
2982 PyTuple_SetItem(ret,0,ret0Py);
2983 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2987 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
2989 DataArrayInt *ret1=0;
2990 MEDCouplingMesh *ret0=0;
2992 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2993 if (!SWIG_IsOK(res1))
2996 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2997 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3001 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3003 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3004 da2->checkAllocated();
3005 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3007 PyObject *res = PyList_New(2);
3008 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3009 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3013 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3015 DataArrayInt *ret1=0;
3017 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3018 PyObject *res=PyTuple_New(2);
3019 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3021 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3024 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3025 PyTuple_SetItem(res,1,res1);
3030 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3033 int v0; std::vector<int> v1;
3034 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3035 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3038 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3039 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3042 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3043 if (!SWIG_IsOK(res1))
3046 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3047 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3051 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3053 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3054 da2->checkAllocated();
3055 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3059 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3061 std::vector<int> tmp;
3062 self->getCellIdsHavingGaussLocalization(locId,tmp);
3063 DataArrayInt *ret=DataArrayInt::New();
3064 ret->alloc((int)tmp.size(),1);
3065 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3066 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3069 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3071 std::vector<int> inp0;
3072 convertPyToNewIntArr4(code,1,3,inp0);
3073 std::vector<const DataArrayInt *> inp1;
3074 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3075 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3080 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3083 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3084 static MEDCouplingFieldTemplate *New(TypeOfField type);
3085 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3086 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3089 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3091 return MEDCouplingFieldTemplate::New(f);
3094 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3096 return MEDCouplingFieldTemplate::New(type);
3099 std::string __str__() const throw(INTERP_KERNEL::Exception)
3101 return self->simpleRepr();
3104 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3106 std::ostringstream oss;
3107 self->reprQuickOverview(oss);
3113 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3116 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3117 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3118 void setTimeUnit(const std::string& unit);
3119 std::string getTimeUnit() const;
3120 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3121 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3122 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3123 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3124 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3125 void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3126 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3127 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3128 MEDCouplingFieldDouble *deepCpy() const;
3129 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3130 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3131 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3132 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3133 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3134 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3135 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3136 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3137 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3138 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3139 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3140 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3141 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3142 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3143 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3144 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3145 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3146 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3147 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3148 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3149 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3150 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3151 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3152 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3153 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3154 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3155 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3156 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3157 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3158 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3159 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3160 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3161 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3162 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3163 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3164 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3165 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3166 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3167 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3168 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3169 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3170 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3171 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3172 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3173 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3174 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3175 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3176 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3177 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3178 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3179 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3180 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3181 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3182 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3183 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3184 double getMinValue() const throw(INTERP_KERNEL::Exception);
3185 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3186 double norm2() const throw(INTERP_KERNEL::Exception);
3187 double normMax() const throw(INTERP_KERNEL::Exception);
3188 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3189 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3190 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3191 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3192 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3193 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3194 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3195 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3196 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3197 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3198 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3199 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3200 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3201 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3202 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3203 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3204 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3205 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3206 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3207 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3208 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3209 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3211 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3213 return MEDCouplingFieldDouble::New(type,td);
3216 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3218 return MEDCouplingFieldDouble::New(ft,td);
3221 std::string __str__() const throw(INTERP_KERNEL::Exception)
3223 return self->simpleRepr();
3226 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3228 std::ostringstream oss;
3229 self->reprQuickOverview(oss);
3233 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3235 DataArrayDouble *ret=self->getArray();
3241 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3243 std::vector<DataArrayDouble *> arrs=self->getArrays();
3244 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3248 PyObject *ret=PyTuple_New(sz);
3249 for(int i=0;i<sz;i++)
3252 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3254 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3259 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3261 std::vector<const DataArrayDouble *> tmp;
3262 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3264 std::vector<DataArrayDouble *> arrs(sz);
3265 for(int i=0;i<sz;i++)
3266 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3267 self->setArrays(arrs);
3270 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3272 DataArrayDouble *ret=self->getEndArray();
3278 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3282 DataArrayDoubleTuple *aa;
3283 std::vector<double> bb;
3285 const MEDCouplingMesh *mesh=self->getMesh();
3287 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3288 int spaceDim=mesh->getSpaceDimension();
3289 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3290 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3292 int sz=self->getNumberOfComponents();
3293 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3294 self->getValueOn(spaceLoc,res);
3295 return convertDblArrToPyList(res,sz);
3298 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3300 int sz=self->getNumberOfComponents();
3301 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3302 self->getValueOnPos(i,j,k,res);
3303 return convertDblArrToPyList(res,sz);
3306 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3308 const MEDCouplingMesh *mesh(self->getMesh());
3310 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3313 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3314 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3315 mesh->getSpaceDimension(),true,nbPts);
3316 return self->getValueOnMulti(inp,nbPts);
3319 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3323 DataArrayDoubleTuple *aa;
3324 std::vector<double> bb;
3326 const MEDCouplingMesh *mesh=self->getMesh();
3328 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3329 int spaceDim=mesh->getSpaceDimension();
3330 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3331 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3334 int sz=self->getNumberOfComponents();
3335 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3336 self->getValueOn(spaceLoc,time,res);
3337 return convertDblArrToPyList(res,sz);
3340 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3342 if(self->getArray()!=0)
3343 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3346 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3347 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3348 self->setArray(arr);
3352 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3355 double tmp0=self->getTime(tmp1,tmp2);
3356 PyObject *res = PyList_New(3);
3357 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3358 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3359 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3363 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3366 double tmp0=self->getStartTime(tmp1,tmp2);
3367 PyObject *res = PyList_New(3);
3368 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3369 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3370 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3374 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3377 double tmp0=self->getEndTime(tmp1,tmp2);
3378 PyObject *res = PyList_New(3);
3379 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3380 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3381 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3384 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3386 int sz=self->getNumberOfComponents();
3387 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3388 self->accumulate(tmp);
3389 return convertDblArrToPyList(tmp,sz);
3391 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3393 int sz=self->getNumberOfComponents();
3394 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3395 self->integral(isWAbs,tmp);
3396 return convertDblArrToPyList(tmp,sz);
3398 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3400 int sz=self->getNumberOfComponents();
3401 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3402 self->getWeightedAverageValue(tmp,isWAbs);
3403 return convertDblArrToPyList(tmp,sz);
3405 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3407 int sz=self->getNumberOfComponents();
3408 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3410 return convertDblArrToPyList(tmp,sz);
3412 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3414 int sz=self->getNumberOfComponents();
3415 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3417 return convertDblArrToPyList(tmp,sz);
3419 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3421 int szArr,sw,iTypppArr;
3422 std::vector<int> stdvecTyyppArr;
3423 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3424 self->renumberCells(tmp,check);
3427 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3429 int szArr,sw,iTypppArr;
3430 std::vector<int> stdvecTyyppArr;
3431 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3432 self->renumberCellsWithoutMesh(tmp,check);
3435 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3437 int szArr,sw,iTypppArr;
3438 std::vector<int> stdvecTyyppArr;
3439 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3440 self->renumberNodes(tmp,eps);
3443 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3445 int szArr,sw,iTypppArr;
3446 std::vector<int> stdvecTyyppArr;
3447 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3448 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3451 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3455 std::vector<int> multiVal;
3456 std::pair<int, std::pair<int,int> > slic;
3457 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3458 const MEDCouplingMesh *mesh=self->getMesh();
3460 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3461 int nbc=mesh->getNumberOfCells();
3462 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3469 std::ostringstream oss;
3470 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3471 throw INTERP_KERNEL::Exception(oss.str().c_str());
3474 return self->buildSubPart(&singleVal,&singleVal+1);
3479 int tmp=nbc+singleVal;
3480 return self->buildSubPart(&tmp,&tmp+1);
3484 std::ostringstream oss;
3485 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3486 throw INTERP_KERNEL::Exception(oss.str().c_str());
3492 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3496 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3501 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3502 daIntTyypp->checkAllocated();
3503 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3506 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3510 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3512 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";
3513 if(PyTuple_Check(li))
3515 Py_ssize_t sz=PyTuple_Size(li);
3517 throw INTERP_KERNEL::Exception(msg);
3518 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3521 std::vector<int> multiVal;
3522 std::pair<int, std::pair<int,int> > slic;
3523 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3524 if(!self->getArray())
3525 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3527 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3528 catch(INTERP_KERNEL::Exception& e)
3529 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3530 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3531 DataArrayDouble *ret0Arr=ret0->getArray();
3533 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3538 std::vector<int> v2(1,singleVal);
3539 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3540 ret0->setArray(aarr);
3545 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3546 ret0->setArray(aarr);
3551 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3552 std::vector<int> v2(nbOfComp);
3553 for(int i=0;i<nbOfComp;i++)
3554 v2[i]=slic.first+i*slic.second.second;
3555 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3556 ret0->setArray(aarr);
3560 throw INTERP_KERNEL::Exception(msg);
3565 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3568 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3571 double r1=self->getMaxValue2(tmp);
3572 PyObject *ret=PyTuple_New(2);
3573 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3574 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3578 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3581 double r1=self->getMinValue2(tmp);
3582 PyObject *ret=PyTuple_New(2);
3583 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3584 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3588 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3590 std::vector<int> tmp;
3591 convertPyToNewIntArr3(li,tmp);
3592 return self->keepSelectedComponents(tmp);
3595 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3597 std::vector<int> tmp;
3598 convertPyToNewIntArr3(li,tmp);
3599 self->setSelectedComponents(f,tmp);
3602 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3605 DataArrayDouble *a,*a2;
3606 DataArrayDoubleTuple *aa,*aa2;
3607 std::vector<double> bb,bb2;
3610 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3611 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3612 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3613 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3615 return self->extractSlice3D(orig,vect,eps);
3618 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3620 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3623 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3625 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3628 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3630 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.";
3631 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3634 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3636 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3638 return (*self)-(*other);
3640 throw INTERP_KERNEL::Exception(msg);
3645 DataArrayDoubleTuple *aa;
3646 std::vector<double> bb;
3648 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3653 if(!self->getArray())
3654 throw INTERP_KERNEL::Exception(msg2);
3655 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3656 ret->applyLin(1.,-val);
3657 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3658 ret2->setArray(ret);
3663 if(!self->getArray())
3664 throw INTERP_KERNEL::Exception(msg2);
3665 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3666 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3667 ret2->setArray(ret);
3672 if(!self->getArray())
3673 throw INTERP_KERNEL::Exception(msg2);
3674 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3675 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3676 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3677 ret2->setArray(ret);
3682 if(!self->getArray())
3683 throw INTERP_KERNEL::Exception(msg2);
3684 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3685 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3686 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3687 ret2->setArray(ret);
3691 { throw INTERP_KERNEL::Exception(msg); }
3695 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3697 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3700 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3702 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3705 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3707 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3710 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3712 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.";
3713 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3716 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3718 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3720 return (*self)/(*other);
3722 throw INTERP_KERNEL::Exception(msg);
3727 DataArrayDoubleTuple *aa;
3728 std::vector<double> bb;
3730 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3736 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3737 if(!self->getArray())
3738 throw INTERP_KERNEL::Exception(msg2);
3739 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3740 ret->applyLin(1./val,0);
3741 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3742 ret2->setArray(ret);
3747 if(!self->getArray())
3748 throw INTERP_KERNEL::Exception(msg2);
3749 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3750 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3751 ret2->setArray(ret);
3756 if(!self->getArray())
3757 throw INTERP_KERNEL::Exception(msg2);
3758 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3759 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3760 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3761 ret2->setArray(ret);
3766 if(!self->getArray())
3767 throw INTERP_KERNEL::Exception(msg2);
3768 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3769 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3770 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3771 ret2->setArray(ret);
3775 { throw INTERP_KERNEL::Exception(msg); }
3779 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3781 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3784 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3786 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.";
3787 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3790 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3792 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3794 return (*self)^(*other);
3796 throw INTERP_KERNEL::Exception(msg);
3801 DataArrayDoubleTuple *aa;
3802 std::vector<double> bb;
3804 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3809 if(!self->getArray())
3810 throw INTERP_KERNEL::Exception(msg2);
3811 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3813 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3814 ret2->setArray(ret);
3819 if(!self->getArray())
3820 throw INTERP_KERNEL::Exception(msg2);
3821 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3822 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3823 ret2->setArray(ret);
3828 if(!self->getArray())
3829 throw INTERP_KERNEL::Exception(msg2);
3830 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3831 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3832 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3833 ret2->setArray(ret);
3838 if(!self->getArray())
3839 throw INTERP_KERNEL::Exception(msg2);
3840 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3841 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3842 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3843 ret2->setArray(ret);
3847 { throw INTERP_KERNEL::Exception(msg); }
3851 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3853 return self->negate();
3856 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3858 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.";
3859 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3862 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3864 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3868 Py_XINCREF(trueSelf);
3872 throw INTERP_KERNEL::Exception(msg);
3877 DataArrayDoubleTuple *aa;
3878 std::vector<double> bb;
3880 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3885 if(!self->getArray())
3886 throw INTERP_KERNEL::Exception(msg2);
3887 self->getArray()->applyLin(1.,val);
3888 Py_XINCREF(trueSelf);
3893 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3896 Py_XINCREF(trueSelf);
3901 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3902 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3903 ret2->setArray(aaa);
3905 Py_XINCREF(trueSelf);
3910 if(!self->getArray())
3911 throw INTERP_KERNEL::Exception(msg2);
3912 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3913 self->getArray()->addEqual(aaa);
3914 Py_XINCREF(trueSelf);
3918 { throw INTERP_KERNEL::Exception(msg); }
3922 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3924 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.";
3925 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
3928 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3930 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3934 Py_XINCREF(trueSelf);
3938 throw INTERP_KERNEL::Exception(msg);
3943 DataArrayDoubleTuple *aa;
3944 std::vector<double> bb;
3946 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3951 if(!self->getArray())
3952 throw INTERP_KERNEL::Exception(msg2);
3953 self->getArray()->applyLin(1.,-val);
3954 Py_XINCREF(trueSelf);
3959 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3962 Py_XINCREF(trueSelf);
3967 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3968 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3969 ret2->setArray(aaa);
3971 Py_XINCREF(trueSelf);
3976 if(!self->getArray())
3977 throw INTERP_KERNEL::Exception(msg2);
3978 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3979 self->getArray()->substractEqual(aaa);
3980 Py_XINCREF(trueSelf);
3984 { throw INTERP_KERNEL::Exception(msg); }
3988 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3990 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.";
3991 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
3994 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3996 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4000 Py_XINCREF(trueSelf);
4004 throw INTERP_KERNEL::Exception(msg);
4009 DataArrayDoubleTuple *aa;
4010 std::vector<double> bb;
4012 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4017 if(!self->getArray())
4018 throw INTERP_KERNEL::Exception(msg2);
4019 self->getArray()->applyLin(val,0);
4020 Py_XINCREF(trueSelf);
4025 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4028 Py_XINCREF(trueSelf);
4033 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4034 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4035 ret2->setArray(aaa);
4037 Py_XINCREF(trueSelf);
4042 if(!self->getArray())
4043 throw INTERP_KERNEL::Exception(msg2);
4044 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4045 self->getArray()->multiplyEqual(aaa);
4046 Py_XINCREF(trueSelf);
4050 { throw INTERP_KERNEL::Exception(msg); }
4054 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4056 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.";
4057 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4060 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4062 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4066 Py_XINCREF(trueSelf);
4070 throw INTERP_KERNEL::Exception(msg);
4075 DataArrayDoubleTuple *aa;
4076 std::vector<double> bb;
4078 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4084 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4085 if(!self->getArray())
4086 throw INTERP_KERNEL::Exception(msg2);
4087 self->getArray()->applyLin(1./val,0);
4088 Py_XINCREF(trueSelf);
4093 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4096 Py_XINCREF(trueSelf);
4101 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4102 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4103 ret2->setArray(aaa);
4105 Py_XINCREF(trueSelf);
4110 if(!self->getArray())
4111 throw INTERP_KERNEL::Exception(msg2);
4112 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4113 self->getArray()->divideEqual(aaa);
4114 Py_XINCREF(trueSelf);
4118 { throw INTERP_KERNEL::Exception(msg); }
4122 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4124 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.";
4125 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4128 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4130 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4134 Py_XINCREF(trueSelf);
4138 throw INTERP_KERNEL::Exception(msg);
4143 DataArrayDoubleTuple *aa;
4144 std::vector<double> bb;
4146 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4151 if(!self->getArray())
4152 throw INTERP_KERNEL::Exception(msg2);
4153 self->getArray()->applyPow(val);
4154 Py_XINCREF(trueSelf);
4159 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4162 Py_XINCREF(trueSelf);
4167 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4168 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4169 ret2->setArray(aaa);
4171 Py_XINCREF(trueSelf);
4176 if(!self->getArray())
4177 throw INTERP_KERNEL::Exception(msg2);
4178 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4179 self->getArray()->powEqual(aaa);
4180 Py_XINCREF(trueSelf);
4184 { throw INTERP_KERNEL::Exception(msg); }
4188 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4190 std::vector<const MEDCouplingFieldDouble *> tmp;
4191 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4192 return MEDCouplingFieldDouble::MergeFields(tmp);
4195 static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4197 std::vector<const MEDCouplingFieldDouble *> tmp;
4198 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4199 MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4204 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4207 int getNumberOfFields() const;
4208 MEDCouplingMultiFields *deepCpy() const;
4209 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4210 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4211 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4212 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4213 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4216 std::string __str__() const throw(INTERP_KERNEL::Exception)
4218 return self->simpleRepr();
4220 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4222 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4223 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4225 std::vector<MEDCouplingFieldDouble *> fs(sz);
4226 for(int i=0;i<sz;i++)
4227 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4228 return MEDCouplingMultiFields::New(fs);
4230 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4232 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4233 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4235 std::vector<MEDCouplingFieldDouble *> fs(sz);
4236 for(int i=0;i<sz;i++)
4237 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4238 return MEDCouplingMultiFields::New(fs);
4240 PyObject *getFields() const
4242 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4243 int sz=fields.size();
4244 PyObject *res = PyList_New(sz);
4245 for(int i=0;i<sz;i++)
4249 fields[i]->incrRef();
4250 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4254 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4259 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4261 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4265 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4268 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4270 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4272 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4274 PyObject *res = PyList_New(sz);
4275 for(int i=0;i<sz;i++)
4280 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4284 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4289 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4291 std::vector<int> refs;
4292 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4294 PyObject *res = PyList_New(sz);
4295 for(int i=0;i<sz;i++)
4300 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4304 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4308 PyObject *ret=PyTuple_New(2);
4309 PyTuple_SetItem(ret,0,res);
4310 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4313 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4315 std::vector<DataArrayDouble *> ms=self->getArrays();
4317 PyObject *res = PyList_New(sz);
4318 for(int i=0;i<sz;i++)
4323 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4327 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4332 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4334 std::vector< std::vector<int> > refs;
4335 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4337 PyObject *res = PyList_New(sz);
4338 PyObject *res2 = PyList_New(sz);
4339 for(int i=0;i<sz;i++)
4344 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4348 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4350 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4353 PyObject *ret=PyTuple_New(2);
4354 PyTuple_SetItem(ret,0,res);
4355 PyTuple_SetItem(ret,1,res2);
4361 class MEDCouplingDefinitionTime
4364 MEDCouplingDefinitionTime();
4365 void assign(const MEDCouplingDefinitionTime& other);
4366 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4367 double getTimeResolution() const;
4368 std::vector<double> getHotSpotsTime() const;
4371 std::string __str__() const throw(INTERP_KERNEL::Exception)
4373 std::ostringstream oss;
4374 self->appendRepr(oss);
4378 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4380 int meshId,arrId,arrIdInField,fieldId;
4381 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4382 PyObject *res=PyList_New(4);
4383 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4384 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4385 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4386 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4390 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4392 int meshId,arrId,arrIdInField,fieldId;
4393 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4394 PyObject *res=PyList_New(4);
4395 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4396 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4397 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4398 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4404 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4407 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4408 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4412 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4414 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4415 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4417 std::vector<MEDCouplingFieldDouble *> fs(sz);
4418 for(int i=0;i<sz;i++)
4419 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4420 return MEDCouplingFieldOverTime::New(fs);
4422 std::string __str__() const throw(INTERP_KERNEL::Exception)
4424 return self->simpleRepr();
4426 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4428 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4429 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4431 std::vector<MEDCouplingFieldDouble *> fs(sz);
4432 for(int i=0;i<sz;i++)
4433 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4434 return MEDCouplingFieldOverTime::New(fs);
4442 __filename=os.environ.get('PYTHONSTARTUP')
4443 if __filename and os.path.isfile(__filename):
4444 execfile(__filename)