1 // Copyright (C) 2007-2013 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.
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
22 #define MEDCOUPLING_EXPORT
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.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 "MEDCouplingTypemaps.i"
45 #include "InterpKernelAutoPtr.hxx"
47 using namespace ParaMEDMEM;
48 using namespace INTERP_KERNEL;
52 %template(ivec) std::vector<int>;
53 %template(dvec) std::vector<double>;
54 %template(svec) std::vector<std::string>;
57 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
59 $result=convertMesh($1,$owner);
62 %typemap(out) MEDCouplingMesh*
64 $result=convertMesh($1,$owner);
69 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingPointSet*
76 $result=convertMesh($1,$owner);
82 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
84 $result=convertMesh($1,$owner);
87 %typemap(out) MEDCoupling1GTUMesh*
89 $result=convertMesh($1,$owner);
94 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
96 $result=convertMesh($1,$owner);
99 %typemap(out) MEDCouplingStructuredMesh*
101 $result=convertMesh($1,$owner);
106 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
108 $result=convertFieldDiscretization($1,$owner);
111 %typemap(out) MEDCouplingFieldDiscretization*
113 $result=convertFieldDiscretization($1,$owner);
118 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
120 $result=convertMultiFields($1,$owner);
123 %typemap(out) MEDCouplingMultiFields*
125 $result=convertMultiFields($1,$owner);
130 %typemap(out) ParaMEDMEM::DataArray*
132 $result=convertDataArray($1,$owner);
135 %typemap(out) DataArray*
137 $result=convertDataArray($1,$owner);
142 %typemap(out) ParaMEDMEM::DataArrayChar*
144 $result=convertDataArrayChar($1,$owner);
147 %typemap(out) DataArrayChar*
149 $result=convertDataArrayChar($1,$owner);
154 %init %{ import_array(); %}
157 %feature("autodoc", "1");
158 %feature("docstring");
160 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
161 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
162 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
163 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
164 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
165 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
166 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
167 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
168 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
169 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
170 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
171 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
172 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
173 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
174 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
223 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
224 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
225 %newobject ParaMEDMEM::DataArrayInt::New;
226 %newobject ParaMEDMEM::DataArrayInt::__iter__;
227 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
228 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
229 %newobject ParaMEDMEM::DataArrayInt::performCpy;
230 %newobject ParaMEDMEM::DataArrayInt::substr;
231 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
232 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
233 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
234 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
235 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
236 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
237 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
238 %newobject ParaMEDMEM::DataArrayInt::renumber;
239 %newobject ParaMEDMEM::DataArrayInt::renumberR;
240 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
241 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
244 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::negate;
249 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
250 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
251 %newobject ParaMEDMEM::DataArrayInt::Meld;
252 %newobject ParaMEDMEM::DataArrayInt::Add;
253 %newobject ParaMEDMEM::DataArrayInt::Substract;
254 %newobject ParaMEDMEM::DataArrayInt::Multiply;
255 %newobject ParaMEDMEM::DataArrayInt::Divide;
256 %newobject ParaMEDMEM::DataArrayInt::Pow;
257 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
258 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
259 %newobject ParaMEDMEM::DataArrayInt::Range;
260 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
261 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
262 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
263 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
264 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
265 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
266 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
267 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
268 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
269 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
270 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
271 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
272 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
273 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
274 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
275 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
276 %newobject ParaMEDMEM::DataArrayInt::__neg__;
277 %newobject ParaMEDMEM::DataArrayInt::__add__;
278 %newobject ParaMEDMEM::DataArrayInt::__radd__;
279 %newobject ParaMEDMEM::DataArrayInt::__sub__;
280 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
281 %newobject ParaMEDMEM::DataArrayInt::__mul__;
282 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
283 %newobject ParaMEDMEM::DataArrayInt::__div__;
284 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
285 %newobject ParaMEDMEM::DataArrayInt::__mod__;
286 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
287 %newobject ParaMEDMEM::DataArrayInt::__pow__;
288 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
289 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
290 %newobject ParaMEDMEM::DataArrayChar::deepCpy;
291 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
292 %newobject ParaMEDMEM::DataArrayChar::renumber;
293 %newobject ParaMEDMEM::DataArrayChar::renumberR;
294 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
295 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
296 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
297 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
298 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
299 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
300 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
301 %newobject ParaMEDMEM::DataArrayChar::Meld;
302 %newobject ParaMEDMEM::DataArrayByte::New;
303 %newobject ParaMEDMEM::DataArrayByte::__iter__;
304 %newobject ParaMEDMEM::DataArrayByte::performCpy;
305 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
306 %newobject ParaMEDMEM::DataArrayChar::substr;
307 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
309 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
310 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
311 %newobject ParaMEDMEM::DataArrayDouble::New;
312 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
313 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
314 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
315 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
317 %newobject ParaMEDMEM::DataArrayDouble::Meld;
318 %newobject ParaMEDMEM::DataArrayDouble::Dot;
319 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
320 %newobject ParaMEDMEM::DataArrayDouble::Add;
321 %newobject ParaMEDMEM::DataArrayDouble::Substract;
322 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
323 %newobject ParaMEDMEM::DataArrayDouble::Divide;
324 %newobject ParaMEDMEM::DataArrayDouble::Pow;
325 %newobject ParaMEDMEM::DataArrayDouble::substr;
326 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
327 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
328 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
329 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
330 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
331 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
332 %newobject ParaMEDMEM::DataArrayDouble::negate;
333 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
334 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
335 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
336 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
337 %newobject ParaMEDMEM::DataArrayDouble::determinant;
338 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
339 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
340 %newobject ParaMEDMEM::DataArrayDouble::inverse;
341 %newobject ParaMEDMEM::DataArrayDouble::trace;
342 %newobject ParaMEDMEM::DataArrayDouble::deviator;
343 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
344 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
345 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
346 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
347 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
348 %newobject ParaMEDMEM::DataArrayDouble::renumber;
349 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
350 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
351 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
352 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
353 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
354 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
355 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
356 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
357 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
358 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
359 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
360 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
361 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
362 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
363 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
364 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
365 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
366 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
367 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
368 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
369 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
370 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
371 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
372 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
373 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
374 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
375 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
376 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
377 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
378 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
379 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
380 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
381 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
382 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
383 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
384 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
385 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
386 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
398 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
399 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
441 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
442 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
443 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
444 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
445 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
446 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::getNodalConnectivity;
447 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
448 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
450 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
451 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivity;
452 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
453 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
456 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
457 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
458 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
459 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
460 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
461 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
462 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
463 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
464 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
465 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
466 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
468 %feature("unref") DataArray "$this->decrRef();"
469 %feature("unref") DataArrayDouble "$this->decrRef();"
470 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
471 %feature("unref") MEDCouplingMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
473 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
474 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
475 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
476 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
477 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
478 %feature("unref") DataArrayInt "$this->decrRef();"
479 %feature("unref") DataArrayChar "$this->decrRef();"
480 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
481 %feature("unref") DataArrayByte "$this->decrRef();"
482 %feature("unref") MEDCouplingField "$this->decrRef();"
483 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
484 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
485 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
486 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
487 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
488 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
489 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
490 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
491 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
493 %rename(assign) *::operator=;
494 %ignore ParaMEDMEM::RefCountObject::decrRef;
495 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
496 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
497 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
498 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
502 %rename (InterpKernelException) INTERP_KERNEL::Exception;
504 namespace INTERP_KERNEL
509 Exception(const char* what);
510 ~Exception() throw ();
511 const char *what() const throw ();
514 std::string __str__() const
516 return std::string(self->what());
527 void declareAsNew() const;
528 virtual void updateTime() const;
529 unsigned int getTimeOfThis() const;
557 CONST_ON_TIME_INTERVAL = 7
558 } TypeOfTimeDiscretization;
560 const char *MEDCouplingVersionStr();
561 int MEDCouplingVersion();
562 int MEDCouplingSizeOfVoidStar();
568 RefCountObject(const RefCountObject& other);
571 bool decrRef() const;
572 void incrRef() const;
573 int getRCValue() const;
574 virtual std::size_t getHeapMemorySize() const;
580 PyObject *MEDCouplingVersionMajMinRel()
582 int tmp0=0,tmp1=0,tmp2=0;
583 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
584 PyObject *res = PyList_New(3);
585 PyList_SetItem(res,0,SWIG_From_int(tmp0));
586 PyList_SetItem(res,1,SWIG_From_int(tmp1));
587 PyList_SetItem(res,2,SWIG_From_int(tmp2));
591 bool MEDCouplingHasNumPyBindings()
600 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
602 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
603 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
604 if(PyRun_SimpleString(script)!=0)
605 throw INTERP_KERNEL::Exception(oss.str().c_str());
606 return std::string(script);
610 %include "MEDCouplingMemArray.i"
617 UNSTRUCTURED_DESC = 6,
621 } MEDCouplingMeshType;
624 class DataArrayDouble;
625 class MEDCouplingUMesh;
626 class MEDCouplingFieldDouble;
628 %extend RefCountObject
630 std::string getHiddenCppPointer() const
632 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
637 %extend MEDCouplingGaussLocalization
639 std::string __str__() const throw(INTERP_KERNEL::Exception)
641 return self->getStringRepr();
644 std::string __repr__() const throw(INTERP_KERNEL::Exception)
646 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
647 oss << self->getStringRepr();
654 class MEDCouplingMesh : public RefCountObject, public TimeLabel
657 void setName(const char *name);
658 const char *getName() const;
659 void setDescription(const char *descr);
660 const char *getDescription() const;
661 void setTime(double val, int iteration, int order);
662 void setTimeUnit(const char *unit);
663 const char *getTimeUnit() const;
664 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
665 bool isStructured() const throw(INTERP_KERNEL::Exception);
666 virtual MEDCouplingMesh *deepCpy() const;
667 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
668 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
669 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
670 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
671 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
672 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
673 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
674 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
675 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
676 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
677 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
678 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
679 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
680 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
681 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
682 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
683 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
684 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
685 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
686 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
687 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
688 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
689 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
690 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
692 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
693 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
694 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
695 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
696 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
697 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
698 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
699 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
700 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
701 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
702 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
703 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
704 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
705 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
706 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
707 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
708 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
711 std::string __str__() const throw(INTERP_KERNEL::Exception)
713 return self->simpleRepr();
716 PyObject *getTime() throw(INTERP_KERNEL::Exception)
719 double tmp0=self->getTime(tmp1,tmp2);
720 PyObject *res = PyList_New(3);
721 PyList_SetItem(res,0,SWIG_From_double(tmp0));
722 PyList_SetItem(res,1,SWIG_From_int(tmp1));
723 PyList_SetItem(res,2,SWIG_From_int(tmp2));
727 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
731 DataArrayDoubleTuple *aa;
732 std::vector<double> bb;
734 int spaceDim=self->getSpaceDimension();
735 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
736 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
737 return self->getCellContainingPoint(pos,eps);
740 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
744 DataArrayDoubleTuple *aa;
745 std::vector<double> bb;
747 int spaceDim=self->getSpaceDimension();
748 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
749 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
750 std::vector<int> elts,eltsIndex;
751 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
752 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
753 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
754 d0->alloc(elts.size(),1);
755 d1->alloc(eltsIndex.size(),1);
756 std::copy(elts.begin(),elts.end(),d0->getPointer());
757 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
758 PyObject *ret=PyTuple_New(2);
759 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
760 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
764 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
766 std::vector<int> elts,eltsIndex;
767 int spaceDim=self->getSpaceDimension();
769 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
770 if (!SWIG_IsOK(res1))
773 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
774 int nbOfPoints=size/spaceDim;
777 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
779 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
783 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
785 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
786 da2->checkAllocated();
787 int size=da2->getNumberOfTuples();
788 int nbOfCompo=da2->getNumberOfComponents();
789 if(nbOfCompo!=spaceDim)
791 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
793 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
795 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
796 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
797 d0->alloc(elts.size(),1);
798 d1->alloc(eltsIndex.size(),1);
799 std::copy(elts.begin(),elts.end(),d0->getPointer());
800 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
801 PyObject *ret=PyTuple_New(2);
802 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
803 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
807 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
811 DataArrayDoubleTuple *aa;
812 std::vector<double> bb;
814 int spaceDim=self->getSpaceDimension();
815 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
816 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
817 std::vector<int> elts;
818 self->getCellsContainingPoint(pos,eps,elts);
819 DataArrayInt *ret=DataArrayInt::New();
820 ret->alloc((int)elts.size(),1);
821 std::copy(elts.begin(),elts.end(),ret->getPointer());
822 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
825 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
828 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
829 if (!SWIG_IsOK(res1))
832 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
833 self->renumberCells(tmp,check);
837 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
839 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
840 da2->checkAllocated();
841 self->renumberCells(da2->getConstPointer(),check);
845 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
847 DataArrayInt *cellCor, *nodeCor;
848 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
849 PyObject *res = PyList_New(2);
850 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
851 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
855 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
857 DataArrayInt *cellCor=0,*nodeCor=0;
858 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
859 PyObject *res = PyList_New(2);
860 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
861 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
865 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
867 DataArrayInt *cellCor=0;
868 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
872 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
875 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
876 if (!SWIG_IsOK(res1))
879 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
880 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
884 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
886 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
887 da2->checkAllocated();
888 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
891 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
893 std::vector<int> conn;
894 self->getNodeIdsOfCell(cellId,conn);
895 return convertIntArrToPyList2(conn);
898 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
900 std::vector<double> coo;
901 self->getCoordinatesOfNode(nodeId,coo);
902 return convertDblArrToPyList2(coo);
905 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
909 DataArrayDoubleTuple *aa;
910 std::vector<double> bb;
912 int spaceDim=self->getSpaceDimension();
913 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
914 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
915 self->scale(pointPtr,factor);
918 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
920 int spaceDim=self->getSpaceDimension();
921 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
922 self->getBoundingBox(tmp);
923 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
927 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
930 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
931 PyObject *ret=PyTuple_New(2);
932 PyObject *ret0Py=ret0?Py_True:Py_False;
934 PyTuple_SetItem(ret,0,ret0Py);
935 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
939 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
941 int szArr,sw,iTypppArr;
942 std::vector<int> stdvecTyyppArr;
943 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
944 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
945 if(sw==3)//DataArrayInt
947 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
948 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
949 std::string name=argpt->getName();
951 ret->setName(name.c_str());
953 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
956 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
958 int szArr,sw,iTypppArr;
959 std::vector<int> stdvecTyyppArr;
961 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
962 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
963 if(sw==3)//DataArrayInt
965 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
966 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
967 std::string name=argpt->getName();
969 ret->setName(name.c_str());
972 PyObject *res = PyList_New(2);
973 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
974 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
975 PyList_SetItem(res,0,obj0);
976 PyList_SetItem(res,1,obj1);
980 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
984 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
985 PyObject *res = PyTuple_New(2);
986 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
989 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
991 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
992 PyTuple_SetItem(res,0,obj0);
993 PyTuple_SetItem(res,1,obj1);
997 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
999 std::vector<int> vals=self->getDistributionOfTypes();
1000 if(vals.size()%3!=0)
1001 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1002 PyObject *ret=PyList_New((int)vals.size()/3);
1003 for(int j=0;j<(int)vals.size()/3;j++)
1005 PyObject *ret1=PyList_New(3);
1006 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1007 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1008 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1009 PyList_SetItem(ret,j,ret1);
1014 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1016 std::vector<int> code;
1017 std::vector<const DataArrayInt *> idsPerType;
1018 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1019 convertPyToNewIntArr4(li,1,3,code);
1020 return self->checkTypeConsistencyAndContig(code,idsPerType);
1023 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1025 std::vector<int> code;
1026 std::vector<DataArrayInt *> idsInPflPerType;
1027 std::vector<DataArrayInt *> idsPerType;
1028 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1029 PyObject *ret=PyTuple_New(3);
1031 if(code.size()%3!=0)
1032 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1033 PyObject *ret0=PyList_New((int)code.size()/3);
1034 for(int j=0;j<(int)code.size()/3;j++)
1036 PyObject *ret00=PyList_New(3);
1037 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1038 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1039 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1040 PyList_SetItem(ret0,j,ret00);
1042 PyTuple_SetItem(ret,0,ret0);
1044 PyObject *ret1=PyList_New(idsInPflPerType.size());
1045 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1046 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1047 PyTuple_SetItem(ret,1,ret1);
1048 int n=idsPerType.size();
1049 PyObject *ret2=PyList_New(n);
1050 for(int i=0;i<n;i++)
1051 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052 PyTuple_SetItem(ret,2,ret2);
1056 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1060 DataArrayDoubleTuple *aa;
1061 std::vector<double> bb;
1063 int spaceDim=self->getSpaceDimension();
1064 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1065 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1066 self->translate(vectorPtr);
1069 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1071 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1074 DataArrayDoubleTuple *aa;
1075 std::vector<double> bb;
1077 int spaceDim=self->getSpaceDimension();
1078 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1079 self->rotate(centerPtr,0,alpha);
1082 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1084 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1086 DataArrayDouble *a,*a2;
1087 DataArrayDoubleTuple *aa,*aa2;
1088 std::vector<double> bb,bb2;
1090 int spaceDim=self->getSpaceDimension();
1091 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1092 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
1093 self->rotate(centerPtr,vectorPtr,alpha);
1096 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1098 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1099 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1100 PyObject *res=PyList_New(result.size());
1101 for(int i=0;iL!=result.end(); i++, iL++)
1102 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1106 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1108 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1109 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1110 return MEDCouplingMesh::MergeMeshes(tmp);
1116 //== MEDCouplingMesh End
1118 %include "NormalizedUnstructuredMesh.hxx"
1119 %include "MEDCouplingNatureOfField.hxx"
1120 %include "MEDCouplingTimeDiscretization.hxx"
1121 %include "MEDCouplingGaussLocalization.hxx"
1122 %include "MEDCouplingFieldDiscretization.hxx"
1124 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1125 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1126 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1128 //== MEDCouplingPointSet
1130 namespace ParaMEDMEM
1132 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1135 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1136 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1137 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1138 void zipCoords() throw(INTERP_KERNEL::Exception);
1139 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1140 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1141 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1142 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1143 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1144 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1145 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1146 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1147 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1148 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1149 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1150 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1151 virtual DataArrayInt *findBoundaryNodes() const;
1152 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1153 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1154 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1155 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1158 std::string __str__() const throw(INTERP_KERNEL::Exception)
1160 return self->simpleRepr();
1163 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1166 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1167 PyObject *res = PyList_New(2);
1168 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1169 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1173 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1175 DataArrayInt *comm, *commIndex;
1176 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1177 PyObject *res = PyList_New(2);
1178 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1179 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1183 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1185 DataArrayDouble *ret1=self->getCoords();
1188 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1191 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1193 int szArr,sw,iTypppArr;
1194 std::vector<int> stdvecTyyppArr;
1195 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1196 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1197 if(sw==3)//DataArrayInt
1199 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1200 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1201 std::string name=argpt->getName();
1203 ret->setName(name.c_str());
1205 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1208 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1210 int szArr,sw,iTypppArr;
1211 std::vector<int> stdvecTyyppArr;
1212 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1213 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1214 if(sw==3)//DataArrayInt
1216 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1217 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1218 std::string name=argpt->getName();
1220 ret->setName(name.c_str());
1222 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1225 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1227 int szArr,sw,iTypppArr;
1228 std::vector<int> stdvecTyyppArr;
1229 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1230 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1231 if(sw==3)//DataArrayInt
1233 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1234 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1235 std::string name=argpt->getName();
1237 ret->setName(name.c_str());
1239 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1242 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1244 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1245 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1248 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1250 int szArr,sw,iTypppArr;
1251 std::vector<int> stdvecTyyppArr;
1252 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1253 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1254 if(sw==3)//DataArrayInt
1256 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1257 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1258 std::string name=argpt->getName();
1260 ret->setName(name.c_str());
1262 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1265 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1267 int szArr,sw,iTypppArr;
1268 std::vector<int> stdvecTyyppArr;
1269 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1270 self->renumberNodes(tmp,newNbOfNodes);
1273 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1275 int szArr,sw,iTypppArr;
1276 std::vector<int> stdvecTyyppArr;
1277 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1278 self->renumberNodes2(tmp,newNbOfNodes);
1281 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1283 int spaceDim=self->getSpaceDimension();
1285 DataArrayDouble *a,*a2;
1286 DataArrayDoubleTuple *aa,*aa2;
1287 std::vector<double> bb,bb2;
1289 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1290 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1291 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1292 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1293 std::vector<int> nodes;
1294 self->findNodesOnLine(p,v,eps,nodes);
1295 DataArrayInt *ret=DataArrayInt::New();
1296 ret->alloc((int)nodes.size(),1);
1297 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1298 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1300 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1302 int spaceDim=self->getSpaceDimension();
1304 DataArrayDouble *a,*a2;
1305 DataArrayDoubleTuple *aa,*aa2;
1306 std::vector<double> bb,bb2;
1308 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1309 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1310 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1311 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1312 std::vector<int> nodes;
1313 self->findNodesOnPlane(p,v,eps,nodes);
1314 DataArrayInt *ret=DataArrayInt::New();
1315 ret->alloc((int)nodes.size(),1);
1316 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1317 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1320 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1324 DataArrayDoubleTuple *aa;
1325 std::vector<double> bb;
1327 int spaceDim=self->getSpaceDimension();
1328 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1329 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1330 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1331 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1334 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1336 DataArrayInt *c=0,*cI=0;
1340 DataArrayDoubleTuple *aa;
1341 std::vector<double> bb;
1343 int spaceDim=self->getSpaceDimension();
1344 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1345 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1346 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1347 PyObject *ret=PyTuple_New(2);
1348 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1349 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1353 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1355 DataArrayInt *c=0,*cI=0;
1356 int spaceDim=self->getSpaceDimension();
1359 DataArrayDoubleTuple *aa;
1360 std::vector<double> bb;
1363 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1364 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1366 PyObject *ret=PyTuple_New(2);
1367 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1368 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1372 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1376 DataArrayDoubleTuple *aa;
1377 std::vector<double> bb;
1379 int spaceDim=self->getSpaceDimension();
1380 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1381 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1383 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1384 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1387 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1391 std::vector<int> multiVal;
1392 std::pair<int, std::pair<int,int> > slic;
1393 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1394 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1398 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1400 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1402 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1404 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1408 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1410 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1411 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1412 self->getReverseNodalConnectivity(d0,d1);
1413 PyObject *ret=PyTuple_New(2);
1414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1419 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1421 DataArrayInt *v0=0,*v1=0;
1422 self->findCommonCells(compType,startCellId,v0,v1);
1423 PyObject *res = PyList_New(2);
1424 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1425 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1430 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1433 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1434 if (!SWIG_IsOK(res1))
1437 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1438 self->renumberNodesInConn(tmp);
1442 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1444 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1445 da2->checkAllocated();
1446 self->renumberNodesInConn(da2->getConstPointer());
1450 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1453 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1454 PyObject *ret=PyTuple_New(2);
1455 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1456 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1460 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1462 DataArrayInt *ret=0;
1464 int szArr,sw,iTypppArr;
1465 std::vector<int> stdvecTyyppArr;
1466 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1467 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1471 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1475 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1476 PyObject *res = PyList_New(3);
1477 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1478 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1479 PyList_SetItem(res,2,SWIG_From_int(ret2));
1483 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1487 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1488 PyObject *res = PyList_New(3);
1489 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1490 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1491 PyList_SetItem(res,2,SWIG_From_int(ret2));
1495 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1498 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1499 if (!SWIG_IsOK(res1))
1502 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1503 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1507 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1509 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1510 da2->checkAllocated();
1511 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1515 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1519 std::vector<int> multiVal;
1520 std::pair<int, std::pair<int,int> > slic;
1521 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1522 int nbc=self->getNumberOfCells();
1523 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1530 std::ostringstream oss;
1531 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1532 throw INTERP_KERNEL::Exception(oss.str().c_str());
1535 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1540 int tmp=nbc+singleVal;
1541 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1545 std::ostringstream oss;
1546 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1547 throw INTERP_KERNEL::Exception(oss.str().c_str());
1553 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1557 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1562 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1563 daIntTyypp->checkAllocated();
1564 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1567 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1571 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1574 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1575 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1576 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1577 for(int i=0;i<sz;i++)
1578 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1581 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1584 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1586 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1587 std::vector<double> val3;
1588 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1589 "Rotate2DAlg",2,true,nbNodes);
1591 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1592 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1595 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1598 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1599 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1600 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1601 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1602 for(int i=0;i<sz;i++)
1603 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1606 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1609 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1611 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1612 std::vector<double> val3;
1613 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1614 "Rotate3DAlg",3,true,nbNodes);
1616 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1617 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1618 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1623 //== MEDCouplingPointSet End
1625 class MEDCouplingUMeshCell
1628 INTERP_KERNEL::NormalizedCellType getType() const;
1631 std::string __str__() const throw(INTERP_KERNEL::Exception)
1633 return self->repr();
1636 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1639 const int *r=self->getAllConn(ret2);
1640 PyObject *ret=PyTuple_New(ret2);
1641 for(int i=0;i<ret2;i++)
1642 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1648 class MEDCouplingUMeshCellIterator
1655 MEDCouplingUMeshCell *ret=self->nextt();
1657 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1660 PyErr_SetString(PyExc_StopIteration,"No more data.");
1667 class MEDCouplingUMeshCellByTypeIterator
1670 ~MEDCouplingUMeshCellByTypeIterator();
1675 MEDCouplingUMeshCellEntry *ret=self->nextt();
1677 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1680 PyErr_SetString(PyExc_StopIteration,"No more data.");
1687 class MEDCouplingUMeshCellByTypeEntry
1690 ~MEDCouplingUMeshCellByTypeEntry();
1693 MEDCouplingUMeshCellByTypeIterator *__iter__()
1695 return self->iterator();
1700 class MEDCouplingUMeshCellEntry
1703 INTERP_KERNEL::NormalizedCellType getType() const;
1704 int getNumberOfElems() const;
1707 MEDCouplingUMeshCellIterator *__iter__()
1709 return self->iterator();
1714 //== MEDCouplingUMesh
1716 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1719 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1720 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1721 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1722 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1723 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1724 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1725 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1726 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1727 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1728 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1729 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1730 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1731 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1732 void computeTypes() throw(INTERP_KERNEL::Exception);
1733 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1734 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1736 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1737 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1738 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1739 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1740 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1741 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1742 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1743 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1744 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1745 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1746 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1747 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1748 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1749 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1750 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1751 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1752 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1753 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1754 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1755 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1756 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1757 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1758 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1759 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1760 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1761 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1762 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1763 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1764 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1765 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1766 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1767 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1768 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1769 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1770 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1771 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1772 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1773 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1774 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1776 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1778 return MEDCouplingUMesh::New();
1781 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1783 return MEDCouplingUMesh::New(meshName,meshDim);
1786 std::string __str__() const throw(INTERP_KERNEL::Exception)
1788 return self->simpleRepr();
1791 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1793 std::ostringstream oss;
1794 self->reprQuickOverview(oss);
1798 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1800 return self->cellIterator();
1803 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1807 std::vector<int> multiVal;
1808 std::pair<int, std::pair<int,int> > slic;
1809 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1810 int nbc=self->getNumberOfCells();
1811 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1818 std::ostringstream oss;
1819 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1820 throw INTERP_KERNEL::Exception(oss.str().c_str());
1824 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1831 int tmp=nbc+singleVal;
1832 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1837 std::ostringstream oss;
1838 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1839 throw INTERP_KERNEL::Exception(oss.str().c_str());
1845 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1851 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1852 daIntTyypp->checkAllocated();
1853 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1857 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1861 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1865 std::vector<int> multiVal;
1866 std::pair<int, std::pair<int,int> > slic;
1867 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1868 int nbc=self->getNumberOfCells();
1869 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1876 std::ostringstream oss;
1877 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1878 throw INTERP_KERNEL::Exception(oss.str().c_str());
1882 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1889 int tmp=nbc+singleVal;
1890 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1895 std::ostringstream oss;
1896 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1897 throw INTERP_KERNEL::Exception(oss.str().c_str());
1903 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1908 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1914 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1915 daIntTyypp->checkAllocated();
1916 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1920 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1924 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1926 int szArr,sw,iTypppArr;
1927 std::vector<int> stdvecTyyppArr;
1928 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1931 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1932 throw INTERP_KERNEL::Exception(oss.str().c_str());
1934 self->insertNextCell(type,size,tmp);
1937 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1939 int szArr,sw,iTypppArr;
1940 std::vector<int> stdvecTyyppArr;
1941 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1942 self->insertNextCell(type,szArr,tmp);
1945 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1947 DataArrayInt *ret=self->getNodalConnectivity();
1952 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1954 DataArrayInt *ret=self->getNodalConnectivityIndex();
1959 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1961 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1962 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1963 PyObject *res = PyList_New(result.size());
1964 for (int i=0;iL!=result.end(); i++, iL++)
1965 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1969 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1971 int szArr,sw,iTypppArr;
1972 std::vector<int> stdvecTyyppArr;
1973 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1974 int nbOfDepthPeelingPerformed=0;
1975 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1976 PyObject *res=PyTuple_New(2);
1977 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1978 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1982 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1984 DataArrayInt *v0=0,*v1=0;
1985 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1986 PyObject *res = PyList_New(2);
1987 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1988 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1992 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1996 DataArrayDoubleTuple *aa;
1997 std::vector<double> bb;
1999 int nbOfCompo=self->getSpaceDimension();
2000 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2003 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2004 PyObject *ret=PyTuple_New(2);
2005 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2006 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2010 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2012 DataArrayInt *ret1=0;
2013 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2014 PyObject *ret=PyTuple_New(2);
2015 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2016 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2020 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2022 std::vector<int> cells;
2023 self->checkButterflyCells(cells,eps);
2024 DataArrayInt *ret=DataArrayInt::New();
2025 ret->alloc((int)cells.size(),1);
2026 std::copy(cells.begin(),cells.end(),ret->getPointer());
2027 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2030 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2032 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2034 PyObject *ret = PyList_New(sz);
2035 for(int i=0;i<sz;i++)
2036 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2040 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2042 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2043 int sz=retCpp.size();
2044 PyObject *ret=PyList_New(sz);
2045 for(int i=0;i<sz;i++)
2046 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2050 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2053 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2054 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2055 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2058 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2061 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2062 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2066 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2069 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2070 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2074 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2076 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2077 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2078 PyObject *ret=PyTuple_New(3);
2079 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2080 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2081 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2087 DataArrayInt *tmp0=0,*tmp1=0;
2088 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2089 PyObject *ret=PyTuple_New(2);
2090 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2091 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2095 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2099 std::vector<int> multiVal;
2100 std::pair<int, std::pair<int,int> > slic;
2101 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2102 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2106 return self->duplicateNodes(&singleVal,&singleVal+1);
2108 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2110 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2112 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2116 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2120 std::vector<int> multiVal;
2121 std::pair<int, std::pair<int,int> > slic;
2122 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2123 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2127 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2129 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2131 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2133 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2137 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2140 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2141 DataArrayInt *tmp0,*tmp1=0;
2142 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2143 PyObject *ret=PyTuple_New(2);
2144 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2145 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2149 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2151 DataArrayInt *ret0=0,*ret1=0;
2152 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2153 PyObject *ret=PyTuple_New(2);
2154 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2155 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2161 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2162 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2163 DataArrayInt *ret1=0,*ret2=0;
2164 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2165 PyObject *ret=PyTuple_New(3);
2166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2167 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2174 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2175 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2176 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2177 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2180 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2183 std::vector<const MEDCouplingUMesh *> meshes;
2184 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2185 std::vector<DataArrayInt *> corr;
2186 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2188 PyObject *ret1=PyList_New(sz);
2189 for(int i=0;i<sz;i++)
2190 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2191 PyObject *ret=PyList_New(2);
2192 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2193 PyList_SetItem(ret,1,ret1);
2197 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2199 std::vector<MEDCouplingUMesh *> meshes;
2200 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2201 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2204 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2206 std::vector<MEDCouplingUMesh *> meshes;
2207 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2208 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2211 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2215 std::vector<int> multiVal;
2216 std::pair<int, std::pair<int,int> > slic;
2217 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2219 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2220 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2224 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2226 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2228 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2230 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2234 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2236 DataArrayInt *arrOut=0,*arrIndexOut=0;
2239 std::vector<int> multiVal;
2240 std::pair<int, std::pair<int,int> > slic;
2241 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2243 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2244 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2249 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2254 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2259 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2263 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2265 PyObject *ret=PyTuple_New(2);
2266 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2267 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2271 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2273 DataArrayInt *arrOut=0,*arrIndexOut=0;
2274 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2275 PyObject *ret=PyTuple_New(2);
2276 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2277 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2283 if(!PySlice_Check(slic))
2284 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2285 Py_ssize_t strt=2,stp=2,step=2;
2286 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2288 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2289 arrIndxIn->checkAllocated();
2290 if(arrIndxIn->getNumberOfComponents()!=1)
2291 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2292 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2293 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2294 DataArrayInt *arrOut=0,*arrIndexOut=0;
2295 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2296 PyObject *ret=PyTuple_New(2);
2297 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2298 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2302 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2303 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2304 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2306 DataArrayInt *arrOut=0,*arrIndexOut=0;
2309 std::vector<int> multiVal;
2310 std::pair<int, std::pair<int,int> > slic;
2311 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2313 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2314 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2319 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2324 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2329 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2333 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2335 PyObject *ret=PyTuple_New(2);
2336 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2341 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2342 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2346 std::vector<int> multiVal;
2347 std::pair<int, std::pair<int,int> > slic;
2348 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2350 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2351 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2356 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2361 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2366 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2370 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2374 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2378 DataArrayDoubleTuple *aa;
2379 std::vector<double> bb;
2381 int spaceDim=self->getSpaceDimension();
2382 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2383 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2385 std::vector<int> cells;
2386 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2387 DataArrayInt *ret=DataArrayInt::New();
2388 ret->alloc((int)cells.size(),1);
2389 std::copy(cells.begin(),cells.end(),ret->getPointer());
2390 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2393 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2397 DataArrayDoubleTuple *aa;
2398 std::vector<double> bb;
2400 int spaceDim=self->getSpaceDimension();
2401 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2402 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2403 self->orientCorrectly2DCells(v,polyOnly);
2406 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2408 std::vector<int> cells;
2409 self->arePolyhedronsNotCorrectlyOriented(cells);
2410 DataArrayInt *ret=DataArrayInt::New();
2411 ret->alloc((int)cells.size(),1);
2412 std::copy(cells.begin(),cells.end(),ret->getPointer());
2413 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2416 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2420 self->getFastAveragePlaneOfThis(vec,pos);
2422 std::copy(vec,vec+3,vals);
2423 std::copy(pos,pos+3,vals+3);
2424 return convertDblArrToPyListOfTuple(vals,3,2);
2427 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2429 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2430 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2431 return MEDCouplingUMesh::MergeUMeshes(tmp);
2434 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2437 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2438 PyObject *ret=PyTuple_New(2);
2439 PyObject *ret0Py=ret0?Py_True:Py_False;
2441 PyTuple_SetItem(ret,0,ret0Py);
2442 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2446 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2449 bool ret0=self->areCellsIncludedIn2(other,ret1);
2450 PyObject *ret=PyTuple_New(2);
2451 PyObject *ret0Py=ret0?Py_True:Py_False;
2453 PyTuple_SetItem(ret,0,ret0Py);
2454 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2458 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2460 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2461 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2462 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2463 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2464 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2465 PyObject *ret=PyTuple_New(5);
2466 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2467 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2468 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2470 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2474 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2476 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2477 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2478 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2479 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2480 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2481 PyObject *ret=PyTuple_New(5);
2482 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2483 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2484 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2485 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2490 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2492 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2493 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2494 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2495 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2496 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2497 PyObject *ret=PyTuple_New(5);
2498 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2499 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2500 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2501 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2502 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2508 DataArrayInt *neighbors=0,*neighborsIdx=0;
2509 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2510 PyObject *ret=PyTuple_New(2);
2511 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2512 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2516 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2518 DataArrayInt *neighbors=0,*neighborsIdx=0;
2519 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2520 PyObject *ret=PyTuple_New(2);
2521 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2522 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2526 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2528 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2529 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2530 DataArrayInt *d2,*d3,*d4,*dd5;
2531 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2532 PyObject *ret=PyTuple_New(7);
2533 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2534 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2536 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2543 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2546 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2547 da->checkAllocated();
2548 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2551 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2554 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2555 da->checkAllocated();
2556 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2559 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2562 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2563 da->checkAllocated();
2564 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2567 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2570 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2571 da->checkAllocated();
2572 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2573 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2574 PyObject *res = PyList_New(result.size());
2575 for (int i=0;iL!=result.end(); i++, iL++)
2576 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2580 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2583 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2584 da->checkAllocated();
2585 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2586 ret->setName(da->getName().c_str());
2590 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2592 DataArrayInt *cellNb1=0,*cellNb2=0;
2593 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2594 PyObject *ret=PyTuple_New(3);
2595 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2596 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2603 int spaceDim=self->getSpaceDimension();
2605 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2607 DataArrayDouble *a,*a2;
2608 DataArrayDoubleTuple *aa,*aa2;
2609 std::vector<double> bb,bb2;
2611 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2612 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2613 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2614 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2616 DataArrayInt *cellIds=0;
2617 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2618 PyObject *ret=PyTuple_New(2);
2619 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2626 int spaceDim=self->getSpaceDimension();
2628 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2630 DataArrayDouble *a,*a2;
2631 DataArrayDoubleTuple *aa,*aa2;
2632 std::vector<double> bb,bb2;
2634 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2635 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2636 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2637 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2639 DataArrayInt *cellIds=0;
2640 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2641 PyObject *ret=PyTuple_New(2);
2642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2647 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2649 int spaceDim=self->getSpaceDimension();
2651 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2653 DataArrayDouble *a,*a2;
2654 DataArrayDoubleTuple *aa,*aa2;
2655 std::vector<double> bb,bb2;
2657 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2658 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2659 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2660 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2661 return self->getCellIdsCrossingPlane(orig,vect,eps);
2664 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2668 std::vector<int> pos2;
2669 DataArrayInt *pos3=0;
2670 DataArrayIntTuple *pos4=0;
2671 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2676 self->convertToPolyTypes(&pos1,&pos1+1);
2683 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2688 self->convertToPolyTypes(pos3->begin(),pos3->end());
2692 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2696 void convertAllToPoly();
2697 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2698 bool unPolyze() throw(INTERP_KERNEL::Exception);
2699 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2700 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2701 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2704 //== MEDCouplingUMesh End
2706 //== MEDCouplingExtrudedMesh
2708 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2711 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2712 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2714 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2716 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2719 std::string __str__() const throw(INTERP_KERNEL::Exception)
2721 return self->simpleRepr();
2724 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2726 std::ostringstream oss;
2727 self->reprQuickOverview(oss);
2731 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2733 MEDCouplingUMesh *ret=self->getMesh2D();
2736 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2738 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2740 MEDCouplingUMesh *ret=self->getMesh1D();
2743 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2745 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2747 DataArrayInt *ret=self->getMesh3DIds();
2750 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2755 //== MEDCouplingExtrudedMesh End
2757 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2760 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2761 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2762 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2765 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2767 int szArr,sw,iTypppArr;
2768 std::vector<int> stdvecTyyppArr;
2769 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2770 self->insertNextCell(tmp,tmp+szArr);
2775 //== MEDCoupling1SGTUMesh
2777 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2780 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2781 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2782 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2783 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2784 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2785 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2788 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2790 return MEDCoupling1SGTUMesh::New(name,type);
2793 std::string __str__() const throw(INTERP_KERNEL::Exception)
2795 return self->simpleRepr();
2798 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2800 std::ostringstream oss;
2801 self->reprQuickOverview(oss);
2805 DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2807 DataArrayInt *ret=self->getNodalConnectivity();
2808 if(ret) ret->incrRef();
2812 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2814 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2815 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2816 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2819 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2821 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2822 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2823 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2828 //== MEDCoupling1SGTUMesh End
2830 //== MEDCoupling1DGTUMesh
2832 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2835 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2836 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2837 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2838 bool isPacked() const throw(INTERP_KERNEL::Exception);
2841 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2843 return MEDCoupling1DGTUMesh::New(name,type);
2846 std::string __str__() const throw(INTERP_KERNEL::Exception)
2848 return self->simpleRepr();
2851 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2853 std::ostringstream oss;
2854 self->reprQuickOverview(oss);
2858 DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2860 DataArrayInt *ret=self->getNodalConnectivity();
2861 if(ret) ret->incrRef();
2865 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2867 DataArrayInt *ret=self->getNodalConnectivityIndex();
2868 if(ret) ret->incrRef();
2872 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2874 DataArrayInt *ret1=0,*ret2=0;
2875 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2876 PyObject *ret0Py=ret0?Py_True:Py_False;
2878 PyObject *ret=PyTuple_New(3);
2879 PyTuple_SetItem(ret,0,ret0Py);
2880 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2881 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2885 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2888 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2889 PyObject *ret=PyTuple_New(2);
2890 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2891 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2892 PyTuple_SetItem(ret,1,ret1Py);
2896 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2898 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2899 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2900 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2903 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2905 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2906 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2907 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2910 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2912 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2913 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2914 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2919 //== MEDCoupling1DGTUMeshEnd
2921 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2924 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2925 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2928 //== MEDCouplingCMesh
2930 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2933 static MEDCouplingCMesh *New();
2934 static MEDCouplingCMesh *New(const char *meshName);
2935 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2936 void setCoords(const DataArrayDouble *coordsX,
2937 const DataArrayDouble *coordsY=0,
2938 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2939 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2943 return MEDCouplingCMesh::New();
2945 MEDCouplingCMesh(const char *meshName)
2947 return MEDCouplingCMesh::New(meshName);
2949 std::string __str__() const throw(INTERP_KERNEL::Exception)
2951 return self->simpleRepr();
2953 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2955 std::ostringstream oss;
2956 self->reprQuickOverview(oss);
2959 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2961 DataArrayDouble *ret=self->getCoordsAt(i);
2969 //== MEDCouplingCMesh End
2971 //== MEDCouplingCurveLinearMesh
2973 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2976 static MEDCouplingCurveLinearMesh *New();
2977 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2978 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2979 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2980 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2982 MEDCouplingCurveLinearMesh()
2984 return MEDCouplingCurveLinearMesh::New();
2986 MEDCouplingCurveLinearMesh(const char *meshName)
2988 return MEDCouplingCurveLinearMesh::New(meshName);
2990 std::string __str__() const throw(INTERP_KERNEL::Exception)
2992 return self->simpleRepr();
2994 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2996 std::ostringstream oss;
2997 self->reprQuickOverview(oss);
3000 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3002 DataArrayDouble *ret=self->getCoords();
3007 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3009 int szArr,sw,iTypppArr;
3010 std::vector<int> stdvecTyyppArr;
3011 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3012 self->setNodeGridStructure(tmp,tmp+szArr);
3017 //== MEDCouplingCurveLinearMesh End
3020 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3022 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3024 int sz=0,sw=-1,val1=-1;
3025 std::vector<int> val2;
3026 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3027 return self->clonePart(inp,inp+sz);
3030 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3032 DataArrayInt *ret1=0;
3034 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3035 PyObject *res=PyTuple_New(2);
3036 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3038 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3041 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3042 PyTuple_SetItem(res,1,res1);
3047 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3049 std::vector<int> vVal; int iVal=-1;
3051 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3053 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3054 DataArrayInt *ret0=0,*ret1=0;
3055 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3056 PyObject *pyRet=PyTuple_New(2);
3057 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3058 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3063 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3065 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3066 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3069 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3071 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3072 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3075 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3077 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3078 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3081 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3083 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3084 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3087 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3089 PyObject *getArrayOfDiscIds() const
3091 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3094 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3097 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3099 std::vector<int> ret1;
3100 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3101 std::size_t sz=ret0.size();
3102 PyObject *pyRet=PyTuple_New(2);
3103 PyObject *pyRet0=PyList_New((int)sz);
3104 PyObject *pyRet1=PyList_New((int)sz);
3105 for(std::size_t i=0;i<sz;i++)
3107 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3108 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3110 PyTuple_SetItem(pyRet,0,pyRet0);
3111 PyTuple_SetItem(pyRet,1,pyRet1);
3116 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3118 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3121 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3122 PyObject *ret=PyTuple_New(2);
3123 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3124 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3129 namespace ParaMEDMEM
3131 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3134 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3135 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3136 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3137 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3138 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3139 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3140 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3141 const char *getDescription() const throw(INTERP_KERNEL::Exception);
3142 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3143 const char *getName() const throw(INTERP_KERNEL::Exception);
3144 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3145 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3146 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3147 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3148 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3149 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3150 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3151 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3152 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3153 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3154 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3155 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3156 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3157 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3158 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3159 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3161 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3163 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3166 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3169 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3171 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3174 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3177 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3179 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3180 return convertIntArrToPyList3(ret);
3183 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3186 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3187 PyObject *ret=PyTuple_New(2);
3188 PyObject *ret0Py=ret0?Py_True:Py_False;
3190 PyTuple_SetItem(ret,0,ret0Py);
3191 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3195 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3197 DataArrayInt *ret1=0;
3198 MEDCouplingMesh *ret0=0;
3200 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3201 if (!SWIG_IsOK(res1))
3204 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3205 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3209 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3211 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3212 da2->checkAllocated();
3213 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3215 PyObject *res = PyList_New(2);
3216 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3217 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3221 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3223 DataArrayInt *ret1=0;
3225 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3226 PyObject *res=PyTuple_New(2);
3227 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3229 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3232 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3233 PyTuple_SetItem(res,1,res1);
3238 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3242 std::vector<int> pos2;
3243 DataArrayInt *pos3=0;
3244 DataArrayIntTuple *pos4=0;
3245 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3250 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3254 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3258 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3261 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3265 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3266 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3269 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3270 if (!SWIG_IsOK(res1))
3273 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3274 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3278 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3280 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3281 da2->checkAllocated();
3282 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3286 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3288 std::vector<int> tmp;
3289 self->getCellIdsHavingGaussLocalization(locId,tmp);
3290 DataArrayInt *ret=DataArrayInt::New();
3291 ret->alloc((int)tmp.size(),1);
3292 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3298 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3301 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3302 static MEDCouplingFieldTemplate *New(TypeOfField type);
3303 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3304 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3307 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3309 return MEDCouplingFieldTemplate::New(f);
3312 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3314 return MEDCouplingFieldTemplate::New(type);
3317 std::string __str__() const throw(INTERP_KERNEL::Exception)
3319 return self->simpleRepr();
3322 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3324 std::ostringstream oss;
3325 self->reprQuickOverview(oss);
3331 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3334 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3335 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3336 void setTimeUnit(const char *unit);
3337 const char *getTimeUnit() const;
3338 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3339 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3340 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3341 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3342 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3343 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3344 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3345 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3346 MEDCouplingFieldDouble *deepCpy() const;
3347 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3348 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3349 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3350 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3351 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3352 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3353 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3354 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3355 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3356 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3357 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3358 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3359 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3360 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3361 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3362 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3363 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3364 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3365 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3366 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3367 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3368 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3369 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3370 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3371 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3372 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3373 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3374 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3375 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3376 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3377 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3378 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3379 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3380 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3381 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3382 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3383 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3384 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3385 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3386 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3387 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3388 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3389 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3390 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3391 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3392 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3393 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3394 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3395 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3396 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3397 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3398 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3399 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3400 double getMinValue() const throw(INTERP_KERNEL::Exception);
3401 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3402 double norm2() const throw(INTERP_KERNEL::Exception);
3403 double normMax() const throw(INTERP_KERNEL::Exception);
3404 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3405 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3406 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3407 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3408 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3409 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3410 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3411 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3412 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3413 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3414 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3415 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3416 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3417 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3418 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3419 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3420 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3421 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3422 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3423 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3424 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3425 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3427 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3429 return MEDCouplingFieldDouble::New(type,td);
3432 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3434 return MEDCouplingFieldDouble::New(ft,td);
3437 std::string __str__() const throw(INTERP_KERNEL::Exception)
3439 return self->simpleRepr();
3442 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3444 std::ostringstream oss;
3445 self->reprQuickOverview(oss);
3449 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3451 DataArrayDouble *ret=self->getArray();
3457 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3459 std::vector<DataArrayDouble *> arrs=self->getArrays();
3460 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3464 PyObject *ret=PyTuple_New(sz);
3465 for(int i=0;i<sz;i++)
3468 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3470 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3475 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3477 std::vector<const DataArrayDouble *> tmp;
3478 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3480 std::vector<DataArrayDouble *> arrs(sz);
3481 for(int i=0;i<sz;i++)
3482 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3483 self->setArrays(arrs);
3486 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3488 DataArrayDouble *ret=self->getEndArray();
3494 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3498 DataArrayDoubleTuple *aa;
3499 std::vector<double> bb;
3501 const MEDCouplingMesh *mesh=self->getMesh();
3503 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3504 int spaceDim=mesh->getSpaceDimension();
3505 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3506 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3508 int sz=self->getNumberOfComponents();
3509 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3510 self->getValueOn(spaceLoc,res);
3511 return convertDblArrToPyList(res,sz);
3514 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3516 int sz=self->getNumberOfComponents();
3517 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3518 self->getValueOnPos(i,j,k,res);
3519 return convertDblArrToPyList(res,sz);
3522 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3525 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3526 if (!SWIG_IsOK(res1))
3529 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3530 const MEDCouplingMesh *mesh=self->getMesh();
3532 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3533 int spaceDim=mesh->getSpaceDimension();
3534 int nbOfPoints=size/spaceDim;
3535 if(size%spaceDim!=0)
3537 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3539 return self->getValueOnMulti(tmp,nbOfPoints);
3543 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3545 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3546 da2->checkAllocated();
3547 int size=da2->getNumberOfTuples();
3548 int nbOfCompo=da2->getNumberOfComponents();
3549 const MEDCouplingMesh *mesh=self->getMesh();
3551 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3552 if(nbOfCompo!=mesh->getSpaceDimension())
3554 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3556 return self->getValueOnMulti(da2->getConstPointer(),size);
3560 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3564 DataArrayDoubleTuple *aa;
3565 std::vector<double> bb;
3567 const MEDCouplingMesh *mesh=self->getMesh();
3569 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3570 int spaceDim=mesh->getSpaceDimension();
3571 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3572 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3575 int sz=self->getNumberOfComponents();
3576 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3577 self->getValueOn(spaceLoc,time,res);
3578 return convertDblArrToPyList(res,sz);
3581 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3583 if(self->getArray()!=0)
3584 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3587 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3588 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3589 self->setArray(arr);
3593 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3596 double tmp0=self->getTime(tmp1,tmp2);
3597 PyObject *res = PyList_New(3);
3598 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3599 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3600 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3604 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3607 double tmp0=self->getStartTime(tmp1,tmp2);
3608 PyObject *res = PyList_New(3);
3609 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3610 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3611 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3615 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3618 double tmp0=self->getEndTime(tmp1,tmp2);
3619 PyObject *res = PyList_New(3);
3620 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3621 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3622 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3625 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3627 int sz=self->getNumberOfComponents();
3628 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3629 self->accumulate(tmp);
3630 return convertDblArrToPyList(tmp,sz);
3632 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3634 int sz=self->getNumberOfComponents();
3635 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3636 self->integral(isWAbs,tmp);
3637 return convertDblArrToPyList(tmp,sz);
3639 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3641 int sz=self->getNumberOfComponents();
3642 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3643 self->getWeightedAverageValue(tmp,isWAbs);
3644 return convertDblArrToPyList(tmp,sz);
3646 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3648 int sz=self->getNumberOfComponents();
3649 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3651 return convertDblArrToPyList(tmp,sz);
3653 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3655 int sz=self->getNumberOfComponents();
3656 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3658 return convertDblArrToPyList(tmp,sz);
3660 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3663 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3664 if (!SWIG_IsOK(res1))
3667 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3668 self->renumberCells(tmp,check);
3672 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3674 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3675 da2->checkAllocated();
3676 self->renumberCells(da2->getConstPointer(),check);
3679 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3682 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3683 if (!SWIG_IsOK(res1))
3686 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3687 self->renumberNodes(tmp,eps);
3691 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3693 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3694 da2->checkAllocated();
3695 self->renumberNodes(da2->getConstPointer(),eps);
3699 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3703 std::vector<int> multiVal;
3704 std::pair<int, std::pair<int,int> > slic;
3705 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3706 const MEDCouplingMesh *mesh=self->getMesh();
3708 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3709 int nbc=mesh->getNumberOfCells();
3710 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3717 std::ostringstream oss;
3718 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3719 throw INTERP_KERNEL::Exception(oss.str().c_str());
3722 return self->buildSubPart(&singleVal,&singleVal+1);
3727 int tmp=nbc+singleVal;
3728 return self->buildSubPart(&tmp,&tmp+1);
3732 std::ostringstream oss;
3733 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3734 throw INTERP_KERNEL::Exception(oss.str().c_str());
3740 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3744 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3749 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3750 daIntTyypp->checkAllocated();
3751 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3754 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3758 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3760 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";
3761 if(PyTuple_Check(li))
3763 Py_ssize_t sz=PyTuple_Size(li);
3765 throw INTERP_KERNEL::Exception(msg);
3766 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3769 std::vector<int> multiVal;
3770 std::pair<int, std::pair<int,int> > slic;
3771 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3772 if(!self->getArray())
3773 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3775 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3776 catch(INTERP_KERNEL::Exception& e)
3777 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3778 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3779 DataArrayDouble *ret0Arr=ret0->getArray();
3781 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3786 std::vector<int> v2(1,singleVal);
3787 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3788 ret0->setArray(aarr);
3793 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3794 ret0->setArray(aarr);
3799 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3800 std::vector<int> v2(nbOfComp);
3801 for(int i=0;i<nbOfComp;i++)
3802 v2[i]=slic.first+i*slic.second.second;
3803 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3804 ret0->setArray(aarr);
3808 throw INTERP_KERNEL::Exception(msg);
3813 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3816 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3819 double r1=self->getMaxValue2(tmp);
3820 PyObject *ret=PyTuple_New(2);
3821 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3822 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3826 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3829 double r1=self->getMinValue2(tmp);
3830 PyObject *ret=PyTuple_New(2);
3831 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3832 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3836 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3838 std::vector<int> tmp;
3839 convertPyToNewIntArr3(li,tmp);
3840 return self->keepSelectedComponents(tmp);
3843 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3845 std::vector<int> tmp;
3846 convertPyToNewIntArr3(li,tmp);
3847 self->setSelectedComponents(f,tmp);
3850 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3853 DataArrayDouble *a,*a2;
3854 DataArrayDoubleTuple *aa,*aa2;
3855 std::vector<double> bb,bb2;
3858 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3859 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3860 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3861 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3863 return self->extractSlice3D(orig,vect,eps);
3866 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3868 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3871 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3873 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3876 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3878 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.";
3879 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3882 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3884 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3886 return (*self)-(*other);
3888 throw INTERP_KERNEL::Exception(msg);
3893 DataArrayDoubleTuple *aa;
3894 std::vector<double> bb;
3896 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3901 if(!self->getArray())
3902 throw INTERP_KERNEL::Exception(msg2);
3903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3904 ret->applyLin(1.,-val);
3905 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3906 ret2->setArray(ret);
3911 if(!self->getArray())
3912 throw INTERP_KERNEL::Exception(msg2);
3913 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3914 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3915 ret2->setArray(ret);
3920 if(!self->getArray())
3921 throw INTERP_KERNEL::Exception(msg2);
3922 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3923 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3924 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3925 ret2->setArray(ret);
3930 if(!self->getArray())
3931 throw INTERP_KERNEL::Exception(msg2);
3932 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3933 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3934 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3935 ret2->setArray(ret);
3939 { throw INTERP_KERNEL::Exception(msg); }
3943 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3945 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3948 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3950 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3953 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3955 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3958 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3960 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.";
3961 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3964 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3966 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3968 return (*self)/(*other);
3970 throw INTERP_KERNEL::Exception(msg);
3975 DataArrayDoubleTuple *aa;
3976 std::vector<double> bb;
3978 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3984 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3985 if(!self->getArray())
3986 throw INTERP_KERNEL::Exception(msg2);
3987 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3988 ret->applyLin(1./val,0);
3989 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3990 ret2->setArray(ret);
3995 if(!self->getArray())
3996 throw INTERP_KERNEL::Exception(msg2);
3997 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3998 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3999 ret2->setArray(ret);
4004 if(!self->getArray())
4005 throw INTERP_KERNEL::Exception(msg2);
4006 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4007 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4008 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4009 ret2->setArray(ret);
4014 if(!self->getArray())
4015 throw INTERP_KERNEL::Exception(msg2);
4016 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4017 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4018 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4019 ret2->setArray(ret);
4023 { throw INTERP_KERNEL::Exception(msg); }
4027 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4029 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4032 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4034 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.";
4035 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4038 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4040 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4042 return (*self)^(*other);
4044 throw INTERP_KERNEL::Exception(msg);
4049 DataArrayDoubleTuple *aa;
4050 std::vector<double> bb;
4052 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4057 if(!self->getArray())
4058 throw INTERP_KERNEL::Exception(msg2);
4059 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4061 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4062 ret2->setArray(ret);
4067 if(!self->getArray())
4068 throw INTERP_KERNEL::Exception(msg2);
4069 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4070 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4071 ret2->setArray(ret);
4076 if(!self->getArray())
4077 throw INTERP_KERNEL::Exception(msg2);
4078 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4079 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4080 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4081 ret2->setArray(ret);
4086 if(!self->getArray())
4087 throw INTERP_KERNEL::Exception(msg2);
4088 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4089 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4090 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4091 ret2->setArray(ret);
4095 { throw INTERP_KERNEL::Exception(msg); }
4099 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4101 return self->negate();
4104 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4106 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.";
4107 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4110 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4112 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4116 Py_XINCREF(trueSelf);
4120 throw INTERP_KERNEL::Exception(msg);
4125 DataArrayDoubleTuple *aa;
4126 std::vector<double> bb;
4128 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4133 if(!self->getArray())
4134 throw INTERP_KERNEL::Exception(msg2);
4135 self->getArray()->applyLin(1.,val);
4136 Py_XINCREF(trueSelf);
4141 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4144 Py_XINCREF(trueSelf);
4149 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4150 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4151 ret2->setArray(aaa);
4153 Py_XINCREF(trueSelf);
4158 if(!self->getArray())
4159 throw INTERP_KERNEL::Exception(msg2);
4160 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4161 self->getArray()->addEqual(aaa);
4162 Py_XINCREF(trueSelf);
4166 { throw INTERP_KERNEL::Exception(msg); }
4170 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4172 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.";
4173 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4176 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4178 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4182 Py_XINCREF(trueSelf);
4186 throw INTERP_KERNEL::Exception(msg);
4191 DataArrayDoubleTuple *aa;
4192 std::vector<double> bb;
4194 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4199 if(!self->getArray())
4200 throw INTERP_KERNEL::Exception(msg2);
4201 self->getArray()->applyLin(1.,-val);
4202 Py_XINCREF(trueSelf);
4207 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4210 Py_XINCREF(trueSelf);
4215 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4216 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4217 ret2->setArray(aaa);
4219 Py_XINCREF(trueSelf);
4224 if(!self->getArray())
4225 throw INTERP_KERNEL::Exception(msg2);
4226 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4227 self->getArray()->substractEqual(aaa);
4228 Py_XINCREF(trueSelf);
4232 { throw INTERP_KERNEL::Exception(msg); }
4236 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4238 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.";
4239 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4242 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4244 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4248 Py_XINCREF(trueSelf);
4252 throw INTERP_KERNEL::Exception(msg);
4257 DataArrayDoubleTuple *aa;
4258 std::vector<double> bb;
4260 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4265 if(!self->getArray())
4266 throw INTERP_KERNEL::Exception(msg2);
4267 self->getArray()->applyLin(val,0);
4268 Py_XINCREF(trueSelf);
4273 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4276 Py_XINCREF(trueSelf);
4281 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4282 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4283 ret2->setArray(aaa);
4285 Py_XINCREF(trueSelf);
4290 if(!self->getArray())
4291 throw INTERP_KERNEL::Exception(msg2);
4292 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4293 self->getArray()->multiplyEqual(aaa);
4294 Py_XINCREF(trueSelf);
4298 { throw INTERP_KERNEL::Exception(msg); }
4302 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4304 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.";
4305 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4308 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4310 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4314 Py_XINCREF(trueSelf);
4318 throw INTERP_KERNEL::Exception(msg);
4323 DataArrayDoubleTuple *aa;
4324 std::vector<double> bb;
4326 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4332 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4333 if(!self->getArray())
4334 throw INTERP_KERNEL::Exception(msg2);
4335 self->getArray()->applyLin(1./val,0);
4336 Py_XINCREF(trueSelf);
4341 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4344 Py_XINCREF(trueSelf);
4349 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4350 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4351 ret2->setArray(aaa);
4353 Py_XINCREF(trueSelf);
4358 if(!self->getArray())
4359 throw INTERP_KERNEL::Exception(msg2);
4360 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4361 self->getArray()->divideEqual(aaa);
4362 Py_XINCREF(trueSelf);
4366 { throw INTERP_KERNEL::Exception(msg); }
4370 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4372 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.";
4373 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4376 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4378 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4382 Py_XINCREF(trueSelf);
4386 throw INTERP_KERNEL::Exception(msg);
4391 DataArrayDoubleTuple *aa;
4392 std::vector<double> bb;
4394 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4399 if(!self->getArray())
4400 throw INTERP_KERNEL::Exception(msg2);
4401 self->getArray()->applyPow(val);
4402 Py_XINCREF(trueSelf);
4407 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4410 Py_XINCREF(trueSelf);
4415 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4416 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4417 ret2->setArray(aaa);
4419 Py_XINCREF(trueSelf);
4424 if(!self->getArray())
4425 throw INTERP_KERNEL::Exception(msg2);
4426 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4427 self->getArray()->powEqual(aaa);
4428 Py_XINCREF(trueSelf);
4432 { throw INTERP_KERNEL::Exception(msg); }
4436 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4438 std::vector<const MEDCouplingFieldDouble *> tmp;
4439 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4440 return MEDCouplingFieldDouble::MergeFields(tmp);
4443 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4445 std::vector<const MEDCouplingFieldDouble *> tmp;
4446 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4447 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4452 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4455 int getNumberOfFields() const;
4456 MEDCouplingMultiFields *deepCpy() const;
4457 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4458 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4459 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4460 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4461 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4464 std::string __str__() const throw(INTERP_KERNEL::Exception)
4466 return self->simpleRepr();
4468 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4470 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4471 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4473 std::vector<MEDCouplingFieldDouble *> fs(sz);
4474 for(int i=0;i<sz;i++)
4475 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4476 return MEDCouplingMultiFields::New(fs);
4478 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4480 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4481 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4483 std::vector<MEDCouplingFieldDouble *> fs(sz);
4484 for(int i=0;i<sz;i++)
4485 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4486 return MEDCouplingMultiFields::New(fs);
4488 PyObject *getFields() const
4490 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4491 int sz=fields.size();
4492 PyObject *res = PyList_New(sz);
4493 for(int i=0;i<sz;i++)
4497 fields[i]->incrRef();
4498 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4502 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4507 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4509 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4513 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4516 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4518 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4520 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4522 PyObject *res = PyList_New(sz);
4523 for(int i=0;i<sz;i++)
4528 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4532 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4537 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4539 std::vector<int> refs;
4540 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4542 PyObject *res = PyList_New(sz);
4543 for(int i=0;i<sz;i++)
4548 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4552 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4556 PyObject *ret=PyTuple_New(2);
4557 PyTuple_SetItem(ret,0,res);
4558 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4561 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4563 std::vector<DataArrayDouble *> ms=self->getArrays();
4565 PyObject *res = PyList_New(sz);
4566 for(int i=0;i<sz;i++)
4571 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4575 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4580 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4582 std::vector< std::vector<int> > refs;
4583 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4585 PyObject *res = PyList_New(sz);
4586 PyObject *res2 = PyList_New(sz);
4587 for(int i=0;i<sz;i++)
4592 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4596 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4598 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4601 PyObject *ret=PyTuple_New(2);
4602 PyTuple_SetItem(ret,0,res);
4603 PyTuple_SetItem(ret,1,res2);
4609 class MEDCouplingDefinitionTime
4612 MEDCouplingDefinitionTime();
4613 void assign(const MEDCouplingDefinitionTime& other);
4614 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4615 double getTimeResolution() const;
4616 std::vector<double> getHotSpotsTime() const;
4619 std::string __str__() const throw(INTERP_KERNEL::Exception)
4621 std::ostringstream oss;
4622 self->appendRepr(oss);
4626 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4628 int meshId,arrId,arrIdInField,fieldId;
4629 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4630 PyObject *res=PyList_New(4);
4631 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4632 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4633 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4634 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4638 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4640 int meshId,arrId,arrIdInField,fieldId;
4641 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4642 PyObject *res=PyList_New(4);
4643 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4644 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4645 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4646 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4652 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4655 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4656 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4660 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4662 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4663 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4665 std::vector<MEDCouplingFieldDouble *> fs(sz);
4666 for(int i=0;i<sz;i++)
4667 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4668 return MEDCouplingFieldOverTime::New(fs);
4670 std::string __str__() const throw(INTERP_KERNEL::Exception)
4672 return self->simpleRepr();
4674 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4676 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4677 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4679 std::vector<MEDCouplingFieldDouble *> fs(sz);
4680 for(int i=0;i<sz;i++)
4681 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4682 return MEDCouplingFieldOverTime::New(fs);
4690 __filename=os.environ.get('PYTHONSTARTUP')
4691 if __filename and os.path.isfile(__filename):
4692 execfile(__filename)