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 "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingCartesianAMRMesh.hxx"
44 #include "MEDCouplingMatrix.hxx"
45 #include "MEDCouplingTypemaps.i"
47 #include "InterpKernelAutoPtr.hxx"
48 #include "BoxSplittingOptions.hxx"
50 using namespace ParaMEDMEM;
51 using namespace INTERP_KERNEL;
55 %template(ivec) std::vector<int>;
56 %template(dvec) std::vector<double>;
57 %template(svec) std::vector<std::string>;
60 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
62 $result=convertMesh($1,$owner);
65 %typemap(out) MEDCouplingMesh*
67 $result=convertMesh($1,$owner);
72 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
74 $result=convertMesh($1,$owner);
77 %typemap(out) MEDCouplingPointSet*
79 $result=convertMesh($1,$owner);
85 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
87 $result=convertMesh($1,$owner);
90 %typemap(out) MEDCoupling1GTUMesh*
92 $result=convertMesh($1,$owner);
97 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
99 $result=convertMesh($1,$owner);
102 %typemap(out) MEDCouplingStructuredMesh*
104 $result=convertMesh($1,$owner);
109 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
111 $result=convertFieldDiscretization($1,$owner);
114 %typemap(out) MEDCouplingFieldDiscretization*
116 $result=convertFieldDiscretization($1,$owner);
121 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
123 $result=convertMultiFields($1,$owner);
126 %typemap(out) MEDCouplingMultiFields*
128 $result=convertMultiFields($1,$owner);
133 %init %{ import_array(); %}
136 %feature("autodoc", "1");
137 %feature("docstring");
139 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
140 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
141 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
143 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
144 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
145 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
146 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
147 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
148 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
149 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
150 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
151 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
152 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
153 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
154 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
155 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
156 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
157 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
158 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
159 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
160 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
161 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
162 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
163 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
164 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
165 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
166 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
167 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
168 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
169 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
170 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
171 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
172 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
173 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
174 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
192 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
193 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
194 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
195 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
196 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
197 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
198 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
199 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
200 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
201 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
202 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
203 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
204 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
205 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
206 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
207 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
208 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
209 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
210 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
211 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
212 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
213 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
214 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
215 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
216 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
217 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
218 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
219 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
220 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
221 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
222 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
223 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
224 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
225 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
226 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
227 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
228 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
229 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
230 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
231 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
232 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
233 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
234 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
235 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
236 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
237 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
238 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
239 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
240 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
241 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
242 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
243 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
244 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
245 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
246 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
247 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
248 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
249 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
250 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
251 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
252 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
253 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
254 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
255 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
256 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
257 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
258 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
259 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
260 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
261 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
262 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
263 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
280 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
281 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
282 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
283 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
284 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
285 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
286 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
287 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
288 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
289 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
290 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
291 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
292 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
293 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
294 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
295 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
296 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
297 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
298 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
299 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
300 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
301 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
302 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
303 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
304 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
305 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
306 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
307 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
308 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
309 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
310 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
311 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
312 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
313 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
314 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
315 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
316 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
317 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
318 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
319 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatch::getMesh;
320 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatch::__getitem__;
321 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
322 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildUnstructured;
323 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildMeshFromPatchEnvelop;
324 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildMeshOfDirectChildrenOnly;
325 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getImageMesh;
326 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getGodFather;
327 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getFather;
328 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getPatch;
329 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::createCellFieldOnPatch;
330 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::findPatchesInTheNeighborhoodOf;
331 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::__getitem__;
332 %newobject ParaMEDMEM::DenseMatrix::New;
333 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
334 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
335 %newobject ParaMEDMEM::DenseMatrix::getData;
336 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
337 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
338 %newobject ParaMEDMEM::DenseMatrix::__add__;
339 %newobject ParaMEDMEM::DenseMatrix::__sub__;
340 %newobject ParaMEDMEM::DenseMatrix::__mul__;
342 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
343 %feature("unref") MEDCouplingMesh "$this->decrRef();"
344 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
345 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
346 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
347 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
348 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
349 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
350 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
351 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
352 %feature("unref") MEDCouplingField "$this->decrRef();"
353 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
354 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
355 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
356 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
357 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
358 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
359 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
360 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
361 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
362 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
363 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
364 %feature("unref") DenseMatrix "$this->decrRef();"
366 %rename(assign) *::operator=;
367 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
368 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
369 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
370 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
374 %rename (InterpKernelException) INTERP_KERNEL::Exception;
376 %include "MEDCouplingRefCountObject.i"
377 %include "MEDCouplingMemArray.i"
379 namespace INTERP_KERNEL
382 * \class BoxSplittingOptions
383 * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
385 class BoxSplittingOptions
388 BoxSplittingOptions();
389 void init() throw(INTERP_KERNEL::Exception);
390 double getEffeciency() const throw(INTERP_KERNEL::Exception);
391 void setEffeciency(double effeciency) throw(INTERP_KERNEL::Exception);
392 double getEffeciencySnd() const throw(INTERP_KERNEL::Exception);
393 void setEffeciencySnd(double effeciencySnd) throw(INTERP_KERNEL::Exception);
394 int getMinCellDirection() const throw(INTERP_KERNEL::Exception);
395 void setMinCellDirection(int minCellDirection) throw(INTERP_KERNEL::Exception);
396 int getMaxCells() const throw(INTERP_KERNEL::Exception);
397 void setMaxCells(int maxCells) throw(INTERP_KERNEL::Exception);
398 void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
399 std::string printOptions() const throw(INTERP_KERNEL::Exception);
402 std::string __str__() const throw(INTERP_KERNEL::Exception)
404 return self->printOptions();
426 CONST_ON_TIME_INTERVAL = 7
427 } TypeOfTimeDiscretization;
435 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
436 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
438 } MEDCouplingMeshType;
441 class DataArrayDouble;
442 class MEDCouplingUMesh;
443 class MEDCouplingFieldDouble;
445 %extend RefCountObject
447 std::string getHiddenCppPointer() const
449 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
454 %extend MEDCouplingGaussLocalization
456 std::string __str__() const throw(INTERP_KERNEL::Exception)
458 return self->getStringRepr();
461 std::string __repr__() const throw(INTERP_KERNEL::Exception)
463 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
464 oss << self->getStringRepr();
471 class MEDCouplingMesh : public RefCountObject, public TimeLabel
474 void setName(const std::string& name);
475 std::string getName() const;
476 void setDescription(const std::string& descr);
477 std::string getDescription() const;
478 void setTime(double val, int iteration, int order);
479 void setTimeUnit(const std::string& unit);
480 std::string getTimeUnit() const;
481 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
482 bool isStructured() const throw(INTERP_KERNEL::Exception);
483 virtual MEDCouplingMesh *deepCpy() const;
484 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
485 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
486 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
487 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
488 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
489 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
490 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
491 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
492 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
493 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
494 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
495 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
496 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
497 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
498 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
499 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
500 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
501 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
502 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
503 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
504 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
505 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
506 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
507 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
508 void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
510 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
511 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
512 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
513 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
514 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
515 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
516 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
517 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
518 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
519 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
520 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
521 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
522 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
523 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
524 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
525 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
526 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
529 std::string __str__() const throw(INTERP_KERNEL::Exception)
531 return self->simpleRepr();
534 PyObject *getTime() throw(INTERP_KERNEL::Exception)
537 double tmp0=self->getTime(tmp1,tmp2);
538 PyObject *res = PyList_New(3);
539 PyList_SetItem(res,0,SWIG_From_double(tmp0));
540 PyList_SetItem(res,1,SWIG_From_int(tmp1));
541 PyList_SetItem(res,2,SWIG_From_int(tmp2));
545 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
549 DataArrayDoubleTuple *aa;
550 std::vector<double> bb;
552 int spaceDim=self->getSpaceDimension();
553 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
554 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
555 return self->getCellContainingPoint(pos,eps);
558 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
562 DataArrayDoubleTuple *aa;
563 std::vector<double> bb;
565 int spaceDim=self->getSpaceDimension();
566 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
567 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
568 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
569 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
570 PyObject *ret=PyTuple_New(2);
571 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
572 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
576 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
578 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
579 int spaceDim=self->getSpaceDimension();
581 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
582 if (!SWIG_IsOK(res1))
585 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
586 int nbOfPoints=size/spaceDim;
589 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
591 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
595 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
597 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
598 da2->checkAllocated();
599 int size=da2->getNumberOfTuples();
600 int nbOfCompo=da2->getNumberOfComponents();
601 if(nbOfCompo!=spaceDim)
603 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
605 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
607 PyObject *ret=PyTuple_New(2);
608 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
609 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
613 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
617 DataArrayDoubleTuple *aa;
618 std::vector<double> bb;
620 int spaceDim=self->getSpaceDimension();
621 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
622 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
623 std::vector<int> elts;
624 self->getCellsContainingPoint(pos,eps,elts);
625 DataArrayInt *ret=DataArrayInt::New();
626 ret->alloc((int)elts.size(),1);
627 std::copy(elts.begin(),elts.end(),ret->getPointer());
628 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
631 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
633 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
634 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
635 self->getReverseNodalConnectivity(d0,d1);
636 PyObject *ret=PyTuple_New(2);
637 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
638 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
642 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
645 int v0; std::vector<int> v1;
646 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
647 self->renumberCells(ids,check);
650 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
652 DataArrayInt *cellCor, *nodeCor;
653 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
654 PyObject *res = PyList_New(2);
655 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
656 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
660 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
662 DataArrayInt *cellCor=0,*nodeCor=0;
663 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
664 PyObject *res = PyList_New(2);
665 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
666 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
670 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
672 DataArrayInt *cellCor=0;
673 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
677 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
680 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
681 if (!SWIG_IsOK(res1))
684 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
685 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
689 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
691 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
692 da2->checkAllocated();
693 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
696 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
698 std::vector<int> conn;
699 self->getNodeIdsOfCell(cellId,conn);
700 return convertIntArrToPyList2(conn);
703 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
705 std::vector<double> coo;
706 self->getCoordinatesOfNode(nodeId,coo);
707 return convertDblArrToPyList2(coo);
710 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
714 DataArrayDoubleTuple *aa;
715 std::vector<double> bb;
717 int spaceDim=self->getSpaceDimension();
718 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
719 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
720 self->scale(pointPtr,factor);
723 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
725 int spaceDim=self->getSpaceDimension();
726 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
727 self->getBoundingBox(tmp);
728 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
732 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
735 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
736 PyObject *ret=PyTuple_New(2);
737 PyObject *ret0Py=ret0?Py_True:Py_False;
739 PyTuple_SetItem(ret,0,ret0Py);
740 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
744 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
746 int szArr,sw,iTypppArr;
747 std::vector<int> stdvecTyyppArr;
748 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
749 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
750 if(sw==3)//DataArrayInt
752 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
753 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
754 std::string name=argpt->getName();
756 ret->setName(name.c_str());
758 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
761 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
763 int szArr,sw,iTypppArr;
764 std::vector<int> stdvecTyyppArr;
766 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
767 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
768 if(sw==3)//DataArrayInt
770 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
771 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
772 std::string name=argpt->getName();
774 ret->setName(name.c_str());
777 PyObject *res = PyList_New(2);
778 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
779 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
780 PyList_SetItem(res,0,obj0);
781 PyList_SetItem(res,1,obj1);
785 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
789 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
790 PyObject *res = PyTuple_New(2);
791 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
794 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
796 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
797 PyTuple_SetItem(res,0,obj0);
798 PyTuple_SetItem(res,1,obj1);
802 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
804 std::vector<int> vals=self->getDistributionOfTypes();
806 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
807 PyObject *ret=PyList_New((int)vals.size()/3);
808 for(int j=0;j<(int)vals.size()/3;j++)
810 PyObject *ret1=PyList_New(3);
811 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
812 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
813 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
814 PyList_SetItem(ret,j,ret1);
819 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
821 std::vector<int> code;
822 std::vector<const DataArrayInt *> idsPerType;
823 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
824 convertPyToNewIntArr4(li,1,3,code);
825 return self->checkTypeConsistencyAndContig(code,idsPerType);
828 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
830 std::vector<int> code;
831 std::vector<DataArrayInt *> idsInPflPerType;
832 std::vector<DataArrayInt *> idsPerType;
833 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
834 PyObject *ret=PyTuple_New(3);
837 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
838 PyObject *ret0=PyList_New((int)code.size()/3);
839 for(int j=0;j<(int)code.size()/3;j++)
841 PyObject *ret00=PyList_New(3);
842 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
843 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
844 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
845 PyList_SetItem(ret0,j,ret00);
847 PyTuple_SetItem(ret,0,ret0);
849 PyObject *ret1=PyList_New(idsInPflPerType.size());
850 for(std::size_t j=0;j<idsInPflPerType.size();j++)
851 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
852 PyTuple_SetItem(ret,1,ret1);
853 int n=idsPerType.size();
854 PyObject *ret2=PyList_New(n);
856 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
857 PyTuple_SetItem(ret,2,ret2);
861 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
865 DataArrayDoubleTuple *aa;
866 std::vector<double> bb;
868 int spaceDim=self->getSpaceDimension();
869 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
870 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
871 self->translate(vectorPtr);
874 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
876 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
879 DataArrayDoubleTuple *aa;
880 std::vector<double> bb;
882 int spaceDim=self->getSpaceDimension();
883 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
884 self->rotate(centerPtr,0,alpha);
887 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
889 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
891 DataArrayDouble *a,*a2;
892 DataArrayDoubleTuple *aa,*aa2;
893 std::vector<double> bb,bb2;
895 int spaceDim=self->getSpaceDimension();
896 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
897 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
898 self->rotate(centerPtr,vectorPtr,alpha);
901 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
903 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
904 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
905 PyObject *res=PyList_New(result.size());
906 for(int i=0;iL!=result.end(); i++, iL++)
907 PyList_SetItem(res,i,PyInt_FromLong(*iL));
911 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
913 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
914 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
915 return MEDCouplingMesh::MergeMeshes(tmp);
921 //== MEDCouplingMesh End
923 %include "NormalizedGeometricTypes"
924 %include "MEDCouplingNatureOfFieldEnum"
928 class MEDCouplingNatureOfField
931 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
932 static std::string GetReprNoThrow(NatureOfField nat);
933 static std::string GetAllPossibilitiesStr();
937 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
938 // include "MEDCouplingTimeDiscretization.i"
942 class MEDCouplingGaussLocalization
945 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
946 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
947 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
948 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
949 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
950 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
951 int getDimension() const throw(INTERP_KERNEL::Exception);
952 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
953 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
954 void checkCoherency() const throw(INTERP_KERNEL::Exception);
955 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
957 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
958 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
959 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
960 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
961 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
962 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
963 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
964 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
965 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
966 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
967 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
968 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
970 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
974 %include "MEDCouplingFieldDiscretization.i"
976 //== MEDCouplingPointSet
980 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
983 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
984 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
985 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
986 void zipCoords() throw(INTERP_KERNEL::Exception);
987 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
988 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
989 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
990 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
991 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
992 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
993 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
994 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
995 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
996 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
997 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
998 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
999 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1000 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1001 virtual DataArrayInt *findBoundaryNodes() const;
1002 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1003 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1004 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1005 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1006 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1007 virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1010 std::string __str__() const throw(INTERP_KERNEL::Exception)
1012 return self->simpleRepr();
1015 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1018 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1019 PyObject *res = PyList_New(2);
1020 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1021 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1025 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1027 DataArrayInt *comm, *commIndex;
1028 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1029 PyObject *res = PyList_New(2);
1030 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1031 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1035 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1037 DataArrayDouble *ret1=self->getCoords();
1040 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1043 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1045 int szArr,sw,iTypppArr;
1046 std::vector<int> stdvecTyyppArr;
1047 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1048 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1049 if(sw==3)//DataArrayInt
1051 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1052 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1053 std::string name=argpt->getName();
1055 ret->setName(name.c_str());
1057 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1060 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1062 int szArr,sw,iTypppArr;
1063 std::vector<int> stdvecTyyppArr;
1064 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1065 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1066 if(sw==3)//DataArrayInt
1068 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1069 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1070 std::string name=argpt->getName();
1072 ret->setName(name.c_str());
1074 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1077 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1079 int szArr,sw,iTypppArr;
1080 std::vector<int> stdvecTyyppArr;
1081 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1082 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1083 if(sw==3)//DataArrayInt
1085 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1086 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1087 std::string name=argpt->getName();
1089 ret->setName(name.c_str());
1091 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1094 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1096 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1097 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1100 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1102 int szArr,sw,iTypppArr;
1103 std::vector<int> stdvecTyyppArr;
1104 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1105 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1106 if(sw==3)//DataArrayInt
1108 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1109 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1110 std::string name=argpt->getName();
1112 ret->setName(name.c_str());
1114 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1117 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1119 int szArr,sw,iTypppArr;
1120 std::vector<int> stdvecTyyppArr;
1121 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1122 self->renumberNodes(tmp,newNbOfNodes);
1125 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1127 int szArr,sw,iTypppArr;
1128 std::vector<int> stdvecTyyppArr;
1129 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1130 self->renumberNodes2(tmp,newNbOfNodes);
1133 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1135 int spaceDim=self->getSpaceDimension();
1137 DataArrayDouble *a,*a2;
1138 DataArrayDoubleTuple *aa,*aa2;
1139 std::vector<double> bb,bb2;
1141 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1142 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1143 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1144 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1145 std::vector<int> nodes;
1146 self->findNodesOnLine(p,v,eps,nodes);
1147 DataArrayInt *ret=DataArrayInt::New();
1148 ret->alloc((int)nodes.size(),1);
1149 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1150 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1152 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1154 int spaceDim=self->getSpaceDimension();
1156 DataArrayDouble *a,*a2;
1157 DataArrayDoubleTuple *aa,*aa2;
1158 std::vector<double> bb,bb2;
1160 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1161 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1162 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1163 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1164 std::vector<int> nodes;
1165 self->findNodesOnPlane(p,v,eps,nodes);
1166 DataArrayInt *ret=DataArrayInt::New();
1167 ret->alloc((int)nodes.size(),1);
1168 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1169 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1172 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1176 DataArrayDoubleTuple *aa;
1177 std::vector<double> bb;
1179 int spaceDim=self->getSpaceDimension();
1180 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1181 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1182 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1183 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1186 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1188 DataArrayInt *c=0,*cI=0;
1192 DataArrayDoubleTuple *aa;
1193 std::vector<double> bb;
1195 int spaceDim=self->getSpaceDimension();
1196 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1197 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1198 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1199 PyObject *ret=PyTuple_New(2);
1200 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1201 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1205 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1207 DataArrayInt *c=0,*cI=0;
1208 int spaceDim=self->getSpaceDimension();
1211 DataArrayDoubleTuple *aa;
1212 std::vector<double> bb;
1215 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1216 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1218 PyObject *ret=PyTuple_New(2);
1219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1224 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1228 DataArrayDoubleTuple *aa;
1229 std::vector<double> bb;
1231 int spaceDim=self->getSpaceDimension();
1232 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1233 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1235 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1236 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1239 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1243 std::vector<int> multiVal;
1244 std::pair<int, std::pair<int,int> > slic;
1245 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1246 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1250 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1252 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1254 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1256 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1260 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1262 DataArrayInt *v0=0,*v1=0;
1263 self->findCommonCells(compType,startCellId,v0,v1);
1264 PyObject *res = PyList_New(2);
1265 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1266 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1271 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1274 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1275 if (!SWIG_IsOK(res1))
1278 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1279 self->renumberNodesInConn(tmp);
1283 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1285 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1286 da2->checkAllocated();
1287 self->renumberNodesInConn(da2->getConstPointer());
1291 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1294 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1295 PyObject *ret=PyTuple_New(2);
1296 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1297 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1301 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1303 DataArrayInt *ret=0;
1305 int szArr,sw,iTypppArr;
1306 std::vector<int> stdvecTyyppArr;
1307 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1308 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1312 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1316 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1317 PyObject *res = PyList_New(3);
1318 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1319 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1320 PyList_SetItem(res,2,SWIG_From_int(ret2));
1324 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1328 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1329 PyObject *res = PyList_New(3);
1330 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1331 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1332 PyList_SetItem(res,2,SWIG_From_int(ret2));
1336 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1339 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1340 if (!SWIG_IsOK(res1))
1343 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1344 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1348 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1350 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1351 da2->checkAllocated();
1352 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1356 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1360 std::vector<int> multiVal;
1361 std::pair<int, std::pair<int,int> > slic;
1362 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1363 int nbc=self->getNumberOfCells();
1364 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1371 std::ostringstream oss;
1372 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1373 throw INTERP_KERNEL::Exception(oss.str().c_str());
1376 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1381 int tmp=nbc+singleVal;
1382 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1386 std::ostringstream oss;
1387 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1388 throw INTERP_KERNEL::Exception(oss.str().c_str());
1394 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1398 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1403 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1404 daIntTyypp->checkAllocated();
1405 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1408 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1412 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1415 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1416 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1417 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1418 for(int i=0;i<sz;i++)
1419 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1422 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1425 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1427 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1428 std::vector<double> val3;
1429 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1430 "Rotate2DAlg",2,true,nbNodes);
1432 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1433 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1436 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1439 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1440 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1441 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1442 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1443 for(int i=0;i<sz;i++)
1444 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1447 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1450 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1452 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1453 std::vector<double> val3;
1454 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1455 "Rotate3DAlg",3,true,nbNodes);
1457 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1458 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1459 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1464 //== MEDCouplingPointSet End
1466 class MEDCouplingUMeshCell
1469 INTERP_KERNEL::NormalizedCellType getType() const;
1472 std::string __str__() const throw(INTERP_KERNEL::Exception)
1474 return self->repr();
1477 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1480 const int *r=self->getAllConn(ret2);
1481 PyObject *ret=PyTuple_New(ret2);
1482 for(int i=0;i<ret2;i++)
1483 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1489 class MEDCouplingUMeshCellIterator
1496 MEDCouplingUMeshCell *ret=self->nextt();
1498 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1501 PyErr_SetString(PyExc_StopIteration,"No more data.");
1508 class MEDCouplingUMeshCellByTypeIterator
1511 ~MEDCouplingUMeshCellByTypeIterator();
1516 MEDCouplingUMeshCellEntry *ret=self->nextt();
1518 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1521 PyErr_SetString(PyExc_StopIteration,"No more data.");
1528 class MEDCouplingUMeshCellByTypeEntry
1531 ~MEDCouplingUMeshCellByTypeEntry();
1534 MEDCouplingUMeshCellByTypeIterator *__iter__()
1536 return self->iterator();
1541 class MEDCouplingUMeshCellEntry
1544 INTERP_KERNEL::NormalizedCellType getType() const;
1545 int getNumberOfElems() const;
1548 MEDCouplingUMeshCellIterator *__iter__()
1550 return self->iterator();
1555 //== MEDCouplingUMesh
1557 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1560 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1561 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1562 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1563 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1564 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1565 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1566 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1567 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1568 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1569 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1570 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1571 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1572 void computeTypes() throw(INTERP_KERNEL::Exception);
1573 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1574 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1576 DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1577 DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1578 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1579 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1580 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1581 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1582 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1583 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1584 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1585 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1586 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1587 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1588 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1589 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1590 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1591 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1592 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1593 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1594 bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1595 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1596 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1597 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1598 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1599 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1600 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1601 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1602 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1603 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1604 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1605 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1606 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1607 DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1608 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1609 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1610 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1611 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1612 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1613 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1614 DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1615 DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1616 DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1617 DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1618 DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1619 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);
1620 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1621 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1622 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1623 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1624 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1626 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1628 return MEDCouplingUMesh::New();
1631 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1633 return MEDCouplingUMesh::New(meshName,meshDim);
1636 std::string __str__() const throw(INTERP_KERNEL::Exception)
1638 return self->simpleRepr();
1641 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1643 std::ostringstream oss;
1644 self->reprQuickOverview(oss);
1648 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1650 return self->cellIterator();
1653 PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1655 std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1656 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1657 PyObject *res=PyList_New(result.size());
1658 for(int i=0;iL!=result.end(); i++, iL++)
1659 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1663 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1667 std::vector<int> multiVal;
1668 std::pair<int, std::pair<int,int> > slic;
1669 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1670 int nbc=self->getNumberOfCells();
1671 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1678 std::ostringstream oss;
1679 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1680 throw INTERP_KERNEL::Exception(oss.str().c_str());
1684 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1691 int tmp=nbc+singleVal;
1692 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1697 std::ostringstream oss;
1698 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1699 throw INTERP_KERNEL::Exception(oss.str().c_str());
1705 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1711 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1712 daIntTyypp->checkAllocated();
1713 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1717 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1721 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1725 std::vector<int> multiVal;
1726 std::pair<int, std::pair<int,int> > slic;
1727 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1728 int nbc=self->getNumberOfCells();
1729 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1736 std::ostringstream oss;
1737 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1738 throw INTERP_KERNEL::Exception(oss.str().c_str());
1742 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1749 int tmp=nbc+singleVal;
1750 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1755 std::ostringstream oss;
1756 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1757 throw INTERP_KERNEL::Exception(oss.str().c_str());
1763 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1768 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1774 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1775 daIntTyypp->checkAllocated();
1776 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1780 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1784 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1786 int szArr,sw,iTypppArr;
1787 std::vector<int> stdvecTyyppArr;
1788 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1791 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1792 throw INTERP_KERNEL::Exception(oss.str().c_str());
1794 self->insertNextCell(type,size,tmp);
1797 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1799 int szArr,sw,iTypppArr;
1800 std::vector<int> stdvecTyyppArr;
1801 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1802 self->insertNextCell(type,szArr,tmp);
1805 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1807 DataArrayInt *ret=self->getNodalConnectivity();
1812 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1814 DataArrayInt *ret=self->getNodalConnectivityIndex();
1820 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1822 int szArr,sw,iTypppArr;
1823 std::vector<int> stdvecTyyppArr;
1824 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1825 int nbOfDepthPeelingPerformed=0;
1826 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1827 PyObject *res=PyTuple_New(2);
1828 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1829 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1833 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1835 DataArrayInt *v0=0,*v1=0;
1836 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1837 PyObject *res = PyList_New(2);
1838 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1839 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1843 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1847 DataArrayDoubleTuple *aa;
1848 std::vector<double> bb;
1850 int nbOfCompo=self->getSpaceDimension();
1851 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1854 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1855 PyObject *ret=PyTuple_New(2);
1856 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1857 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1861 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1863 DataArrayInt *ret1=0;
1864 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1865 PyObject *ret=PyTuple_New(2);
1866 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1867 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1871 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1874 DataArrayInt *ret1(0);
1875 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1876 PyObject *ret=PyTuple_New(3);
1877 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1878 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1879 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1883 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1885 std::vector<int> cells;
1886 self->checkButterflyCells(cells,eps);
1887 DataArrayInt *ret=DataArrayInt::New();
1888 ret->alloc((int)cells.size(),1);
1889 std::copy(cells.begin(),cells.end(),ret->getPointer());
1890 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1893 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1895 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1897 PyObject *ret = PyList_New(sz);
1898 for(int i=0;i<sz;i++)
1899 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1903 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1905 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1906 int sz=retCpp.size();
1907 PyObject *ret=PyList_New(sz);
1908 for(int i=0;i<sz;i++)
1909 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1913 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1916 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1917 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1918 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1921 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1924 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1925 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1929 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1932 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1933 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1937 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1939 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1940 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1941 PyObject *ret=PyTuple_New(3);
1942 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1943 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1944 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1948 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1950 DataArrayInt *tmp0=0,*tmp1=0;
1951 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1952 PyObject *ret=PyTuple_New(2);
1953 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1954 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1958 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1962 std::vector<int> multiVal;
1963 std::pair<int, std::pair<int,int> > slic;
1964 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1965 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1969 return self->duplicateNodes(&singleVal,&singleVal+1);
1971 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1973 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1975 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1979 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1983 std::vector<int> multiVal;
1984 std::pair<int, std::pair<int,int> > slic;
1985 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1986 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1990 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1992 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1994 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1996 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2000 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2003 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2004 DataArrayInt *tmp0,*tmp1=0;
2005 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2006 PyObject *ret=PyTuple_New(2);
2007 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2008 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2012 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2014 DataArrayInt *ret0=0,*ret1=0;
2015 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2016 PyObject *ret=PyTuple_New(2);
2017 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2018 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2022 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2024 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2025 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2026 DataArrayInt *ret1=0,*ret2=0;
2027 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2028 PyObject *ret=PyTuple_New(3);
2029 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2030 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2031 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2035 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2037 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2038 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2039 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2040 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2043 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2046 std::vector<const MEDCouplingUMesh *> meshes;
2047 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2048 std::vector<DataArrayInt *> corr;
2049 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2051 PyObject *ret1=PyList_New(sz);
2052 for(int i=0;i<sz;i++)
2053 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2054 PyObject *ret=PyList_New(2);
2055 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2056 PyList_SetItem(ret,1,ret1);
2060 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2062 std::vector<MEDCouplingUMesh *> meshes;
2063 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2064 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2067 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2069 std::vector<MEDCouplingUMesh *> meshes;
2070 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2071 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2074 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2078 std::vector<int> multiVal;
2079 std::pair<int, std::pair<int,int> > slic;
2080 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2082 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2083 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2087 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2089 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2091 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2093 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2097 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2099 DataArrayInt *arrOut=0,*arrIndexOut=0;
2102 std::vector<int> multiVal;
2103 std::pair<int, std::pair<int,int> > slic;
2104 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2106 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2107 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2112 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2117 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2122 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2126 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2128 PyObject *ret=PyTuple_New(2);
2129 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2130 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2134 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2136 DataArrayInt *arrOut=0,*arrIndexOut=0;
2137 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2138 PyObject *ret=PyTuple_New(2);
2139 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2140 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2144 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2146 if(!PySlice_Check(slic))
2147 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2148 Py_ssize_t strt=2,stp=2,step=2;
2149 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2151 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2152 arrIndxIn->checkAllocated();
2153 if(arrIndxIn->getNumberOfComponents()!=1)
2154 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2155 GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2156 DataArrayInt *arrOut=0,*arrIndexOut=0;
2157 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2158 PyObject *ret=PyTuple_New(2);
2159 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2165 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2166 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *arrOut=0,*arrIndexOut=0;
2171 std::vector<int> multiVal;
2172 std::pair<int, std::pair<int,int> > slic;
2173 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2175 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2176 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2181 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2186 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2191 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2195 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2197 PyObject *ret=PyTuple_New(2);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2204 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2208 std::vector<int> multiVal;
2209 std::pair<int, std::pair<int,int> > slic;
2210 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2212 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2213 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2218 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2223 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2228 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2232 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2236 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2240 DataArrayDoubleTuple *aa;
2241 std::vector<double> bb;
2243 int spaceDim=self->getSpaceDimension();
2244 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2245 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2247 std::vector<int> cells;
2248 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2249 DataArrayInt *ret=DataArrayInt::New();
2250 ret->alloc((int)cells.size(),1);
2251 std::copy(cells.begin(),cells.end(),ret->getPointer());
2252 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2255 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2259 DataArrayDoubleTuple *aa;
2260 std::vector<double> bb;
2262 int spaceDim=self->getSpaceDimension();
2263 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2264 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2265 self->orientCorrectly2DCells(v,polyOnly);
2268 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2270 std::vector<int> cells;
2271 self->arePolyhedronsNotCorrectlyOriented(cells);
2272 DataArrayInt *ret=DataArrayInt::New();
2273 ret->alloc((int)cells.size(),1);
2274 std::copy(cells.begin(),cells.end(),ret->getPointer());
2275 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2278 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2282 self->getFastAveragePlaneOfThis(vec,pos);
2284 std::copy(vec,vec+3,vals);
2285 std::copy(pos,pos+3,vals+3);
2286 return convertDblArrToPyListOfTuple(vals,3,2);
2289 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2291 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2292 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2293 return MEDCouplingUMesh::MergeUMeshes(tmp);
2296 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2299 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2300 PyObject *ret=PyTuple_New(2);
2301 PyObject *ret0Py=ret0?Py_True:Py_False;
2303 PyTuple_SetItem(ret,0,ret0Py);
2304 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2308 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2311 bool ret0=self->areCellsIncludedIn2(other,ret1);
2312 PyObject *ret=PyTuple_New(2);
2313 PyObject *ret0Py=ret0?Py_True:Py_False;
2315 PyTuple_SetItem(ret,0,ret0Py);
2316 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2320 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2322 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2323 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2324 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2325 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2326 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2327 PyObject *ret=PyTuple_New(5);
2328 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2329 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2330 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2331 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2332 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2336 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2338 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2339 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2340 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2341 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2342 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2343 PyObject *ret=PyTuple_New(5);
2344 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2345 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2346 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2352 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2354 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2355 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2356 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2357 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2358 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2359 PyObject *ret=PyTuple_New(5);
2360 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2361 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2362 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2364 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2368 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2370 DataArrayInt *neighbors=0,*neighborsIdx=0;
2371 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2372 PyObject *ret=PyTuple_New(2);
2373 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2378 PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2380 DataArrayInt *neighbors=0,*neighborsIdx=0;
2381 self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2382 PyObject *ret=PyTuple_New(2);
2383 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2384 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2388 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2390 DataArrayInt *neighbors=0,*neighborsIdx=0;
2391 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2392 PyObject *ret=PyTuple_New(2);
2393 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2394 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2398 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2400 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2401 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2402 DataArrayInt *d2,*d3,*d4,*dd5;
2403 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2404 PyObject *ret=PyTuple_New(7);
2405 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2406 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2407 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2408 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2409 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2410 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2411 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2418 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2419 da->checkAllocated();
2420 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2423 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2426 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2427 da->checkAllocated();
2428 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2431 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2434 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2435 da->checkAllocated();
2436 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2439 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2442 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2443 da->checkAllocated();
2444 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2445 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2446 PyObject *res = PyList_New(result.size());
2447 for (int i=0;iL!=result.end(); i++, iL++)
2448 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2452 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2455 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2456 da->checkAllocated();
2457 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2458 ret->setName(da->getName().c_str());
2462 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2464 DataArrayInt *cellNb1=0,*cellNb2=0;
2465 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2466 PyObject *ret=PyTuple_New(3);
2467 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2468 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2473 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2475 int spaceDim=self->getSpaceDimension();
2477 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2479 DataArrayDouble *a,*a2;
2480 DataArrayDoubleTuple *aa,*aa2;
2481 std::vector<double> bb,bb2;
2483 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2484 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2485 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2486 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2488 DataArrayInt *cellIds=0;
2489 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2490 PyObject *ret=PyTuple_New(2);
2491 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2492 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2496 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2498 int spaceDim=self->getSpaceDimension();
2500 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2502 DataArrayDouble *a,*a2;
2503 DataArrayDoubleTuple *aa,*aa2;
2504 std::vector<double> bb,bb2;
2506 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2507 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2508 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2509 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2511 DataArrayInt *cellIds=0;
2512 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2513 PyObject *ret=PyTuple_New(2);
2514 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2515 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2519 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2521 int spaceDim=self->getSpaceDimension();
2523 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2525 DataArrayDouble *a,*a2;
2526 DataArrayDoubleTuple *aa,*aa2;
2527 std::vector<double> bb,bb2;
2529 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2530 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2531 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2532 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2533 return self->getCellIdsCrossingPlane(orig,vect,eps);
2536 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2540 std::vector<int> pos2;
2541 DataArrayInt *pos3=0;
2542 DataArrayIntTuple *pos4=0;
2543 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2548 self->convertToPolyTypes(&pos1,&pos1+1);
2555 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2560 self->convertToPolyTypes(pos3->begin(),pos3->end());
2564 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2568 void convertAllToPoly();
2569 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2570 bool unPolyze() throw(INTERP_KERNEL::Exception);
2571 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2572 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2573 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2576 //== MEDCouplingUMesh End
2578 //== MEDCouplingExtrudedMesh
2580 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2583 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2584 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2586 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2588 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2591 std::string __str__() const throw(INTERP_KERNEL::Exception)
2593 return self->simpleRepr();
2596 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2598 std::ostringstream oss;
2599 self->reprQuickOverview(oss);
2603 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2605 MEDCouplingUMesh *ret=self->getMesh2D();
2608 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2610 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2612 MEDCouplingUMesh *ret=self->getMesh1D();
2615 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2617 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2619 DataArrayInt *ret=self->getMesh3DIds();
2622 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2627 //== MEDCouplingExtrudedMesh End
2629 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2632 static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2633 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2634 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2635 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2636 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2637 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2640 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2642 int szArr,sw,iTypppArr;
2643 std::vector<int> stdvecTyyppArr;
2644 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2645 self->insertNextCell(tmp,tmp+szArr);
2648 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2650 DataArrayInt *ret=self->getNodalConnectivity();
2651 if(ret) ret->incrRef();
2655 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2657 std::vector< const MEDCoupling1GTUMesh *> parts;
2658 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2659 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2664 //== MEDCoupling1SGTUMesh
2666 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2669 static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2670 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2671 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2672 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2673 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2674 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2675 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2676 MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2677 DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2680 MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2682 return MEDCoupling1SGTUMesh::New(name,type);
2685 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2687 return MEDCoupling1SGTUMesh::New(m);
2690 std::string __str__() const throw(INTERP_KERNEL::Exception)
2692 return self->simpleRepr();
2695 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2697 std::ostringstream oss;
2698 self->reprQuickOverview(oss);
2702 PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2704 DataArrayInt *cellPerm(0),*nodePerm(0);
2705 MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2706 PyObject *ret(PyTuple_New(3));
2707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2709 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2715 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2716 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2717 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2720 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2722 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2723 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2724 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2729 //== MEDCoupling1SGTUMesh End
2731 //== MEDCoupling1DGTUMesh
2733 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2736 static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2737 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2738 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2739 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2740 bool isPacked() const throw(INTERP_KERNEL::Exception);
2743 MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2745 return MEDCoupling1DGTUMesh::New(name,type);
2748 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2750 return MEDCoupling1DGTUMesh::New(m);
2753 std::string __str__() const throw(INTERP_KERNEL::Exception)
2755 return self->simpleRepr();
2758 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2760 std::ostringstream oss;
2761 self->reprQuickOverview(oss);
2765 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2767 DataArrayInt *ret=self->getNodalConnectivityIndex();
2768 if(ret) ret->incrRef();
2772 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2774 DataArrayInt *ret1=0,*ret2=0;
2775 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2776 PyObject *ret0Py=ret0?Py_True:Py_False;
2778 PyObject *ret=PyTuple_New(3);
2779 PyTuple_SetItem(ret,0,ret0Py);
2780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2781 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2785 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2788 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2789 PyObject *ret=PyTuple_New(2);
2790 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2791 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2792 PyTuple_SetItem(ret,1,ret1Py);
2796 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2798 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2799 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2800 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2803 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2805 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2806 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2807 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2810 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2812 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2813 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2814 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2819 //== MEDCoupling1DGTUMeshEnd
2821 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2824 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2825 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2826 int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2827 int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
2828 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2829 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2830 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2831 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2832 MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2833 static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2834 static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
2837 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2839 int tmpp1=-1,tmpp2=-1;
2840 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2841 std::vector< std::pair<int,int> > inp;
2845 for(int i=0;i<tmpp1;i++)
2846 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2851 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2852 inp.resize(tmpp1/2);
2853 for(int i=0;i<tmpp1/2;i++)
2854 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2857 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2858 return self->buildStructuredSubPart(inp);
2861 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2863 std::vector< std::pair<int,int> > inp;
2864 convertPyToVectorPairInt(part,inp);
2866 int szArr,sw,iTypppArr;
2867 std::vector<int> stdvecTyyppArr;
2868 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2869 std::vector<int> tmp5(tmp4,tmp4+szArr);
2871 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2874 static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2876 std::vector< std::pair<int,int> > inp;
2877 convertPyToVectorPairInt(partCompactFormat,inp);
2878 return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
2881 static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
2883 std::vector< std::pair<int,int> > inp;
2884 convertPyToVectorPairInt(part,inp);
2885 return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
2888 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2890 int szArr,sw,iTypppArr;
2891 std::vector<int> stdvecTyyppArr;
2892 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2893 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2896 static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2898 int szArr,sw,iTypppArr;
2899 std::vector<int> stdvecTyyppArr;
2900 const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
2901 return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
2904 static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2906 std::vector< std::pair<int,int> > inp;
2907 convertPyToVectorPairInt(partCompactFormat,inp);
2908 return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
2911 static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
2913 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
2914 PyObject *retPy=PyList_New(ret.size());
2915 for(std::size_t i=0;i<ret.size();i++)
2917 PyObject *tmp=PyTuple_New(2);
2918 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2919 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2920 PyList_SetItem(retPy,i,tmp);
2925 static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
2927 std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
2928 convertPyToVectorPairInt(r1,r1Cpp);
2929 convertPyToVectorPairInt(r2,r2Cpp);
2930 std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
2931 PyObject *retPy=PyList_New(ret.size());
2932 for(std::size_t i=0;i<ret.size();i++)
2934 PyObject *tmp=PyTuple_New(2);
2935 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2936 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2937 PyList_SetItem(retPy,i,tmp);
2942 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2944 int szArr,sw,iTypppArr;
2945 std::vector<int> stdvecTyyppArr;
2946 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2947 int szArr2,sw2,iTypppArr2;
2948 std::vector<int> stdvecTyyppArr2;
2949 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
2950 std::vector<int> tmp3(tmp2,tmp2+szArr2);
2951 std::vector< std::pair<int,int> > partCompactFormat;
2952 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
2953 PyObject *ret=PyTuple_New(2);
2954 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
2955 PyTuple_SetItem(ret,0,ret0Py);
2956 PyObject *ret1Py=PyList_New(partCompactFormat.size());
2957 for(std::size_t i=0;i<partCompactFormat.size();i++)
2959 PyObject *tmp4=PyTuple_New(2);
2960 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
2961 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
2962 PyList_SetItem(ret1Py,i,tmp4);
2964 PyTuple_SetItem(ret,1,ret1Py);
2968 static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
2970 std::vector< std::pair<int,int> > param0,param1,ret;
2971 convertPyToVectorPairInt(bigInAbs,param0);
2972 convertPyToVectorPairInt(partOfBigInAbs,param1);
2973 MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
2974 PyObject *retPy(PyList_New(ret.size()));
2975 for(std::size_t i=0;i<ret.size();i++)
2977 PyObject *tmp(PyTuple_New(2));
2978 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2979 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2980 PyList_SetItem(retPy,i,tmp);
2985 static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
2987 std::vector< std::pair<int,int> > param0,param1,ret;
2988 convertPyToVectorPairInt(bigInAbs,param0);
2989 convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
2990 MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
2991 PyObject *retPy(PyList_New(ret.size()));
2992 for(std::size_t i=0;i<ret.size();i++)
2994 PyObject *tmp(PyTuple_New(2));
2995 PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2996 PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2997 PyList_SetItem(retPy,i,tmp);
3004 //== MEDCouplingCMesh
3006 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3009 static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3010 static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3011 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3012 void setCoords(const DataArrayDouble *coordsX,
3013 const DataArrayDouble *coordsY=0,
3014 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3015 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3017 MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3019 return MEDCouplingCMesh::New();
3021 MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3023 return MEDCouplingCMesh::New(meshName);
3025 std::string __str__() const throw(INTERP_KERNEL::Exception)
3027 return self->simpleRepr();
3029 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3031 std::ostringstream oss;
3032 self->reprQuickOverview(oss);
3035 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3037 DataArrayDouble *ret=self->getCoordsAt(i);
3045 //== MEDCouplingCMesh End
3047 //== MEDCouplingCurveLinearMesh
3049 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3052 static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3053 static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3054 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3055 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3057 MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3059 return MEDCouplingCurveLinearMesh::New();
3061 MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3063 return MEDCouplingCurveLinearMesh::New(meshName);
3065 std::string __str__() const throw(INTERP_KERNEL::Exception)
3067 return self->simpleRepr();
3069 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3071 std::ostringstream oss;
3072 self->reprQuickOverview(oss);
3075 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3077 DataArrayDouble *ret=self->getCoords();
3082 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3084 int szArr,sw,iTypppArr;
3085 std::vector<int> stdvecTyyppArr;
3086 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3087 self->setNodeGridStructure(tmp,tmp+szArr);
3092 //== MEDCouplingCurveLinearMesh End
3094 //== MEDCouplingIMesh
3096 class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3099 static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3101 void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3102 std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3103 std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3104 std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3105 void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3106 std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3107 double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3108 MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3109 void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3110 MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3111 MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3116 return MEDCouplingIMesh::New();
3118 static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3120 static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3121 static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3122 const int *nodeStrctPtr(0);
3123 const double *originPtr(0),*dxyzPtr(0);
3125 std::vector<int> bb0;
3126 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3129 std::vector<double> bb,bb2;
3131 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3132 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3134 return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3137 MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3139 return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3142 void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3145 std::vector<int> bb0;
3146 const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3147 self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3150 void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3152 static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3155 DataArrayDoubleTuple *aa;
3156 std::vector<double> bb;
3158 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3159 self->setOrigin(originPtr,originPtr+nbTuples);
3162 void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3164 static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3167 DataArrayDoubleTuple *aa;
3168 std::vector<double> bb;
3170 const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3171 self->setDXYZ(originPtr,originPtr+nbTuples);
3174 static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3176 std::vector< std::pair<int,int> > inp;
3177 convertPyToVectorPairInt(fineLocInCoarse,inp);
3178 MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3181 static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize) throw(INTERP_KERNEL::Exception)
3183 std::vector< std::pair<int,int> > inp;
3184 convertPyToVectorPairInt(fineLocInCoarse,inp);
3185 MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3188 static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3190 std::vector< std::pair<int,int> > inp;
3191 convertPyToVectorPairInt(fineLocInCoarse,inp);
3192 MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3195 static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3197 std::vector< std::pair<int,int> > inp;
3198 convertPyToVectorPairInt(fineLocInCoarse,inp);
3199 MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3202 std::string __str__() const throw(INTERP_KERNEL::Exception)
3204 return self->simpleRepr();
3206 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3208 std::ostringstream oss;
3209 self->reprQuickOverview(oss);
3215 //== MEDCouplingIMesh End
3219 namespace ParaMEDMEM
3221 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3224 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3225 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3226 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3227 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3228 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3229 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3230 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3231 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3232 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3233 std::string getName() const throw(INTERP_KERNEL::Exception);
3234 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3235 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3236 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3237 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3238 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3239 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3240 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3241 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3242 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3243 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3244 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3245 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3246 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3247 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3248 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3249 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3251 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3253 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3256 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3259 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3261 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3264 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3267 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3269 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3270 return convertIntArrToPyList3(ret);
3273 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3276 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3277 PyObject *ret=PyTuple_New(2);
3278 PyObject *ret0Py=ret0?Py_True:Py_False;
3280 PyTuple_SetItem(ret,0,ret0Py);
3281 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3285 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3287 DataArrayInt *ret1=0;
3288 MEDCouplingMesh *ret0=0;
3290 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3291 if (!SWIG_IsOK(res1))
3294 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3295 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3299 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3301 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3302 da2->checkAllocated();
3303 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3305 PyObject *res = PyList_New(2);
3306 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3307 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3311 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3313 DataArrayInt *ret1=0;
3315 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3316 PyObject *res=PyTuple_New(2);
3317 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3319 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3322 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3323 PyTuple_SetItem(res,1,res1);
3328 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3331 int v0; std::vector<int> v1;
3332 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3333 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3336 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3337 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3340 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3341 if (!SWIG_IsOK(res1))
3344 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3345 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3349 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3351 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3352 da2->checkAllocated();
3353 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3357 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3359 std::vector<int> tmp;
3360 self->getCellIdsHavingGaussLocalization(locId,tmp);
3361 DataArrayInt *ret=DataArrayInt::New();
3362 ret->alloc((int)tmp.size(),1);
3363 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3364 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3367 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3369 std::vector<int> inp0;
3370 convertPyToNewIntArr4(code,1,3,inp0);
3371 std::vector<const DataArrayInt *> inp1;
3372 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3373 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3378 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3381 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3382 static MEDCouplingFieldTemplate *New(TypeOfField type);
3383 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3384 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3387 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3389 return MEDCouplingFieldTemplate::New(f);
3392 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3394 return MEDCouplingFieldTemplate::New(type);
3397 std::string __str__() const throw(INTERP_KERNEL::Exception)
3399 return self->simpleRepr();
3402 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3404 std::ostringstream oss;
3405 self->reprQuickOverview(oss);
3411 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3414 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3415 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3416 void setTimeUnit(const std::string& unit);
3417 std::string getTimeUnit() const;
3418 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3419 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3420 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3421 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3422 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3423 void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3424 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3425 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3426 MEDCouplingFieldDouble *deepCpy() const;
3427 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3428 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3429 MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3430 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3431 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3432 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3433 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3434 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3435 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3436 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3437 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3438 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3439 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3440 void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3441 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3442 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3443 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3444 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3445 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3446 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3447 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3448 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3449 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3450 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3451 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3452 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3453 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3454 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3455 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3456 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3457 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3458 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3459 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3460 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3461 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3462 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3463 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3464 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3465 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3466 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3467 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3468 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3469 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3470 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3471 void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3472 void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3473 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3474 void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3475 void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3476 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3477 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3478 void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3479 void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3480 void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3481 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3482 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3483 double getMinValue() const throw(INTERP_KERNEL::Exception);
3484 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3485 double norm2() const throw(INTERP_KERNEL::Exception);
3486 double normMax() const throw(INTERP_KERNEL::Exception);
3487 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3488 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3489 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3490 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3491 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3492 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3493 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3494 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3495 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3496 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3497 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3498 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3499 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3500 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3501 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3502 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3503 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3504 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3505 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3506 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3507 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3508 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3510 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3512 return MEDCouplingFieldDouble::New(type,td);
3515 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3517 return MEDCouplingFieldDouble::New(ft,td);
3520 std::string __str__() const throw(INTERP_KERNEL::Exception)
3522 return self->simpleRepr();
3525 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3527 std::ostringstream oss;
3528 self->reprQuickOverview(oss);
3532 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3534 DataArrayDouble *ret=self->getArray();
3540 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3542 std::vector<DataArrayDouble *> arrs=self->getArrays();
3543 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3547 PyObject *ret=PyTuple_New(sz);
3548 for(int i=0;i<sz;i++)
3551 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3553 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3558 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3560 std::vector<const DataArrayDouble *> tmp;
3561 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3563 std::vector<DataArrayDouble *> arrs(sz);
3564 for(int i=0;i<sz;i++)
3565 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3566 self->setArrays(arrs);
3569 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3571 DataArrayDouble *ret=self->getEndArray();
3577 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3581 DataArrayDoubleTuple *aa;
3582 std::vector<double> bb;
3584 const MEDCouplingMesh *mesh=self->getMesh();
3586 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3587 int spaceDim=mesh->getSpaceDimension();
3588 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3589 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3591 int sz=self->getNumberOfComponents();
3592 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3593 self->getValueOn(spaceLoc,res);
3594 return convertDblArrToPyList(res,sz);
3597 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3599 int sz=self->getNumberOfComponents();
3600 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3601 self->getValueOnPos(i,j,k,res);
3602 return convertDblArrToPyList(res,sz);
3605 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3607 const MEDCouplingMesh *mesh(self->getMesh());
3609 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3612 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3613 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3614 mesh->getSpaceDimension(),true,nbPts);
3615 return self->getValueOnMulti(inp,nbPts);
3618 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3622 DataArrayDoubleTuple *aa;
3623 std::vector<double> bb;
3625 const MEDCouplingMesh *mesh=self->getMesh();
3627 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3628 int spaceDim=mesh->getSpaceDimension();
3629 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3630 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3633 int sz=self->getNumberOfComponents();
3634 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3635 self->getValueOn(spaceLoc,time,res);
3636 return convertDblArrToPyList(res,sz);
3639 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3641 if(self->getArray()!=0)
3642 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3645 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3646 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3647 self->setArray(arr);
3651 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3654 double tmp0=self->getTime(tmp1,tmp2);
3655 PyObject *res = PyList_New(3);
3656 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3657 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3658 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3662 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3665 double tmp0=self->getStartTime(tmp1,tmp2);
3666 PyObject *res = PyList_New(3);
3667 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3668 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3669 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3673 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3676 double tmp0=self->getEndTime(tmp1,tmp2);
3677 PyObject *res = PyList_New(3);
3678 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3679 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3680 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3683 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3685 int sz=self->getNumberOfComponents();
3686 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3687 self->accumulate(tmp);
3688 return convertDblArrToPyList(tmp,sz);
3690 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3692 int sz=self->getNumberOfComponents();
3693 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3694 self->integral(isWAbs,tmp);
3695 return convertDblArrToPyList(tmp,sz);
3697 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3699 int sz=self->getNumberOfComponents();
3700 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3701 self->getWeightedAverageValue(tmp,isWAbs);
3702 return convertDblArrToPyList(tmp,sz);
3704 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3706 int sz=self->getNumberOfComponents();
3707 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3709 return convertDblArrToPyList(tmp,sz);
3711 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3713 int sz=self->getNumberOfComponents();
3714 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3716 return convertDblArrToPyList(tmp,sz);
3718 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3720 int szArr,sw,iTypppArr;
3721 std::vector<int> stdvecTyyppArr;
3722 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3723 self->renumberCells(tmp,check);
3726 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3728 int szArr,sw,iTypppArr;
3729 std::vector<int> stdvecTyyppArr;
3730 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3731 self->renumberCellsWithoutMesh(tmp,check);
3734 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3736 int szArr,sw,iTypppArr;
3737 std::vector<int> stdvecTyyppArr;
3738 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3739 self->renumberNodes(tmp,eps);
3742 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3744 int szArr,sw,iTypppArr;
3745 std::vector<int> stdvecTyyppArr;
3746 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3747 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3750 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3754 std::vector<int> multiVal;
3755 std::pair<int, std::pair<int,int> > slic;
3756 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3757 const MEDCouplingMesh *mesh=self->getMesh();
3759 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3760 int nbc=mesh->getNumberOfCells();
3761 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3768 std::ostringstream oss;
3769 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3770 throw INTERP_KERNEL::Exception(oss.str().c_str());
3773 return self->buildSubPart(&singleVal,&singleVal+1);
3778 int tmp=nbc+singleVal;
3779 return self->buildSubPart(&tmp,&tmp+1);
3783 std::ostringstream oss;
3784 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3785 throw INTERP_KERNEL::Exception(oss.str().c_str());
3791 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3795 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3800 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3801 daIntTyypp->checkAllocated();
3802 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3805 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3809 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3811 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";
3812 if(PyTuple_Check(li))
3814 Py_ssize_t sz=PyTuple_Size(li);
3816 throw INTERP_KERNEL::Exception(msg);
3817 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3820 std::vector<int> multiVal;
3821 std::pair<int, std::pair<int,int> > slic;
3822 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3823 if(!self->getArray())
3824 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3826 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3827 catch(INTERP_KERNEL::Exception& e)
3828 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3829 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3830 DataArrayDouble *ret0Arr=ret0->getArray();
3832 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3837 std::vector<int> v2(1,singleVal);
3838 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3839 ret0->setArray(aarr);
3844 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3845 ret0->setArray(aarr);
3850 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3851 std::vector<int> v2(nbOfComp);
3852 for(int i=0;i<nbOfComp;i++)
3853 v2[i]=slic.first+i*slic.second.second;
3854 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3855 ret0->setArray(aarr);
3859 throw INTERP_KERNEL::Exception(msg);
3864 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3867 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3870 double r1=self->getMaxValue2(tmp);
3871 PyObject *ret=PyTuple_New(2);
3872 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3873 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3877 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3880 double r1=self->getMinValue2(tmp);
3881 PyObject *ret=PyTuple_New(2);
3882 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3883 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3887 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3889 std::vector<int> tmp;
3890 convertPyToNewIntArr3(li,tmp);
3891 return self->keepSelectedComponents(tmp);
3894 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3896 std::vector<int> tmp;
3897 convertPyToNewIntArr3(li,tmp);
3898 self->setSelectedComponents(f,tmp);
3901 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3904 DataArrayDouble *a,*a2;
3905 DataArrayDoubleTuple *aa,*aa2;
3906 std::vector<double> bb,bb2;
3909 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3910 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3911 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3912 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3914 return self->extractSlice3D(orig,vect,eps);
3917 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3919 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3922 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3924 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3927 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3929 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.";
3930 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3933 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3935 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3937 return (*self)-(*other);
3939 throw INTERP_KERNEL::Exception(msg);
3944 DataArrayDoubleTuple *aa;
3945 std::vector<double> bb;
3947 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3952 if(!self->getArray())
3953 throw INTERP_KERNEL::Exception(msg2);
3954 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3955 ret->applyLin(1.,-val);
3956 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3957 ret2->setArray(ret);
3962 if(!self->getArray())
3963 throw INTERP_KERNEL::Exception(msg2);
3964 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3965 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3966 ret2->setArray(ret);
3971 if(!self->getArray())
3972 throw INTERP_KERNEL::Exception(msg2);
3973 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3974 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3975 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3976 ret2->setArray(ret);
3981 if(!self->getArray())
3982 throw INTERP_KERNEL::Exception(msg2);
3983 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3984 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3985 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3986 ret2->setArray(ret);
3990 { throw INTERP_KERNEL::Exception(msg); }
3994 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3996 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3999 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4001 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4004 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4006 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4009 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4011 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.";
4012 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4015 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4017 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4019 return (*self)/(*other);
4021 throw INTERP_KERNEL::Exception(msg);
4026 DataArrayDoubleTuple *aa;
4027 std::vector<double> bb;
4029 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4035 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4036 if(!self->getArray())
4037 throw INTERP_KERNEL::Exception(msg2);
4038 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4039 ret->applyLin(1./val,0);
4040 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4041 ret2->setArray(ret);
4046 if(!self->getArray())
4047 throw INTERP_KERNEL::Exception(msg2);
4048 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4049 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4050 ret2->setArray(ret);
4055 if(!self->getArray())
4056 throw INTERP_KERNEL::Exception(msg2);
4057 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4058 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4059 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4060 ret2->setArray(ret);
4065 if(!self->getArray())
4066 throw INTERP_KERNEL::Exception(msg2);
4067 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4068 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4069 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4070 ret2->setArray(ret);
4074 { throw INTERP_KERNEL::Exception(msg); }
4078 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4080 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4083 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4085 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.";
4086 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4089 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4091 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4093 return (*self)^(*other);
4095 throw INTERP_KERNEL::Exception(msg);
4100 DataArrayDoubleTuple *aa;
4101 std::vector<double> bb;
4103 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4108 if(!self->getArray())
4109 throw INTERP_KERNEL::Exception(msg2);
4110 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4112 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4113 ret2->setArray(ret);
4118 if(!self->getArray())
4119 throw INTERP_KERNEL::Exception(msg2);
4120 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4121 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4122 ret2->setArray(ret);
4127 if(!self->getArray())
4128 throw INTERP_KERNEL::Exception(msg2);
4129 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4130 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4131 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4132 ret2->setArray(ret);
4137 if(!self->getArray())
4138 throw INTERP_KERNEL::Exception(msg2);
4139 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4140 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4141 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4142 ret2->setArray(ret);
4146 { throw INTERP_KERNEL::Exception(msg); }
4150 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4152 return self->negate();
4155 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4157 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.";
4158 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4161 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4163 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4167 Py_XINCREF(trueSelf);
4171 throw INTERP_KERNEL::Exception(msg);
4176 DataArrayDoubleTuple *aa;
4177 std::vector<double> bb;
4179 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4184 if(!self->getArray())
4185 throw INTERP_KERNEL::Exception(msg2);
4186 self->getArray()->applyLin(1.,val);
4187 Py_XINCREF(trueSelf);
4192 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4195 Py_XINCREF(trueSelf);
4200 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4201 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4202 ret2->setArray(aaa);
4204 Py_XINCREF(trueSelf);
4209 if(!self->getArray())
4210 throw INTERP_KERNEL::Exception(msg2);
4211 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4212 self->getArray()->addEqual(aaa);
4213 Py_XINCREF(trueSelf);
4217 { throw INTERP_KERNEL::Exception(msg); }
4221 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4223 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.";
4224 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4227 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4229 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4233 Py_XINCREF(trueSelf);
4237 throw INTERP_KERNEL::Exception(msg);
4242 DataArrayDoubleTuple *aa;
4243 std::vector<double> bb;
4245 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4250 if(!self->getArray())
4251 throw INTERP_KERNEL::Exception(msg2);
4252 self->getArray()->applyLin(1.,-val);
4253 Py_XINCREF(trueSelf);
4258 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4261 Py_XINCREF(trueSelf);
4266 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4267 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4268 ret2->setArray(aaa);
4270 Py_XINCREF(trueSelf);
4275 if(!self->getArray())
4276 throw INTERP_KERNEL::Exception(msg2);
4277 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4278 self->getArray()->substractEqual(aaa);
4279 Py_XINCREF(trueSelf);
4283 { throw INTERP_KERNEL::Exception(msg); }
4287 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4289 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.";
4290 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4293 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4295 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4299 Py_XINCREF(trueSelf);
4303 throw INTERP_KERNEL::Exception(msg);
4308 DataArrayDoubleTuple *aa;
4309 std::vector<double> bb;
4311 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4316 if(!self->getArray())
4317 throw INTERP_KERNEL::Exception(msg2);
4318 self->getArray()->applyLin(val,0);
4319 Py_XINCREF(trueSelf);
4324 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4327 Py_XINCREF(trueSelf);
4332 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4333 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4334 ret2->setArray(aaa);
4336 Py_XINCREF(trueSelf);
4341 if(!self->getArray())
4342 throw INTERP_KERNEL::Exception(msg2);
4343 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4344 self->getArray()->multiplyEqual(aaa);
4345 Py_XINCREF(trueSelf);
4349 { throw INTERP_KERNEL::Exception(msg); }
4353 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4355 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.";
4356 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4359 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4361 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4365 Py_XINCREF(trueSelf);
4369 throw INTERP_KERNEL::Exception(msg);
4374 DataArrayDoubleTuple *aa;
4375 std::vector<double> bb;
4377 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4383 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4384 if(!self->getArray())
4385 throw INTERP_KERNEL::Exception(msg2);
4386 self->getArray()->applyLin(1./val,0);
4387 Py_XINCREF(trueSelf);
4392 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4395 Py_XINCREF(trueSelf);
4400 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4401 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4402 ret2->setArray(aaa);
4404 Py_XINCREF(trueSelf);
4409 if(!self->getArray())
4410 throw INTERP_KERNEL::Exception(msg2);
4411 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4412 self->getArray()->divideEqual(aaa);
4413 Py_XINCREF(trueSelf);
4417 { throw INTERP_KERNEL::Exception(msg); }
4421 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4423 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.";
4424 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4427 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4429 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4433 Py_XINCREF(trueSelf);
4437 throw INTERP_KERNEL::Exception(msg);
4442 DataArrayDoubleTuple *aa;
4443 std::vector<double> bb;
4445 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4450 if(!self->getArray())
4451 throw INTERP_KERNEL::Exception(msg2);
4452 self->getArray()->applyPow(val);
4453 Py_XINCREF(trueSelf);
4458 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4461 Py_XINCREF(trueSelf);
4466 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4467 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4468 ret2->setArray(aaa);
4470 Py_XINCREF(trueSelf);
4475 if(!self->getArray())
4476 throw INTERP_KERNEL::Exception(msg2);
4477 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4478 self->getArray()->powEqual(aaa);
4479 Py_XINCREF(trueSelf);
4483 { throw INTERP_KERNEL::Exception(msg); }
4487 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4489 std::vector<const MEDCouplingFieldDouble *> tmp;
4490 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4491 return MEDCouplingFieldDouble::MergeFields(tmp);
4494 static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4496 std::vector<const MEDCouplingFieldDouble *> tmp;
4497 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4498 MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4503 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4506 int getNumberOfFields() const;
4507 MEDCouplingMultiFields *deepCpy() const;
4508 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4509 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4510 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4511 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4512 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4515 std::string __str__() const throw(INTERP_KERNEL::Exception)
4517 return self->simpleRepr();
4519 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4521 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4522 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4524 std::vector<MEDCouplingFieldDouble *> fs(sz);
4525 for(int i=0;i<sz;i++)
4526 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4527 return MEDCouplingMultiFields::New(fs);
4529 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4531 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4532 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4534 std::vector<MEDCouplingFieldDouble *> fs(sz);
4535 for(int i=0;i<sz;i++)
4536 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4537 return MEDCouplingMultiFields::New(fs);
4539 PyObject *getFields() const
4541 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4542 int sz=fields.size();
4543 PyObject *res = PyList_New(sz);
4544 for(int i=0;i<sz;i++)
4548 fields[i]->incrRef();
4549 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4553 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4558 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4560 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4564 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4567 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4569 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4571 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4573 PyObject *res = PyList_New(sz);
4574 for(int i=0;i<sz;i++)
4579 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4583 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4588 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4590 std::vector<int> refs;
4591 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4593 PyObject *res = PyList_New(sz);
4594 for(int i=0;i<sz;i++)
4599 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4603 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4607 PyObject *ret=PyTuple_New(2);
4608 PyTuple_SetItem(ret,0,res);
4609 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4612 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4614 std::vector<DataArrayDouble *> ms=self->getArrays();
4616 PyObject *res = PyList_New(sz);
4617 for(int i=0;i<sz;i++)
4622 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4626 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4631 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4633 std::vector< std::vector<int> > refs;
4634 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4636 PyObject *res = PyList_New(sz);
4637 PyObject *res2 = PyList_New(sz);
4638 for(int i=0;i<sz;i++)
4643 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4647 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4649 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4652 PyObject *ret=PyTuple_New(2);
4653 PyTuple_SetItem(ret,0,res);
4654 PyTuple_SetItem(ret,1,res2);
4660 class MEDCouplingDefinitionTime
4663 MEDCouplingDefinitionTime();
4664 void assign(const MEDCouplingDefinitionTime& other);
4665 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4666 double getTimeResolution() const;
4667 std::vector<double> getHotSpotsTime() const;
4670 std::string __str__() const throw(INTERP_KERNEL::Exception)
4672 std::ostringstream oss;
4673 self->appendRepr(oss);
4677 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4679 int meshId,arrId,arrIdInField,fieldId;
4680 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4681 PyObject *res=PyList_New(4);
4682 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4683 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4684 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4685 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4689 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4691 int meshId,arrId,arrIdInField,fieldId;
4692 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4693 PyObject *res=PyList_New(4);
4694 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4695 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4696 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4697 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4703 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4706 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4707 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4711 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4713 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4714 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4716 std::vector<MEDCouplingFieldDouble *> fs(sz);
4717 for(int i=0;i<sz;i++)
4718 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4719 return MEDCouplingFieldOverTime::New(fs);
4721 std::string __str__() const throw(INTERP_KERNEL::Exception)
4723 return self->simpleRepr();
4725 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4727 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4728 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4730 std::vector<MEDCouplingFieldDouble *> fs(sz);
4731 for(int i=0;i<sz;i++)
4732 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4733 return MEDCouplingFieldOverTime::New(fs);
4738 class MEDCouplingCartesianAMRMesh;
4740 class MEDCouplingCartesianAMRPatch : public RefCountObject
4743 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4744 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4745 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4746 int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4747 bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
4748 bool isGodFatherPatch() const throw(INTERP_KERNEL::Exception);
4751 PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4753 const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4754 return convertFromVectorPairInt(ret);
4757 MEDCouplingCartesianAMRMesh *getMesh() const throw(INTERP_KERNEL::Exception)
4759 MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getMesh()));
4765 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4767 std::vector< std::pair<int,int> > inp;
4768 convertPyToVectorPairInt(bottomLeftTopRight,inp);
4769 self->addPatch(inp,factors);
4772 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4774 const MEDCouplingCartesianAMRMesh *mesh(self->getMesh());
4776 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__getitem__ : no underlying mesh !");
4777 if(patchId==mesh->getNumberOfPatches())
4779 std::ostringstream oss;
4780 oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4781 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4784 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
4790 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4792 MEDCouplingCartesianAMRMesh *mesh(const_cast<MEDCouplingCartesianAMRMesh *>(self->getMesh()));
4794 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
4795 mesh->removePatch(patchId);
4798 int __len__() const throw(INTERP_KERNEL::Exception)
4800 const MEDCouplingCartesianAMRMesh *mesh(self->getMesh());
4802 throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
4803 return mesh->getNumberOfPatches();
4808 class MEDCouplingCartesianAMRMesh : public RefCountObject, public TimeLabel
4811 int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
4812 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4813 const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
4814 void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
4815 int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4816 int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4817 int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4818 int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4819 bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
4821 int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
4822 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
4823 MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
4824 MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
4825 void removeAllPatches() throw(INTERP_KERNEL::Exception);
4826 void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
4827 void detachFromFather() throw(INTERP_KERNEL::Exception);
4828 void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
4829 DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
4830 void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch) const throw(INTERP_KERNEL::Exception);
4831 void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
4832 void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
4833 void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev) const throw(INTERP_KERNEL::Exception);
4834 DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
4837 static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
4839 static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
4840 static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
4841 const int *nodeStrctPtr(0);
4842 const double *originPtr(0),*dxyzPtr(0);
4844 std::vector<int> bb0;
4845 nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
4848 std::vector<double> bb,bb2;
4850 originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
4851 dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
4853 return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
4856 MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
4858 return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
4861 void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4863 std::vector< std::pair<int,int> > inp;
4864 convertPyToVectorPairInt(bottomLeftTopRight,inp);
4865 self->addPatch(inp,factors);
4868 MEDCouplingCartesianAMRMesh *getFather() const throw(INTERP_KERNEL::Exception)
4870 MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getFather()));
4876 MEDCouplingCartesianAMRMesh *getGodFather() const throw(INTERP_KERNEL::Exception)
4878 MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getGodFather()));
4884 MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
4886 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
4892 MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
4894 const MEDCouplingIMesh *ret(self->getImageMesh());
4897 return const_cast<MEDCouplingIMesh *>(ret);
4900 MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4902 if(patchId==self->getNumberOfPatches())
4904 std::ostringstream oss;
4905 oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
4906 PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4909 MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
4915 void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches) const throw(INTERP_KERNEL::Exception)
4917 std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
4918 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
4919 self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2);
4922 void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4924 self->removePatch(patchId);
4927 int __len__() const throw(INTERP_KERNEL::Exception)
4929 return self->getNumberOfPatches();
4934 class DenseMatrix : public RefCountObject, public TimeLabel
4937 static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
4938 static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
4939 DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
4940 DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
4942 int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
4943 int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
4944 int getNbOfElems() const throw(INTERP_KERNEL::Exception);
4945 void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
4946 void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
4947 void transpose() throw(INTERP_KERNEL::Exception);
4949 bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
4950 DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
4951 static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
4954 DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
4956 return DenseMatrix::New(nbRows,nbCols);
4959 DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
4961 return DenseMatrix::New(array,nbRows,nbCols);
4964 PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
4967 bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
4968 PyObject *ret=PyTuple_New(2);
4969 PyObject *ret0Py=ret0?Py_True:Py_False;
4971 PyTuple_SetItem(ret,0,ret0Py);
4972 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4976 DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
4978 DataArrayDouble *ret(self->getData());
4984 DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
4986 return ParaMEDMEM::DenseMatrix::Add(self,other);
4989 DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
4991 return ParaMEDMEM::DenseMatrix::Substract(self,other);
4994 DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
4996 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
4999 DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5001 return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5004 PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5006 self->addEqual(other);
5007 Py_XINCREF(trueSelf);
5011 PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5013 self->substractEqual(other);
5014 Py_XINCREF(trueSelf);
5018 PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5020 PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5030 __filename=os.environ.get('PYTHONSTARTUP')
5031 if __filename and os.path.isfile(__filename):
5032 execfile(__filename)