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::deepCpy;
225 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
226 %newobject ParaMEDMEM::DataArray::selectByTupleId;
227 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
228 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
229 %newobject ParaMEDMEM::DataArray::Aggregate;
230 %newobject ParaMEDMEM::DataArrayInt::New;
231 %newobject ParaMEDMEM::DataArrayInt::__iter__;
232 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
233 %newobject ParaMEDMEM::DataArrayInt::performCpy;
234 %newobject ParaMEDMEM::DataArrayInt::substr;
235 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
236 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
237 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
238 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
239 %newobject ParaMEDMEM::DataArrayInt::renumber;
240 %newobject ParaMEDMEM::DataArrayInt::renumberR;
241 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
244 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
249 %newobject ParaMEDMEM::DataArrayInt::negate;
250 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
251 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
252 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
253 %newobject ParaMEDMEM::DataArrayInt::Meld;
254 %newobject ParaMEDMEM::DataArrayInt::Add;
255 %newobject ParaMEDMEM::DataArrayInt::Substract;
256 %newobject ParaMEDMEM::DataArrayInt::Multiply;
257 %newobject ParaMEDMEM::DataArrayInt::Divide;
258 %newobject ParaMEDMEM::DataArrayInt::Pow;
259 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
260 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
261 %newobject ParaMEDMEM::DataArrayInt::Range;
262 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
264 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
265 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
267 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
268 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
269 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
270 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
271 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
272 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
273 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
274 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
275 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
276 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
277 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
278 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
279 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
280 %newobject ParaMEDMEM::DataArrayInt::__neg__;
281 %newobject ParaMEDMEM::DataArrayInt::__add__;
282 %newobject ParaMEDMEM::DataArrayInt::__radd__;
283 %newobject ParaMEDMEM::DataArrayInt::__sub__;
284 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
285 %newobject ParaMEDMEM::DataArrayInt::__mul__;
286 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
287 %newobject ParaMEDMEM::DataArrayInt::__div__;
288 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
289 %newobject ParaMEDMEM::DataArrayInt::__mod__;
290 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
291 %newobject ParaMEDMEM::DataArrayInt::__pow__;
292 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
293 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
294 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
295 %newobject ParaMEDMEM::DataArrayChar::renumber;
296 %newobject ParaMEDMEM::DataArrayChar::renumberR;
297 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
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::performCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
317 %newobject ParaMEDMEM::DataArrayDouble::Meld;
318 %newobject ParaMEDMEM::DataArrayDouble::Dot;
319 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
320 %newobject ParaMEDMEM::DataArrayDouble::Add;
321 %newobject ParaMEDMEM::DataArrayDouble::Substract;
322 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
323 %newobject ParaMEDMEM::DataArrayDouble::Divide;
324 %newobject ParaMEDMEM::DataArrayDouble::Pow;
325 %newobject ParaMEDMEM::DataArrayDouble::substr;
326 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
327 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
328 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
329 %newobject ParaMEDMEM::DataArrayDouble::negate;
330 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
331 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
332 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
333 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
334 %newobject ParaMEDMEM::DataArrayDouble::determinant;
335 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
336 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
337 %newobject ParaMEDMEM::DataArrayDouble::inverse;
338 %newobject ParaMEDMEM::DataArrayDouble::trace;
339 %newobject ParaMEDMEM::DataArrayDouble::deviator;
340 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
341 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
342 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
343 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
344 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
345 %newobject ParaMEDMEM::DataArrayDouble::renumber;
346 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
347 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
348 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
349 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
350 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
351 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
352 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
353 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
354 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
355 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
356 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
357 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
358 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
359 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
360 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
361 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
362 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
363 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
364 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
365 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
366 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
367 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
368 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
369 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
370 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
371 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
372 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
373 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
374 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
375 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
376 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
377 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
378 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
379 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
380 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
381 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
382 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
383 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
384 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
385 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
386 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
398 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
399 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
441 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
442 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
443 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
444 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
445 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
446 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
447 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
448 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
450 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
451 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
452 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
453 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
456 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
457 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
458 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
459 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
460 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
461 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
462 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
463 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
464 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
465 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
466 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
467 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
468 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
469 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
470 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
472 %feature("unref") DataArray "$this->decrRef();"
473 %feature("unref") DataArrayDouble "$this->decrRef();"
474 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
475 %feature("unref") MEDCouplingMesh "$this->decrRef();"
476 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
477 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
478 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
479 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
480 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
481 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
482 %feature("unref") DataArrayInt "$this->decrRef();"
483 %feature("unref") DataArrayChar "$this->decrRef();"
484 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
485 %feature("unref") DataArrayByte "$this->decrRef();"
486 %feature("unref") MEDCouplingField "$this->decrRef();"
487 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
488 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
489 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
490 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
491 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
492 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
493 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
494 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
495 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
497 %rename(assign) *::operator=;
498 %ignore ParaMEDMEM::RefCountObject::decrRef;
499 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
500 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
501 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
502 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
506 %rename (InterpKernelException) INTERP_KERNEL::Exception;
508 namespace INTERP_KERNEL
513 Exception(const char* what);
514 ~Exception() throw ();
515 const char *what() const throw ();
518 std::string __str__() const
520 return std::string(self->what());
531 void declareAsNew() const;
532 virtual void updateTime() const;
533 unsigned int getTimeOfThis() const;
561 CONST_ON_TIME_INTERVAL = 7
562 } TypeOfTimeDiscretization;
564 const char *MEDCouplingVersionStr();
565 int MEDCouplingVersion();
566 int MEDCouplingSizeOfVoidStar();
572 RefCountObject(const RefCountObject& other);
575 bool decrRef() const;
576 void incrRef() const;
577 int getRCValue() const;
578 virtual std::size_t getHeapMemorySize() const;
584 PyObject *MEDCouplingVersionMajMinRel()
586 int tmp0=0,tmp1=0,tmp2=0;
587 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
588 PyObject *res = PyList_New(3);
589 PyList_SetItem(res,0,SWIG_From_int(tmp0));
590 PyList_SetItem(res,1,SWIG_From_int(tmp1));
591 PyList_SetItem(res,2,SWIG_From_int(tmp2));
595 bool MEDCouplingHasNumPyBindings()
604 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
606 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
607 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
608 if(PyRun_SimpleString(script)!=0)
609 throw INTERP_KERNEL::Exception(oss.str().c_str());
610 return std::string(script);
614 %include "MEDCouplingMemArray.i"
621 UNSTRUCTURED_DESC = 6,
625 } MEDCouplingMeshType;
628 class DataArrayDouble;
629 class MEDCouplingUMesh;
630 class MEDCouplingFieldDouble;
632 %extend RefCountObject
634 std::string getHiddenCppPointer() const
636 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
641 %extend MEDCouplingGaussLocalization
643 std::string __str__() const throw(INTERP_KERNEL::Exception)
645 return self->getStringRepr();
648 std::string __repr__() const throw(INTERP_KERNEL::Exception)
650 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
651 oss << self->getStringRepr();
658 class MEDCouplingMesh : public RefCountObject, public TimeLabel
661 void setName(const char *name);
662 std::string getName() const;
663 void setDescription(const char *descr);
664 std::string getDescription() const;
665 void setTime(double val, int iteration, int order);
666 void setTimeUnit(const char *unit);
667 const char *getTimeUnit() const;
668 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
669 bool isStructured() const throw(INTERP_KERNEL::Exception);
670 virtual MEDCouplingMesh *deepCpy() const;
671 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
672 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
673 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
674 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
675 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
676 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
677 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
678 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
679 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
680 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
681 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
682 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
683 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
684 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
685 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
686 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
687 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
688 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
689 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
690 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
691 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
692 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
693 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
694 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
695 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
697 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
698 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
699 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
700 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
701 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
702 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
703 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
704 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
705 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
706 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
707 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
708 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
709 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
710 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
711 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
712 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
713 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
716 std::string __str__() const throw(INTERP_KERNEL::Exception)
718 return self->simpleRepr();
721 PyObject *getTime() throw(INTERP_KERNEL::Exception)
724 double tmp0=self->getTime(tmp1,tmp2);
725 PyObject *res = PyList_New(3);
726 PyList_SetItem(res,0,SWIG_From_double(tmp0));
727 PyList_SetItem(res,1,SWIG_From_int(tmp1));
728 PyList_SetItem(res,2,SWIG_From_int(tmp2));
732 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
736 DataArrayDoubleTuple *aa;
737 std::vector<double> bb;
739 int spaceDim=self->getSpaceDimension();
740 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
741 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
742 return self->getCellContainingPoint(pos,eps);
745 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
749 DataArrayDoubleTuple *aa;
750 std::vector<double> bb;
752 int spaceDim=self->getSpaceDimension();
753 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
754 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
755 std::vector<int> elts,eltsIndex;
756 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
757 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
758 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
759 d0->alloc(elts.size(),1);
760 d1->alloc(eltsIndex.size(),1);
761 std::copy(elts.begin(),elts.end(),d0->getPointer());
762 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
763 PyObject *ret=PyTuple_New(2);
764 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
765 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
769 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
771 std::vector<int> elts,eltsIndex;
772 int spaceDim=self->getSpaceDimension();
774 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
775 if (!SWIG_IsOK(res1))
778 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
779 int nbOfPoints=size/spaceDim;
782 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
784 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
788 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
790 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
791 da2->checkAllocated();
792 int size=da2->getNumberOfTuples();
793 int nbOfCompo=da2->getNumberOfComponents();
794 if(nbOfCompo!=spaceDim)
796 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
798 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
800 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
801 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
802 d0->alloc(elts.size(),1);
803 d1->alloc(eltsIndex.size(),1);
804 std::copy(elts.begin(),elts.end(),d0->getPointer());
805 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
806 PyObject *ret=PyTuple_New(2);
807 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
808 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
812 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
816 DataArrayDoubleTuple *aa;
817 std::vector<double> bb;
819 int spaceDim=self->getSpaceDimension();
820 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
821 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
822 std::vector<int> elts;
823 self->getCellsContainingPoint(pos,eps,elts);
824 DataArrayInt *ret=DataArrayInt::New();
825 ret->alloc((int)elts.size(),1);
826 std::copy(elts.begin(),elts.end(),ret->getPointer());
827 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
830 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
833 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
834 if (!SWIG_IsOK(res1))
837 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
838 self->renumberCells(tmp,check);
842 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
844 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
845 da2->checkAllocated();
846 self->renumberCells(da2->getConstPointer(),check);
850 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
852 DataArrayInt *cellCor, *nodeCor;
853 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
854 PyObject *res = PyList_New(2);
855 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
856 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
860 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
862 DataArrayInt *cellCor=0,*nodeCor=0;
863 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
864 PyObject *res = PyList_New(2);
865 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
866 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
870 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
872 DataArrayInt *cellCor=0;
873 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
877 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
880 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
881 if (!SWIG_IsOK(res1))
884 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
885 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
889 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
891 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
892 da2->checkAllocated();
893 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
896 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
898 std::vector<int> conn;
899 self->getNodeIdsOfCell(cellId,conn);
900 return convertIntArrToPyList2(conn);
903 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
905 std::vector<double> coo;
906 self->getCoordinatesOfNode(nodeId,coo);
907 return convertDblArrToPyList2(coo);
910 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
914 DataArrayDoubleTuple *aa;
915 std::vector<double> bb;
917 int spaceDim=self->getSpaceDimension();
918 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
919 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
920 self->scale(pointPtr,factor);
923 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
925 int spaceDim=self->getSpaceDimension();
926 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
927 self->getBoundingBox(tmp);
928 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
932 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
935 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
936 PyObject *ret=PyTuple_New(2);
937 PyObject *ret0Py=ret0?Py_True:Py_False;
939 PyTuple_SetItem(ret,0,ret0Py);
940 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
944 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
946 int szArr,sw,iTypppArr;
947 std::vector<int> stdvecTyyppArr;
948 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
949 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
950 if(sw==3)//DataArrayInt
952 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
953 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
954 std::string name=argpt->getName();
956 ret->setName(name.c_str());
958 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
961 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
963 int szArr,sw,iTypppArr;
964 std::vector<int> stdvecTyyppArr;
966 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
967 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
968 if(sw==3)//DataArrayInt
970 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
971 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
972 std::string name=argpt->getName();
974 ret->setName(name.c_str());
977 PyObject *res = PyList_New(2);
978 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
979 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
980 PyList_SetItem(res,0,obj0);
981 PyList_SetItem(res,1,obj1);
985 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
989 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
990 PyObject *res = PyTuple_New(2);
991 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
994 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
996 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
997 PyTuple_SetItem(res,0,obj0);
998 PyTuple_SetItem(res,1,obj1);
1002 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1004 std::vector<int> vals=self->getDistributionOfTypes();
1005 if(vals.size()%3!=0)
1006 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1007 PyObject *ret=PyList_New((int)vals.size()/3);
1008 for(int j=0;j<(int)vals.size()/3;j++)
1010 PyObject *ret1=PyList_New(3);
1011 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1012 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1013 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1014 PyList_SetItem(ret,j,ret1);
1019 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1021 std::vector<int> code;
1022 std::vector<const DataArrayInt *> idsPerType;
1023 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1024 convertPyToNewIntArr4(li,1,3,code);
1025 return self->checkTypeConsistencyAndContig(code,idsPerType);
1028 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1030 std::vector<int> code;
1031 std::vector<DataArrayInt *> idsInPflPerType;
1032 std::vector<DataArrayInt *> idsPerType;
1033 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1034 PyObject *ret=PyTuple_New(3);
1036 if(code.size()%3!=0)
1037 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1038 PyObject *ret0=PyList_New((int)code.size()/3);
1039 for(int j=0;j<(int)code.size()/3;j++)
1041 PyObject *ret00=PyList_New(3);
1042 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1043 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1044 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1045 PyList_SetItem(ret0,j,ret00);
1047 PyTuple_SetItem(ret,0,ret0);
1049 PyObject *ret1=PyList_New(idsInPflPerType.size());
1050 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1051 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052 PyTuple_SetItem(ret,1,ret1);
1053 int n=idsPerType.size();
1054 PyObject *ret2=PyList_New(n);
1055 for(int i=0;i<n;i++)
1056 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1057 PyTuple_SetItem(ret,2,ret2);
1061 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1065 DataArrayDoubleTuple *aa;
1066 std::vector<double> bb;
1068 int spaceDim=self->getSpaceDimension();
1069 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1070 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1071 self->translate(vectorPtr);
1074 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1076 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1079 DataArrayDoubleTuple *aa;
1080 std::vector<double> bb;
1082 int spaceDim=self->getSpaceDimension();
1083 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1084 self->rotate(centerPtr,0,alpha);
1087 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1089 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1091 DataArrayDouble *a,*a2;
1092 DataArrayDoubleTuple *aa,*aa2;
1093 std::vector<double> bb,bb2;
1095 int spaceDim=self->getSpaceDimension();
1096 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1097 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
1098 self->rotate(centerPtr,vectorPtr,alpha);
1101 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1103 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1104 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1105 PyObject *res=PyList_New(result.size());
1106 for(int i=0;iL!=result.end(); i++, iL++)
1107 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1111 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1113 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1114 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1115 return MEDCouplingMesh::MergeMeshes(tmp);
1121 //== MEDCouplingMesh End
1123 %include "NormalizedUnstructuredMesh.hxx"
1124 %include "MEDCouplingNatureOfField.hxx"
1125 %include "MEDCouplingTimeDiscretization.hxx"
1126 %include "MEDCouplingGaussLocalization.hxx"
1127 %include "MEDCouplingFieldDiscretization.hxx"
1129 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1130 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1131 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1133 //== MEDCouplingPointSet
1135 namespace ParaMEDMEM
1137 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1140 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1141 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1142 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1143 void zipCoords() throw(INTERP_KERNEL::Exception);
1144 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1145 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1146 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1147 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1148 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1149 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1150 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1151 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1152 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1153 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1154 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1155 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1156 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1157 virtual DataArrayInt *findBoundaryNodes() const;
1158 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1159 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1160 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1161 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1162 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1165 std::string __str__() const throw(INTERP_KERNEL::Exception)
1167 return self->simpleRepr();
1170 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1173 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1174 PyObject *res = PyList_New(2);
1175 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1176 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1180 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1182 DataArrayInt *comm, *commIndex;
1183 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1184 PyObject *res = PyList_New(2);
1185 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1186 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1190 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1192 DataArrayDouble *ret1=self->getCoords();
1195 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1198 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1200 int szArr,sw,iTypppArr;
1201 std::vector<int> stdvecTyyppArr;
1202 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1203 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1204 if(sw==3)//DataArrayInt
1206 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1207 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1208 std::string name=argpt->getName();
1210 ret->setName(name.c_str());
1212 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1215 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1217 int szArr,sw,iTypppArr;
1218 std::vector<int> stdvecTyyppArr;
1219 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1220 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1221 if(sw==3)//DataArrayInt
1223 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1224 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1225 std::string name=argpt->getName();
1227 ret->setName(name.c_str());
1229 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1232 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1234 int szArr,sw,iTypppArr;
1235 std::vector<int> stdvecTyyppArr;
1236 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1237 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1238 if(sw==3)//DataArrayInt
1240 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1241 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1242 std::string name=argpt->getName();
1244 ret->setName(name.c_str());
1246 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1249 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1251 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1252 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1255 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1257 int szArr,sw,iTypppArr;
1258 std::vector<int> stdvecTyyppArr;
1259 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1260 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1261 if(sw==3)//DataArrayInt
1263 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1264 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1265 std::string name=argpt->getName();
1267 ret->setName(name.c_str());
1269 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1272 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1274 int szArr,sw,iTypppArr;
1275 std::vector<int> stdvecTyyppArr;
1276 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1277 self->renumberNodes(tmp,newNbOfNodes);
1280 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1282 int szArr,sw,iTypppArr;
1283 std::vector<int> stdvecTyyppArr;
1284 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1285 self->renumberNodes2(tmp,newNbOfNodes);
1288 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1290 int spaceDim=self->getSpaceDimension();
1292 DataArrayDouble *a,*a2;
1293 DataArrayDoubleTuple *aa,*aa2;
1294 std::vector<double> bb,bb2;
1296 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1297 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1298 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1299 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1300 std::vector<int> nodes;
1301 self->findNodesOnLine(p,v,eps,nodes);
1302 DataArrayInt *ret=DataArrayInt::New();
1303 ret->alloc((int)nodes.size(),1);
1304 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1305 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1307 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1309 int spaceDim=self->getSpaceDimension();
1311 DataArrayDouble *a,*a2;
1312 DataArrayDoubleTuple *aa,*aa2;
1313 std::vector<double> bb,bb2;
1315 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1316 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1317 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1318 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1319 std::vector<int> nodes;
1320 self->findNodesOnPlane(p,v,eps,nodes);
1321 DataArrayInt *ret=DataArrayInt::New();
1322 ret->alloc((int)nodes.size(),1);
1323 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1324 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1327 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1331 DataArrayDoubleTuple *aa;
1332 std::vector<double> bb;
1334 int spaceDim=self->getSpaceDimension();
1335 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1336 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1337 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1338 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1341 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1343 DataArrayInt *c=0,*cI=0;
1347 DataArrayDoubleTuple *aa;
1348 std::vector<double> bb;
1350 int spaceDim=self->getSpaceDimension();
1351 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1352 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1353 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1354 PyObject *ret=PyTuple_New(2);
1355 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1356 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1360 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1362 DataArrayInt *c=0,*cI=0;
1363 int spaceDim=self->getSpaceDimension();
1366 DataArrayDoubleTuple *aa;
1367 std::vector<double> bb;
1370 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1371 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1373 PyObject *ret=PyTuple_New(2);
1374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1375 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1379 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1383 DataArrayDoubleTuple *aa;
1384 std::vector<double> bb;
1386 int spaceDim=self->getSpaceDimension();
1387 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1388 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1390 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1391 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1394 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1398 std::vector<int> multiVal;
1399 std::pair<int, std::pair<int,int> > slic;
1400 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1401 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1405 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1407 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1409 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1411 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1415 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1417 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1418 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1419 self->getReverseNodalConnectivity(d0,d1);
1420 PyObject *ret=PyTuple_New(2);
1421 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1428 DataArrayInt *v0=0,*v1=0;
1429 self->findCommonCells(compType,startCellId,v0,v1);
1430 PyObject *res = PyList_New(2);
1431 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1432 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1437 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1440 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1441 if (!SWIG_IsOK(res1))
1444 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1445 self->renumberNodesInConn(tmp);
1449 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1451 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1452 da2->checkAllocated();
1453 self->renumberNodesInConn(da2->getConstPointer());
1457 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1460 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1461 PyObject *ret=PyTuple_New(2);
1462 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1463 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1467 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1469 DataArrayInt *ret=0;
1471 int szArr,sw,iTypppArr;
1472 std::vector<int> stdvecTyyppArr;
1473 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1474 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1478 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1482 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1483 PyObject *res = PyList_New(3);
1484 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1485 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1486 PyList_SetItem(res,2,SWIG_From_int(ret2));
1490 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1494 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1495 PyObject *res = PyList_New(3);
1496 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1497 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1498 PyList_SetItem(res,2,SWIG_From_int(ret2));
1502 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1505 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1506 if (!SWIG_IsOK(res1))
1509 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1510 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1514 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1516 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1517 da2->checkAllocated();
1518 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1522 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1526 std::vector<int> multiVal;
1527 std::pair<int, std::pair<int,int> > slic;
1528 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1529 int nbc=self->getNumberOfCells();
1530 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1537 std::ostringstream oss;
1538 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1539 throw INTERP_KERNEL::Exception(oss.str().c_str());
1542 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1547 int tmp=nbc+singleVal;
1548 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1552 std::ostringstream oss;
1553 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1554 throw INTERP_KERNEL::Exception(oss.str().c_str());
1560 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1564 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1569 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1570 daIntTyypp->checkAllocated();
1571 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1574 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1578 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1581 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1582 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1583 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1584 for(int i=0;i<sz;i++)
1585 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1588 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1591 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1593 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1594 std::vector<double> val3;
1595 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1596 "Rotate2DAlg",2,true,nbNodes);
1598 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1599 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1602 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1605 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1606 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1607 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1608 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1609 for(int i=0;i<sz;i++)
1610 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1613 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1616 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1618 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1619 std::vector<double> val3;
1620 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1621 "Rotate3DAlg",3,true,nbNodes);
1623 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1624 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1625 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1630 //== MEDCouplingPointSet End
1632 class MEDCouplingUMeshCell
1635 INTERP_KERNEL::NormalizedCellType getType() const;
1638 std::string __str__() const throw(INTERP_KERNEL::Exception)
1640 return self->repr();
1643 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1646 const int *r=self->getAllConn(ret2);
1647 PyObject *ret=PyTuple_New(ret2);
1648 for(int i=0;i<ret2;i++)
1649 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1655 class MEDCouplingUMeshCellIterator
1662 MEDCouplingUMeshCell *ret=self->nextt();
1664 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1667 PyErr_SetString(PyExc_StopIteration,"No more data.");
1674 class MEDCouplingUMeshCellByTypeIterator
1677 ~MEDCouplingUMeshCellByTypeIterator();
1682 MEDCouplingUMeshCellEntry *ret=self->nextt();
1684 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1687 PyErr_SetString(PyExc_StopIteration,"No more data.");
1694 class MEDCouplingUMeshCellByTypeEntry
1697 ~MEDCouplingUMeshCellByTypeEntry();
1700 MEDCouplingUMeshCellByTypeIterator *__iter__()
1702 return self->iterator();
1707 class MEDCouplingUMeshCellEntry
1710 INTERP_KERNEL::NormalizedCellType getType() const;
1711 int getNumberOfElems() const;
1714 MEDCouplingUMeshCellIterator *__iter__()
1716 return self->iterator();
1721 //== MEDCouplingUMesh
1723 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1726 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1727 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1728 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1729 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1730 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1731 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1732 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1733 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1734 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1735 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1736 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1737 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1738 void computeTypes() throw(INTERP_KERNEL::Exception);
1739 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1740 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1742 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1743 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1744 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1745 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1746 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1747 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1748 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1749 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1750 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1751 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1752 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1753 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1754 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1755 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1756 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1757 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1758 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1759 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1760 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1761 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1762 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1763 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1764 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1765 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1766 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1767 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1768 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1769 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1770 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1771 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1772 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1773 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1774 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1775 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1776 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1777 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1778 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1779 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1780 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1782 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1784 return MEDCouplingUMesh::New();
1787 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1789 return MEDCouplingUMesh::New(meshName,meshDim);
1792 std::string __str__() const throw(INTERP_KERNEL::Exception)
1794 return self->simpleRepr();
1797 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1799 std::ostringstream oss;
1800 self->reprQuickOverview(oss);
1804 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1806 return self->cellIterator();
1809 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1813 std::vector<int> multiVal;
1814 std::pair<int, std::pair<int,int> > slic;
1815 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1816 int nbc=self->getNumberOfCells();
1817 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1824 std::ostringstream oss;
1825 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1826 throw INTERP_KERNEL::Exception(oss.str().c_str());
1830 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1837 int tmp=nbc+singleVal;
1838 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1843 std::ostringstream oss;
1844 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1845 throw INTERP_KERNEL::Exception(oss.str().c_str());
1851 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1857 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1858 daIntTyypp->checkAllocated();
1859 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1863 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1867 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1871 std::vector<int> multiVal;
1872 std::pair<int, std::pair<int,int> > slic;
1873 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1874 int nbc=self->getNumberOfCells();
1875 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1882 std::ostringstream oss;
1883 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1884 throw INTERP_KERNEL::Exception(oss.str().c_str());
1888 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1895 int tmp=nbc+singleVal;
1896 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1901 std::ostringstream oss;
1902 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1903 throw INTERP_KERNEL::Exception(oss.str().c_str());
1909 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1914 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1920 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1921 daIntTyypp->checkAllocated();
1922 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1926 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1930 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1932 int szArr,sw,iTypppArr;
1933 std::vector<int> stdvecTyyppArr;
1934 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1937 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1938 throw INTERP_KERNEL::Exception(oss.str().c_str());
1940 self->insertNextCell(type,size,tmp);
1943 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1945 int szArr,sw,iTypppArr;
1946 std::vector<int> stdvecTyyppArr;
1947 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1948 self->insertNextCell(type,szArr,tmp);
1951 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1953 DataArrayInt *ret=self->getNodalConnectivity();
1958 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1960 DataArrayInt *ret=self->getNodalConnectivityIndex();
1965 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1967 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1968 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1969 PyObject *res = PyList_New(result.size());
1970 for (int i=0;iL!=result.end(); i++, iL++)
1971 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1975 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1977 int szArr,sw,iTypppArr;
1978 std::vector<int> stdvecTyyppArr;
1979 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1980 int nbOfDepthPeelingPerformed=0;
1981 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1982 PyObject *res=PyTuple_New(2);
1983 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1984 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1988 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1990 DataArrayInt *v0=0,*v1=0;
1991 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1992 PyObject *res = PyList_New(2);
1993 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1994 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1998 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2002 DataArrayDoubleTuple *aa;
2003 std::vector<double> bb;
2005 int nbOfCompo=self->getSpaceDimension();
2006 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2009 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2010 PyObject *ret=PyTuple_New(2);
2011 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2012 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2016 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2018 DataArrayInt *ret1=0;
2019 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2020 PyObject *ret=PyTuple_New(2);
2021 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2022 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2026 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2029 DataArrayInt *ret1(0);
2030 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2031 PyObject *ret=PyTuple_New(3);
2032 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2033 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2034 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2038 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2040 std::vector<int> cells;
2041 self->checkButterflyCells(cells,eps);
2042 DataArrayInt *ret=DataArrayInt::New();
2043 ret->alloc((int)cells.size(),1);
2044 std::copy(cells.begin(),cells.end(),ret->getPointer());
2045 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2048 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2050 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2052 PyObject *ret = PyList_New(sz);
2053 for(int i=0;i<sz;i++)
2054 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2058 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2060 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2061 int sz=retCpp.size();
2062 PyObject *ret=PyList_New(sz);
2063 for(int i=0;i<sz;i++)
2064 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2068 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2071 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2072 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2073 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2076 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2079 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2080 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2084 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2087 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2088 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2092 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2094 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2095 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2096 PyObject *ret=PyTuple_New(3);
2097 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2098 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2099 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2103 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2105 DataArrayInt *tmp0=0,*tmp1=0;
2106 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2107 PyObject *ret=PyTuple_New(2);
2108 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2109 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2113 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2117 std::vector<int> multiVal;
2118 std::pair<int, std::pair<int,int> > slic;
2119 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2120 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2124 return self->duplicateNodes(&singleVal,&singleVal+1);
2126 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2128 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2130 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2134 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2138 std::vector<int> multiVal;
2139 std::pair<int, std::pair<int,int> > slic;
2140 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2141 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2145 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2147 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2149 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2151 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2155 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2158 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2159 DataArrayInt *tmp0,*tmp1=0;
2160 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2161 PyObject *ret=PyTuple_New(2);
2162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2167 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2169 DataArrayInt *ret0=0,*ret1=0;
2170 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2171 PyObject *ret=PyTuple_New(2);
2172 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2179 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2180 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2181 DataArrayInt *ret1=0,*ret2=0;
2182 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2183 PyObject *ret=PyTuple_New(3);
2184 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2185 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2192 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2193 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2194 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2195 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2198 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2201 std::vector<const MEDCouplingUMesh *> meshes;
2202 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2203 std::vector<DataArrayInt *> corr;
2204 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2206 PyObject *ret1=PyList_New(sz);
2207 for(int i=0;i<sz;i++)
2208 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209 PyObject *ret=PyList_New(2);
2210 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2211 PyList_SetItem(ret,1,ret1);
2215 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2217 std::vector<MEDCouplingUMesh *> meshes;
2218 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2219 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2222 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2224 std::vector<MEDCouplingUMesh *> meshes;
2225 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2226 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2229 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2233 std::vector<int> multiVal;
2234 std::pair<int, std::pair<int,int> > slic;
2235 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2237 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2238 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2242 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2244 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2246 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2248 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2252 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2254 DataArrayInt *arrOut=0,*arrIndexOut=0;
2257 std::vector<int> multiVal;
2258 std::pair<int, std::pair<int,int> > slic;
2259 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2261 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2262 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2267 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2272 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2277 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2281 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2283 PyObject *ret=PyTuple_New(2);
2284 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2285 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2289 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2291 DataArrayInt *arrOut=0,*arrIndexOut=0;
2292 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2293 PyObject *ret=PyTuple_New(2);
2294 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2295 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2299 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2301 if(!PySlice_Check(slic))
2302 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2303 Py_ssize_t strt=2,stp=2,step=2;
2304 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2306 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2307 arrIndxIn->checkAllocated();
2308 if(arrIndxIn->getNumberOfComponents()!=1)
2309 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2310 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2311 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2312 DataArrayInt *arrOut=0,*arrIndexOut=0;
2313 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2314 PyObject *ret=PyTuple_New(2);
2315 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2316 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2320 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2321 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2322 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2324 DataArrayInt *arrOut=0,*arrIndexOut=0;
2327 std::vector<int> multiVal;
2328 std::pair<int, std::pair<int,int> > slic;
2329 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2331 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2332 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2337 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2342 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2347 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2351 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2353 PyObject *ret=PyTuple_New(2);
2354 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2355 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2359 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2360 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2364 std::vector<int> multiVal;
2365 std::pair<int, std::pair<int,int> > slic;
2366 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2368 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2369 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2374 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2379 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2384 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2388 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2392 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2396 DataArrayDoubleTuple *aa;
2397 std::vector<double> bb;
2399 int spaceDim=self->getSpaceDimension();
2400 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2401 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2403 std::vector<int> cells;
2404 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2405 DataArrayInt *ret=DataArrayInt::New();
2406 ret->alloc((int)cells.size(),1);
2407 std::copy(cells.begin(),cells.end(),ret->getPointer());
2408 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2411 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2415 DataArrayDoubleTuple *aa;
2416 std::vector<double> bb;
2418 int spaceDim=self->getSpaceDimension();
2419 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2420 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2421 self->orientCorrectly2DCells(v,polyOnly);
2424 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2426 std::vector<int> cells;
2427 self->arePolyhedronsNotCorrectlyOriented(cells);
2428 DataArrayInt *ret=DataArrayInt::New();
2429 ret->alloc((int)cells.size(),1);
2430 std::copy(cells.begin(),cells.end(),ret->getPointer());
2431 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2434 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2438 self->getFastAveragePlaneOfThis(vec,pos);
2440 std::copy(vec,vec+3,vals);
2441 std::copy(pos,pos+3,vals+3);
2442 return convertDblArrToPyListOfTuple(vals,3,2);
2445 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2447 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2448 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2449 return MEDCouplingUMesh::MergeUMeshes(tmp);
2452 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2455 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2456 PyObject *ret=PyTuple_New(2);
2457 PyObject *ret0Py=ret0?Py_True:Py_False;
2459 PyTuple_SetItem(ret,0,ret0Py);
2460 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2464 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2467 bool ret0=self->areCellsIncludedIn2(other,ret1);
2468 PyObject *ret=PyTuple_New(2);
2469 PyObject *ret0Py=ret0?Py_True:Py_False;
2471 PyTuple_SetItem(ret,0,ret0Py);
2472 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2478 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2479 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2481 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2482 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2483 PyObject *ret=PyTuple_New(5);
2484 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2485 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2487 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2488 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2492 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2494 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2495 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2496 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2498 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2499 PyObject *ret=PyTuple_New(5);
2500 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2501 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2502 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2503 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2504 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2508 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2510 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2511 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2512 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2513 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2514 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2515 PyObject *ret=PyTuple_New(5);
2516 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2517 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2518 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2519 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2520 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2526 DataArrayInt *neighbors=0,*neighborsIdx=0;
2527 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2528 PyObject *ret=PyTuple_New(2);
2529 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2530 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2536 DataArrayInt *neighbors=0,*neighborsIdx=0;
2537 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2538 PyObject *ret=PyTuple_New(2);
2539 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2546 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2547 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2548 DataArrayInt *d2,*d3,*d4,*dd5;
2549 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2550 PyObject *ret=PyTuple_New(7);
2551 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2552 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2553 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2554 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2557 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2561 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2564 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2565 da->checkAllocated();
2566 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2569 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2572 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2573 da->checkAllocated();
2574 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2577 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2580 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2581 da->checkAllocated();
2582 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2585 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2588 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2589 da->checkAllocated();
2590 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2591 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2592 PyObject *res = PyList_New(result.size());
2593 for (int i=0;iL!=result.end(); i++, iL++)
2594 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2598 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2601 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2602 da->checkAllocated();
2603 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2604 ret->setName(da->getName().c_str());
2608 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2610 DataArrayInt *cellNb1=0,*cellNb2=0;
2611 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2612 PyObject *ret=PyTuple_New(3);
2613 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2614 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2615 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2619 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2621 int spaceDim=self->getSpaceDimension();
2623 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2625 DataArrayDouble *a,*a2;
2626 DataArrayDoubleTuple *aa,*aa2;
2627 std::vector<double> bb,bb2;
2629 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2630 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2631 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2632 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2634 DataArrayInt *cellIds=0;
2635 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2636 PyObject *ret=PyTuple_New(2);
2637 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2638 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2642 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2644 int spaceDim=self->getSpaceDimension();
2646 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2648 DataArrayDouble *a,*a2;
2649 DataArrayDoubleTuple *aa,*aa2;
2650 std::vector<double> bb,bb2;
2652 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2653 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2654 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2655 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2657 DataArrayInt *cellIds=0;
2658 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2659 PyObject *ret=PyTuple_New(2);
2660 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2667 int spaceDim=self->getSpaceDimension();
2669 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2671 DataArrayDouble *a,*a2;
2672 DataArrayDoubleTuple *aa,*aa2;
2673 std::vector<double> bb,bb2;
2675 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2676 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2677 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2678 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2679 return self->getCellIdsCrossingPlane(orig,vect,eps);
2682 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2686 std::vector<int> pos2;
2687 DataArrayInt *pos3=0;
2688 DataArrayIntTuple *pos4=0;
2689 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2694 self->convertToPolyTypes(&pos1,&pos1+1);
2701 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2706 self->convertToPolyTypes(pos3->begin(),pos3->end());
2710 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2714 void convertAllToPoly();
2715 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2716 bool unPolyze() throw(INTERP_KERNEL::Exception);
2717 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2718 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2719 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2722 //== MEDCouplingUMesh End
2724 //== MEDCouplingExtrudedMesh
2726 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2729 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2730 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2732 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2734 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2737 std::string __str__() const throw(INTERP_KERNEL::Exception)
2739 return self->simpleRepr();
2742 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2744 std::ostringstream oss;
2745 self->reprQuickOverview(oss);
2749 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2751 MEDCouplingUMesh *ret=self->getMesh2D();
2754 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2756 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2758 MEDCouplingUMesh *ret=self->getMesh1D();
2761 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2763 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2765 DataArrayInt *ret=self->getMesh3DIds();
2768 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2773 //== MEDCouplingExtrudedMesh End
2775 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2778 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2779 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2780 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2781 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2782 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2783 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2786 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2788 int szArr,sw,iTypppArr;
2789 std::vector<int> stdvecTyyppArr;
2790 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2791 self->insertNextCell(tmp,tmp+szArr);
2794 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2796 DataArrayInt *ret=self->getNodalConnectivity();
2797 if(ret) ret->incrRef();
2801 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2803 std::vector< const MEDCoupling1GTUMesh *> parts;
2804 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2805 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2810 //== MEDCoupling1SGTUMesh
2812 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2815 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2816 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2817 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2818 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2819 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2820 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2821 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2824 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2826 return MEDCoupling1SGTUMesh::New(name,type);
2829 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2831 return MEDCoupling1SGTUMesh::New(m);
2834 std::string __str__() const throw(INTERP_KERNEL::Exception)
2836 return self->simpleRepr();
2839 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2841 std::ostringstream oss;
2842 self->reprQuickOverview(oss);
2846 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2848 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2849 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2850 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2853 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2855 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2856 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2857 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2862 //== MEDCoupling1SGTUMesh End
2864 //== MEDCoupling1DGTUMesh
2866 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2869 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2870 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2871 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2872 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2873 bool isPacked() const throw(INTERP_KERNEL::Exception);
2876 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2878 return MEDCoupling1DGTUMesh::New(name,type);
2881 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2883 return MEDCoupling1DGTUMesh::New(m);
2886 std::string __str__() const throw(INTERP_KERNEL::Exception)
2888 return self->simpleRepr();
2891 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2893 std::ostringstream oss;
2894 self->reprQuickOverview(oss);
2898 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2900 DataArrayInt *ret=self->getNodalConnectivityIndex();
2901 if(ret) ret->incrRef();
2905 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2907 DataArrayInt *ret1=0,*ret2=0;
2908 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2909 PyObject *ret0Py=ret0?Py_True:Py_False;
2911 PyObject *ret=PyTuple_New(3);
2912 PyTuple_SetItem(ret,0,ret0Py);
2913 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2914 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2918 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2921 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2922 PyObject *ret=PyTuple_New(2);
2923 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2924 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2925 PyTuple_SetItem(ret,1,ret1Py);
2929 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2931 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2932 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2933 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2936 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2938 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2939 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2940 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2943 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2945 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2946 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2947 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2952 //== MEDCoupling1DGTUMeshEnd
2954 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2957 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2958 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2959 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2960 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2961 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2962 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2965 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2967 int tmpp1=-1,tmpp2=-1;
2968 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2969 std::vector< std::pair<int,int> > inp;
2973 for(int i=0;i<tmpp1;i++)
2974 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2979 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2980 inp.resize(tmpp1/2);
2981 for(int i=0;i<tmpp1/2;i++)
2982 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2985 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2986 return self->buildStructuredSubPart(inp);
2989 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2991 int tmpp1=-1,tmpp2=-1;
2992 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2993 std::vector< std::pair<int,int> > inp;
2997 for(int i=0;i<tmpp1;i++)
2998 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3003 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
3004 inp.resize(tmpp1/2);
3005 for(int i=0;i<tmpp1/2;i++)
3006 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3009 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
3011 int szArr,sw,iTypppArr;
3012 std::vector<int> stdvecTyyppArr;
3013 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3014 std::vector<int> tmp5(tmp4,tmp4+szArr);
3016 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3019 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3021 int szArr,sw,iTypppArr;
3022 std::vector<int> stdvecTyyppArr;
3023 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3024 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3027 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3029 int szArr,sw,iTypppArr;
3030 std::vector<int> stdvecTyyppArr;
3031 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3032 int szArr2,sw2,iTypppArr2;
3033 std::vector<int> stdvecTyyppArr2;
3034 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3035 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3036 std::vector< std::pair<int,int> > partCompactFormat;
3037 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3038 PyObject *ret=PyTuple_New(2);
3039 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3040 PyTuple_SetItem(ret,0,ret0Py);
3041 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3042 for(std::size_t i=0;i<partCompactFormat.size();i++)
3044 PyObject *tmp4=PyTuple_New(2);
3045 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3046 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3047 PyList_SetItem(ret1Py,i,tmp4);
3049 PyTuple_SetItem(ret,1,ret1Py);
3055 //== MEDCouplingCMesh
3057 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3060 static MEDCouplingCMesh *New();
3061 static MEDCouplingCMesh *New(const char *meshName);
3062 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3063 void setCoords(const DataArrayDouble *coordsX,
3064 const DataArrayDouble *coordsY=0,
3065 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3066 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3070 return MEDCouplingCMesh::New();
3072 MEDCouplingCMesh(const char *meshName)
3074 return MEDCouplingCMesh::New(meshName);
3076 std::string __str__() const throw(INTERP_KERNEL::Exception)
3078 return self->simpleRepr();
3080 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3082 std::ostringstream oss;
3083 self->reprQuickOverview(oss);
3086 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3088 DataArrayDouble *ret=self->getCoordsAt(i);
3096 //== MEDCouplingCMesh End
3098 //== MEDCouplingCurveLinearMesh
3100 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3103 static MEDCouplingCurveLinearMesh *New();
3104 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3105 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3106 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3108 MEDCouplingCurveLinearMesh()
3110 return MEDCouplingCurveLinearMesh::New();
3112 MEDCouplingCurveLinearMesh(const char *meshName)
3114 return MEDCouplingCurveLinearMesh::New(meshName);
3116 std::string __str__() const throw(INTERP_KERNEL::Exception)
3118 return self->simpleRepr();
3120 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3122 std::ostringstream oss;
3123 self->reprQuickOverview(oss);
3126 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3128 DataArrayDouble *ret=self->getCoords();
3133 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3135 int szArr,sw,iTypppArr;
3136 std::vector<int> stdvecTyyppArr;
3137 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3138 self->setNodeGridStructure(tmp,tmp+szArr);
3143 //== MEDCouplingCurveLinearMesh End
3146 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3148 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3150 int sz=0,sw=-1,val1=-1;
3151 std::vector<int> val2;
3152 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3153 return self->clonePart(inp,inp+sz);
3156 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3158 DataArrayInt *ret1=0;
3160 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3161 PyObject *res=PyTuple_New(2);
3162 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3164 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3167 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3168 PyTuple_SetItem(res,1,res1);
3173 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3175 std::vector<int> vVal; int iVal=-1;
3177 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3179 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3180 DataArrayInt *ret0=0,*ret1=0;
3181 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3182 PyObject *pyRet=PyTuple_New(2);
3183 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3184 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3188 int getNumberOfTuplesExpectedRegardingCode(const MEDCouplingMesh *mesh, PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3190 std::vector<int> inp0;
3191 convertPyToNewIntArr4(code,1,3,inp0);
3192 std::vector<const DataArrayInt *> inp1;
3193 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3194 return self->getNumberOfTuplesExpectedRegardingCode(mesh,inp0,inp1);
3198 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3200 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3201 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3204 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3206 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3207 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3210 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3212 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3213 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3216 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3218 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3219 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3222 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3224 PyObject *getArrayOfDiscIds() const
3226 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3229 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3232 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3234 std::vector<int> ret1;
3235 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3236 std::size_t sz=ret0.size();
3237 PyObject *pyRet=PyTuple_New(2);
3238 PyObject *pyRet0=PyList_New((int)sz);
3239 PyObject *pyRet1=PyList_New((int)sz);
3240 for(std::size_t i=0;i<sz;i++)
3242 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3243 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3245 PyTuple_SetItem(pyRet,0,pyRet0);
3246 PyTuple_SetItem(pyRet,1,pyRet1);
3251 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3253 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3256 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3257 PyObject *ret=PyTuple_New(2);
3258 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3259 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3264 namespace ParaMEDMEM
3266 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3269 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3270 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3271 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3272 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3273 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3274 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3275 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3276 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3277 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3278 std::string getName() const throw(INTERP_KERNEL::Exception);
3279 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3280 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3281 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3282 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3283 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3284 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3285 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3286 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3287 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3288 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3289 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3290 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3291 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3292 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3293 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3294 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3296 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3298 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3301 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3304 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3306 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3309 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3312 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3314 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3315 return convertIntArrToPyList3(ret);
3318 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3321 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3322 PyObject *ret=PyTuple_New(2);
3323 PyObject *ret0Py=ret0?Py_True:Py_False;
3325 PyTuple_SetItem(ret,0,ret0Py);
3326 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3330 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3332 DataArrayInt *ret1=0;
3333 MEDCouplingMesh *ret0=0;
3335 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3336 if (!SWIG_IsOK(res1))
3339 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3340 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3344 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3346 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3347 da2->checkAllocated();
3348 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3350 PyObject *res = PyList_New(2);
3351 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3352 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3356 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3358 DataArrayInt *ret1=0;
3360 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3361 PyObject *res=PyTuple_New(2);
3362 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3364 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3367 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3368 PyTuple_SetItem(res,1,res1);
3373 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3377 std::vector<int> pos2;
3378 DataArrayInt *pos3=0;
3379 DataArrayIntTuple *pos4=0;
3380 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3385 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3389 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3393 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3396 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3400 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3401 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3404 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3405 if (!SWIG_IsOK(res1))
3408 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3409 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3413 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3415 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3416 da2->checkAllocated();
3417 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3421 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3423 std::vector<int> tmp;
3424 self->getCellIdsHavingGaussLocalization(locId,tmp);
3425 DataArrayInt *ret=DataArrayInt::New();
3426 ret->alloc((int)tmp.size(),1);
3427 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3428 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3431 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3433 std::vector<int> inp0;
3434 convertPyToNewIntArr4(code,1,3,inp0);
3435 std::vector<const DataArrayInt *> inp1;
3436 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3437 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3442 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3445 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3446 static MEDCouplingFieldTemplate *New(TypeOfField type);
3447 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3448 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3451 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3453 return MEDCouplingFieldTemplate::New(f);
3456 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3458 return MEDCouplingFieldTemplate::New(type);
3461 std::string __str__() const throw(INTERP_KERNEL::Exception)
3463 return self->simpleRepr();
3466 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3468 std::ostringstream oss;
3469 self->reprQuickOverview(oss);
3475 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3478 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3479 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3480 void setTimeUnit(const char *unit);
3481 const char *getTimeUnit() const;
3482 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3483 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3484 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3485 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3486 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3487 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3488 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3489 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3490 MEDCouplingFieldDouble *deepCpy() const;
3491 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3492 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3493 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3494 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3495 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3496 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3497 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3498 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3499 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3500 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3501 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3502 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3503 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3504 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3505 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3506 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3507 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3508 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3509 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3510 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3511 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3512 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3513 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3514 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3515 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3516 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3517 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3518 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3519 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3520 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3521 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3522 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3523 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3524 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3525 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3526 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3527 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3528 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3529 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3530 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3531 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3532 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3533 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3534 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3535 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3536 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3537 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3538 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3539 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3540 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3541 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3542 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3543 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3544 double getMinValue() const throw(INTERP_KERNEL::Exception);
3545 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3546 double norm2() const throw(INTERP_KERNEL::Exception);
3547 double normMax() const throw(INTERP_KERNEL::Exception);
3548 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3549 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3550 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3551 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3552 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3553 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3554 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3555 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3556 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3557 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3558 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3559 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3560 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3561 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3562 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3563 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3564 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3565 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3566 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3567 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3568 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3569 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3571 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3573 return MEDCouplingFieldDouble::New(type,td);
3576 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3578 return MEDCouplingFieldDouble::New(ft,td);
3581 std::string __str__() const throw(INTERP_KERNEL::Exception)
3583 return self->simpleRepr();
3586 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3588 std::ostringstream oss;
3589 self->reprQuickOverview(oss);
3593 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3595 DataArrayDouble *ret=self->getArray();
3601 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3603 std::vector<DataArrayDouble *> arrs=self->getArrays();
3604 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3608 PyObject *ret=PyTuple_New(sz);
3609 for(int i=0;i<sz;i++)
3612 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3614 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3619 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3621 std::vector<const DataArrayDouble *> tmp;
3622 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3624 std::vector<DataArrayDouble *> arrs(sz);
3625 for(int i=0;i<sz;i++)
3626 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3627 self->setArrays(arrs);
3630 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3632 DataArrayDouble *ret=self->getEndArray();
3638 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3642 DataArrayDoubleTuple *aa;
3643 std::vector<double> bb;
3645 const MEDCouplingMesh *mesh=self->getMesh();
3647 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3648 int spaceDim=mesh->getSpaceDimension();
3649 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3650 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3652 int sz=self->getNumberOfComponents();
3653 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3654 self->getValueOn(spaceLoc,res);
3655 return convertDblArrToPyList(res,sz);
3658 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3660 int sz=self->getNumberOfComponents();
3661 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3662 self->getValueOnPos(i,j,k,res);
3663 return convertDblArrToPyList(res,sz);
3666 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3669 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3670 if (!SWIG_IsOK(res1))
3673 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3674 const MEDCouplingMesh *mesh=self->getMesh();
3676 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3677 int spaceDim=mesh->getSpaceDimension();
3678 int nbOfPoints=size/spaceDim;
3679 if(size%spaceDim!=0)
3681 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3683 return self->getValueOnMulti(tmp,nbOfPoints);
3687 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3689 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3690 da2->checkAllocated();
3691 int size=da2->getNumberOfTuples();
3692 int nbOfCompo=da2->getNumberOfComponents();
3693 const MEDCouplingMesh *mesh=self->getMesh();
3695 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3696 if(nbOfCompo!=mesh->getSpaceDimension())
3698 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3700 return self->getValueOnMulti(da2->getConstPointer(),size);
3704 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3708 DataArrayDoubleTuple *aa;
3709 std::vector<double> bb;
3711 const MEDCouplingMesh *mesh=self->getMesh();
3713 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3714 int spaceDim=mesh->getSpaceDimension();
3715 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3716 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3719 int sz=self->getNumberOfComponents();
3720 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3721 self->getValueOn(spaceLoc,time,res);
3722 return convertDblArrToPyList(res,sz);
3725 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3727 if(self->getArray()!=0)
3728 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3731 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3732 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3733 self->setArray(arr);
3737 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3740 double tmp0=self->getTime(tmp1,tmp2);
3741 PyObject *res = PyList_New(3);
3742 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3743 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3744 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3748 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3751 double tmp0=self->getStartTime(tmp1,tmp2);
3752 PyObject *res = PyList_New(3);
3753 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3754 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3755 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3759 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3762 double tmp0=self->getEndTime(tmp1,tmp2);
3763 PyObject *res = PyList_New(3);
3764 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3765 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3766 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3769 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3771 int sz=self->getNumberOfComponents();
3772 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3773 self->accumulate(tmp);
3774 return convertDblArrToPyList(tmp,sz);
3776 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3778 int sz=self->getNumberOfComponents();
3779 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3780 self->integral(isWAbs,tmp);
3781 return convertDblArrToPyList(tmp,sz);
3783 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3785 int sz=self->getNumberOfComponents();
3786 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3787 self->getWeightedAverageValue(tmp,isWAbs);
3788 return convertDblArrToPyList(tmp,sz);
3790 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3792 int sz=self->getNumberOfComponents();
3793 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3795 return convertDblArrToPyList(tmp,sz);
3797 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3799 int sz=self->getNumberOfComponents();
3800 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3802 return convertDblArrToPyList(tmp,sz);
3804 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3806 int szArr,sw,iTypppArr;
3807 std::vector<int> stdvecTyyppArr;
3808 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3809 self->renumberCells(tmp,check);
3812 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3814 int szArr,sw,iTypppArr;
3815 std::vector<int> stdvecTyyppArr;
3816 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3817 self->renumberCellsWithoutMesh(tmp,check);
3820 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3822 int szArr,sw,iTypppArr;
3823 std::vector<int> stdvecTyyppArr;
3824 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3825 self->renumberNodes(tmp,eps);
3828 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3830 int szArr,sw,iTypppArr;
3831 std::vector<int> stdvecTyyppArr;
3832 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3833 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3836 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3840 std::vector<int> multiVal;
3841 std::pair<int, std::pair<int,int> > slic;
3842 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3843 const MEDCouplingMesh *mesh=self->getMesh();
3845 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3846 int nbc=mesh->getNumberOfCells();
3847 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3854 std::ostringstream oss;
3855 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3856 throw INTERP_KERNEL::Exception(oss.str().c_str());
3859 return self->buildSubPart(&singleVal,&singleVal+1);
3864 int tmp=nbc+singleVal;
3865 return self->buildSubPart(&tmp,&tmp+1);
3869 std::ostringstream oss;
3870 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3871 throw INTERP_KERNEL::Exception(oss.str().c_str());
3877 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3881 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3886 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3887 daIntTyypp->checkAllocated();
3888 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3891 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3895 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3897 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";
3898 if(PyTuple_Check(li))
3900 Py_ssize_t sz=PyTuple_Size(li);
3902 throw INTERP_KERNEL::Exception(msg);
3903 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3906 std::vector<int> multiVal;
3907 std::pair<int, std::pair<int,int> > slic;
3908 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3909 if(!self->getArray())
3910 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3912 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3913 catch(INTERP_KERNEL::Exception& e)
3914 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3915 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3916 DataArrayDouble *ret0Arr=ret0->getArray();
3918 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3923 std::vector<int> v2(1,singleVal);
3924 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3925 ret0->setArray(aarr);
3930 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3931 ret0->setArray(aarr);
3936 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3937 std::vector<int> v2(nbOfComp);
3938 for(int i=0;i<nbOfComp;i++)
3939 v2[i]=slic.first+i*slic.second.second;
3940 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3941 ret0->setArray(aarr);
3945 throw INTERP_KERNEL::Exception(msg);
3950 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3953 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3956 double r1=self->getMaxValue2(tmp);
3957 PyObject *ret=PyTuple_New(2);
3958 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3959 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3963 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3966 double r1=self->getMinValue2(tmp);
3967 PyObject *ret=PyTuple_New(2);
3968 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3969 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3973 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3975 std::vector<int> tmp;
3976 convertPyToNewIntArr3(li,tmp);
3977 return self->keepSelectedComponents(tmp);
3980 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3982 std::vector<int> tmp;
3983 convertPyToNewIntArr3(li,tmp);
3984 self->setSelectedComponents(f,tmp);
3987 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3990 DataArrayDouble *a,*a2;
3991 DataArrayDoubleTuple *aa,*aa2;
3992 std::vector<double> bb,bb2;
3995 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3996 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3997 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3998 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4000 return self->extractSlice3D(orig,vect,eps);
4003 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4005 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4008 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4010 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4013 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4015 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.";
4016 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4019 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4021 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4023 return (*self)-(*other);
4025 throw INTERP_KERNEL::Exception(msg);
4030 DataArrayDoubleTuple *aa;
4031 std::vector<double> bb;
4033 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4038 if(!self->getArray())
4039 throw INTERP_KERNEL::Exception(msg2);
4040 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4041 ret->applyLin(1.,-val);
4042 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4043 ret2->setArray(ret);
4048 if(!self->getArray())
4049 throw INTERP_KERNEL::Exception(msg2);
4050 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4051 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4052 ret2->setArray(ret);
4057 if(!self->getArray())
4058 throw INTERP_KERNEL::Exception(msg2);
4059 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4060 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4061 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4062 ret2->setArray(ret);
4067 if(!self->getArray())
4068 throw INTERP_KERNEL::Exception(msg2);
4069 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4070 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4071 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4072 ret2->setArray(ret);
4076 { throw INTERP_KERNEL::Exception(msg); }
4080 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4082 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4085 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4087 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4090 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4092 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4095 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4097 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.";
4098 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4101 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4103 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4105 return (*self)/(*other);
4107 throw INTERP_KERNEL::Exception(msg);
4112 DataArrayDoubleTuple *aa;
4113 std::vector<double> bb;
4115 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4121 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4122 if(!self->getArray())
4123 throw INTERP_KERNEL::Exception(msg2);
4124 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4125 ret->applyLin(1./val,0);
4126 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4127 ret2->setArray(ret);
4132 if(!self->getArray())
4133 throw INTERP_KERNEL::Exception(msg2);
4134 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4135 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4136 ret2->setArray(ret);
4141 if(!self->getArray())
4142 throw INTERP_KERNEL::Exception(msg2);
4143 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4144 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4145 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4146 ret2->setArray(ret);
4151 if(!self->getArray())
4152 throw INTERP_KERNEL::Exception(msg2);
4153 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4154 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4155 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4156 ret2->setArray(ret);
4160 { throw INTERP_KERNEL::Exception(msg); }
4164 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4166 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4169 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4171 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.";
4172 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4175 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4177 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4179 return (*self)^(*other);
4181 throw INTERP_KERNEL::Exception(msg);
4186 DataArrayDoubleTuple *aa;
4187 std::vector<double> bb;
4189 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4194 if(!self->getArray())
4195 throw INTERP_KERNEL::Exception(msg2);
4196 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4198 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4199 ret2->setArray(ret);
4204 if(!self->getArray())
4205 throw INTERP_KERNEL::Exception(msg2);
4206 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4207 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4208 ret2->setArray(ret);
4213 if(!self->getArray())
4214 throw INTERP_KERNEL::Exception(msg2);
4215 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4216 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4217 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4218 ret2->setArray(ret);
4223 if(!self->getArray())
4224 throw INTERP_KERNEL::Exception(msg2);
4225 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4226 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4227 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4228 ret2->setArray(ret);
4232 { throw INTERP_KERNEL::Exception(msg); }
4236 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4238 return self->negate();
4241 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4243 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.";
4244 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4247 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4249 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4253 Py_XINCREF(trueSelf);
4257 throw INTERP_KERNEL::Exception(msg);
4262 DataArrayDoubleTuple *aa;
4263 std::vector<double> bb;
4265 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4270 if(!self->getArray())
4271 throw INTERP_KERNEL::Exception(msg2);
4272 self->getArray()->applyLin(1.,val);
4273 Py_XINCREF(trueSelf);
4278 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4281 Py_XINCREF(trueSelf);
4286 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4287 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4288 ret2->setArray(aaa);
4290 Py_XINCREF(trueSelf);
4295 if(!self->getArray())
4296 throw INTERP_KERNEL::Exception(msg2);
4297 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4298 self->getArray()->addEqual(aaa);
4299 Py_XINCREF(trueSelf);
4303 { throw INTERP_KERNEL::Exception(msg); }
4307 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4309 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.";
4310 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4313 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4315 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4319 Py_XINCREF(trueSelf);
4323 throw INTERP_KERNEL::Exception(msg);
4328 DataArrayDoubleTuple *aa;
4329 std::vector<double> bb;
4331 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4336 if(!self->getArray())
4337 throw INTERP_KERNEL::Exception(msg2);
4338 self->getArray()->applyLin(1.,-val);
4339 Py_XINCREF(trueSelf);
4344 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4347 Py_XINCREF(trueSelf);
4352 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4353 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4354 ret2->setArray(aaa);
4356 Py_XINCREF(trueSelf);
4361 if(!self->getArray())
4362 throw INTERP_KERNEL::Exception(msg2);
4363 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4364 self->getArray()->substractEqual(aaa);
4365 Py_XINCREF(trueSelf);
4369 { throw INTERP_KERNEL::Exception(msg); }
4373 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4375 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.";
4376 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4379 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4381 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4385 Py_XINCREF(trueSelf);
4389 throw INTERP_KERNEL::Exception(msg);
4394 DataArrayDoubleTuple *aa;
4395 std::vector<double> bb;
4397 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4402 if(!self->getArray())
4403 throw INTERP_KERNEL::Exception(msg2);
4404 self->getArray()->applyLin(val,0);
4405 Py_XINCREF(trueSelf);
4410 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4413 Py_XINCREF(trueSelf);
4418 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4419 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4420 ret2->setArray(aaa);
4422 Py_XINCREF(trueSelf);
4427 if(!self->getArray())
4428 throw INTERP_KERNEL::Exception(msg2);
4429 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4430 self->getArray()->multiplyEqual(aaa);
4431 Py_XINCREF(trueSelf);
4435 { throw INTERP_KERNEL::Exception(msg); }
4439 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4441 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.";
4442 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4445 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4447 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4451 Py_XINCREF(trueSelf);
4455 throw INTERP_KERNEL::Exception(msg);
4460 DataArrayDoubleTuple *aa;
4461 std::vector<double> bb;
4463 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4469 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4470 if(!self->getArray())
4471 throw INTERP_KERNEL::Exception(msg2);
4472 self->getArray()->applyLin(1./val,0);
4473 Py_XINCREF(trueSelf);
4478 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4481 Py_XINCREF(trueSelf);
4486 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4487 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4488 ret2->setArray(aaa);
4490 Py_XINCREF(trueSelf);
4495 if(!self->getArray())
4496 throw INTERP_KERNEL::Exception(msg2);
4497 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4498 self->getArray()->divideEqual(aaa);
4499 Py_XINCREF(trueSelf);
4503 { throw INTERP_KERNEL::Exception(msg); }
4507 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4509 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.";
4510 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4513 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4515 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4519 Py_XINCREF(trueSelf);
4523 throw INTERP_KERNEL::Exception(msg);
4528 DataArrayDoubleTuple *aa;
4529 std::vector<double> bb;
4531 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4536 if(!self->getArray())
4537 throw INTERP_KERNEL::Exception(msg2);
4538 self->getArray()->applyPow(val);
4539 Py_XINCREF(trueSelf);
4544 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4547 Py_XINCREF(trueSelf);
4552 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4553 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4554 ret2->setArray(aaa);
4556 Py_XINCREF(trueSelf);
4561 if(!self->getArray())
4562 throw INTERP_KERNEL::Exception(msg2);
4563 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4564 self->getArray()->powEqual(aaa);
4565 Py_XINCREF(trueSelf);
4569 { throw INTERP_KERNEL::Exception(msg); }
4573 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4575 std::vector<const MEDCouplingFieldDouble *> tmp;
4576 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4577 return MEDCouplingFieldDouble::MergeFields(tmp);
4580 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4582 std::vector<const MEDCouplingFieldDouble *> tmp;
4583 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4584 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4589 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4592 int getNumberOfFields() const;
4593 MEDCouplingMultiFields *deepCpy() const;
4594 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4595 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4596 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4597 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4598 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4601 std::string __str__() const throw(INTERP_KERNEL::Exception)
4603 return self->simpleRepr();
4605 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4607 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4608 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4610 std::vector<MEDCouplingFieldDouble *> fs(sz);
4611 for(int i=0;i<sz;i++)
4612 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4613 return MEDCouplingMultiFields::New(fs);
4615 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4617 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4618 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4620 std::vector<MEDCouplingFieldDouble *> fs(sz);
4621 for(int i=0;i<sz;i++)
4622 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4623 return MEDCouplingMultiFields::New(fs);
4625 PyObject *getFields() const
4627 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4628 int sz=fields.size();
4629 PyObject *res = PyList_New(sz);
4630 for(int i=0;i<sz;i++)
4634 fields[i]->incrRef();
4635 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4639 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4644 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4646 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4650 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4653 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4655 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4657 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4659 PyObject *res = PyList_New(sz);
4660 for(int i=0;i<sz;i++)
4665 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4669 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4674 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4676 std::vector<int> refs;
4677 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4679 PyObject *res = PyList_New(sz);
4680 for(int i=0;i<sz;i++)
4685 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4689 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4693 PyObject *ret=PyTuple_New(2);
4694 PyTuple_SetItem(ret,0,res);
4695 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4698 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4700 std::vector<DataArrayDouble *> ms=self->getArrays();
4702 PyObject *res = PyList_New(sz);
4703 for(int i=0;i<sz;i++)
4708 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4712 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4717 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4719 std::vector< std::vector<int> > refs;
4720 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4722 PyObject *res = PyList_New(sz);
4723 PyObject *res2 = PyList_New(sz);
4724 for(int i=0;i<sz;i++)
4729 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4733 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4735 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4738 PyObject *ret=PyTuple_New(2);
4739 PyTuple_SetItem(ret,0,res);
4740 PyTuple_SetItem(ret,1,res2);
4746 class MEDCouplingDefinitionTime
4749 MEDCouplingDefinitionTime();
4750 void assign(const MEDCouplingDefinitionTime& other);
4751 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4752 double getTimeResolution() const;
4753 std::vector<double> getHotSpotsTime() const;
4756 std::string __str__() const throw(INTERP_KERNEL::Exception)
4758 std::ostringstream oss;
4759 self->appendRepr(oss);
4763 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4765 int meshId,arrId,arrIdInField,fieldId;
4766 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4767 PyObject *res=PyList_New(4);
4768 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4769 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4770 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4771 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4775 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4777 int meshId,arrId,arrIdInField,fieldId;
4778 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4779 PyObject *res=PyList_New(4);
4780 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4781 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4782 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4783 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4789 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4792 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4793 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4797 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4799 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4800 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4802 std::vector<MEDCouplingFieldDouble *> fs(sz);
4803 for(int i=0;i<sz;i++)
4804 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4805 return MEDCouplingFieldOverTime::New(fs);
4807 std::string __str__() const throw(INTERP_KERNEL::Exception)
4809 return self->simpleRepr();
4811 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4813 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4814 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4816 std::vector<MEDCouplingFieldDouble *> fs(sz);
4817 for(int i=0;i<sz;i++)
4818 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4819 return MEDCouplingFieldOverTime::New(fs);
4827 __filename=os.environ.get('PYTHONSTARTUP')
4828 if __filename and os.path.isfile(__filename):
4829 execfile(__filename)