1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #define MEDCOUPLING_EXPORT
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingTypemaps.i"
45 #include "InterpKernelAutoPtr.hxx"
47 using namespace ParaMEDMEM;
48 using namespace INTERP_KERNEL;
52 %template(ivec) std::vector<int>;
53 %template(dvec) std::vector<double>;
54 %template(svec) std::vector<std::string>;
57 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
59 $result=convertMesh($1,$owner);
62 %typemap(out) MEDCouplingMesh*
64 $result=convertMesh($1,$owner);
69 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingPointSet*
76 $result=convertMesh($1,$owner);
82 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
84 $result=convertMesh($1,$owner);
87 %typemap(out) MEDCoupling1GTUMesh*
89 $result=convertMesh($1,$owner);
94 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
96 $result=convertMesh($1,$owner);
99 %typemap(out) MEDCouplingStructuredMesh*
101 $result=convertMesh($1,$owner);
106 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
108 $result=convertFieldDiscretization($1,$owner);
111 %typemap(out) MEDCouplingFieldDiscretization*
113 $result=convertFieldDiscretization($1,$owner);
118 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
120 $result=convertMultiFields($1,$owner);
123 %typemap(out) MEDCouplingMultiFields*
125 $result=convertMultiFields($1,$owner);
130 %typemap(out) ParaMEDMEM::DataArray*
132 $result=convertDataArray($1,$owner);
135 %typemap(out) DataArray*
137 $result=convertDataArray($1,$owner);
142 %typemap(out) ParaMEDMEM::DataArrayChar*
144 $result=convertDataArrayChar($1,$owner);
147 %typemap(out) DataArrayChar*
149 $result=convertDataArrayChar($1,$owner);
154 %init %{ import_array(); %}
157 %feature("autodoc", "1");
158 %feature("docstring");
160 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
161 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
162 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
163 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
164 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
165 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
166 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
167 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
168 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
169 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
170 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
171 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
172 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
173 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
174 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
223 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
224 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
225 %newobject ParaMEDMEM::DataArrayInt::New;
226 %newobject ParaMEDMEM::DataArrayInt::__iter__;
227 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
228 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
229 %newobject ParaMEDMEM::DataArrayInt::performCpy;
230 %newobject ParaMEDMEM::DataArrayInt::substr;
231 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
232 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
233 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
234 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
235 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
236 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
237 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
238 %newobject ParaMEDMEM::DataArrayInt::renumber;
239 %newobject ParaMEDMEM::DataArrayInt::renumberR;
240 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
241 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
244 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::negate;
249 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
250 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
251 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
252 %newobject ParaMEDMEM::DataArrayInt::Meld;
253 %newobject ParaMEDMEM::DataArrayInt::Add;
254 %newobject ParaMEDMEM::DataArrayInt::Substract;
255 %newobject ParaMEDMEM::DataArrayInt::Multiply;
256 %newobject ParaMEDMEM::DataArrayInt::Divide;
257 %newobject ParaMEDMEM::DataArrayInt::Pow;
258 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
259 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
260 %newobject ParaMEDMEM::DataArrayInt::Range;
261 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
262 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
264 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
265 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
267 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
268 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
269 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
270 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
271 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
272 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
273 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
274 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
275 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
276 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
277 %newobject ParaMEDMEM::DataArrayInt::__neg__;
278 %newobject ParaMEDMEM::DataArrayInt::__add__;
279 %newobject ParaMEDMEM::DataArrayInt::__radd__;
280 %newobject ParaMEDMEM::DataArrayInt::__sub__;
281 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
282 %newobject ParaMEDMEM::DataArrayInt::__mul__;
283 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
284 %newobject ParaMEDMEM::DataArrayInt::__div__;
285 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
286 %newobject ParaMEDMEM::DataArrayInt::__mod__;
287 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
288 %newobject ParaMEDMEM::DataArrayInt::__pow__;
289 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
290 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
291 %newobject ParaMEDMEM::DataArrayChar::deepCpy;
292 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
293 %newobject ParaMEDMEM::DataArrayChar::renumber;
294 %newobject ParaMEDMEM::DataArrayChar::renumberR;
295 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
296 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
297 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
298 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
299 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
300 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
301 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
302 %newobject ParaMEDMEM::DataArrayChar::Meld;
303 %newobject ParaMEDMEM::DataArrayByte::New;
304 %newobject ParaMEDMEM::DataArrayByte::__iter__;
305 %newobject ParaMEDMEM::DataArrayByte::performCpy;
306 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
307 %newobject ParaMEDMEM::DataArrayChar::substr;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
309 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
310 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
311 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
312 %newobject ParaMEDMEM::DataArrayDouble::New;
313 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
314 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
315 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
317 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
318 %newobject ParaMEDMEM::DataArrayDouble::Meld;
319 %newobject ParaMEDMEM::DataArrayDouble::Dot;
320 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
321 %newobject ParaMEDMEM::DataArrayDouble::Add;
322 %newobject ParaMEDMEM::DataArrayDouble::Substract;
323 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
324 %newobject ParaMEDMEM::DataArrayDouble::Divide;
325 %newobject ParaMEDMEM::DataArrayDouble::Pow;
326 %newobject ParaMEDMEM::DataArrayDouble::substr;
327 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
328 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
329 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
330 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
331 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
332 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
333 %newobject ParaMEDMEM::DataArrayDouble::negate;
334 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
335 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
336 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
337 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
338 %newobject ParaMEDMEM::DataArrayDouble::determinant;
339 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
340 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
341 %newobject ParaMEDMEM::DataArrayDouble::inverse;
342 %newobject ParaMEDMEM::DataArrayDouble::trace;
343 %newobject ParaMEDMEM::DataArrayDouble::deviator;
344 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
345 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
346 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
347 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
348 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
349 %newobject ParaMEDMEM::DataArrayDouble::renumber;
350 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
351 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
352 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
353 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
354 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
355 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
356 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
357 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
358 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
359 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
360 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
361 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
362 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
363 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
364 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
365 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
366 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
367 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
368 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
369 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
370 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
371 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
372 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
373 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
374 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
375 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
376 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
377 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
378 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
379 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
380 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
381 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
382 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
383 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
384 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
385 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
386 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
387 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
398 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
399 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
400 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
441 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
442 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
443 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
444 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
445 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
446 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
447 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
448 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
450 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
451 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
452 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
453 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
456 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
457 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
458 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
459 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
460 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
461 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
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 const char *getName() const;
663 void setDescription(const char *descr);
664 const char *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 MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
690 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
691 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
692 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
693 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
694 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
696 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
697 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
698 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
699 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
700 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
701 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
702 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
703 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
704 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
705 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
706 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
707 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
708 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
709 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
710 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
711 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
712 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
715 std::string __str__() const throw(INTERP_KERNEL::Exception)
717 return self->simpleRepr();
720 PyObject *getTime() throw(INTERP_KERNEL::Exception)
723 double tmp0=self->getTime(tmp1,tmp2);
724 PyObject *res = PyList_New(3);
725 PyList_SetItem(res,0,SWIG_From_double(tmp0));
726 PyList_SetItem(res,1,SWIG_From_int(tmp1));
727 PyList_SetItem(res,2,SWIG_From_int(tmp2));
731 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
735 DataArrayDoubleTuple *aa;
736 std::vector<double> bb;
738 int spaceDim=self->getSpaceDimension();
739 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
740 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
741 return self->getCellContainingPoint(pos,eps);
744 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
748 DataArrayDoubleTuple *aa;
749 std::vector<double> bb;
751 int spaceDim=self->getSpaceDimension();
752 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
753 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
754 std::vector<int> elts,eltsIndex;
755 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
756 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
757 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
758 d0->alloc(elts.size(),1);
759 d1->alloc(eltsIndex.size(),1);
760 std::copy(elts.begin(),elts.end(),d0->getPointer());
761 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
762 PyObject *ret=PyTuple_New(2);
763 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
764 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
768 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
770 std::vector<int> elts,eltsIndex;
771 int spaceDim=self->getSpaceDimension();
773 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
774 if (!SWIG_IsOK(res1))
777 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
778 int nbOfPoints=size/spaceDim;
781 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
783 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
787 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
789 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
790 da2->checkAllocated();
791 int size=da2->getNumberOfTuples();
792 int nbOfCompo=da2->getNumberOfComponents();
793 if(nbOfCompo!=spaceDim)
795 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
797 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
799 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
800 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
801 d0->alloc(elts.size(),1);
802 d1->alloc(eltsIndex.size(),1);
803 std::copy(elts.begin(),elts.end(),d0->getPointer());
804 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
805 PyObject *ret=PyTuple_New(2);
806 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
807 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
811 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
815 DataArrayDoubleTuple *aa;
816 std::vector<double> bb;
818 int spaceDim=self->getSpaceDimension();
819 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
820 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
821 std::vector<int> elts;
822 self->getCellsContainingPoint(pos,eps,elts);
823 DataArrayInt *ret=DataArrayInt::New();
824 ret->alloc((int)elts.size(),1);
825 std::copy(elts.begin(),elts.end(),ret->getPointer());
826 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
829 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
832 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
833 if (!SWIG_IsOK(res1))
836 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
837 self->renumberCells(tmp,check);
841 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
843 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
844 da2->checkAllocated();
845 self->renumberCells(da2->getConstPointer(),check);
849 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
851 DataArrayInt *cellCor, *nodeCor;
852 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
853 PyObject *res = PyList_New(2);
854 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
855 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
859 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
861 DataArrayInt *cellCor=0,*nodeCor=0;
862 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
863 PyObject *res = PyList_New(2);
864 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
865 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
869 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
871 DataArrayInt *cellCor=0;
872 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
876 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
879 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
880 if (!SWIG_IsOK(res1))
883 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
884 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
888 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
890 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
891 da2->checkAllocated();
892 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
895 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
897 std::vector<int> conn;
898 self->getNodeIdsOfCell(cellId,conn);
899 return convertIntArrToPyList2(conn);
902 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
904 std::vector<double> coo;
905 self->getCoordinatesOfNode(nodeId,coo);
906 return convertDblArrToPyList2(coo);
909 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
913 DataArrayDoubleTuple *aa;
914 std::vector<double> bb;
916 int spaceDim=self->getSpaceDimension();
917 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
918 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
919 self->scale(pointPtr,factor);
922 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
924 int spaceDim=self->getSpaceDimension();
925 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
926 self->getBoundingBox(tmp);
927 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
931 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
934 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
935 PyObject *ret=PyTuple_New(2);
936 PyObject *ret0Py=ret0?Py_True:Py_False;
938 PyTuple_SetItem(ret,0,ret0Py);
939 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
943 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
945 int szArr,sw,iTypppArr;
946 std::vector<int> stdvecTyyppArr;
947 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
948 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
949 if(sw==3)//DataArrayInt
951 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
952 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
953 std::string name=argpt->getName();
955 ret->setName(name.c_str());
957 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
960 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
962 int szArr,sw,iTypppArr;
963 std::vector<int> stdvecTyyppArr;
965 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
966 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
967 if(sw==3)//DataArrayInt
969 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
970 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
971 std::string name=argpt->getName();
973 ret->setName(name.c_str());
976 PyObject *res = PyList_New(2);
977 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
978 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
979 PyList_SetItem(res,0,obj0);
980 PyList_SetItem(res,1,obj1);
984 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
988 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
989 PyObject *res = PyTuple_New(2);
990 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
993 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
995 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
996 PyTuple_SetItem(res,0,obj0);
997 PyTuple_SetItem(res,1,obj1);
1001 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1003 std::vector<int> vals=self->getDistributionOfTypes();
1004 if(vals.size()%3!=0)
1005 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1006 PyObject *ret=PyList_New((int)vals.size()/3);
1007 for(int j=0;j<(int)vals.size()/3;j++)
1009 PyObject *ret1=PyList_New(3);
1010 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1011 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1012 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1013 PyList_SetItem(ret,j,ret1);
1018 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1020 std::vector<int> code;
1021 std::vector<const DataArrayInt *> idsPerType;
1022 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1023 convertPyToNewIntArr4(li,1,3,code);
1024 return self->checkTypeConsistencyAndContig(code,idsPerType);
1027 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1029 std::vector<int> code;
1030 std::vector<DataArrayInt *> idsInPflPerType;
1031 std::vector<DataArrayInt *> idsPerType;
1032 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1033 PyObject *ret=PyTuple_New(3);
1035 if(code.size()%3!=0)
1036 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1037 PyObject *ret0=PyList_New((int)code.size()/3);
1038 for(int j=0;j<(int)code.size()/3;j++)
1040 PyObject *ret00=PyList_New(3);
1041 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1042 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1043 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1044 PyList_SetItem(ret0,j,ret00);
1046 PyTuple_SetItem(ret,0,ret0);
1048 PyObject *ret1=PyList_New(idsInPflPerType.size());
1049 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1050 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1051 PyTuple_SetItem(ret,1,ret1);
1052 int n=idsPerType.size();
1053 PyObject *ret2=PyList_New(n);
1054 for(int i=0;i<n;i++)
1055 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1056 PyTuple_SetItem(ret,2,ret2);
1060 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1064 DataArrayDoubleTuple *aa;
1065 std::vector<double> bb;
1067 int spaceDim=self->getSpaceDimension();
1068 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1069 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1070 self->translate(vectorPtr);
1073 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1075 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1078 DataArrayDoubleTuple *aa;
1079 std::vector<double> bb;
1081 int spaceDim=self->getSpaceDimension();
1082 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1083 self->rotate(centerPtr,0,alpha);
1086 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1088 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1090 DataArrayDouble *a,*a2;
1091 DataArrayDoubleTuple *aa,*aa2;
1092 std::vector<double> bb,bb2;
1094 int spaceDim=self->getSpaceDimension();
1095 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1096 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
1097 self->rotate(centerPtr,vectorPtr,alpha);
1100 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1102 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1103 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1104 PyObject *res=PyList_New(result.size());
1105 for(int i=0;iL!=result.end(); i++, iL++)
1106 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1110 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1112 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1113 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1114 return MEDCouplingMesh::MergeMeshes(tmp);
1120 //== MEDCouplingMesh End
1122 %include "NormalizedUnstructuredMesh.hxx"
1123 %include "MEDCouplingNatureOfField.hxx"
1124 %include "MEDCouplingTimeDiscretization.hxx"
1125 %include "MEDCouplingGaussLocalization.hxx"
1126 %include "MEDCouplingFieldDiscretization.hxx"
1128 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1129 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1130 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1132 //== MEDCouplingPointSet
1134 namespace ParaMEDMEM
1136 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1139 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1140 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1141 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1142 void zipCoords() throw(INTERP_KERNEL::Exception);
1143 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1144 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1145 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1146 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1147 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1148 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1149 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1150 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1151 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1152 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1153 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1154 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1155 virtual DataArrayInt *findBoundaryNodes() const;
1156 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1157 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1158 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1159 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1160 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1163 std::string __str__() const throw(INTERP_KERNEL::Exception)
1165 return self->simpleRepr();
1168 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1171 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1172 PyObject *res = PyList_New(2);
1173 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1174 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1178 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1180 DataArrayInt *comm, *commIndex;
1181 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1182 PyObject *res = PyList_New(2);
1183 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1184 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1188 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1190 DataArrayDouble *ret1=self->getCoords();
1193 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1196 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1198 int szArr,sw,iTypppArr;
1199 std::vector<int> stdvecTyyppArr;
1200 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1201 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1202 if(sw==3)//DataArrayInt
1204 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1205 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1206 std::string name=argpt->getName();
1208 ret->setName(name.c_str());
1210 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1213 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1215 int szArr,sw,iTypppArr;
1216 std::vector<int> stdvecTyyppArr;
1217 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1218 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1219 if(sw==3)//DataArrayInt
1221 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1222 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1223 std::string name=argpt->getName();
1225 ret->setName(name.c_str());
1227 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1230 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1232 int szArr,sw,iTypppArr;
1233 std::vector<int> stdvecTyyppArr;
1234 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1235 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1236 if(sw==3)//DataArrayInt
1238 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1239 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1240 std::string name=argpt->getName();
1242 ret->setName(name.c_str());
1244 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1247 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1249 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1250 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1253 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1255 int szArr,sw,iTypppArr;
1256 std::vector<int> stdvecTyyppArr;
1257 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1258 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1259 if(sw==3)//DataArrayInt
1261 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1262 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1263 std::string name=argpt->getName();
1265 ret->setName(name.c_str());
1267 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1270 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1272 int szArr,sw,iTypppArr;
1273 std::vector<int> stdvecTyyppArr;
1274 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1275 self->renumberNodes(tmp,newNbOfNodes);
1278 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1280 int szArr,sw,iTypppArr;
1281 std::vector<int> stdvecTyyppArr;
1282 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1283 self->renumberNodes2(tmp,newNbOfNodes);
1286 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1288 int spaceDim=self->getSpaceDimension();
1290 DataArrayDouble *a,*a2;
1291 DataArrayDoubleTuple *aa,*aa2;
1292 std::vector<double> bb,bb2;
1294 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1295 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1296 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1297 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1298 std::vector<int> nodes;
1299 self->findNodesOnLine(p,v,eps,nodes);
1300 DataArrayInt *ret=DataArrayInt::New();
1301 ret->alloc((int)nodes.size(),1);
1302 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1303 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1305 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1307 int spaceDim=self->getSpaceDimension();
1309 DataArrayDouble *a,*a2;
1310 DataArrayDoubleTuple *aa,*aa2;
1311 std::vector<double> bb,bb2;
1313 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1314 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1315 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1316 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1317 std::vector<int> nodes;
1318 self->findNodesOnPlane(p,v,eps,nodes);
1319 DataArrayInt *ret=DataArrayInt::New();
1320 ret->alloc((int)nodes.size(),1);
1321 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1322 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1325 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1329 DataArrayDoubleTuple *aa;
1330 std::vector<double> bb;
1332 int spaceDim=self->getSpaceDimension();
1333 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1334 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1335 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1336 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1339 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1341 DataArrayInt *c=0,*cI=0;
1345 DataArrayDoubleTuple *aa;
1346 std::vector<double> bb;
1348 int spaceDim=self->getSpaceDimension();
1349 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1350 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1351 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1352 PyObject *ret=PyTuple_New(2);
1353 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1354 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1358 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1360 DataArrayInt *c=0,*cI=0;
1361 int spaceDim=self->getSpaceDimension();
1364 DataArrayDoubleTuple *aa;
1365 std::vector<double> bb;
1368 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1369 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1371 PyObject *ret=PyTuple_New(2);
1372 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1373 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1377 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1381 DataArrayDoubleTuple *aa;
1382 std::vector<double> bb;
1384 int spaceDim=self->getSpaceDimension();
1385 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1386 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1388 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1389 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1392 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1396 std::vector<int> multiVal;
1397 std::pair<int, std::pair<int,int> > slic;
1398 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1399 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1403 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1405 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1407 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1409 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1413 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1415 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1416 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1417 self->getReverseNodalConnectivity(d0,d1);
1418 PyObject *ret=PyTuple_New(2);
1419 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1420 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1424 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1426 DataArrayInt *v0=0,*v1=0;
1427 self->findCommonCells(compType,startCellId,v0,v1);
1428 PyObject *res = PyList_New(2);
1429 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1430 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1435 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1438 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1439 if (!SWIG_IsOK(res1))
1442 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1443 self->renumberNodesInConn(tmp);
1447 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1449 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1450 da2->checkAllocated();
1451 self->renumberNodesInConn(da2->getConstPointer());
1455 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1458 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1459 PyObject *ret=PyTuple_New(2);
1460 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1461 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1465 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1467 DataArrayInt *ret=0;
1469 int szArr,sw,iTypppArr;
1470 std::vector<int> stdvecTyyppArr;
1471 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1472 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1476 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1480 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1481 PyObject *res = PyList_New(3);
1482 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1483 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1484 PyList_SetItem(res,2,SWIG_From_int(ret2));
1488 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1492 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1493 PyObject *res = PyList_New(3);
1494 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1495 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1496 PyList_SetItem(res,2,SWIG_From_int(ret2));
1500 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1503 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1504 if (!SWIG_IsOK(res1))
1507 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1508 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1512 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1514 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1515 da2->checkAllocated();
1516 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1520 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1524 std::vector<int> multiVal;
1525 std::pair<int, std::pair<int,int> > slic;
1526 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1527 int nbc=self->getNumberOfCells();
1528 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1535 std::ostringstream oss;
1536 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1537 throw INTERP_KERNEL::Exception(oss.str().c_str());
1540 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1545 int tmp=nbc+singleVal;
1546 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1550 std::ostringstream oss;
1551 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1552 throw INTERP_KERNEL::Exception(oss.str().c_str());
1558 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1562 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1567 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1568 daIntTyypp->checkAllocated();
1569 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1572 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1576 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1579 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1580 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1581 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1582 for(int i=0;i<sz;i++)
1583 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1586 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1589 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1591 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1592 std::vector<double> val3;
1593 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1594 "Rotate2DAlg",2,true,nbNodes);
1596 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1597 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1600 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1603 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1604 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1605 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1606 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1607 for(int i=0;i<sz;i++)
1608 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1611 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1614 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1616 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1617 std::vector<double> val3;
1618 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1619 "Rotate3DAlg",3,true,nbNodes);
1621 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1622 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1623 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1628 //== MEDCouplingPointSet End
1630 class MEDCouplingUMeshCell
1633 INTERP_KERNEL::NormalizedCellType getType() const;
1636 std::string __str__() const throw(INTERP_KERNEL::Exception)
1638 return self->repr();
1641 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1644 const int *r=self->getAllConn(ret2);
1645 PyObject *ret=PyTuple_New(ret2);
1646 for(int i=0;i<ret2;i++)
1647 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1653 class MEDCouplingUMeshCellIterator
1660 MEDCouplingUMeshCell *ret=self->nextt();
1662 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1665 PyErr_SetString(PyExc_StopIteration,"No more data.");
1672 class MEDCouplingUMeshCellByTypeIterator
1675 ~MEDCouplingUMeshCellByTypeIterator();
1680 MEDCouplingUMeshCellEntry *ret=self->nextt();
1682 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1685 PyErr_SetString(PyExc_StopIteration,"No more data.");
1692 class MEDCouplingUMeshCellByTypeEntry
1695 ~MEDCouplingUMeshCellByTypeEntry();
1698 MEDCouplingUMeshCellByTypeIterator *__iter__()
1700 return self->iterator();
1705 class MEDCouplingUMeshCellEntry
1708 INTERP_KERNEL::NormalizedCellType getType() const;
1709 int getNumberOfElems() const;
1712 MEDCouplingUMeshCellIterator *__iter__()
1714 return self->iterator();
1719 //== MEDCouplingUMesh
1721 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1724 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1725 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1726 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1727 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1728 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1729 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1730 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1731 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1732 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1733 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1734 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1735 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1736 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1737 void computeTypes() throw(INTERP_KERNEL::Exception);
1738 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1739 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1741 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1742 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1743 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1744 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1745 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1746 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1747 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1748 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1749 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1750 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1751 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1752 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1753 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1754 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1755 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1756 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1757 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1758 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1759 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1760 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1761 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1762 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1763 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1764 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1765 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1766 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1767 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1768 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1769 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1770 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1771 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1772 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1773 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1774 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1775 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1776 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1777 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1778 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1779 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1781 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1783 return MEDCouplingUMesh::New();
1786 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1788 return MEDCouplingUMesh::New(meshName,meshDim);
1791 std::string __str__() const throw(INTERP_KERNEL::Exception)
1793 return self->simpleRepr();
1796 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1798 std::ostringstream oss;
1799 self->reprQuickOverview(oss);
1803 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1805 return self->cellIterator();
1808 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1812 std::vector<int> multiVal;
1813 std::pair<int, std::pair<int,int> > slic;
1814 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1815 int nbc=self->getNumberOfCells();
1816 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1823 std::ostringstream oss;
1824 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1825 throw INTERP_KERNEL::Exception(oss.str().c_str());
1829 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1836 int tmp=nbc+singleVal;
1837 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1842 std::ostringstream oss;
1843 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1844 throw INTERP_KERNEL::Exception(oss.str().c_str());
1850 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1856 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1857 daIntTyypp->checkAllocated();
1858 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1862 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1866 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1870 std::vector<int> multiVal;
1871 std::pair<int, std::pair<int,int> > slic;
1872 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1873 int nbc=self->getNumberOfCells();
1874 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1881 std::ostringstream oss;
1882 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1883 throw INTERP_KERNEL::Exception(oss.str().c_str());
1887 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1894 int tmp=nbc+singleVal;
1895 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1900 std::ostringstream oss;
1901 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1902 throw INTERP_KERNEL::Exception(oss.str().c_str());
1908 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1913 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1919 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1920 daIntTyypp->checkAllocated();
1921 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1925 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1929 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1931 int szArr,sw,iTypppArr;
1932 std::vector<int> stdvecTyyppArr;
1933 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1936 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1937 throw INTERP_KERNEL::Exception(oss.str().c_str());
1939 self->insertNextCell(type,size,tmp);
1942 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1944 int szArr,sw,iTypppArr;
1945 std::vector<int> stdvecTyyppArr;
1946 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1947 self->insertNextCell(type,szArr,tmp);
1950 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1952 DataArrayInt *ret=self->getNodalConnectivity();
1957 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1959 DataArrayInt *ret=self->getNodalConnectivityIndex();
1964 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1966 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1967 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1968 PyObject *res = PyList_New(result.size());
1969 for (int i=0;iL!=result.end(); i++, iL++)
1970 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1974 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1976 int szArr,sw,iTypppArr;
1977 std::vector<int> stdvecTyyppArr;
1978 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1979 int nbOfDepthPeelingPerformed=0;
1980 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1981 PyObject *res=PyTuple_New(2);
1982 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1983 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1987 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1989 DataArrayInt *v0=0,*v1=0;
1990 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1991 PyObject *res = PyList_New(2);
1992 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1993 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1997 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2001 DataArrayDoubleTuple *aa;
2002 std::vector<double> bb;
2004 int nbOfCompo=self->getSpaceDimension();
2005 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2008 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2009 PyObject *ret=PyTuple_New(2);
2010 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2011 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2015 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2017 DataArrayInt *ret1=0;
2018 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2019 PyObject *ret=PyTuple_New(2);
2020 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2021 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2025 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2027 std::vector<int> cells;
2028 self->checkButterflyCells(cells,eps);
2029 DataArrayInt *ret=DataArrayInt::New();
2030 ret->alloc((int)cells.size(),1);
2031 std::copy(cells.begin(),cells.end(),ret->getPointer());
2032 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2035 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2037 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2039 PyObject *ret = PyList_New(sz);
2040 for(int i=0;i<sz;i++)
2041 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2045 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2047 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2048 int sz=retCpp.size();
2049 PyObject *ret=PyList_New(sz);
2050 for(int i=0;i<sz;i++)
2051 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2055 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2058 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2059 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2060 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2063 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2066 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2067 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2071 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2074 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2075 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2079 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2081 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2082 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2083 PyObject *ret=PyTuple_New(3);
2084 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2086 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2090 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2092 DataArrayInt *tmp0=0,*tmp1=0;
2093 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2094 PyObject *ret=PyTuple_New(2);
2095 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2096 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2100 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2104 std::vector<int> multiVal;
2105 std::pair<int, std::pair<int,int> > slic;
2106 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2107 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2111 return self->duplicateNodes(&singleVal,&singleVal+1);
2113 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2115 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2117 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2121 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2125 std::vector<int> multiVal;
2126 std::pair<int, std::pair<int,int> > slic;
2127 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2128 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2132 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2134 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2136 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2138 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2142 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2145 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2146 DataArrayInt *tmp0,*tmp1=0;
2147 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2148 PyObject *ret=PyTuple_New(2);
2149 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2150 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2154 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2156 DataArrayInt *ret0=0,*ret1=0;
2157 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2158 PyObject *ret=PyTuple_New(2);
2159 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2166 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2167 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2168 DataArrayInt *ret1=0,*ret2=0;
2169 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2170 PyObject *ret=PyTuple_New(3);
2171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 static PyObject *MergeUMeshesOnSameCoords(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 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2182 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2185 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2188 std::vector<const MEDCouplingUMesh *> meshes;
2189 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2190 std::vector<DataArrayInt *> corr;
2191 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2193 PyObject *ret1=PyList_New(sz);
2194 for(int i=0;i<sz;i++)
2195 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyObject *ret=PyList_New(2);
2197 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2198 PyList_SetItem(ret,1,ret1);
2202 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2204 std::vector<MEDCouplingUMesh *> meshes;
2205 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2206 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2209 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2211 std::vector<MEDCouplingUMesh *> meshes;
2212 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2213 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2216 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2220 std::vector<int> multiVal;
2221 std::pair<int, std::pair<int,int> > slic;
2222 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2224 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2225 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2229 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2231 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2233 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2235 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2239 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2241 DataArrayInt *arrOut=0,*arrIndexOut=0;
2244 std::vector<int> multiVal;
2245 std::pair<int, std::pair<int,int> > slic;
2246 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2248 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2249 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2254 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2259 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2264 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2268 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2270 PyObject *ret=PyTuple_New(2);
2271 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2272 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2276 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2278 DataArrayInt *arrOut=0,*arrIndexOut=0;
2279 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2280 PyObject *ret=PyTuple_New(2);
2281 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2282 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2286 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2288 if(!PySlice_Check(slic))
2289 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2290 Py_ssize_t strt=2,stp=2,step=2;
2291 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2293 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2294 arrIndxIn->checkAllocated();
2295 if(arrIndxIn->getNumberOfComponents()!=1)
2296 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2297 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2298 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2299 DataArrayInt *arrOut=0,*arrIndexOut=0;
2300 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2301 PyObject *ret=PyTuple_New(2);
2302 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2303 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2307 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2308 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2309 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2311 DataArrayInt *arrOut=0,*arrIndexOut=0;
2314 std::vector<int> multiVal;
2315 std::pair<int, std::pair<int,int> > slic;
2316 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2318 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2319 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2324 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2329 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2334 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2338 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2340 PyObject *ret=PyTuple_New(2);
2341 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2342 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2346 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2347 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2351 std::vector<int> multiVal;
2352 std::pair<int, std::pair<int,int> > slic;
2353 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2355 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2356 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2361 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2366 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2371 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2375 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2379 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2383 DataArrayDoubleTuple *aa;
2384 std::vector<double> bb;
2386 int spaceDim=self->getSpaceDimension();
2387 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2388 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2390 std::vector<int> cells;
2391 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2392 DataArrayInt *ret=DataArrayInt::New();
2393 ret->alloc((int)cells.size(),1);
2394 std::copy(cells.begin(),cells.end(),ret->getPointer());
2395 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2398 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2402 DataArrayDoubleTuple *aa;
2403 std::vector<double> bb;
2405 int spaceDim=self->getSpaceDimension();
2406 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2407 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2408 self->orientCorrectly2DCells(v,polyOnly);
2411 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2413 std::vector<int> cells;
2414 self->arePolyhedronsNotCorrectlyOriented(cells);
2415 DataArrayInt *ret=DataArrayInt::New();
2416 ret->alloc((int)cells.size(),1);
2417 std::copy(cells.begin(),cells.end(),ret->getPointer());
2418 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2421 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2425 self->getFastAveragePlaneOfThis(vec,pos);
2427 std::copy(vec,vec+3,vals);
2428 std::copy(pos,pos+3,vals+3);
2429 return convertDblArrToPyListOfTuple(vals,3,2);
2432 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2434 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2435 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2436 return MEDCouplingUMesh::MergeUMeshes(tmp);
2439 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2442 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2443 PyObject *ret=PyTuple_New(2);
2444 PyObject *ret0Py=ret0?Py_True:Py_False;
2446 PyTuple_SetItem(ret,0,ret0Py);
2447 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2451 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2454 bool ret0=self->areCellsIncludedIn2(other,ret1);
2455 PyObject *ret=PyTuple_New(2);
2456 PyObject *ret0Py=ret0?Py_True:Py_False;
2458 PyTuple_SetItem(ret,0,ret0Py);
2459 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2463 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2465 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2466 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2467 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2468 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2469 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2470 PyObject *ret=PyTuple_New(5);
2471 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2472 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2473 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2474 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2475 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2479 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2481 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2482 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2483 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2484 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2485 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2486 PyObject *ret=PyTuple_New(5);
2487 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2488 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2489 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2490 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2491 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2495 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2498 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2500 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2501 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2502 PyObject *ret=PyTuple_New(5);
2503 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2504 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2505 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2511 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2513 DataArrayInt *neighbors=0,*neighborsIdx=0;
2514 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2515 PyObject *ret=PyTuple_New(2);
2516 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2517 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2521 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2523 DataArrayInt *neighbors=0,*neighborsIdx=0;
2524 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2525 PyObject *ret=PyTuple_New(2);
2526 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2531 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2533 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2534 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2535 DataArrayInt *d2,*d3,*d4,*dd5;
2536 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2537 PyObject *ret=PyTuple_New(7);
2538 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2539 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2543 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2548 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2551 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2552 da->checkAllocated();
2553 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2556 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2559 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2560 da->checkAllocated();
2561 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2564 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2567 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2568 da->checkAllocated();
2569 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2572 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2575 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2576 da->checkAllocated();
2577 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2578 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2579 PyObject *res = PyList_New(result.size());
2580 for (int i=0;iL!=result.end(); i++, iL++)
2581 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2585 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2588 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2589 da->checkAllocated();
2590 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2591 ret->setName(da->getName().c_str());
2595 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2597 DataArrayInt *cellNb1=0,*cellNb2=0;
2598 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2599 PyObject *ret=PyTuple_New(3);
2600 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2601 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2606 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2608 int spaceDim=self->getSpaceDimension();
2610 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2612 DataArrayDouble *a,*a2;
2613 DataArrayDoubleTuple *aa,*aa2;
2614 std::vector<double> bb,bb2;
2616 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2617 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2618 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2619 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2621 DataArrayInt *cellIds=0;
2622 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2623 PyObject *ret=PyTuple_New(2);
2624 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2625 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2629 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2631 int spaceDim=self->getSpaceDimension();
2633 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2635 DataArrayDouble *a,*a2;
2636 DataArrayDoubleTuple *aa,*aa2;
2637 std::vector<double> bb,bb2;
2639 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2640 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2641 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2642 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2644 DataArrayInt *cellIds=0;
2645 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2646 PyObject *ret=PyTuple_New(2);
2647 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2648 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2652 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2654 int spaceDim=self->getSpaceDimension();
2656 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2658 DataArrayDouble *a,*a2;
2659 DataArrayDoubleTuple *aa,*aa2;
2660 std::vector<double> bb,bb2;
2662 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2663 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2664 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2665 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2666 return self->getCellIdsCrossingPlane(orig,vect,eps);
2669 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2673 std::vector<int> pos2;
2674 DataArrayInt *pos3=0;
2675 DataArrayIntTuple *pos4=0;
2676 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2681 self->convertToPolyTypes(&pos1,&pos1+1);
2688 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2693 self->convertToPolyTypes(pos3->begin(),pos3->end());
2697 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2701 void convertAllToPoly();
2702 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2703 bool unPolyze() throw(INTERP_KERNEL::Exception);
2704 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2705 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2706 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2709 //== MEDCouplingUMesh End
2711 //== MEDCouplingExtrudedMesh
2713 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2716 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2717 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2719 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2721 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2724 std::string __str__() const throw(INTERP_KERNEL::Exception)
2726 return self->simpleRepr();
2729 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2731 std::ostringstream oss;
2732 self->reprQuickOverview(oss);
2736 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2738 MEDCouplingUMesh *ret=self->getMesh2D();
2741 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2743 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2745 MEDCouplingUMesh *ret=self->getMesh1D();
2748 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2750 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2752 DataArrayInt *ret=self->getMesh3DIds();
2755 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2760 //== MEDCouplingExtrudedMesh End
2762 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2765 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2766 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2767 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2768 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2769 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2770 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2773 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2775 int szArr,sw,iTypppArr;
2776 std::vector<int> stdvecTyyppArr;
2777 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2778 self->insertNextCell(tmp,tmp+szArr);
2781 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2783 DataArrayInt *ret=self->getNodalConnectivity();
2784 if(ret) ret->incrRef();
2788 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2790 std::vector< const MEDCoupling1GTUMesh *> parts;
2791 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2792 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2797 //== MEDCoupling1SGTUMesh
2799 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2802 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2803 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2804 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2805 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2806 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2807 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2810 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2812 return MEDCoupling1SGTUMesh::New(name,type);
2815 std::string __str__() const throw(INTERP_KERNEL::Exception)
2817 return self->simpleRepr();
2820 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2822 std::ostringstream oss;
2823 self->reprQuickOverview(oss);
2827 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2829 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2830 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2831 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2834 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2836 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2837 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2838 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2843 //== MEDCoupling1SGTUMesh End
2845 //== MEDCoupling1DGTUMesh
2847 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2850 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2851 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2852 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2853 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2854 bool isPacked() const throw(INTERP_KERNEL::Exception);
2857 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2859 return MEDCoupling1DGTUMesh::New(name,type);
2862 std::string __str__() const throw(INTERP_KERNEL::Exception)
2864 return self->simpleRepr();
2867 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2869 std::ostringstream oss;
2870 self->reprQuickOverview(oss);
2874 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2876 DataArrayInt *ret=self->getNodalConnectivityIndex();
2877 if(ret) ret->incrRef();
2881 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2883 DataArrayInt *ret1=0,*ret2=0;
2884 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2885 PyObject *ret0Py=ret0?Py_True:Py_False;
2887 PyObject *ret=PyTuple_New(3);
2888 PyTuple_SetItem(ret,0,ret0Py);
2889 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2890 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2894 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2897 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2898 PyObject *ret=PyTuple_New(2);
2899 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2900 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2901 PyTuple_SetItem(ret,1,ret1Py);
2905 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2907 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2908 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2909 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2912 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2914 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2915 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2916 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2919 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2921 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2922 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2923 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2928 //== MEDCoupling1DGTUMeshEnd
2930 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2933 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2934 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2935 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2936 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2937 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2940 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2942 int tmpp1=-1,tmpp2=-1;
2943 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2944 std::vector< std::pair<int,int> > inp;
2948 for(int i=0;i<tmpp1;i++)
2949 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2954 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2955 inp.resize(tmpp1/2);
2956 for(int i=0;i<tmpp1/2;i++)
2957 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2960 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2961 return self->buildStructuredSubPart(inp);
2964 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2966 int tmpp1=-1,tmpp2=-1;
2967 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2968 std::vector< std::pair<int,int> > inp;
2972 for(int i=0;i<tmpp1;i++)
2973 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2978 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
2979 inp.resize(tmpp1/2);
2980 for(int i=0;i<tmpp1/2;i++)
2981 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2984 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
2986 int szArr,sw,iTypppArr;
2987 std::vector<int> stdvecTyyppArr;
2988 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2989 std::vector<int> tmp5(tmp4,tmp4+szArr);
2991 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2994 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2996 int szArr,sw,iTypppArr;
2997 std::vector<int> stdvecTyyppArr;
2998 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2999 int szArr2,sw2,iTypppArr2;
3000 std::vector<int> stdvecTyyppArr2;
3001 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3002 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3003 std::vector< std::pair<int,int> > partCompactFormat;
3004 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3005 PyObject *ret=PyTuple_New(2);
3006 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3007 PyTuple_SetItem(ret,0,ret0Py);
3008 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3009 for(std::size_t i=0;i<partCompactFormat.size();i++)
3011 PyObject *tmp4=PyTuple_New(2);
3012 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3013 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3014 PyList_SetItem(ret1Py,i,tmp4);
3016 PyTuple_SetItem(ret,1,ret1Py);
3022 //== MEDCouplingCMesh
3024 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3027 static MEDCouplingCMesh *New();
3028 static MEDCouplingCMesh *New(const char *meshName);
3029 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3030 void setCoords(const DataArrayDouble *coordsX,
3031 const DataArrayDouble *coordsY=0,
3032 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3033 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3037 return MEDCouplingCMesh::New();
3039 MEDCouplingCMesh(const char *meshName)
3041 return MEDCouplingCMesh::New(meshName);
3043 std::string __str__() const throw(INTERP_KERNEL::Exception)
3045 return self->simpleRepr();
3047 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3049 std::ostringstream oss;
3050 self->reprQuickOverview(oss);
3053 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3055 DataArrayDouble *ret=self->getCoordsAt(i);
3063 //== MEDCouplingCMesh End
3065 //== MEDCouplingCurveLinearMesh
3067 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3070 static MEDCouplingCurveLinearMesh *New();
3071 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3072 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3073 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3075 MEDCouplingCurveLinearMesh()
3077 return MEDCouplingCurveLinearMesh::New();
3079 MEDCouplingCurveLinearMesh(const char *meshName)
3081 return MEDCouplingCurveLinearMesh::New(meshName);
3083 std::string __str__() const throw(INTERP_KERNEL::Exception)
3085 return self->simpleRepr();
3087 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3089 std::ostringstream oss;
3090 self->reprQuickOverview(oss);
3093 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3095 DataArrayDouble *ret=self->getCoords();
3100 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3102 int szArr,sw,iTypppArr;
3103 std::vector<int> stdvecTyyppArr;
3104 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3105 self->setNodeGridStructure(tmp,tmp+szArr);
3110 //== MEDCouplingCurveLinearMesh End
3113 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3115 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3117 int sz=0,sw=-1,val1=-1;
3118 std::vector<int> val2;
3119 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3120 return self->clonePart(inp,inp+sz);
3123 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3125 DataArrayInt *ret1=0;
3127 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3128 PyObject *res=PyTuple_New(2);
3129 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3131 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3134 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3135 PyTuple_SetItem(res,1,res1);
3140 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3142 std::vector<int> vVal; int iVal=-1;
3144 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3146 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3147 DataArrayInt *ret0=0,*ret1=0;
3148 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3149 PyObject *pyRet=PyTuple_New(2);
3150 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3151 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3156 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3158 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3159 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3162 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3164 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3165 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3168 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3170 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3171 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3174 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3176 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3177 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3180 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3182 PyObject *getArrayOfDiscIds() const
3184 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3187 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3190 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3192 std::vector<int> ret1;
3193 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3194 std::size_t sz=ret0.size();
3195 PyObject *pyRet=PyTuple_New(2);
3196 PyObject *pyRet0=PyList_New((int)sz);
3197 PyObject *pyRet1=PyList_New((int)sz);
3198 for(std::size_t i=0;i<sz;i++)
3200 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3201 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3203 PyTuple_SetItem(pyRet,0,pyRet0);
3204 PyTuple_SetItem(pyRet,1,pyRet1);
3209 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3211 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3214 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3215 PyObject *ret=PyTuple_New(2);
3216 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3217 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3222 namespace ParaMEDMEM
3224 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3227 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3228 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3229 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3230 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3231 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3232 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3233 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3234 const char *getDescription() const throw(INTERP_KERNEL::Exception);
3235 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3236 const char *getName() const throw(INTERP_KERNEL::Exception);
3237 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3238 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3239 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3240 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3241 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3242 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3243 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3244 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3245 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3246 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3247 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3248 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3249 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3250 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3251 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3252 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3254 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3256 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3259 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3262 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3264 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3267 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3270 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3272 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3273 return convertIntArrToPyList3(ret);
3276 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3279 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3280 PyObject *ret=PyTuple_New(2);
3281 PyObject *ret0Py=ret0?Py_True:Py_False;
3283 PyTuple_SetItem(ret,0,ret0Py);
3284 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3288 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3290 DataArrayInt *ret1=0;
3291 MEDCouplingMesh *ret0=0;
3293 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3294 if (!SWIG_IsOK(res1))
3297 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3298 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3302 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3304 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3305 da2->checkAllocated();
3306 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3308 PyObject *res = PyList_New(2);
3309 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3310 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3314 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3316 DataArrayInt *ret1=0;
3318 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3319 PyObject *res=PyTuple_New(2);
3320 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3322 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3325 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3326 PyTuple_SetItem(res,1,res1);
3331 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3335 std::vector<int> pos2;
3336 DataArrayInt *pos3=0;
3337 DataArrayIntTuple *pos4=0;
3338 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3343 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3347 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3351 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3354 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3358 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3359 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3362 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3363 if (!SWIG_IsOK(res1))
3366 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3367 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3371 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3373 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3374 da2->checkAllocated();
3375 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3379 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3381 std::vector<int> tmp;
3382 self->getCellIdsHavingGaussLocalization(locId,tmp);
3383 DataArrayInt *ret=DataArrayInt::New();
3384 ret->alloc((int)tmp.size(),1);
3385 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3386 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3391 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3394 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3395 static MEDCouplingFieldTemplate *New(TypeOfField type);
3396 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3397 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3400 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3402 return MEDCouplingFieldTemplate::New(f);
3405 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3407 return MEDCouplingFieldTemplate::New(type);
3410 std::string __str__() const throw(INTERP_KERNEL::Exception)
3412 return self->simpleRepr();
3415 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3417 std::ostringstream oss;
3418 self->reprQuickOverview(oss);
3424 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3427 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3428 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3429 void setTimeUnit(const char *unit);
3430 const char *getTimeUnit() const;
3431 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3432 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3433 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3434 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3435 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3436 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3437 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3438 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3439 MEDCouplingFieldDouble *deepCpy() const;
3440 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3441 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3442 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3443 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3444 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3445 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3446 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3447 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3448 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3449 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3450 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3451 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3452 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3453 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3454 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3455 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3456 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3457 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3458 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3459 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3460 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3461 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3462 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3463 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3464 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3465 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3466 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3467 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3468 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3469 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3470 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3471 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3472 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3473 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3474 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3475 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3476 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3477 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3478 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3479 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3480 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3481 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3482 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3483 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3484 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3485 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3486 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3487 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3488 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3489 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3490 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3491 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3492 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3493 double getMinValue() const throw(INTERP_KERNEL::Exception);
3494 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3495 double norm2() const throw(INTERP_KERNEL::Exception);
3496 double normMax() const throw(INTERP_KERNEL::Exception);
3497 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3498 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3499 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3500 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3501 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3502 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3503 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3504 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3505 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3506 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3507 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3508 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3509 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3510 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3511 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3512 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3513 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3514 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3515 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3516 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3517 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3518 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3520 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3522 return MEDCouplingFieldDouble::New(type,td);
3525 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3527 return MEDCouplingFieldDouble::New(ft,td);
3530 std::string __str__() const throw(INTERP_KERNEL::Exception)
3532 return self->simpleRepr();
3535 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3537 std::ostringstream oss;
3538 self->reprQuickOverview(oss);
3542 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3544 DataArrayDouble *ret=self->getArray();
3550 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3552 std::vector<DataArrayDouble *> arrs=self->getArrays();
3553 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3557 PyObject *ret=PyTuple_New(sz);
3558 for(int i=0;i<sz;i++)
3561 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3563 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3568 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3570 std::vector<const DataArrayDouble *> tmp;
3571 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3573 std::vector<DataArrayDouble *> arrs(sz);
3574 for(int i=0;i<sz;i++)
3575 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3576 self->setArrays(arrs);
3579 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3581 DataArrayDouble *ret=self->getEndArray();
3587 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3591 DataArrayDoubleTuple *aa;
3592 std::vector<double> bb;
3594 const MEDCouplingMesh *mesh=self->getMesh();
3596 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3597 int spaceDim=mesh->getSpaceDimension();
3598 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3599 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3601 int sz=self->getNumberOfComponents();
3602 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3603 self->getValueOn(spaceLoc,res);
3604 return convertDblArrToPyList(res,sz);
3607 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3609 int sz=self->getNumberOfComponents();
3610 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3611 self->getValueOnPos(i,j,k,res);
3612 return convertDblArrToPyList(res,sz);
3615 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3618 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3619 if (!SWIG_IsOK(res1))
3622 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3623 const MEDCouplingMesh *mesh=self->getMesh();
3625 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3626 int spaceDim=mesh->getSpaceDimension();
3627 int nbOfPoints=size/spaceDim;
3628 if(size%spaceDim!=0)
3630 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3632 return self->getValueOnMulti(tmp,nbOfPoints);
3636 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3638 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3639 da2->checkAllocated();
3640 int size=da2->getNumberOfTuples();
3641 int nbOfCompo=da2->getNumberOfComponents();
3642 const MEDCouplingMesh *mesh=self->getMesh();
3644 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3645 if(nbOfCompo!=mesh->getSpaceDimension())
3647 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3649 return self->getValueOnMulti(da2->getConstPointer(),size);
3653 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3657 DataArrayDoubleTuple *aa;
3658 std::vector<double> bb;
3660 const MEDCouplingMesh *mesh=self->getMesh();
3662 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3663 int spaceDim=mesh->getSpaceDimension();
3664 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3665 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3668 int sz=self->getNumberOfComponents();
3669 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3670 self->getValueOn(spaceLoc,time,res);
3671 return convertDblArrToPyList(res,sz);
3674 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3676 if(self->getArray()!=0)
3677 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3680 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3681 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3682 self->setArray(arr);
3686 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3689 double tmp0=self->getTime(tmp1,tmp2);
3690 PyObject *res = PyList_New(3);
3691 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3692 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3693 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3697 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3700 double tmp0=self->getStartTime(tmp1,tmp2);
3701 PyObject *res = PyList_New(3);
3702 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3703 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3704 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3708 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3711 double tmp0=self->getEndTime(tmp1,tmp2);
3712 PyObject *res = PyList_New(3);
3713 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3714 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3715 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3718 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3720 int sz=self->getNumberOfComponents();
3721 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3722 self->accumulate(tmp);
3723 return convertDblArrToPyList(tmp,sz);
3725 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3727 int sz=self->getNumberOfComponents();
3728 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3729 self->integral(isWAbs,tmp);
3730 return convertDblArrToPyList(tmp,sz);
3732 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3734 int sz=self->getNumberOfComponents();
3735 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3736 self->getWeightedAverageValue(tmp,isWAbs);
3737 return convertDblArrToPyList(tmp,sz);
3739 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3741 int sz=self->getNumberOfComponents();
3742 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3744 return convertDblArrToPyList(tmp,sz);
3746 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3748 int sz=self->getNumberOfComponents();
3749 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3751 return convertDblArrToPyList(tmp,sz);
3753 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3756 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3757 if (!SWIG_IsOK(res1))
3760 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3761 self->renumberCells(tmp,check);
3765 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3767 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3768 da2->checkAllocated();
3769 self->renumberCells(da2->getConstPointer(),check);
3772 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3775 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3776 if (!SWIG_IsOK(res1))
3779 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3780 self->renumberNodes(tmp,eps);
3784 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3786 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3787 da2->checkAllocated();
3788 self->renumberNodes(da2->getConstPointer(),eps);
3792 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3796 std::vector<int> multiVal;
3797 std::pair<int, std::pair<int,int> > slic;
3798 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3799 const MEDCouplingMesh *mesh=self->getMesh();
3801 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3802 int nbc=mesh->getNumberOfCells();
3803 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3810 std::ostringstream oss;
3811 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3812 throw INTERP_KERNEL::Exception(oss.str().c_str());
3815 return self->buildSubPart(&singleVal,&singleVal+1);
3820 int tmp=nbc+singleVal;
3821 return self->buildSubPart(&tmp,&tmp+1);
3825 std::ostringstream oss;
3826 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3827 throw INTERP_KERNEL::Exception(oss.str().c_str());
3833 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3837 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3842 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3843 daIntTyypp->checkAllocated();
3844 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3847 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3851 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3853 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";
3854 if(PyTuple_Check(li))
3856 Py_ssize_t sz=PyTuple_Size(li);
3858 throw INTERP_KERNEL::Exception(msg);
3859 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3862 std::vector<int> multiVal;
3863 std::pair<int, std::pair<int,int> > slic;
3864 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3865 if(!self->getArray())
3866 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3868 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3869 catch(INTERP_KERNEL::Exception& e)
3870 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3871 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3872 DataArrayDouble *ret0Arr=ret0->getArray();
3874 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3879 std::vector<int> v2(1,singleVal);
3880 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3881 ret0->setArray(aarr);
3886 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3887 ret0->setArray(aarr);
3892 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3893 std::vector<int> v2(nbOfComp);
3894 for(int i=0;i<nbOfComp;i++)
3895 v2[i]=slic.first+i*slic.second.second;
3896 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3897 ret0->setArray(aarr);
3901 throw INTERP_KERNEL::Exception(msg);
3906 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3909 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3912 double r1=self->getMaxValue2(tmp);
3913 PyObject *ret=PyTuple_New(2);
3914 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3915 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3919 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3922 double r1=self->getMinValue2(tmp);
3923 PyObject *ret=PyTuple_New(2);
3924 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3925 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3929 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3931 std::vector<int> tmp;
3932 convertPyToNewIntArr3(li,tmp);
3933 return self->keepSelectedComponents(tmp);
3936 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3938 std::vector<int> tmp;
3939 convertPyToNewIntArr3(li,tmp);
3940 self->setSelectedComponents(f,tmp);
3943 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3946 DataArrayDouble *a,*a2;
3947 DataArrayDoubleTuple *aa,*aa2;
3948 std::vector<double> bb,bb2;
3951 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3952 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3953 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3954 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3956 return self->extractSlice3D(orig,vect,eps);
3959 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3961 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3964 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3966 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3969 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3971 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.";
3972 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3975 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3977 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3979 return (*self)-(*other);
3981 throw INTERP_KERNEL::Exception(msg);
3986 DataArrayDoubleTuple *aa;
3987 std::vector<double> bb;
3989 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3994 if(!self->getArray())
3995 throw INTERP_KERNEL::Exception(msg2);
3996 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3997 ret->applyLin(1.,-val);
3998 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3999 ret2->setArray(ret);
4004 if(!self->getArray())
4005 throw INTERP_KERNEL::Exception(msg2);
4006 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4007 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4008 ret2->setArray(ret);
4013 if(!self->getArray())
4014 throw INTERP_KERNEL::Exception(msg2);
4015 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4016 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4017 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4018 ret2->setArray(ret);
4023 if(!self->getArray())
4024 throw INTERP_KERNEL::Exception(msg2);
4025 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4026 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4027 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4028 ret2->setArray(ret);
4032 { throw INTERP_KERNEL::Exception(msg); }
4036 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4038 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4041 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4043 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4046 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4048 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4051 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4053 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.";
4054 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4057 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4059 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4061 return (*self)/(*other);
4063 throw INTERP_KERNEL::Exception(msg);
4068 DataArrayDoubleTuple *aa;
4069 std::vector<double> bb;
4071 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4077 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4078 if(!self->getArray())
4079 throw INTERP_KERNEL::Exception(msg2);
4080 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4081 ret->applyLin(1./val,0);
4082 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4083 ret2->setArray(ret);
4088 if(!self->getArray())
4089 throw INTERP_KERNEL::Exception(msg2);
4090 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4091 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4092 ret2->setArray(ret);
4097 if(!self->getArray())
4098 throw INTERP_KERNEL::Exception(msg2);
4099 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4100 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4101 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4102 ret2->setArray(ret);
4107 if(!self->getArray())
4108 throw INTERP_KERNEL::Exception(msg2);
4109 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4110 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4111 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4112 ret2->setArray(ret);
4116 { throw INTERP_KERNEL::Exception(msg); }
4120 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4122 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4125 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4127 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.";
4128 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4131 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4133 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4135 return (*self)^(*other);
4137 throw INTERP_KERNEL::Exception(msg);
4142 DataArrayDoubleTuple *aa;
4143 std::vector<double> bb;
4145 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4150 if(!self->getArray())
4151 throw INTERP_KERNEL::Exception(msg2);
4152 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4154 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4155 ret2->setArray(ret);
4160 if(!self->getArray())
4161 throw INTERP_KERNEL::Exception(msg2);
4162 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4163 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4164 ret2->setArray(ret);
4169 if(!self->getArray())
4170 throw INTERP_KERNEL::Exception(msg2);
4171 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4172 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4173 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4174 ret2->setArray(ret);
4179 if(!self->getArray())
4180 throw INTERP_KERNEL::Exception(msg2);
4181 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4182 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4183 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4184 ret2->setArray(ret);
4188 { throw INTERP_KERNEL::Exception(msg); }
4192 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4194 return self->negate();
4197 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4199 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.";
4200 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4203 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4205 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4209 Py_XINCREF(trueSelf);
4213 throw INTERP_KERNEL::Exception(msg);
4218 DataArrayDoubleTuple *aa;
4219 std::vector<double> bb;
4221 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4226 if(!self->getArray())
4227 throw INTERP_KERNEL::Exception(msg2);
4228 self->getArray()->applyLin(1.,val);
4229 Py_XINCREF(trueSelf);
4234 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4237 Py_XINCREF(trueSelf);
4242 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4243 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4244 ret2->setArray(aaa);
4246 Py_XINCREF(trueSelf);
4251 if(!self->getArray())
4252 throw INTERP_KERNEL::Exception(msg2);
4253 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4254 self->getArray()->addEqual(aaa);
4255 Py_XINCREF(trueSelf);
4259 { throw INTERP_KERNEL::Exception(msg); }
4263 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4265 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.";
4266 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4269 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4271 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4275 Py_XINCREF(trueSelf);
4279 throw INTERP_KERNEL::Exception(msg);
4284 DataArrayDoubleTuple *aa;
4285 std::vector<double> bb;
4287 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4292 if(!self->getArray())
4293 throw INTERP_KERNEL::Exception(msg2);
4294 self->getArray()->applyLin(1.,-val);
4295 Py_XINCREF(trueSelf);
4300 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4303 Py_XINCREF(trueSelf);
4308 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4309 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4310 ret2->setArray(aaa);
4312 Py_XINCREF(trueSelf);
4317 if(!self->getArray())
4318 throw INTERP_KERNEL::Exception(msg2);
4319 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4320 self->getArray()->substractEqual(aaa);
4321 Py_XINCREF(trueSelf);
4325 { throw INTERP_KERNEL::Exception(msg); }
4329 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4331 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.";
4332 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4335 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4337 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4341 Py_XINCREF(trueSelf);
4345 throw INTERP_KERNEL::Exception(msg);
4350 DataArrayDoubleTuple *aa;
4351 std::vector<double> bb;
4353 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4358 if(!self->getArray())
4359 throw INTERP_KERNEL::Exception(msg2);
4360 self->getArray()->applyLin(val,0);
4361 Py_XINCREF(trueSelf);
4366 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4369 Py_XINCREF(trueSelf);
4374 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4375 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4376 ret2->setArray(aaa);
4378 Py_XINCREF(trueSelf);
4383 if(!self->getArray())
4384 throw INTERP_KERNEL::Exception(msg2);
4385 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4386 self->getArray()->multiplyEqual(aaa);
4387 Py_XINCREF(trueSelf);
4391 { throw INTERP_KERNEL::Exception(msg); }
4395 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4397 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.";
4398 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4401 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4403 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4407 Py_XINCREF(trueSelf);
4411 throw INTERP_KERNEL::Exception(msg);
4416 DataArrayDoubleTuple *aa;
4417 std::vector<double> bb;
4419 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4425 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4426 if(!self->getArray())
4427 throw INTERP_KERNEL::Exception(msg2);
4428 self->getArray()->applyLin(1./val,0);
4429 Py_XINCREF(trueSelf);
4434 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4437 Py_XINCREF(trueSelf);
4442 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4443 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4444 ret2->setArray(aaa);
4446 Py_XINCREF(trueSelf);
4451 if(!self->getArray())
4452 throw INTERP_KERNEL::Exception(msg2);
4453 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4454 self->getArray()->divideEqual(aaa);
4455 Py_XINCREF(trueSelf);
4459 { throw INTERP_KERNEL::Exception(msg); }
4463 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4465 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.";
4466 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4469 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4471 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4475 Py_XINCREF(trueSelf);
4479 throw INTERP_KERNEL::Exception(msg);
4484 DataArrayDoubleTuple *aa;
4485 std::vector<double> bb;
4487 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4492 if(!self->getArray())
4493 throw INTERP_KERNEL::Exception(msg2);
4494 self->getArray()->applyPow(val);
4495 Py_XINCREF(trueSelf);
4500 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4503 Py_XINCREF(trueSelf);
4508 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4509 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4510 ret2->setArray(aaa);
4512 Py_XINCREF(trueSelf);
4517 if(!self->getArray())
4518 throw INTERP_KERNEL::Exception(msg2);
4519 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4520 self->getArray()->powEqual(aaa);
4521 Py_XINCREF(trueSelf);
4525 { throw INTERP_KERNEL::Exception(msg); }
4529 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4531 std::vector<const MEDCouplingFieldDouble *> tmp;
4532 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4533 return MEDCouplingFieldDouble::MergeFields(tmp);
4536 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4538 std::vector<const MEDCouplingFieldDouble *> tmp;
4539 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4540 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4545 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4548 int getNumberOfFields() const;
4549 MEDCouplingMultiFields *deepCpy() const;
4550 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4551 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4552 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4553 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4554 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4557 std::string __str__() const throw(INTERP_KERNEL::Exception)
4559 return self->simpleRepr();
4561 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4563 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4564 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4566 std::vector<MEDCouplingFieldDouble *> fs(sz);
4567 for(int i=0;i<sz;i++)
4568 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4569 return MEDCouplingMultiFields::New(fs);
4571 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4573 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4574 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4576 std::vector<MEDCouplingFieldDouble *> fs(sz);
4577 for(int i=0;i<sz;i++)
4578 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4579 return MEDCouplingMultiFields::New(fs);
4581 PyObject *getFields() const
4583 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4584 int sz=fields.size();
4585 PyObject *res = PyList_New(sz);
4586 for(int i=0;i<sz;i++)
4590 fields[i]->incrRef();
4591 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4595 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4600 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4602 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4606 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4609 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4611 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4613 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4615 PyObject *res = PyList_New(sz);
4616 for(int i=0;i<sz;i++)
4621 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4625 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4630 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4632 std::vector<int> refs;
4633 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4635 PyObject *res = PyList_New(sz);
4636 for(int i=0;i<sz;i++)
4641 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4645 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4649 PyObject *ret=PyTuple_New(2);
4650 PyTuple_SetItem(ret,0,res);
4651 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4654 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4656 std::vector<DataArrayDouble *> ms=self->getArrays();
4658 PyObject *res = PyList_New(sz);
4659 for(int i=0;i<sz;i++)
4664 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4668 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4673 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4675 std::vector< std::vector<int> > refs;
4676 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4678 PyObject *res = PyList_New(sz);
4679 PyObject *res2 = PyList_New(sz);
4680 for(int i=0;i<sz;i++)
4685 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4689 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4691 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4694 PyObject *ret=PyTuple_New(2);
4695 PyTuple_SetItem(ret,0,res);
4696 PyTuple_SetItem(ret,1,res2);
4702 class MEDCouplingDefinitionTime
4705 MEDCouplingDefinitionTime();
4706 void assign(const MEDCouplingDefinitionTime& other);
4707 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4708 double getTimeResolution() const;
4709 std::vector<double> getHotSpotsTime() const;
4712 std::string __str__() const throw(INTERP_KERNEL::Exception)
4714 std::ostringstream oss;
4715 self->appendRepr(oss);
4719 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4721 int meshId,arrId,arrIdInField,fieldId;
4722 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4723 PyObject *res=PyList_New(4);
4724 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4725 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4726 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4727 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4731 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4733 int meshId,arrId,arrIdInField,fieldId;
4734 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4735 PyObject *res=PyList_New(4);
4736 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4737 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4738 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4739 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4745 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4748 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4749 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4753 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4755 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4756 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4758 std::vector<MEDCouplingFieldDouble *> fs(sz);
4759 for(int i=0;i<sz;i++)
4760 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4761 return MEDCouplingFieldOverTime::New(fs);
4763 std::string __str__() const throw(INTERP_KERNEL::Exception)
4765 return self->simpleRepr();
4767 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4769 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4770 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4772 std::vector<MEDCouplingFieldDouble *> fs(sz);
4773 for(int i=0;i<sz;i++)
4774 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4775 return MEDCouplingFieldOverTime::New(fs);
4783 __filename=os.environ.get('PYTHONSTARTUP')
4784 if __filename and os.path.isfile(__filename):
4785 execfile(__filename)