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::AggregateIndexes;
252 %newobject ParaMEDMEM::DataArrayInt::Meld;
253 %newobject ParaMEDMEM::DataArrayInt::Add;
254 %newobject ParaMEDMEM::DataArrayInt::Substract;
255 %newobject ParaMEDMEM::DataArrayInt::Multiply;
256 %newobject ParaMEDMEM::DataArrayInt::Divide;
257 %newobject ParaMEDMEM::DataArrayInt::Pow;
258 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
259 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
260 %newobject ParaMEDMEM::DataArrayInt::Range;
261 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
262 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
264 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
265 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
267 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
268 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
269 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
270 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
271 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
272 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
273 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
274 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
275 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
276 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
277 %newobject ParaMEDMEM::DataArrayInt::__neg__;
278 %newobject ParaMEDMEM::DataArrayInt::__add__;
279 %newobject ParaMEDMEM::DataArrayInt::__radd__;
280 %newobject ParaMEDMEM::DataArrayInt::__sub__;
281 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
282 %newobject ParaMEDMEM::DataArrayInt::__mul__;
283 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
284 %newobject ParaMEDMEM::DataArrayInt::__div__;
285 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
286 %newobject ParaMEDMEM::DataArrayInt::__mod__;
287 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
288 %newobject ParaMEDMEM::DataArrayInt::__pow__;
289 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
290 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
291 %newobject ParaMEDMEM::DataArrayChar::deepCpy;
292 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
293 %newobject ParaMEDMEM::DataArrayChar::renumber;
294 %newobject ParaMEDMEM::DataArrayChar::renumberR;
295 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
296 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
297 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
298 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
299 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
300 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
301 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
302 %newobject ParaMEDMEM::DataArrayChar::Meld;
303 %newobject ParaMEDMEM::DataArrayByte::New;
304 %newobject ParaMEDMEM::DataArrayByte::__iter__;
305 %newobject ParaMEDMEM::DataArrayByte::performCpy;
306 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
307 %newobject ParaMEDMEM::DataArrayChar::substr;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
309 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
310 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
311 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
312 %newobject ParaMEDMEM::DataArrayDouble::New;
313 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
314 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
315 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
317 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
318 %newobject ParaMEDMEM::DataArrayDouble::Meld;
319 %newobject ParaMEDMEM::DataArrayDouble::Dot;
320 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
321 %newobject ParaMEDMEM::DataArrayDouble::Add;
322 %newobject ParaMEDMEM::DataArrayDouble::Substract;
323 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
324 %newobject ParaMEDMEM::DataArrayDouble::Divide;
325 %newobject ParaMEDMEM::DataArrayDouble::Pow;
326 %newobject ParaMEDMEM::DataArrayDouble::substr;
327 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
328 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
329 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
330 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
331 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
332 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
333 %newobject ParaMEDMEM::DataArrayDouble::negate;
334 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
335 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
336 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
337 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
338 %newobject ParaMEDMEM::DataArrayDouble::determinant;
339 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
340 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
341 %newobject ParaMEDMEM::DataArrayDouble::inverse;
342 %newobject ParaMEDMEM::DataArrayDouble::trace;
343 %newobject ParaMEDMEM::DataArrayDouble::deviator;
344 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
345 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
346 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
347 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
348 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
349 %newobject ParaMEDMEM::DataArrayDouble::renumber;
350 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
351 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
352 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
353 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
354 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
355 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
356 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
357 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
358 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
359 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
360 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
361 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
362 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
363 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
364 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
365 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
366 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
367 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
368 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
369 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
370 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
371 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
372 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
373 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
374 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
375 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
376 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
377 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
378 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
379 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
380 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
381 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
382 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
383 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
384 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
385 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
386 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
387 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
398 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
399 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
441 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
442 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
443 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
444 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
445 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
446 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
447 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::getNodalConnectivity;
448 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
450 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
451 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
452 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivity;
453 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
456 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
457 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
458 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
459 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
460 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
461 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
462 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
463 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
464 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
465 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
466 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
467 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
469 %feature("unref") DataArray "$this->decrRef();"
470 %feature("unref") DataArrayDouble "$this->decrRef();"
471 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
472 %feature("unref") MEDCouplingMesh "$this->decrRef();"
473 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
474 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
475 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
476 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
477 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
478 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
479 %feature("unref") DataArrayInt "$this->decrRef();"
480 %feature("unref") DataArrayChar "$this->decrRef();"
481 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
482 %feature("unref") DataArrayByte "$this->decrRef();"
483 %feature("unref") MEDCouplingField "$this->decrRef();"
484 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
485 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
486 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
487 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
488 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
489 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
490 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
491 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
492 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
494 %rename(assign) *::operator=;
495 %ignore ParaMEDMEM::RefCountObject::decrRef;
496 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
497 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
498 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
499 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
503 %rename (InterpKernelException) INTERP_KERNEL::Exception;
505 namespace INTERP_KERNEL
510 Exception(const char* what);
511 ~Exception() throw ();
512 const char *what() const throw ();
515 std::string __str__() const
517 return std::string(self->what());
528 void declareAsNew() const;
529 virtual void updateTime() const;
530 unsigned int getTimeOfThis() const;
558 CONST_ON_TIME_INTERVAL = 7
559 } TypeOfTimeDiscretization;
561 const char *MEDCouplingVersionStr();
562 int MEDCouplingVersion();
563 int MEDCouplingSizeOfVoidStar();
569 RefCountObject(const RefCountObject& other);
572 bool decrRef() const;
573 void incrRef() const;
574 int getRCValue() const;
575 virtual std::size_t getHeapMemorySize() const;
581 PyObject *MEDCouplingVersionMajMinRel()
583 int tmp0=0,tmp1=0,tmp2=0;
584 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
585 PyObject *res = PyList_New(3);
586 PyList_SetItem(res,0,SWIG_From_int(tmp0));
587 PyList_SetItem(res,1,SWIG_From_int(tmp1));
588 PyList_SetItem(res,2,SWIG_From_int(tmp2));
592 bool MEDCouplingHasNumPyBindings()
601 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
603 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
604 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
605 if(PyRun_SimpleString(script)!=0)
606 throw INTERP_KERNEL::Exception(oss.str().c_str());
607 return std::string(script);
611 %include "MEDCouplingMemArray.i"
618 UNSTRUCTURED_DESC = 6,
622 } MEDCouplingMeshType;
625 class DataArrayDouble;
626 class MEDCouplingUMesh;
627 class MEDCouplingFieldDouble;
629 %extend RefCountObject
631 std::string getHiddenCppPointer() const
633 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
638 %extend MEDCouplingGaussLocalization
640 std::string __str__() const throw(INTERP_KERNEL::Exception)
642 return self->getStringRepr();
645 std::string __repr__() const throw(INTERP_KERNEL::Exception)
647 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
648 oss << self->getStringRepr();
655 class MEDCouplingMesh : public RefCountObject, public TimeLabel
658 void setName(const char *name);
659 const char *getName() const;
660 void setDescription(const char *descr);
661 const char *getDescription() const;
662 void setTime(double val, int iteration, int order);
663 void setTimeUnit(const char *unit);
664 const char *getTimeUnit() const;
665 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
666 bool isStructured() const throw(INTERP_KERNEL::Exception);
667 virtual MEDCouplingMesh *deepCpy() const;
668 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
669 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
670 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
671 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
672 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
673 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
674 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
675 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
676 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
677 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
678 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
679 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
680 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
681 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
682 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
683 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
684 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
685 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
686 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
687 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
688 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
689 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
690 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
691 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
693 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
694 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
695 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
696 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
697 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
698 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
699 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
700 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
701 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
702 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
703 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
704 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
705 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
706 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
707 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
708 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
709 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
712 std::string __str__() const throw(INTERP_KERNEL::Exception)
714 return self->simpleRepr();
717 PyObject *getTime() throw(INTERP_KERNEL::Exception)
720 double tmp0=self->getTime(tmp1,tmp2);
721 PyObject *res = PyList_New(3);
722 PyList_SetItem(res,0,SWIG_From_double(tmp0));
723 PyList_SetItem(res,1,SWIG_From_int(tmp1));
724 PyList_SetItem(res,2,SWIG_From_int(tmp2));
728 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
732 DataArrayDoubleTuple *aa;
733 std::vector<double> bb;
735 int spaceDim=self->getSpaceDimension();
736 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
737 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
738 return self->getCellContainingPoint(pos,eps);
741 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
745 DataArrayDoubleTuple *aa;
746 std::vector<double> bb;
748 int spaceDim=self->getSpaceDimension();
749 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
750 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
751 std::vector<int> elts,eltsIndex;
752 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
753 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
754 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
755 d0->alloc(elts.size(),1);
756 d1->alloc(eltsIndex.size(),1);
757 std::copy(elts.begin(),elts.end(),d0->getPointer());
758 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
759 PyObject *ret=PyTuple_New(2);
760 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
761 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
765 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
767 std::vector<int> elts,eltsIndex;
768 int spaceDim=self->getSpaceDimension();
770 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
771 if (!SWIG_IsOK(res1))
774 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
775 int nbOfPoints=size/spaceDim;
778 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
780 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
784 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
786 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
787 da2->checkAllocated();
788 int size=da2->getNumberOfTuples();
789 int nbOfCompo=da2->getNumberOfComponents();
790 if(nbOfCompo!=spaceDim)
792 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
794 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
796 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
797 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
798 d0->alloc(elts.size(),1);
799 d1->alloc(eltsIndex.size(),1);
800 std::copy(elts.begin(),elts.end(),d0->getPointer());
801 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
802 PyObject *ret=PyTuple_New(2);
803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
804 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
808 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
812 DataArrayDoubleTuple *aa;
813 std::vector<double> bb;
815 int spaceDim=self->getSpaceDimension();
816 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
817 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
818 std::vector<int> elts;
819 self->getCellsContainingPoint(pos,eps,elts);
820 DataArrayInt *ret=DataArrayInt::New();
821 ret->alloc((int)elts.size(),1);
822 std::copy(elts.begin(),elts.end(),ret->getPointer());
823 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
826 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
829 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
830 if (!SWIG_IsOK(res1))
833 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
834 self->renumberCells(tmp,check);
838 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
840 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
841 da2->checkAllocated();
842 self->renumberCells(da2->getConstPointer(),check);
846 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
848 DataArrayInt *cellCor, *nodeCor;
849 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
850 PyObject *res = PyList_New(2);
851 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
852 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
856 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
858 DataArrayInt *cellCor=0,*nodeCor=0;
859 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
860 PyObject *res = PyList_New(2);
861 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
862 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
866 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
868 DataArrayInt *cellCor=0;
869 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
873 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
876 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
877 if (!SWIG_IsOK(res1))
880 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
881 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
885 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
887 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
888 da2->checkAllocated();
889 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
892 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
894 std::vector<int> conn;
895 self->getNodeIdsOfCell(cellId,conn);
896 return convertIntArrToPyList2(conn);
899 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
901 std::vector<double> coo;
902 self->getCoordinatesOfNode(nodeId,coo);
903 return convertDblArrToPyList2(coo);
906 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
910 DataArrayDoubleTuple *aa;
911 std::vector<double> bb;
913 int spaceDim=self->getSpaceDimension();
914 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
915 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
916 self->scale(pointPtr,factor);
919 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
921 int spaceDim=self->getSpaceDimension();
922 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
923 self->getBoundingBox(tmp);
924 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
928 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
931 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
932 PyObject *ret=PyTuple_New(2);
933 PyObject *ret0Py=ret0?Py_True:Py_False;
935 PyTuple_SetItem(ret,0,ret0Py);
936 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
940 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
942 int szArr,sw,iTypppArr;
943 std::vector<int> stdvecTyyppArr;
944 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
945 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
946 if(sw==3)//DataArrayInt
948 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
949 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
950 std::string name=argpt->getName();
952 ret->setName(name.c_str());
954 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
957 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
959 int szArr,sw,iTypppArr;
960 std::vector<int> stdvecTyyppArr;
962 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
963 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
964 if(sw==3)//DataArrayInt
966 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
967 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
968 std::string name=argpt->getName();
970 ret->setName(name.c_str());
973 PyObject *res = PyList_New(2);
974 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
975 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
976 PyList_SetItem(res,0,obj0);
977 PyList_SetItem(res,1,obj1);
981 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
985 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
986 PyObject *res = PyTuple_New(2);
987 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
990 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
992 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
993 PyTuple_SetItem(res,0,obj0);
994 PyTuple_SetItem(res,1,obj1);
998 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1000 std::vector<int> vals=self->getDistributionOfTypes();
1001 if(vals.size()%3!=0)
1002 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1003 PyObject *ret=PyList_New((int)vals.size()/3);
1004 for(int j=0;j<(int)vals.size()/3;j++)
1006 PyObject *ret1=PyList_New(3);
1007 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1008 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1009 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1010 PyList_SetItem(ret,j,ret1);
1015 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1017 std::vector<int> code;
1018 std::vector<const DataArrayInt *> idsPerType;
1019 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1020 convertPyToNewIntArr4(li,1,3,code);
1021 return self->checkTypeConsistencyAndContig(code,idsPerType);
1024 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1026 std::vector<int> code;
1027 std::vector<DataArrayInt *> idsInPflPerType;
1028 std::vector<DataArrayInt *> idsPerType;
1029 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1030 PyObject *ret=PyTuple_New(3);
1032 if(code.size()%3!=0)
1033 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1034 PyObject *ret0=PyList_New((int)code.size()/3);
1035 for(int j=0;j<(int)code.size()/3;j++)
1037 PyObject *ret00=PyList_New(3);
1038 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1039 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1040 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1041 PyList_SetItem(ret0,j,ret00);
1043 PyTuple_SetItem(ret,0,ret0);
1045 PyObject *ret1=PyList_New(idsInPflPerType.size());
1046 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1047 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1048 PyTuple_SetItem(ret,1,ret1);
1049 int n=idsPerType.size();
1050 PyObject *ret2=PyList_New(n);
1051 for(int i=0;i<n;i++)
1052 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1053 PyTuple_SetItem(ret,2,ret2);
1057 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1061 DataArrayDoubleTuple *aa;
1062 std::vector<double> bb;
1064 int spaceDim=self->getSpaceDimension();
1065 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1066 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1067 self->translate(vectorPtr);
1070 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1072 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1075 DataArrayDoubleTuple *aa;
1076 std::vector<double> bb;
1078 int spaceDim=self->getSpaceDimension();
1079 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1080 self->rotate(centerPtr,0,alpha);
1083 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1085 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1087 DataArrayDouble *a,*a2;
1088 DataArrayDoubleTuple *aa,*aa2;
1089 std::vector<double> bb,bb2;
1091 int spaceDim=self->getSpaceDimension();
1092 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1093 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
1094 self->rotate(centerPtr,vectorPtr,alpha);
1097 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1099 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1100 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1101 PyObject *res=PyList_New(result.size());
1102 for(int i=0;iL!=result.end(); i++, iL++)
1103 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1107 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1109 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1110 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1111 return MEDCouplingMesh::MergeMeshes(tmp);
1117 //== MEDCouplingMesh End
1119 %include "NormalizedUnstructuredMesh.hxx"
1120 %include "MEDCouplingNatureOfField.hxx"
1121 %include "MEDCouplingTimeDiscretization.hxx"
1122 %include "MEDCouplingGaussLocalization.hxx"
1123 %include "MEDCouplingFieldDiscretization.hxx"
1125 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1126 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1127 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1129 //== MEDCouplingPointSet
1131 namespace ParaMEDMEM
1133 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1136 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1137 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1138 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1139 void zipCoords() throw(INTERP_KERNEL::Exception);
1140 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1141 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1142 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1143 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1144 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1145 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1146 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1147 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1148 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1149 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1150 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1151 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1152 virtual DataArrayInt *findBoundaryNodes() const;
1153 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1154 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1155 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1156 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1159 std::string __str__() const throw(INTERP_KERNEL::Exception)
1161 return self->simpleRepr();
1164 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1167 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1168 PyObject *res = PyList_New(2);
1169 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1170 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1174 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1176 DataArrayInt *comm, *commIndex;
1177 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1178 PyObject *res = PyList_New(2);
1179 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1180 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1184 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1186 DataArrayDouble *ret1=self->getCoords();
1189 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1192 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1194 int szArr,sw,iTypppArr;
1195 std::vector<int> stdvecTyyppArr;
1196 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1197 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1198 if(sw==3)//DataArrayInt
1200 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1201 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1202 std::string name=argpt->getName();
1204 ret->setName(name.c_str());
1206 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1209 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1211 int szArr,sw,iTypppArr;
1212 std::vector<int> stdvecTyyppArr;
1213 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1214 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1215 if(sw==3)//DataArrayInt
1217 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1218 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1219 std::string name=argpt->getName();
1221 ret->setName(name.c_str());
1223 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1226 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1228 int szArr,sw,iTypppArr;
1229 std::vector<int> stdvecTyyppArr;
1230 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1231 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1232 if(sw==3)//DataArrayInt
1234 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1235 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1236 std::string name=argpt->getName();
1238 ret->setName(name.c_str());
1240 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1243 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1245 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1246 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1249 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1251 int szArr,sw,iTypppArr;
1252 std::vector<int> stdvecTyyppArr;
1253 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1254 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1255 if(sw==3)//DataArrayInt
1257 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1258 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1259 std::string name=argpt->getName();
1261 ret->setName(name.c_str());
1263 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1266 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1268 int szArr,sw,iTypppArr;
1269 std::vector<int> stdvecTyyppArr;
1270 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1271 self->renumberNodes(tmp,newNbOfNodes);
1274 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1276 int szArr,sw,iTypppArr;
1277 std::vector<int> stdvecTyyppArr;
1278 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1279 self->renumberNodes2(tmp,newNbOfNodes);
1282 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1284 int spaceDim=self->getSpaceDimension();
1286 DataArrayDouble *a,*a2;
1287 DataArrayDoubleTuple *aa,*aa2;
1288 std::vector<double> bb,bb2;
1290 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1291 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1292 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1293 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1294 std::vector<int> nodes;
1295 self->findNodesOnLine(p,v,eps,nodes);
1296 DataArrayInt *ret=DataArrayInt::New();
1297 ret->alloc((int)nodes.size(),1);
1298 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1299 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1301 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1303 int spaceDim=self->getSpaceDimension();
1305 DataArrayDouble *a,*a2;
1306 DataArrayDoubleTuple *aa,*aa2;
1307 std::vector<double> bb,bb2;
1309 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1310 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1311 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1312 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1313 std::vector<int> nodes;
1314 self->findNodesOnPlane(p,v,eps,nodes);
1315 DataArrayInt *ret=DataArrayInt::New();
1316 ret->alloc((int)nodes.size(),1);
1317 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1321 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1325 DataArrayDoubleTuple *aa;
1326 std::vector<double> bb;
1328 int spaceDim=self->getSpaceDimension();
1329 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1330 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1331 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1332 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1335 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1337 DataArrayInt *c=0,*cI=0;
1341 DataArrayDoubleTuple *aa;
1342 std::vector<double> bb;
1344 int spaceDim=self->getSpaceDimension();
1345 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1346 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1347 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1348 PyObject *ret=PyTuple_New(2);
1349 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1350 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1354 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1356 DataArrayInt *c=0,*cI=0;
1357 int spaceDim=self->getSpaceDimension();
1360 DataArrayDoubleTuple *aa;
1361 std::vector<double> bb;
1364 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1365 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1367 PyObject *ret=PyTuple_New(2);
1368 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1369 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1373 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1377 DataArrayDoubleTuple *aa;
1378 std::vector<double> bb;
1380 int spaceDim=self->getSpaceDimension();
1381 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1382 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1384 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1385 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1388 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1392 std::vector<int> multiVal;
1393 std::pair<int, std::pair<int,int> > slic;
1394 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1395 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1399 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1401 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1403 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1405 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1409 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1411 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1412 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1413 self->getReverseNodalConnectivity(d0,d1);
1414 PyObject *ret=PyTuple_New(2);
1415 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1416 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1420 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1422 DataArrayInt *v0=0,*v1=0;
1423 self->findCommonCells(compType,startCellId,v0,v1);
1424 PyObject *res = PyList_New(2);
1425 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1431 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1434 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1435 if (!SWIG_IsOK(res1))
1438 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1439 self->renumberNodesInConn(tmp);
1443 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1445 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1446 da2->checkAllocated();
1447 self->renumberNodesInConn(da2->getConstPointer());
1451 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1454 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1455 PyObject *ret=PyTuple_New(2);
1456 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1457 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1461 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1463 DataArrayInt *ret=0;
1465 int szArr,sw,iTypppArr;
1466 std::vector<int> stdvecTyyppArr;
1467 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1468 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1472 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1476 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1477 PyObject *res = PyList_New(3);
1478 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1479 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1480 PyList_SetItem(res,2,SWIG_From_int(ret2));
1484 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1488 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1489 PyObject *res = PyList_New(3);
1490 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1491 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1492 PyList_SetItem(res,2,SWIG_From_int(ret2));
1496 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1499 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1500 if (!SWIG_IsOK(res1))
1503 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1504 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1508 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1510 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1511 da2->checkAllocated();
1512 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1516 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1520 std::vector<int> multiVal;
1521 std::pair<int, std::pair<int,int> > slic;
1522 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1523 int nbc=self->getNumberOfCells();
1524 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1531 std::ostringstream oss;
1532 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1533 throw INTERP_KERNEL::Exception(oss.str().c_str());
1536 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1541 int tmp=nbc+singleVal;
1542 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1546 std::ostringstream oss;
1547 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1548 throw INTERP_KERNEL::Exception(oss.str().c_str());
1554 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1558 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1563 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1564 daIntTyypp->checkAllocated();
1565 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1568 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1572 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1575 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1576 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1577 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1578 for(int i=0;i<sz;i++)
1579 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1582 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1585 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1587 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1588 std::vector<double> val3;
1589 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1590 "Rotate2DAlg",2,true,nbNodes);
1592 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1593 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1596 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1599 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1600 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1601 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1602 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1603 for(int i=0;i<sz;i++)
1604 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1607 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1610 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1612 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1613 std::vector<double> val3;
1614 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1615 "Rotate3DAlg",3,true,nbNodes);
1617 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1618 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1619 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1624 //== MEDCouplingPointSet End
1626 class MEDCouplingUMeshCell
1629 INTERP_KERNEL::NormalizedCellType getType() const;
1632 std::string __str__() const throw(INTERP_KERNEL::Exception)
1634 return self->repr();
1637 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1640 const int *r=self->getAllConn(ret2);
1641 PyObject *ret=PyTuple_New(ret2);
1642 for(int i=0;i<ret2;i++)
1643 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1649 class MEDCouplingUMeshCellIterator
1656 MEDCouplingUMeshCell *ret=self->nextt();
1658 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1661 PyErr_SetString(PyExc_StopIteration,"No more data.");
1668 class MEDCouplingUMeshCellByTypeIterator
1671 ~MEDCouplingUMeshCellByTypeIterator();
1676 MEDCouplingUMeshCellEntry *ret=self->nextt();
1678 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1681 PyErr_SetString(PyExc_StopIteration,"No more data.");
1688 class MEDCouplingUMeshCellByTypeEntry
1691 ~MEDCouplingUMeshCellByTypeEntry();
1694 MEDCouplingUMeshCellByTypeIterator *__iter__()
1696 return self->iterator();
1701 class MEDCouplingUMeshCellEntry
1704 INTERP_KERNEL::NormalizedCellType getType() const;
1705 int getNumberOfElems() const;
1708 MEDCouplingUMeshCellIterator *__iter__()
1710 return self->iterator();
1715 //== MEDCouplingUMesh
1717 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1720 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1721 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1722 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1723 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1724 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1725 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1726 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1727 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1728 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1729 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1730 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1731 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1732 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1733 void computeTypes() throw(INTERP_KERNEL::Exception);
1734 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1735 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1737 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1738 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1739 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1740 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1741 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1742 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1743 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1744 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1745 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1746 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1747 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1748 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1749 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1750 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1751 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1752 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1753 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1754 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1755 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1756 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1757 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1758 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1759 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1760 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1761 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1762 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1763 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1764 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1765 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1766 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1767 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1768 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1769 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1770 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1771 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1772 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1773 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1774 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1775 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1777 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1779 return MEDCouplingUMesh::New();
1782 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1784 return MEDCouplingUMesh::New(meshName,meshDim);
1787 std::string __str__() const throw(INTERP_KERNEL::Exception)
1789 return self->simpleRepr();
1792 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1794 std::ostringstream oss;
1795 self->reprQuickOverview(oss);
1799 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1801 return self->cellIterator();
1804 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1808 std::vector<int> multiVal;
1809 std::pair<int, std::pair<int,int> > slic;
1810 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1811 int nbc=self->getNumberOfCells();
1812 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1819 std::ostringstream oss;
1820 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1821 throw INTERP_KERNEL::Exception(oss.str().c_str());
1825 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1832 int tmp=nbc+singleVal;
1833 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1838 std::ostringstream oss;
1839 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1840 throw INTERP_KERNEL::Exception(oss.str().c_str());
1846 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1852 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1853 daIntTyypp->checkAllocated();
1854 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1858 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1862 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1866 std::vector<int> multiVal;
1867 std::pair<int, std::pair<int,int> > slic;
1868 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1869 int nbc=self->getNumberOfCells();
1870 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1877 std::ostringstream oss;
1878 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1879 throw INTERP_KERNEL::Exception(oss.str().c_str());
1883 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1890 int tmp=nbc+singleVal;
1891 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1896 std::ostringstream oss;
1897 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1898 throw INTERP_KERNEL::Exception(oss.str().c_str());
1904 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1909 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1915 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1916 daIntTyypp->checkAllocated();
1917 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1921 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1925 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1927 int szArr,sw,iTypppArr;
1928 std::vector<int> stdvecTyyppArr;
1929 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1932 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1933 throw INTERP_KERNEL::Exception(oss.str().c_str());
1935 self->insertNextCell(type,size,tmp);
1938 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1940 int szArr,sw,iTypppArr;
1941 std::vector<int> stdvecTyyppArr;
1942 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1943 self->insertNextCell(type,szArr,tmp);
1946 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1948 DataArrayInt *ret=self->getNodalConnectivity();
1953 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1955 DataArrayInt *ret=self->getNodalConnectivityIndex();
1960 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1962 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1963 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1964 PyObject *res = PyList_New(result.size());
1965 for (int i=0;iL!=result.end(); i++, iL++)
1966 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1970 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1972 int szArr,sw,iTypppArr;
1973 std::vector<int> stdvecTyyppArr;
1974 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1975 int nbOfDepthPeelingPerformed=0;
1976 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1977 PyObject *res=PyTuple_New(2);
1978 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1979 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1983 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1985 DataArrayInt *v0=0,*v1=0;
1986 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1987 PyObject *res = PyList_New(2);
1988 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1989 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1993 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1997 DataArrayDoubleTuple *aa;
1998 std::vector<double> bb;
2000 int nbOfCompo=self->getSpaceDimension();
2001 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2004 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2005 PyObject *ret=PyTuple_New(2);
2006 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2007 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2011 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2013 DataArrayInt *ret1=0;
2014 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2015 PyObject *ret=PyTuple_New(2);
2016 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2017 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2021 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2023 std::vector<int> cells;
2024 self->checkButterflyCells(cells,eps);
2025 DataArrayInt *ret=DataArrayInt::New();
2026 ret->alloc((int)cells.size(),1);
2027 std::copy(cells.begin(),cells.end(),ret->getPointer());
2028 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2031 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2033 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2035 PyObject *ret = PyList_New(sz);
2036 for(int i=0;i<sz;i++)
2037 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2041 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2043 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2044 int sz=retCpp.size();
2045 PyObject *ret=PyList_New(sz);
2046 for(int i=0;i<sz;i++)
2047 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2051 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2054 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2055 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2056 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2059 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2062 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2063 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2067 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2070 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2071 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2075 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2077 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2078 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2079 PyObject *ret=PyTuple_New(3);
2080 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2081 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2082 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2086 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2088 DataArrayInt *tmp0=0,*tmp1=0;
2089 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2090 PyObject *ret=PyTuple_New(2);
2091 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2092 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2096 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2100 std::vector<int> multiVal;
2101 std::pair<int, std::pair<int,int> > slic;
2102 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2103 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2107 return self->duplicateNodes(&singleVal,&singleVal+1);
2109 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2111 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2113 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2117 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2121 std::vector<int> multiVal;
2122 std::pair<int, std::pair<int,int> > slic;
2123 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2124 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2128 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2130 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2132 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2134 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2138 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2141 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2142 DataArrayInt *tmp0,*tmp1=0;
2143 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2144 PyObject *ret=PyTuple_New(2);
2145 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2146 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2150 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2152 DataArrayInt *ret0=0,*ret1=0;
2153 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2154 PyObject *ret=PyTuple_New(2);
2155 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2162 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2163 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2164 DataArrayInt *ret1=0,*ret2=0;
2165 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2166 PyObject *ret=PyTuple_New(3);
2167 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2175 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2176 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2177 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2178 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2181 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2184 std::vector<const MEDCouplingUMesh *> meshes;
2185 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2186 std::vector<DataArrayInt *> corr;
2187 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2189 PyObject *ret1=PyList_New(sz);
2190 for(int i=0;i<sz;i++)
2191 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *ret=PyList_New(2);
2193 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2194 PyList_SetItem(ret,1,ret1);
2198 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2200 std::vector<MEDCouplingUMesh *> meshes;
2201 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2202 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2205 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2207 std::vector<MEDCouplingUMesh *> meshes;
2208 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2209 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2212 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2216 std::vector<int> multiVal;
2217 std::pair<int, std::pair<int,int> > slic;
2218 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2220 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2221 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2225 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2227 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2229 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2231 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2235 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2237 DataArrayInt *arrOut=0,*arrIndexOut=0;
2240 std::vector<int> multiVal;
2241 std::pair<int, std::pair<int,int> > slic;
2242 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2244 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2245 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2250 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2255 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2260 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2264 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2266 PyObject *ret=PyTuple_New(2);
2267 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2272 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2274 DataArrayInt *arrOut=0,*arrIndexOut=0;
2275 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2276 PyObject *ret=PyTuple_New(2);
2277 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2282 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2284 if(!PySlice_Check(slic))
2285 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2286 Py_ssize_t strt=2,stp=2,step=2;
2287 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2289 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2290 arrIndxIn->checkAllocated();
2291 if(arrIndxIn->getNumberOfComponents()!=1)
2292 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2293 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2294 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2295 DataArrayInt *arrOut=0,*arrIndexOut=0;
2296 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2297 PyObject *ret=PyTuple_New(2);
2298 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2299 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2304 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2305 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2307 DataArrayInt *arrOut=0,*arrIndexOut=0;
2310 std::vector<int> multiVal;
2311 std::pair<int, std::pair<int,int> > slic;
2312 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2314 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2315 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2320 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2325 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2330 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2334 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2336 PyObject *ret=PyTuple_New(2);
2337 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2342 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2343 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2347 std::vector<int> multiVal;
2348 std::pair<int, std::pair<int,int> > slic;
2349 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2351 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2352 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2357 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2362 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2367 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2371 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2375 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2379 DataArrayDoubleTuple *aa;
2380 std::vector<double> bb;
2382 int spaceDim=self->getSpaceDimension();
2383 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2384 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2386 std::vector<int> cells;
2387 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2388 DataArrayInt *ret=DataArrayInt::New();
2389 ret->alloc((int)cells.size(),1);
2390 std::copy(cells.begin(),cells.end(),ret->getPointer());
2391 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2394 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2398 DataArrayDoubleTuple *aa;
2399 std::vector<double> bb;
2401 int spaceDim=self->getSpaceDimension();
2402 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2403 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2404 self->orientCorrectly2DCells(v,polyOnly);
2407 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2409 std::vector<int> cells;
2410 self->arePolyhedronsNotCorrectlyOriented(cells);
2411 DataArrayInt *ret=DataArrayInt::New();
2412 ret->alloc((int)cells.size(),1);
2413 std::copy(cells.begin(),cells.end(),ret->getPointer());
2414 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2417 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2421 self->getFastAveragePlaneOfThis(vec,pos);
2423 std::copy(vec,vec+3,vals);
2424 std::copy(pos,pos+3,vals+3);
2425 return convertDblArrToPyListOfTuple(vals,3,2);
2428 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2430 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2431 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2432 return MEDCouplingUMesh::MergeUMeshes(tmp);
2435 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2438 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2439 PyObject *ret=PyTuple_New(2);
2440 PyObject *ret0Py=ret0?Py_True:Py_False;
2442 PyTuple_SetItem(ret,0,ret0Py);
2443 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2447 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2450 bool ret0=self->areCellsIncludedIn2(other,ret1);
2451 PyObject *ret=PyTuple_New(2);
2452 PyObject *ret0Py=ret0?Py_True:Py_False;
2454 PyTuple_SetItem(ret,0,ret0Py);
2455 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2459 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2461 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2462 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2463 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2464 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2465 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2466 PyObject *ret=PyTuple_New(5);
2467 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2468 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2470 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2471 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2475 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2477 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2478 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2479 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2481 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2482 PyObject *ret=PyTuple_New(5);
2483 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2484 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2485 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2487 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2491 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2493 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2494 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2495 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2496 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2497 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2498 PyObject *ret=PyTuple_New(5);
2499 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2500 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2501 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2502 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2503 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2509 DataArrayInt *neighbors=0,*neighborsIdx=0;
2510 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2511 PyObject *ret=PyTuple_New(2);
2512 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2513 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2517 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2519 DataArrayInt *neighbors=0,*neighborsIdx=0;
2520 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2521 PyObject *ret=PyTuple_New(2);
2522 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2529 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2530 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2531 DataArrayInt *d2,*d3,*d4,*dd5;
2532 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2533 PyObject *ret=PyTuple_New(7);
2534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2536 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2547 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2548 da->checkAllocated();
2549 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2552 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2555 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2556 da->checkAllocated();
2557 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2560 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2563 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2564 da->checkAllocated();
2565 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2568 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2571 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2572 da->checkAllocated();
2573 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2574 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2575 PyObject *res = PyList_New(result.size());
2576 for (int i=0;iL!=result.end(); i++, iL++)
2577 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2581 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2584 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2585 da->checkAllocated();
2586 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2587 ret->setName(da->getName().c_str());
2591 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2593 DataArrayInt *cellNb1=0,*cellNb2=0;
2594 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2595 PyObject *ret=PyTuple_New(3);
2596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2598 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2604 int spaceDim=self->getSpaceDimension();
2606 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2608 DataArrayDouble *a,*a2;
2609 DataArrayDoubleTuple *aa,*aa2;
2610 std::vector<double> bb,bb2;
2612 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2613 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2614 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2615 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2617 DataArrayInt *cellIds=0;
2618 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2619 PyObject *ret=PyTuple_New(2);
2620 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2621 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2625 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2627 int spaceDim=self->getSpaceDimension();
2629 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2631 DataArrayDouble *a,*a2;
2632 DataArrayDoubleTuple *aa,*aa2;
2633 std::vector<double> bb,bb2;
2635 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2636 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2637 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2638 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2640 DataArrayInt *cellIds=0;
2641 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2642 PyObject *ret=PyTuple_New(2);
2643 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2644 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2648 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2650 int spaceDim=self->getSpaceDimension();
2652 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2654 DataArrayDouble *a,*a2;
2655 DataArrayDoubleTuple *aa,*aa2;
2656 std::vector<double> bb,bb2;
2658 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2659 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2660 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2661 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2662 return self->getCellIdsCrossingPlane(orig,vect,eps);
2665 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2669 std::vector<int> pos2;
2670 DataArrayInt *pos3=0;
2671 DataArrayIntTuple *pos4=0;
2672 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2677 self->convertToPolyTypes(&pos1,&pos1+1);
2684 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2689 self->convertToPolyTypes(pos3->begin(),pos3->end());
2693 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2697 void convertAllToPoly();
2698 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2699 bool unPolyze() throw(INTERP_KERNEL::Exception);
2700 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2701 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2702 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2705 //== MEDCouplingUMesh End
2707 //== MEDCouplingExtrudedMesh
2709 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2712 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2713 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2715 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2717 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2720 std::string __str__() const throw(INTERP_KERNEL::Exception)
2722 return self->simpleRepr();
2725 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2727 std::ostringstream oss;
2728 self->reprQuickOverview(oss);
2732 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2734 MEDCouplingUMesh *ret=self->getMesh2D();
2737 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2739 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2741 MEDCouplingUMesh *ret=self->getMesh1D();
2744 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2746 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2748 DataArrayInt *ret=self->getMesh3DIds();
2751 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2756 //== MEDCouplingExtrudedMesh End
2758 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2761 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2762 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2763 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2766 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2768 int szArr,sw,iTypppArr;
2769 std::vector<int> stdvecTyyppArr;
2770 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2771 self->insertNextCell(tmp,tmp+szArr);
2776 //== MEDCoupling1SGTUMesh
2778 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2781 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2782 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2783 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2784 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2785 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2786 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2789 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2791 return MEDCoupling1SGTUMesh::New(name,type);
2794 std::string __str__() const throw(INTERP_KERNEL::Exception)
2796 return self->simpleRepr();
2799 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2801 std::ostringstream oss;
2802 self->reprQuickOverview(oss);
2806 DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2808 DataArrayInt *ret=self->getNodalConnectivity();
2809 if(ret) ret->incrRef();
2813 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2815 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2816 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2817 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2820 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2822 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2823 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2824 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2829 //== MEDCoupling1SGTUMesh End
2831 //== MEDCoupling1DGTUMesh
2833 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2836 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2837 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2838 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2839 bool isPacked() const throw(INTERP_KERNEL::Exception);
2842 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2844 return MEDCoupling1DGTUMesh::New(name,type);
2847 std::string __str__() const throw(INTERP_KERNEL::Exception)
2849 return self->simpleRepr();
2852 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2854 std::ostringstream oss;
2855 self->reprQuickOverview(oss);
2859 DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2861 DataArrayInt *ret=self->getNodalConnectivity();
2862 if(ret) ret->incrRef();
2866 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2868 DataArrayInt *ret=self->getNodalConnectivityIndex();
2869 if(ret) ret->incrRef();
2873 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2875 DataArrayInt *ret1=0,*ret2=0;
2876 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2877 PyObject *ret0Py=ret0?Py_True:Py_False;
2879 PyObject *ret=PyTuple_New(3);
2880 PyTuple_SetItem(ret,0,ret0Py);
2881 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2882 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2886 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2889 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2890 PyObject *ret=PyTuple_New(2);
2891 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2892 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2893 PyTuple_SetItem(ret,1,ret1Py);
2897 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2899 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2900 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2901 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2904 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2906 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2907 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2908 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2911 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2913 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2914 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2915 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2920 //== MEDCoupling1DGTUMeshEnd
2922 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2925 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2926 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2929 //== MEDCouplingCMesh
2931 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2934 static MEDCouplingCMesh *New();
2935 static MEDCouplingCMesh *New(const char *meshName);
2936 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2937 void setCoords(const DataArrayDouble *coordsX,
2938 const DataArrayDouble *coordsY=0,
2939 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2940 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2944 return MEDCouplingCMesh::New();
2946 MEDCouplingCMesh(const char *meshName)
2948 return MEDCouplingCMesh::New(meshName);
2950 std::string __str__() const throw(INTERP_KERNEL::Exception)
2952 return self->simpleRepr();
2954 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2956 std::ostringstream oss;
2957 self->reprQuickOverview(oss);
2960 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2962 DataArrayDouble *ret=self->getCoordsAt(i);
2970 //== MEDCouplingCMesh End
2972 //== MEDCouplingCurveLinearMesh
2974 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2977 static MEDCouplingCurveLinearMesh *New();
2978 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2979 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2980 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2981 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2983 MEDCouplingCurveLinearMesh()
2985 return MEDCouplingCurveLinearMesh::New();
2987 MEDCouplingCurveLinearMesh(const char *meshName)
2989 return MEDCouplingCurveLinearMesh::New(meshName);
2991 std::string __str__() const throw(INTERP_KERNEL::Exception)
2993 return self->simpleRepr();
2995 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2997 std::ostringstream oss;
2998 self->reprQuickOverview(oss);
3001 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3003 DataArrayDouble *ret=self->getCoords();
3008 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3010 int szArr,sw,iTypppArr;
3011 std::vector<int> stdvecTyyppArr;
3012 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3013 self->setNodeGridStructure(tmp,tmp+szArr);
3018 //== MEDCouplingCurveLinearMesh End
3021 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3023 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3025 int sz=0,sw=-1,val1=-1;
3026 std::vector<int> val2;
3027 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3028 return self->clonePart(inp,inp+sz);
3031 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3033 DataArrayInt *ret1=0;
3035 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3036 PyObject *res=PyTuple_New(2);
3037 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3039 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3042 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3043 PyTuple_SetItem(res,1,res1);
3048 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3050 std::vector<int> vVal; int iVal=-1;
3052 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3054 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3055 DataArrayInt *ret0=0,*ret1=0;
3056 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3057 PyObject *pyRet=PyTuple_New(2);
3058 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3059 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3064 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3066 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3067 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3070 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3072 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3073 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3076 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3078 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3079 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3082 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3084 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3085 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3088 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3090 PyObject *getArrayOfDiscIds() const
3092 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3095 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3098 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3100 std::vector<int> ret1;
3101 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3102 std::size_t sz=ret0.size();
3103 PyObject *pyRet=PyTuple_New(2);
3104 PyObject *pyRet0=PyList_New((int)sz);
3105 PyObject *pyRet1=PyList_New((int)sz);
3106 for(std::size_t i=0;i<sz;i++)
3108 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3109 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3111 PyTuple_SetItem(pyRet,0,pyRet0);
3112 PyTuple_SetItem(pyRet,1,pyRet1);
3117 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3119 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3122 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3123 PyObject *ret=PyTuple_New(2);
3124 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3125 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3130 namespace ParaMEDMEM
3132 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3135 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3136 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3137 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3138 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3139 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3140 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3141 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3142 const char *getDescription() const throw(INTERP_KERNEL::Exception);
3143 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3144 const char *getName() const throw(INTERP_KERNEL::Exception);
3145 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3146 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3147 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3148 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3149 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3150 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3151 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3152 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3153 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3154 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3155 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3156 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3157 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3158 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3159 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3160 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3162 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3164 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3167 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3170 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3172 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3175 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3178 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3180 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3181 return convertIntArrToPyList3(ret);
3184 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3187 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3188 PyObject *ret=PyTuple_New(2);
3189 PyObject *ret0Py=ret0?Py_True:Py_False;
3191 PyTuple_SetItem(ret,0,ret0Py);
3192 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3196 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3198 DataArrayInt *ret1=0;
3199 MEDCouplingMesh *ret0=0;
3201 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3202 if (!SWIG_IsOK(res1))
3205 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3206 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3210 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3212 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3213 da2->checkAllocated();
3214 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3216 PyObject *res = PyList_New(2);
3217 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3218 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3222 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3224 DataArrayInt *ret1=0;
3226 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3227 PyObject *res=PyTuple_New(2);
3228 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3230 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3233 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3234 PyTuple_SetItem(res,1,res1);
3239 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3243 std::vector<int> pos2;
3244 DataArrayInt *pos3=0;
3245 DataArrayIntTuple *pos4=0;
3246 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3251 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3255 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3259 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3262 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3266 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3267 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3270 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3271 if (!SWIG_IsOK(res1))
3274 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3275 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3279 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3281 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3282 da2->checkAllocated();
3283 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3287 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3289 std::vector<int> tmp;
3290 self->getCellIdsHavingGaussLocalization(locId,tmp);
3291 DataArrayInt *ret=DataArrayInt::New();
3292 ret->alloc((int)tmp.size(),1);
3293 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3294 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3299 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3302 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3303 static MEDCouplingFieldTemplate *New(TypeOfField type);
3304 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3305 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3308 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3310 return MEDCouplingFieldTemplate::New(f);
3313 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3315 return MEDCouplingFieldTemplate::New(type);
3318 std::string __str__() const throw(INTERP_KERNEL::Exception)
3320 return self->simpleRepr();
3323 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3325 std::ostringstream oss;
3326 self->reprQuickOverview(oss);
3332 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3335 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3336 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3337 void setTimeUnit(const char *unit);
3338 const char *getTimeUnit() const;
3339 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3340 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3341 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3342 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3343 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3344 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3345 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3346 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3347 MEDCouplingFieldDouble *deepCpy() const;
3348 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3349 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3350 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3351 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3352 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3353 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3354 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3355 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3356 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3357 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3358 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3359 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3360 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3361 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3362 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3363 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3364 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3365 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3366 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3367 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3368 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3369 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3370 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3371 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3372 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3373 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3374 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3375 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3376 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3377 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3378 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3379 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3380 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3381 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3382 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3383 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3384 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3385 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3386 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3387 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3388 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3389 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3390 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3391 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3392 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3393 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3394 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3395 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3396 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3397 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3398 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3399 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3400 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3401 double getMinValue() const throw(INTERP_KERNEL::Exception);
3402 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3403 double norm2() const throw(INTERP_KERNEL::Exception);
3404 double normMax() const throw(INTERP_KERNEL::Exception);
3405 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3406 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3407 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3408 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3409 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3410 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3411 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3412 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3413 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3414 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3415 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3416 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3417 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3418 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3419 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3420 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3421 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3422 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3423 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3424 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3425 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3426 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3428 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3430 return MEDCouplingFieldDouble::New(type,td);
3433 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3435 return MEDCouplingFieldDouble::New(ft,td);
3438 std::string __str__() const throw(INTERP_KERNEL::Exception)
3440 return self->simpleRepr();
3443 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3445 std::ostringstream oss;
3446 self->reprQuickOverview(oss);
3450 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3452 DataArrayDouble *ret=self->getArray();
3458 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3460 std::vector<DataArrayDouble *> arrs=self->getArrays();
3461 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3465 PyObject *ret=PyTuple_New(sz);
3466 for(int i=0;i<sz;i++)
3469 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3471 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3476 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3478 std::vector<const DataArrayDouble *> tmp;
3479 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3481 std::vector<DataArrayDouble *> arrs(sz);
3482 for(int i=0;i<sz;i++)
3483 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3484 self->setArrays(arrs);
3487 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3489 DataArrayDouble *ret=self->getEndArray();
3495 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3499 DataArrayDoubleTuple *aa;
3500 std::vector<double> bb;
3502 const MEDCouplingMesh *mesh=self->getMesh();
3504 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3505 int spaceDim=mesh->getSpaceDimension();
3506 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3507 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3509 int sz=self->getNumberOfComponents();
3510 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3511 self->getValueOn(spaceLoc,res);
3512 return convertDblArrToPyList(res,sz);
3515 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3517 int sz=self->getNumberOfComponents();
3518 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3519 self->getValueOnPos(i,j,k,res);
3520 return convertDblArrToPyList(res,sz);
3523 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3526 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3527 if (!SWIG_IsOK(res1))
3530 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3531 const MEDCouplingMesh *mesh=self->getMesh();
3533 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3534 int spaceDim=mesh->getSpaceDimension();
3535 int nbOfPoints=size/spaceDim;
3536 if(size%spaceDim!=0)
3538 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3540 return self->getValueOnMulti(tmp,nbOfPoints);
3544 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3546 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3547 da2->checkAllocated();
3548 int size=da2->getNumberOfTuples();
3549 int nbOfCompo=da2->getNumberOfComponents();
3550 const MEDCouplingMesh *mesh=self->getMesh();
3552 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3553 if(nbOfCompo!=mesh->getSpaceDimension())
3555 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3557 return self->getValueOnMulti(da2->getConstPointer(),size);
3561 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3565 DataArrayDoubleTuple *aa;
3566 std::vector<double> bb;
3568 const MEDCouplingMesh *mesh=self->getMesh();
3570 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3571 int spaceDim=mesh->getSpaceDimension();
3572 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3573 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3576 int sz=self->getNumberOfComponents();
3577 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3578 self->getValueOn(spaceLoc,time,res);
3579 return convertDblArrToPyList(res,sz);
3582 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3584 if(self->getArray()!=0)
3585 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3588 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3589 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3590 self->setArray(arr);
3594 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3597 double tmp0=self->getTime(tmp1,tmp2);
3598 PyObject *res = PyList_New(3);
3599 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3600 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3601 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3605 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3608 double tmp0=self->getStartTime(tmp1,tmp2);
3609 PyObject *res = PyList_New(3);
3610 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3611 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3612 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3616 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3619 double tmp0=self->getEndTime(tmp1,tmp2);
3620 PyObject *res = PyList_New(3);
3621 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3622 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3623 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3626 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3628 int sz=self->getNumberOfComponents();
3629 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3630 self->accumulate(tmp);
3631 return convertDblArrToPyList(tmp,sz);
3633 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3635 int sz=self->getNumberOfComponents();
3636 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3637 self->integral(isWAbs,tmp);
3638 return convertDblArrToPyList(tmp,sz);
3640 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3642 int sz=self->getNumberOfComponents();
3643 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3644 self->getWeightedAverageValue(tmp,isWAbs);
3645 return convertDblArrToPyList(tmp,sz);
3647 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3649 int sz=self->getNumberOfComponents();
3650 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3652 return convertDblArrToPyList(tmp,sz);
3654 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3656 int sz=self->getNumberOfComponents();
3657 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3659 return convertDblArrToPyList(tmp,sz);
3661 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3664 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3665 if (!SWIG_IsOK(res1))
3668 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3669 self->renumberCells(tmp,check);
3673 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3675 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3676 da2->checkAllocated();
3677 self->renumberCells(da2->getConstPointer(),check);
3680 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3683 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3684 if (!SWIG_IsOK(res1))
3687 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3688 self->renumberNodes(tmp,eps);
3692 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3694 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3695 da2->checkAllocated();
3696 self->renumberNodes(da2->getConstPointer(),eps);
3700 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3704 std::vector<int> multiVal;
3705 std::pair<int, std::pair<int,int> > slic;
3706 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3707 const MEDCouplingMesh *mesh=self->getMesh();
3709 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3710 int nbc=mesh->getNumberOfCells();
3711 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3718 std::ostringstream oss;
3719 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3720 throw INTERP_KERNEL::Exception(oss.str().c_str());
3723 return self->buildSubPart(&singleVal,&singleVal+1);
3728 int tmp=nbc+singleVal;
3729 return self->buildSubPart(&tmp,&tmp+1);
3733 std::ostringstream oss;
3734 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3735 throw INTERP_KERNEL::Exception(oss.str().c_str());
3741 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3745 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3750 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3751 daIntTyypp->checkAllocated();
3752 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3755 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3759 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3761 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";
3762 if(PyTuple_Check(li))
3764 Py_ssize_t sz=PyTuple_Size(li);
3766 throw INTERP_KERNEL::Exception(msg);
3767 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3770 std::vector<int> multiVal;
3771 std::pair<int, std::pair<int,int> > slic;
3772 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3773 if(!self->getArray())
3774 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3776 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3777 catch(INTERP_KERNEL::Exception& e)
3778 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3779 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3780 DataArrayDouble *ret0Arr=ret0->getArray();
3782 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3787 std::vector<int> v2(1,singleVal);
3788 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3789 ret0->setArray(aarr);
3794 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3795 ret0->setArray(aarr);
3800 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3801 std::vector<int> v2(nbOfComp);
3802 for(int i=0;i<nbOfComp;i++)
3803 v2[i]=slic.first+i*slic.second.second;
3804 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3805 ret0->setArray(aarr);
3809 throw INTERP_KERNEL::Exception(msg);
3814 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3817 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3820 double r1=self->getMaxValue2(tmp);
3821 PyObject *ret=PyTuple_New(2);
3822 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3823 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3827 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3830 double r1=self->getMinValue2(tmp);
3831 PyObject *ret=PyTuple_New(2);
3832 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3833 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3837 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3839 std::vector<int> tmp;
3840 convertPyToNewIntArr3(li,tmp);
3841 return self->keepSelectedComponents(tmp);
3844 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3846 std::vector<int> tmp;
3847 convertPyToNewIntArr3(li,tmp);
3848 self->setSelectedComponents(f,tmp);
3851 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3854 DataArrayDouble *a,*a2;
3855 DataArrayDoubleTuple *aa,*aa2;
3856 std::vector<double> bb,bb2;
3859 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3860 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3861 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3862 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3864 return self->extractSlice3D(orig,vect,eps);
3867 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3869 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3872 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3874 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3877 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3879 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.";
3880 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3883 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3885 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3887 return (*self)-(*other);
3889 throw INTERP_KERNEL::Exception(msg);
3894 DataArrayDoubleTuple *aa;
3895 std::vector<double> bb;
3897 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3902 if(!self->getArray())
3903 throw INTERP_KERNEL::Exception(msg2);
3904 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3905 ret->applyLin(1.,-val);
3906 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3907 ret2->setArray(ret);
3912 if(!self->getArray())
3913 throw INTERP_KERNEL::Exception(msg2);
3914 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3915 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3916 ret2->setArray(ret);
3921 if(!self->getArray())
3922 throw INTERP_KERNEL::Exception(msg2);
3923 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3924 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3925 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3926 ret2->setArray(ret);
3931 if(!self->getArray())
3932 throw INTERP_KERNEL::Exception(msg2);
3933 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3934 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3935 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3936 ret2->setArray(ret);
3940 { throw INTERP_KERNEL::Exception(msg); }
3944 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3946 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3949 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3951 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3954 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3956 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3959 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3961 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.";
3962 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3965 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3967 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3969 return (*self)/(*other);
3971 throw INTERP_KERNEL::Exception(msg);
3976 DataArrayDoubleTuple *aa;
3977 std::vector<double> bb;
3979 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3985 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3986 if(!self->getArray())
3987 throw INTERP_KERNEL::Exception(msg2);
3988 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3989 ret->applyLin(1./val,0);
3990 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3991 ret2->setArray(ret);
3996 if(!self->getArray())
3997 throw INTERP_KERNEL::Exception(msg2);
3998 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3999 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4000 ret2->setArray(ret);
4005 if(!self->getArray())
4006 throw INTERP_KERNEL::Exception(msg2);
4007 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4008 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4009 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4010 ret2->setArray(ret);
4015 if(!self->getArray())
4016 throw INTERP_KERNEL::Exception(msg2);
4017 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4018 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4019 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4020 ret2->setArray(ret);
4024 { throw INTERP_KERNEL::Exception(msg); }
4028 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4030 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4033 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4035 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.";
4036 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4039 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4041 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4043 return (*self)^(*other);
4045 throw INTERP_KERNEL::Exception(msg);
4050 DataArrayDoubleTuple *aa;
4051 std::vector<double> bb;
4053 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4058 if(!self->getArray())
4059 throw INTERP_KERNEL::Exception(msg2);
4060 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4062 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4063 ret2->setArray(ret);
4068 if(!self->getArray())
4069 throw INTERP_KERNEL::Exception(msg2);
4070 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4071 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4072 ret2->setArray(ret);
4077 if(!self->getArray())
4078 throw INTERP_KERNEL::Exception(msg2);
4079 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4080 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4081 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4082 ret2->setArray(ret);
4087 if(!self->getArray())
4088 throw INTERP_KERNEL::Exception(msg2);
4089 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4090 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4091 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4092 ret2->setArray(ret);
4096 { throw INTERP_KERNEL::Exception(msg); }
4100 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4102 return self->negate();
4105 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4107 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.";
4108 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4111 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4113 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4117 Py_XINCREF(trueSelf);
4121 throw INTERP_KERNEL::Exception(msg);
4126 DataArrayDoubleTuple *aa;
4127 std::vector<double> bb;
4129 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4134 if(!self->getArray())
4135 throw INTERP_KERNEL::Exception(msg2);
4136 self->getArray()->applyLin(1.,val);
4137 Py_XINCREF(trueSelf);
4142 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4145 Py_XINCREF(trueSelf);
4150 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4151 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4152 ret2->setArray(aaa);
4154 Py_XINCREF(trueSelf);
4159 if(!self->getArray())
4160 throw INTERP_KERNEL::Exception(msg2);
4161 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4162 self->getArray()->addEqual(aaa);
4163 Py_XINCREF(trueSelf);
4167 { throw INTERP_KERNEL::Exception(msg); }
4171 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4173 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.";
4174 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4177 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4179 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4183 Py_XINCREF(trueSelf);
4187 throw INTERP_KERNEL::Exception(msg);
4192 DataArrayDoubleTuple *aa;
4193 std::vector<double> bb;
4195 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4200 if(!self->getArray())
4201 throw INTERP_KERNEL::Exception(msg2);
4202 self->getArray()->applyLin(1.,-val);
4203 Py_XINCREF(trueSelf);
4208 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4211 Py_XINCREF(trueSelf);
4216 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4217 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4218 ret2->setArray(aaa);
4220 Py_XINCREF(trueSelf);
4225 if(!self->getArray())
4226 throw INTERP_KERNEL::Exception(msg2);
4227 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4228 self->getArray()->substractEqual(aaa);
4229 Py_XINCREF(trueSelf);
4233 { throw INTERP_KERNEL::Exception(msg); }
4237 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4239 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.";
4240 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4243 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4245 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4249 Py_XINCREF(trueSelf);
4253 throw INTERP_KERNEL::Exception(msg);
4258 DataArrayDoubleTuple *aa;
4259 std::vector<double> bb;
4261 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4266 if(!self->getArray())
4267 throw INTERP_KERNEL::Exception(msg2);
4268 self->getArray()->applyLin(val,0);
4269 Py_XINCREF(trueSelf);
4274 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4277 Py_XINCREF(trueSelf);
4282 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4283 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4284 ret2->setArray(aaa);
4286 Py_XINCREF(trueSelf);
4291 if(!self->getArray())
4292 throw INTERP_KERNEL::Exception(msg2);
4293 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4294 self->getArray()->multiplyEqual(aaa);
4295 Py_XINCREF(trueSelf);
4299 { throw INTERP_KERNEL::Exception(msg); }
4303 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4305 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.";
4306 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4309 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4311 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4315 Py_XINCREF(trueSelf);
4319 throw INTERP_KERNEL::Exception(msg);
4324 DataArrayDoubleTuple *aa;
4325 std::vector<double> bb;
4327 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4333 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4334 if(!self->getArray())
4335 throw INTERP_KERNEL::Exception(msg2);
4336 self->getArray()->applyLin(1./val,0);
4337 Py_XINCREF(trueSelf);
4342 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4345 Py_XINCREF(trueSelf);
4350 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4351 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4352 ret2->setArray(aaa);
4354 Py_XINCREF(trueSelf);
4359 if(!self->getArray())
4360 throw INTERP_KERNEL::Exception(msg2);
4361 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4362 self->getArray()->divideEqual(aaa);
4363 Py_XINCREF(trueSelf);
4367 { throw INTERP_KERNEL::Exception(msg); }
4371 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4373 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.";
4374 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4377 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4379 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4383 Py_XINCREF(trueSelf);
4387 throw INTERP_KERNEL::Exception(msg);
4392 DataArrayDoubleTuple *aa;
4393 std::vector<double> bb;
4395 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4400 if(!self->getArray())
4401 throw INTERP_KERNEL::Exception(msg2);
4402 self->getArray()->applyPow(val);
4403 Py_XINCREF(trueSelf);
4408 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4411 Py_XINCREF(trueSelf);
4416 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4417 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4418 ret2->setArray(aaa);
4420 Py_XINCREF(trueSelf);
4425 if(!self->getArray())
4426 throw INTERP_KERNEL::Exception(msg2);
4427 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4428 self->getArray()->powEqual(aaa);
4429 Py_XINCREF(trueSelf);
4433 { throw INTERP_KERNEL::Exception(msg); }
4437 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4439 std::vector<const MEDCouplingFieldDouble *> tmp;
4440 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4441 return MEDCouplingFieldDouble::MergeFields(tmp);
4444 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4446 std::vector<const MEDCouplingFieldDouble *> tmp;
4447 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4448 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4453 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4456 int getNumberOfFields() const;
4457 MEDCouplingMultiFields *deepCpy() const;
4458 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4459 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4460 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4461 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4462 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4465 std::string __str__() const throw(INTERP_KERNEL::Exception)
4467 return self->simpleRepr();
4469 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4471 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4472 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4474 std::vector<MEDCouplingFieldDouble *> fs(sz);
4475 for(int i=0;i<sz;i++)
4476 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4477 return MEDCouplingMultiFields::New(fs);
4479 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4481 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4482 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4484 std::vector<MEDCouplingFieldDouble *> fs(sz);
4485 for(int i=0;i<sz;i++)
4486 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4487 return MEDCouplingMultiFields::New(fs);
4489 PyObject *getFields() const
4491 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4492 int sz=fields.size();
4493 PyObject *res = PyList_New(sz);
4494 for(int i=0;i<sz;i++)
4498 fields[i]->incrRef();
4499 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4503 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4508 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4510 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4514 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4517 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4519 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4521 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4523 PyObject *res = PyList_New(sz);
4524 for(int i=0;i<sz;i++)
4529 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4533 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4538 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4540 std::vector<int> refs;
4541 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4543 PyObject *res = PyList_New(sz);
4544 for(int i=0;i<sz;i++)
4549 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4553 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4557 PyObject *ret=PyTuple_New(2);
4558 PyTuple_SetItem(ret,0,res);
4559 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4562 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4564 std::vector<DataArrayDouble *> ms=self->getArrays();
4566 PyObject *res = PyList_New(sz);
4567 for(int i=0;i<sz;i++)
4572 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4576 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4581 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4583 std::vector< std::vector<int> > refs;
4584 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4586 PyObject *res = PyList_New(sz);
4587 PyObject *res2 = PyList_New(sz);
4588 for(int i=0;i<sz;i++)
4593 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4597 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4599 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4602 PyObject *ret=PyTuple_New(2);
4603 PyTuple_SetItem(ret,0,res);
4604 PyTuple_SetItem(ret,1,res2);
4610 class MEDCouplingDefinitionTime
4613 MEDCouplingDefinitionTime();
4614 void assign(const MEDCouplingDefinitionTime& other);
4615 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4616 double getTimeResolution() const;
4617 std::vector<double> getHotSpotsTime() const;
4620 std::string __str__() const throw(INTERP_KERNEL::Exception)
4622 std::ostringstream oss;
4623 self->appendRepr(oss);
4627 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4629 int meshId,arrId,arrIdInField,fieldId;
4630 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4631 PyObject *res=PyList_New(4);
4632 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4633 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4634 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4635 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4639 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4641 int meshId,arrId,arrIdInField,fieldId;
4642 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4643 PyObject *res=PyList_New(4);
4644 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4645 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4646 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4647 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4653 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4656 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4657 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4661 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4663 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4664 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4666 std::vector<MEDCouplingFieldDouble *> fs(sz);
4667 for(int i=0;i<sz;i++)
4668 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4669 return MEDCouplingFieldOverTime::New(fs);
4671 std::string __str__() const throw(INTERP_KERNEL::Exception)
4673 return self->simpleRepr();
4675 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4677 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4678 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4680 std::vector<MEDCouplingFieldDouble *> fs(sz);
4681 for(int i=0;i<sz;i++)
4682 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4683 return MEDCouplingFieldOverTime::New(fs);
4691 __filename=os.environ.get('PYTHONSTARTUP')
4692 if __filename and os.path.isfile(__filename):
4693 execfile(__filename)