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::MEDCouplingField::buildMeasureField;
161 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
162 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
163 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
164 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
165 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
166 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
167 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
168 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
169 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
170 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
171 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
172 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
173 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
174 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
212 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
213 %newobject ParaMEDMEM::DataArray::deepCpy;
214 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
215 %newobject ParaMEDMEM::DataArray::selectByTupleId;
216 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
217 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
218 %newobject ParaMEDMEM::DataArray::Aggregate;
219 %newobject ParaMEDMEM::DataArrayInt::New;
220 %newobject ParaMEDMEM::DataArrayInt::__iter__;
221 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
222 %newobject ParaMEDMEM::DataArrayInt::performCpy;
223 %newobject ParaMEDMEM::DataArrayInt::substr;
224 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
225 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
226 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
227 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
228 %newobject ParaMEDMEM::DataArrayInt::renumber;
229 %newobject ParaMEDMEM::DataArrayInt::renumberR;
230 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
231 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
232 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
233 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
234 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
235 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
236 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
237 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
238 %newobject ParaMEDMEM::DataArrayInt::negate;
239 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
240 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
241 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
242 %newobject ParaMEDMEM::DataArrayInt::Meld;
243 %newobject ParaMEDMEM::DataArrayInt::Add;
244 %newobject ParaMEDMEM::DataArrayInt::Substract;
245 %newobject ParaMEDMEM::DataArrayInt::Multiply;
246 %newobject ParaMEDMEM::DataArrayInt::Divide;
247 %newobject ParaMEDMEM::DataArrayInt::Pow;
248 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
249 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
250 %newobject ParaMEDMEM::DataArrayInt::Range;
251 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
252 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
253 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
254 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
255 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
256 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
257 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
258 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
259 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
260 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
261 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
262 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
263 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
264 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
265 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
266 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
267 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
268 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
269 %newobject ParaMEDMEM::DataArrayInt::__neg__;
270 %newobject ParaMEDMEM::DataArrayInt::__add__;
271 %newobject ParaMEDMEM::DataArrayInt::__radd__;
272 %newobject ParaMEDMEM::DataArrayInt::__sub__;
273 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
274 %newobject ParaMEDMEM::DataArrayInt::__mul__;
275 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
276 %newobject ParaMEDMEM::DataArrayInt::__div__;
277 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
278 %newobject ParaMEDMEM::DataArrayInt::__mod__;
279 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
280 %newobject ParaMEDMEM::DataArrayInt::__pow__;
281 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
282 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
283 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
284 %newobject ParaMEDMEM::DataArrayChar::renumber;
285 %newobject ParaMEDMEM::DataArrayChar::renumberR;
286 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
287 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
288 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
289 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
290 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
291 %newobject ParaMEDMEM::DataArrayChar::Meld;
292 %newobject ParaMEDMEM::DataArrayByte::New;
293 %newobject ParaMEDMEM::DataArrayByte::__iter__;
294 %newobject ParaMEDMEM::DataArrayByte::performCpy;
295 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
296 %newobject ParaMEDMEM::DataArrayChar::substr;
297 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
298 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
299 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
300 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
301 %newobject ParaMEDMEM::DataArrayDouble::New;
302 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
303 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
304 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
305 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
306 %newobject ParaMEDMEM::DataArrayDouble::Meld;
307 %newobject ParaMEDMEM::DataArrayDouble::Dot;
308 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
309 %newobject ParaMEDMEM::DataArrayDouble::Add;
310 %newobject ParaMEDMEM::DataArrayDouble::Substract;
311 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
312 %newobject ParaMEDMEM::DataArrayDouble::Divide;
313 %newobject ParaMEDMEM::DataArrayDouble::Pow;
314 %newobject ParaMEDMEM::DataArrayDouble::substr;
315 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
316 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
317 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
318 %newobject ParaMEDMEM::DataArrayDouble::negate;
319 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
320 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
321 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
322 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
323 %newobject ParaMEDMEM::DataArrayDouble::determinant;
324 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
325 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
326 %newobject ParaMEDMEM::DataArrayDouble::inverse;
327 %newobject ParaMEDMEM::DataArrayDouble::trace;
328 %newobject ParaMEDMEM::DataArrayDouble::deviator;
329 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
330 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
331 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
332 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
333 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
334 %newobject ParaMEDMEM::DataArrayDouble::renumber;
335 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
336 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
337 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
338 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
339 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
340 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
341 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
342 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
343 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
344 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
345 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
346 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
347 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
348 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
349 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
350 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
351 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
352 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
353 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
354 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
355 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
356 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
357 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
358 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
359 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
360 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
361 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
362 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
363 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
364 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
365 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
366 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
367 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
368 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
369 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
370 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
371 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
372 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
373 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
374 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
375 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
376 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
377 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
378 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
379 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
380 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
381 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
382 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
383 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
384 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
385 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
386 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
390 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
391 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
392 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
393 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
394 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
395 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
396 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
397 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
398 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
399 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
433 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
434 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
435 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
436 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
437 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
438 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
439 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
440 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
441 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
442 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
443 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
444 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
445 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
446 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
447 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
448 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
449 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
450 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
451 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
452 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
453 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
454 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
455 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
456 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
457 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
458 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
459 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
460 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
461 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
462 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
464 %feature("unref") DataArray "$this->decrRef();"
465 %feature("unref") DataArrayDouble "$this->decrRef();"
466 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
467 %feature("unref") MEDCouplingMesh "$this->decrRef();"
468 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
469 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
470 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
471 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
473 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
474 %feature("unref") DataArrayInt "$this->decrRef();"
475 %feature("unref") DataArrayChar "$this->decrRef();"
476 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
477 %feature("unref") DataArrayByte "$this->decrRef();"
478 %feature("unref") MEDCouplingField "$this->decrRef();"
479 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
480 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
481 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
482 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
483 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
484 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
485 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
486 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
487 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
489 %rename(assign) *::operator=;
490 %ignore ParaMEDMEM::RefCountObject::decrRef;
491 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
492 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
493 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
494 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
498 %rename (InterpKernelException) INTERP_KERNEL::Exception;
500 namespace INTERP_KERNEL
505 Exception(const char* what);
506 ~Exception() throw ();
507 const char *what() const throw ();
510 std::string __str__() const
512 return std::string(self->what());
523 void declareAsNew() const;
524 virtual void updateTime() const;
525 unsigned int getTimeOfThis() const;
553 CONST_ON_TIME_INTERVAL = 7
554 } TypeOfTimeDiscretization;
556 const char *MEDCouplingVersionStr();
557 int MEDCouplingVersion();
558 int MEDCouplingSizeOfVoidStar();
559 bool MEDCouplingByteOrder();
560 const char *MEDCouplingByteOrderStr();
562 class BigMemoryObject
565 std::size_t getHeapMemorySize() const throw(INTERP_KERNEL::Exception);
566 std::string getHeapMemorySizeStr() const throw(INTERP_KERNEL::Exception);
567 virtual std::size_t getHeapMemorySizeWithoutChildren() const throw(INTERP_KERNEL::Exception);
568 virtual ~BigMemoryObject();
571 virtual PyObject *getDirectChildren() const throw(INTERP_KERNEL::Exception)
573 std::vector<const BigMemoryObject *> c(self->getDirectChildren());
574 PyObject *ret(PyList_New(c.size()));
575 for(std::size_t i=0;i<c.size();i++)
576 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_ParaMEDMEM__BigMemoryObject, 0 | 0 ));
580 static std::size_t GetHeapMemorySizeOfObjs(PyObject *objs) throw(INTERP_KERNEL::Exception)
582 std::vector<const BigMemoryObject *> cppObjs;
583 convertFromPyObjVectorOfObj<const ParaMEDMEM::BigMemoryObject *>(objs,SWIGTYPE_p_ParaMEDMEM__BigMemoryObject,"BigMemoryObject",cppObjs);
584 return BigMemoryObject::GetHeapMemorySizeOfObjs(cppObjs);
589 class RefCountObjectOnly
592 bool decrRef() const;
593 void incrRef() const;
594 int getRCValue() const;
595 RefCountObjectOnly& operator=(const RefCountObjectOnly& other);
597 ~RefCountObjectOnly();
600 class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
609 PyObject *MEDCouplingVersionMajMinRel()
611 int tmp0=0,tmp1=0,tmp2=0;
612 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
613 PyObject *res = PyList_New(3);
614 PyList_SetItem(res,0,SWIG_From_int(tmp0));
615 PyList_SetItem(res,1,SWIG_From_int(tmp1));
616 PyList_SetItem(res,2,SWIG_From_int(tmp2));
620 bool MEDCouplingHasNumPyBindings()
629 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
631 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
632 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
633 if(PyRun_SimpleString(script)!=0)
634 throw INTERP_KERNEL::Exception(oss.str().c_str());
635 return std::string(script);
639 %include "MEDCouplingMemArray.i"
649 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
650 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11
651 } MEDCouplingMeshType;
654 class DataArrayDouble;
655 class MEDCouplingUMesh;
656 class MEDCouplingFieldDouble;
658 %extend RefCountObject
660 std::string getHiddenCppPointer() const
662 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
667 %extend MEDCouplingGaussLocalization
669 std::string __str__() const throw(INTERP_KERNEL::Exception)
671 return self->getStringRepr();
674 std::string __repr__() const throw(INTERP_KERNEL::Exception)
676 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
677 oss << self->getStringRepr();
684 class MEDCouplingMesh : public RefCountObject, public TimeLabel
687 void setName(const char *name);
688 std::string getName() const;
689 void setDescription(const char *descr);
690 std::string getDescription() const;
691 void setTime(double val, int iteration, int order);
692 void setTimeUnit(const char *unit);
693 const char *getTimeUnit() const;
694 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
695 bool isStructured() const throw(INTERP_KERNEL::Exception);
696 virtual MEDCouplingMesh *deepCpy() const;
697 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
698 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
699 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
700 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
701 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
702 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
703 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
704 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
705 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
706 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
707 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
708 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
709 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
710 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
711 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
712 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
713 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
714 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
715 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
716 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
717 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
718 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
719 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
720 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
721 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
723 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
724 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
725 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
726 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
727 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
728 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
729 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
730 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
731 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
732 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
733 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
734 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
735 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
736 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
737 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
738 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
739 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
742 std::string __str__() const throw(INTERP_KERNEL::Exception)
744 return self->simpleRepr();
747 PyObject *getTime() throw(INTERP_KERNEL::Exception)
750 double tmp0=self->getTime(tmp1,tmp2);
751 PyObject *res = PyList_New(3);
752 PyList_SetItem(res,0,SWIG_From_double(tmp0));
753 PyList_SetItem(res,1,SWIG_From_int(tmp1));
754 PyList_SetItem(res,2,SWIG_From_int(tmp2));
758 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
762 DataArrayDoubleTuple *aa;
763 std::vector<double> bb;
765 int spaceDim=self->getSpaceDimension();
766 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
767 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
768 return self->getCellContainingPoint(pos,eps);
771 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
775 DataArrayDoubleTuple *aa;
776 std::vector<double> bb;
778 int spaceDim=self->getSpaceDimension();
779 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
780 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
781 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
782 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
783 PyObject *ret=PyTuple_New(2);
784 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
785 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
789 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
791 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
792 int spaceDim=self->getSpaceDimension();
794 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
795 if (!SWIG_IsOK(res1))
798 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
799 int nbOfPoints=size/spaceDim;
802 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
804 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
808 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
810 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
811 da2->checkAllocated();
812 int size=da2->getNumberOfTuples();
813 int nbOfCompo=da2->getNumberOfComponents();
814 if(nbOfCompo!=spaceDim)
816 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
818 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
820 PyObject *ret=PyTuple_New(2);
821 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
822 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
826 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
830 DataArrayDoubleTuple *aa;
831 std::vector<double> bb;
833 int spaceDim=self->getSpaceDimension();
834 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
835 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
836 std::vector<int> elts;
837 self->getCellsContainingPoint(pos,eps,elts);
838 DataArrayInt *ret=DataArrayInt::New();
839 ret->alloc((int)elts.size(),1);
840 std::copy(elts.begin(),elts.end(),ret->getPointer());
841 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
844 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
847 int v0; std::vector<int> v1;
848 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
849 self->renumberCells(ids,check);
852 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
854 DataArrayInt *cellCor, *nodeCor;
855 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
856 PyObject *res = PyList_New(2);
857 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
858 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
862 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
864 DataArrayInt *cellCor=0,*nodeCor=0;
865 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
866 PyObject *res = PyList_New(2);
867 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
868 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
872 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
874 DataArrayInt *cellCor=0;
875 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
879 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
882 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
883 if (!SWIG_IsOK(res1))
886 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
887 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
891 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
893 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
894 da2->checkAllocated();
895 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
898 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
900 std::vector<int> conn;
901 self->getNodeIdsOfCell(cellId,conn);
902 return convertIntArrToPyList2(conn);
905 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
907 std::vector<double> coo;
908 self->getCoordinatesOfNode(nodeId,coo);
909 return convertDblArrToPyList2(coo);
912 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
916 DataArrayDoubleTuple *aa;
917 std::vector<double> bb;
919 int spaceDim=self->getSpaceDimension();
920 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
921 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
922 self->scale(pointPtr,factor);
925 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
927 int spaceDim=self->getSpaceDimension();
928 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
929 self->getBoundingBox(tmp);
930 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
934 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
937 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
938 PyObject *ret=PyTuple_New(2);
939 PyObject *ret0Py=ret0?Py_True:Py_False;
941 PyTuple_SetItem(ret,0,ret0Py);
942 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
946 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
948 int szArr,sw,iTypppArr;
949 std::vector<int> stdvecTyyppArr;
950 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
951 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
952 if(sw==3)//DataArrayInt
954 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
955 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
956 std::string name=argpt->getName();
958 ret->setName(name.c_str());
960 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
963 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
965 int szArr,sw,iTypppArr;
966 std::vector<int> stdvecTyyppArr;
968 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
969 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
970 if(sw==3)//DataArrayInt
972 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
973 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
974 std::string name=argpt->getName();
976 ret->setName(name.c_str());
979 PyObject *res = PyList_New(2);
980 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
981 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
982 PyList_SetItem(res,0,obj0);
983 PyList_SetItem(res,1,obj1);
987 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
991 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
992 PyObject *res = PyTuple_New(2);
993 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
996 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
998 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
999 PyTuple_SetItem(res,0,obj0);
1000 PyTuple_SetItem(res,1,obj1);
1004 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1006 std::vector<int> vals=self->getDistributionOfTypes();
1007 if(vals.size()%3!=0)
1008 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1009 PyObject *ret=PyList_New((int)vals.size()/3);
1010 for(int j=0;j<(int)vals.size()/3;j++)
1012 PyObject *ret1=PyList_New(3);
1013 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1014 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1015 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1016 PyList_SetItem(ret,j,ret1);
1021 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1023 std::vector<int> code;
1024 std::vector<const DataArrayInt *> idsPerType;
1025 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1026 convertPyToNewIntArr4(li,1,3,code);
1027 return self->checkTypeConsistencyAndContig(code,idsPerType);
1030 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1032 std::vector<int> code;
1033 std::vector<DataArrayInt *> idsInPflPerType;
1034 std::vector<DataArrayInt *> idsPerType;
1035 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1036 PyObject *ret=PyTuple_New(3);
1038 if(code.size()%3!=0)
1039 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1040 PyObject *ret0=PyList_New((int)code.size()/3);
1041 for(int j=0;j<(int)code.size()/3;j++)
1043 PyObject *ret00=PyList_New(3);
1044 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1045 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1046 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1047 PyList_SetItem(ret0,j,ret00);
1049 PyTuple_SetItem(ret,0,ret0);
1051 PyObject *ret1=PyList_New(idsInPflPerType.size());
1052 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1053 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1054 PyTuple_SetItem(ret,1,ret1);
1055 int n=idsPerType.size();
1056 PyObject *ret2=PyList_New(n);
1057 for(int i=0;i<n;i++)
1058 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1059 PyTuple_SetItem(ret,2,ret2);
1063 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1067 DataArrayDoubleTuple *aa;
1068 std::vector<double> bb;
1070 int spaceDim=self->getSpaceDimension();
1071 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1072 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1073 self->translate(vectorPtr);
1076 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1078 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1081 DataArrayDoubleTuple *aa;
1082 std::vector<double> bb;
1084 int spaceDim=self->getSpaceDimension();
1085 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1086 self->rotate(centerPtr,0,alpha);
1089 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1091 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1093 DataArrayDouble *a,*a2;
1094 DataArrayDoubleTuple *aa,*aa2;
1095 std::vector<double> bb,bb2;
1097 int spaceDim=self->getSpaceDimension();
1098 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1099 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
1100 self->rotate(centerPtr,vectorPtr,alpha);
1103 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1105 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1106 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1107 PyObject *res=PyList_New(result.size());
1108 for(int i=0;iL!=result.end(); i++, iL++)
1109 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1113 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1115 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1116 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1117 return MEDCouplingMesh::MergeMeshes(tmp);
1123 //== MEDCouplingMesh End
1125 %include "NormalizedGeometricTypes"
1126 %include "MEDCouplingNatureOfFieldEnum"
1128 namespace ParaMEDMEM
1130 class MEDCouplingNatureOfField
1133 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1134 static std::string GetReprNoThrow(NatureOfField nat);
1135 static std::string GetAllPossibilitiesStr();
1139 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1140 // include "MEDCouplingTimeDiscretization.i"
1142 namespace ParaMEDMEM
1144 class MEDCouplingGaussLocalization
1147 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1148 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1149 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1150 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1151 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1152 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1153 int getDimension() const throw(INTERP_KERNEL::Exception);
1154 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1155 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1156 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1157 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1159 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1160 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1161 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1162 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1163 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1164 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1165 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1166 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1167 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1168 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1169 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1170 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1172 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1176 %include "MEDCouplingFieldDiscretization.i"
1178 //== MEDCouplingPointSet
1180 namespace ParaMEDMEM
1182 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1185 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1186 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1187 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1188 void zipCoords() throw(INTERP_KERNEL::Exception);
1189 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1190 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1191 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1192 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1193 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1194 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1195 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1196 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1197 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1198 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1199 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1200 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1201 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1202 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1203 virtual DataArrayInt *findBoundaryNodes() const;
1204 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1205 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1206 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1207 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1208 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1209 virtual DataArrayDouble *getBoundingBoxForBBTree() const throw(INTERP_KERNEL::Exception);
1212 std::string __str__() const throw(INTERP_KERNEL::Exception)
1214 return self->simpleRepr();
1217 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1220 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1221 PyObject *res = PyList_New(2);
1222 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1223 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1227 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1229 DataArrayInt *comm, *commIndex;
1230 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1231 PyObject *res = PyList_New(2);
1232 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1233 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1237 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1239 DataArrayDouble *ret1=self->getCoords();
1242 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1245 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1247 int szArr,sw,iTypppArr;
1248 std::vector<int> stdvecTyyppArr;
1249 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1250 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1251 if(sw==3)//DataArrayInt
1253 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1254 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1255 std::string name=argpt->getName();
1257 ret->setName(name.c_str());
1259 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1262 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1264 int szArr,sw,iTypppArr;
1265 std::vector<int> stdvecTyyppArr;
1266 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1267 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1268 if(sw==3)//DataArrayInt
1270 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1271 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1272 std::string name=argpt->getName();
1274 ret->setName(name.c_str());
1276 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1279 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1281 int szArr,sw,iTypppArr;
1282 std::vector<int> stdvecTyyppArr;
1283 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1284 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1285 if(sw==3)//DataArrayInt
1287 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1288 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1289 std::string name=argpt->getName();
1291 ret->setName(name.c_str());
1293 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1296 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1298 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1299 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1302 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1304 int szArr,sw,iTypppArr;
1305 std::vector<int> stdvecTyyppArr;
1306 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1307 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1308 if(sw==3)//DataArrayInt
1310 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1311 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1312 std::string name=argpt->getName();
1314 ret->setName(name.c_str());
1316 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1319 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1321 int szArr,sw,iTypppArr;
1322 std::vector<int> stdvecTyyppArr;
1323 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1324 self->renumberNodes(tmp,newNbOfNodes);
1327 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1329 int szArr,sw,iTypppArr;
1330 std::vector<int> stdvecTyyppArr;
1331 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1332 self->renumberNodes2(tmp,newNbOfNodes);
1335 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1337 int spaceDim=self->getSpaceDimension();
1339 DataArrayDouble *a,*a2;
1340 DataArrayDoubleTuple *aa,*aa2;
1341 std::vector<double> bb,bb2;
1343 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1344 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1345 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1346 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1347 std::vector<int> nodes;
1348 self->findNodesOnLine(p,v,eps,nodes);
1349 DataArrayInt *ret=DataArrayInt::New();
1350 ret->alloc((int)nodes.size(),1);
1351 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1352 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1354 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1356 int spaceDim=self->getSpaceDimension();
1358 DataArrayDouble *a,*a2;
1359 DataArrayDoubleTuple *aa,*aa2;
1360 std::vector<double> bb,bb2;
1362 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1363 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1364 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1365 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1366 std::vector<int> nodes;
1367 self->findNodesOnPlane(p,v,eps,nodes);
1368 DataArrayInt *ret=DataArrayInt::New();
1369 ret->alloc((int)nodes.size(),1);
1370 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1371 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1374 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1378 DataArrayDoubleTuple *aa;
1379 std::vector<double> bb;
1381 int spaceDim=self->getSpaceDimension();
1382 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1383 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1384 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1385 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1388 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1390 DataArrayInt *c=0,*cI=0;
1394 DataArrayDoubleTuple *aa;
1395 std::vector<double> bb;
1397 int spaceDim=self->getSpaceDimension();
1398 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1399 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1400 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1401 PyObject *ret=PyTuple_New(2);
1402 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1403 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1407 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1409 DataArrayInt *c=0,*cI=0;
1410 int spaceDim=self->getSpaceDimension();
1413 DataArrayDoubleTuple *aa;
1414 std::vector<double> bb;
1417 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1418 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1420 PyObject *ret=PyTuple_New(2);
1421 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1430 DataArrayDoubleTuple *aa;
1431 std::vector<double> bb;
1433 int spaceDim=self->getSpaceDimension();
1434 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1435 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1437 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1438 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1441 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1445 std::vector<int> multiVal;
1446 std::pair<int, std::pair<int,int> > slic;
1447 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1448 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1452 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1454 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1456 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1458 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1462 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1464 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1465 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1466 self->getReverseNodalConnectivity(d0,d1);
1467 PyObject *ret=PyTuple_New(2);
1468 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1469 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1473 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1475 DataArrayInt *v0=0,*v1=0;
1476 self->findCommonCells(compType,startCellId,v0,v1);
1477 PyObject *res = PyList_New(2);
1478 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1479 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1484 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1487 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1488 if (!SWIG_IsOK(res1))
1491 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1492 self->renumberNodesInConn(tmp);
1496 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1498 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1499 da2->checkAllocated();
1500 self->renumberNodesInConn(da2->getConstPointer());
1504 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1507 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1508 PyObject *ret=PyTuple_New(2);
1509 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1510 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1514 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1516 DataArrayInt *ret=0;
1518 int szArr,sw,iTypppArr;
1519 std::vector<int> stdvecTyyppArr;
1520 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1521 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1525 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1529 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1530 PyObject *res = PyList_New(3);
1531 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1532 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1533 PyList_SetItem(res,2,SWIG_From_int(ret2));
1537 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1541 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1542 PyObject *res = PyList_New(3);
1543 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1544 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1545 PyList_SetItem(res,2,SWIG_From_int(ret2));
1549 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1552 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1553 if (!SWIG_IsOK(res1))
1556 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1557 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1561 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1563 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1564 da2->checkAllocated();
1565 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1569 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1573 std::vector<int> multiVal;
1574 std::pair<int, std::pair<int,int> > slic;
1575 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1576 int nbc=self->getNumberOfCells();
1577 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1584 std::ostringstream oss;
1585 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1586 throw INTERP_KERNEL::Exception(oss.str().c_str());
1589 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1594 int tmp=nbc+singleVal;
1595 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1599 std::ostringstream oss;
1600 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1601 throw INTERP_KERNEL::Exception(oss.str().c_str());
1607 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1611 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1616 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1617 daIntTyypp->checkAllocated();
1618 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1621 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1625 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1628 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1629 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1630 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1631 for(int i=0;i<sz;i++)
1632 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1635 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1638 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1640 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1641 std::vector<double> val3;
1642 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1643 "Rotate2DAlg",2,true,nbNodes);
1645 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1646 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1649 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1652 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1653 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1654 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1655 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1656 for(int i=0;i<sz;i++)
1657 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1660 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1663 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1665 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1666 std::vector<double> val3;
1667 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1668 "Rotate3DAlg",3,true,nbNodes);
1670 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1671 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1672 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1677 //== MEDCouplingPointSet End
1679 class MEDCouplingUMeshCell
1682 INTERP_KERNEL::NormalizedCellType getType() const;
1685 std::string __str__() const throw(INTERP_KERNEL::Exception)
1687 return self->repr();
1690 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1693 const int *r=self->getAllConn(ret2);
1694 PyObject *ret=PyTuple_New(ret2);
1695 for(int i=0;i<ret2;i++)
1696 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1702 class MEDCouplingUMeshCellIterator
1709 MEDCouplingUMeshCell *ret=self->nextt();
1711 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1714 PyErr_SetString(PyExc_StopIteration,"No more data.");
1721 class MEDCouplingUMeshCellByTypeIterator
1724 ~MEDCouplingUMeshCellByTypeIterator();
1729 MEDCouplingUMeshCellEntry *ret=self->nextt();
1731 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1734 PyErr_SetString(PyExc_StopIteration,"No more data.");
1741 class MEDCouplingUMeshCellByTypeEntry
1744 ~MEDCouplingUMeshCellByTypeEntry();
1747 MEDCouplingUMeshCellByTypeIterator *__iter__()
1749 return self->iterator();
1754 class MEDCouplingUMeshCellEntry
1757 INTERP_KERNEL::NormalizedCellType getType() const;
1758 int getNumberOfElems() const;
1761 MEDCouplingUMeshCellIterator *__iter__()
1763 return self->iterator();
1768 //== MEDCouplingUMesh
1770 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1773 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1774 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1775 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1776 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1777 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1778 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1779 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1780 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1781 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1782 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1783 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1784 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1785 void computeTypes() throw(INTERP_KERNEL::Exception);
1786 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1787 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1789 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1790 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1791 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1792 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1793 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1794 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1795 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1796 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1797 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1798 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1799 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1800 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1801 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1802 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1803 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1804 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1805 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1806 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1807 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1808 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1809 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1810 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1811 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1812 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1813 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1814 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1815 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1816 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1817 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1818 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1819 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1820 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1821 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1822 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1823 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1824 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1825 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1826 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1827 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1829 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1831 return MEDCouplingUMesh::New();
1834 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1836 return MEDCouplingUMesh::New(meshName,meshDim);
1839 std::string __str__() const throw(INTERP_KERNEL::Exception)
1841 return self->simpleRepr();
1844 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1846 std::ostringstream oss;
1847 self->reprQuickOverview(oss);
1851 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1853 return self->cellIterator();
1856 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1860 std::vector<int> multiVal;
1861 std::pair<int, std::pair<int,int> > slic;
1862 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1863 int nbc=self->getNumberOfCells();
1864 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1871 std::ostringstream oss;
1872 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1873 throw INTERP_KERNEL::Exception(oss.str().c_str());
1877 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1884 int tmp=nbc+singleVal;
1885 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1890 std::ostringstream oss;
1891 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1892 throw INTERP_KERNEL::Exception(oss.str().c_str());
1898 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1904 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1905 daIntTyypp->checkAllocated();
1906 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1910 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1914 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1918 std::vector<int> multiVal;
1919 std::pair<int, std::pair<int,int> > slic;
1920 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1921 int nbc=self->getNumberOfCells();
1922 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1929 std::ostringstream oss;
1930 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1931 throw INTERP_KERNEL::Exception(oss.str().c_str());
1935 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1942 int tmp=nbc+singleVal;
1943 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1948 std::ostringstream oss;
1949 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1950 throw INTERP_KERNEL::Exception(oss.str().c_str());
1956 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1961 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1967 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1968 daIntTyypp->checkAllocated();
1969 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1973 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1977 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1979 int szArr,sw,iTypppArr;
1980 std::vector<int> stdvecTyyppArr;
1981 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1984 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1985 throw INTERP_KERNEL::Exception(oss.str().c_str());
1987 self->insertNextCell(type,size,tmp);
1990 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1992 int szArr,sw,iTypppArr;
1993 std::vector<int> stdvecTyyppArr;
1994 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1995 self->insertNextCell(type,szArr,tmp);
1998 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2000 DataArrayInt *ret=self->getNodalConnectivity();
2005 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2007 DataArrayInt *ret=self->getNodalConnectivityIndex();
2012 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
2014 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
2015 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2016 PyObject *res = PyList_New(result.size());
2017 for (int i=0;iL!=result.end(); i++, iL++)
2018 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2022 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2024 int szArr,sw,iTypppArr;
2025 std::vector<int> stdvecTyyppArr;
2026 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2027 int nbOfDepthPeelingPerformed=0;
2028 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2029 PyObject *res=PyTuple_New(2);
2030 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2031 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2035 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2037 DataArrayInt *v0=0,*v1=0;
2038 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2039 PyObject *res = PyList_New(2);
2040 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2041 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2045 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2049 DataArrayDoubleTuple *aa;
2050 std::vector<double> bb;
2052 int nbOfCompo=self->getSpaceDimension();
2053 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2056 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2057 PyObject *ret=PyTuple_New(2);
2058 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2059 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2063 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2065 DataArrayInt *ret1=0;
2066 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2067 PyObject *ret=PyTuple_New(2);
2068 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2069 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2073 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2076 DataArrayInt *ret1(0);
2077 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2078 PyObject *ret=PyTuple_New(3);
2079 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2080 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2081 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2085 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2087 std::vector<int> cells;
2088 self->checkButterflyCells(cells,eps);
2089 DataArrayInt *ret=DataArrayInt::New();
2090 ret->alloc((int)cells.size(),1);
2091 std::copy(cells.begin(),cells.end(),ret->getPointer());
2092 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2095 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2097 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2099 PyObject *ret = PyList_New(sz);
2100 for(int i=0;i<sz;i++)
2101 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2105 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2107 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2108 int sz=retCpp.size();
2109 PyObject *ret=PyList_New(sz);
2110 for(int i=0;i<sz;i++)
2111 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2115 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2118 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2119 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2120 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2123 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2126 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2127 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2131 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2134 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2135 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2139 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2141 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2142 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2143 PyObject *ret=PyTuple_New(3);
2144 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2145 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2146 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2150 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2152 DataArrayInt *tmp0=0,*tmp1=0;
2153 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2154 PyObject *ret=PyTuple_New(2);
2155 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2164 std::vector<int> multiVal;
2165 std::pair<int, std::pair<int,int> > slic;
2166 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2167 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2171 return self->duplicateNodes(&singleVal,&singleVal+1);
2173 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2175 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2177 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2181 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2185 std::vector<int> multiVal;
2186 std::pair<int, std::pair<int,int> > slic;
2187 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2188 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2192 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2194 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2196 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2198 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2202 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2205 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2206 DataArrayInt *tmp0,*tmp1=0;
2207 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2208 PyObject *ret=PyTuple_New(2);
2209 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2216 DataArrayInt *ret0=0,*ret1=0;
2217 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2218 PyObject *ret=PyTuple_New(2);
2219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2226 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2227 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2228 DataArrayInt *ret1=0,*ret2=0;
2229 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2230 PyObject *ret=PyTuple_New(3);
2231 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2232 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2237 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2239 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2240 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2241 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2242 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2245 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2248 std::vector<const MEDCouplingUMesh *> meshes;
2249 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2250 std::vector<DataArrayInt *> corr;
2251 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2253 PyObject *ret1=PyList_New(sz);
2254 for(int i=0;i<sz;i++)
2255 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2256 PyObject *ret=PyList_New(2);
2257 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2258 PyList_SetItem(ret,1,ret1);
2262 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2264 std::vector<MEDCouplingUMesh *> meshes;
2265 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2266 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2269 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2271 std::vector<MEDCouplingUMesh *> meshes;
2272 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2273 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2276 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2280 std::vector<int> multiVal;
2281 std::pair<int, std::pair<int,int> > slic;
2282 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2284 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2285 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2289 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2291 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2293 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2295 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2299 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2301 DataArrayInt *arrOut=0,*arrIndexOut=0;
2304 std::vector<int> multiVal;
2305 std::pair<int, std::pair<int,int> > slic;
2306 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2308 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2309 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2314 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2319 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2324 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2328 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2330 PyObject *ret=PyTuple_New(2);
2331 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2332 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2336 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2338 DataArrayInt *arrOut=0,*arrIndexOut=0;
2339 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
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 PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2348 if(!PySlice_Check(slic))
2349 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2350 Py_ssize_t strt=2,stp=2,step=2;
2351 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2353 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2354 arrIndxIn->checkAllocated();
2355 if(arrIndxIn->getNumberOfComponents()!=1)
2356 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2357 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2358 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2359 DataArrayInt *arrOut=0,*arrIndexOut=0;
2360 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2361 PyObject *ret=PyTuple_New(2);
2362 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2368 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2369 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2371 DataArrayInt *arrOut=0,*arrIndexOut=0;
2374 std::vector<int> multiVal;
2375 std::pair<int, std::pair<int,int> > slic;
2376 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2378 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2379 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2384 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2389 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2394 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2398 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2400 PyObject *ret=PyTuple_New(2);
2401 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2402 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2407 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2411 std::vector<int> multiVal;
2412 std::pair<int, std::pair<int,int> > slic;
2413 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2415 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2416 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2421 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2426 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2431 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2435 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2439 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2443 DataArrayDoubleTuple *aa;
2444 std::vector<double> bb;
2446 int spaceDim=self->getSpaceDimension();
2447 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2448 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2450 std::vector<int> cells;
2451 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2452 DataArrayInt *ret=DataArrayInt::New();
2453 ret->alloc((int)cells.size(),1);
2454 std::copy(cells.begin(),cells.end(),ret->getPointer());
2455 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2458 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2462 DataArrayDoubleTuple *aa;
2463 std::vector<double> bb;
2465 int spaceDim=self->getSpaceDimension();
2466 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2467 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2468 self->orientCorrectly2DCells(v,polyOnly);
2471 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2473 std::vector<int> cells;
2474 self->arePolyhedronsNotCorrectlyOriented(cells);
2475 DataArrayInt *ret=DataArrayInt::New();
2476 ret->alloc((int)cells.size(),1);
2477 std::copy(cells.begin(),cells.end(),ret->getPointer());
2478 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2481 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2485 self->getFastAveragePlaneOfThis(vec,pos);
2487 std::copy(vec,vec+3,vals);
2488 std::copy(pos,pos+3,vals+3);
2489 return convertDblArrToPyListOfTuple(vals,3,2);
2492 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2494 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2495 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2496 return MEDCouplingUMesh::MergeUMeshes(tmp);
2499 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2502 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2503 PyObject *ret=PyTuple_New(2);
2504 PyObject *ret0Py=ret0?Py_True:Py_False;
2506 PyTuple_SetItem(ret,0,ret0Py);
2507 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2511 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2514 bool ret0=self->areCellsIncludedIn2(other,ret1);
2515 PyObject *ret=PyTuple_New(2);
2516 PyObject *ret0Py=ret0?Py_True:Py_False;
2518 PyTuple_SetItem(ret,0,ret0Py);
2519 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2525 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2526 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2527 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2528 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2529 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2530 PyObject *ret=PyTuple_New(5);
2531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2532 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2533 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2534 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2541 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2542 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2543 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2544 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2545 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2546 PyObject *ret=PyTuple_New(5);
2547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2548 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2549 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2550 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2551 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2557 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2558 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2559 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2560 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2561 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2562 PyObject *ret=PyTuple_New(5);
2563 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2564 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2565 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2567 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2571 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2573 DataArrayInt *neighbors=0,*neighborsIdx=0;
2574 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2575 PyObject *ret=PyTuple_New(2);
2576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2577 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2581 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2583 DataArrayInt *neighbors=0,*neighborsIdx=0;
2584 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2585 PyObject *ret=PyTuple_New(2);
2586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2591 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2593 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2594 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2595 DataArrayInt *d2,*d3,*d4,*dd5;
2596 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2597 PyObject *ret=PyTuple_New(7);
2598 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2599 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2600 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2602 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2603 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2608 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2611 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2612 da->checkAllocated();
2613 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2616 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2619 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2620 da->checkAllocated();
2621 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2624 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2627 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2628 da->checkAllocated();
2629 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2632 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2635 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2636 da->checkAllocated();
2637 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2638 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2639 PyObject *res = PyList_New(result.size());
2640 for (int i=0;iL!=result.end(); i++, iL++)
2641 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2645 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2648 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2649 da->checkAllocated();
2650 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2651 ret->setName(da->getName().c_str());
2655 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2657 DataArrayInt *cellNb1=0,*cellNb2=0;
2658 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2659 PyObject *ret=PyTuple_New(3);
2660 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2662 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2666 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2668 int spaceDim=self->getSpaceDimension();
2670 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2672 DataArrayDouble *a,*a2;
2673 DataArrayDoubleTuple *aa,*aa2;
2674 std::vector<double> bb,bb2;
2676 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2677 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2678 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2679 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2681 DataArrayInt *cellIds=0;
2682 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2683 PyObject *ret=PyTuple_New(2);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2691 int spaceDim=self->getSpaceDimension();
2693 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2695 DataArrayDouble *a,*a2;
2696 DataArrayDoubleTuple *aa,*aa2;
2697 std::vector<double> bb,bb2;
2699 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2700 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2701 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2702 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2704 DataArrayInt *cellIds=0;
2705 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2706 PyObject *ret=PyTuple_New(2);
2707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2714 int spaceDim=self->getSpaceDimension();
2716 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2718 DataArrayDouble *a,*a2;
2719 DataArrayDoubleTuple *aa,*aa2;
2720 std::vector<double> bb,bb2;
2722 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2723 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2724 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2725 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2726 return self->getCellIdsCrossingPlane(orig,vect,eps);
2729 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2733 std::vector<int> pos2;
2734 DataArrayInt *pos3=0;
2735 DataArrayIntTuple *pos4=0;
2736 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2741 self->convertToPolyTypes(&pos1,&pos1+1);
2748 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2753 self->convertToPolyTypes(pos3->begin(),pos3->end());
2757 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2761 void convertAllToPoly();
2762 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2763 bool unPolyze() throw(INTERP_KERNEL::Exception);
2764 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2765 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2766 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2769 //== MEDCouplingUMesh End
2771 //== MEDCouplingExtrudedMesh
2773 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2776 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2777 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2779 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2781 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2784 std::string __str__() const throw(INTERP_KERNEL::Exception)
2786 return self->simpleRepr();
2789 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2791 std::ostringstream oss;
2792 self->reprQuickOverview(oss);
2796 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2798 MEDCouplingUMesh *ret=self->getMesh2D();
2801 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2803 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2805 MEDCouplingUMesh *ret=self->getMesh1D();
2808 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2810 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2812 DataArrayInt *ret=self->getMesh3DIds();
2815 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2820 //== MEDCouplingExtrudedMesh End
2822 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2825 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2826 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2827 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2828 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2829 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2830 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2833 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2835 int szArr,sw,iTypppArr;
2836 std::vector<int> stdvecTyyppArr;
2837 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2838 self->insertNextCell(tmp,tmp+szArr);
2841 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2843 DataArrayInt *ret=self->getNodalConnectivity();
2844 if(ret) ret->incrRef();
2848 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2850 std::vector< const MEDCoupling1GTUMesh *> parts;
2851 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2852 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2857 //== MEDCoupling1SGTUMesh
2859 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2862 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2863 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2864 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2865 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2866 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2867 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2868 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2871 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2873 return MEDCoupling1SGTUMesh::New(name,type);
2876 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2878 return MEDCoupling1SGTUMesh::New(m);
2881 std::string __str__() const throw(INTERP_KERNEL::Exception)
2883 return self->simpleRepr();
2886 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2888 std::ostringstream oss;
2889 self->reprQuickOverview(oss);
2893 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2895 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2896 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2897 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2900 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2902 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2903 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2904 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2909 //== MEDCoupling1SGTUMesh End
2911 //== MEDCoupling1DGTUMesh
2913 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2916 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2917 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2918 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2919 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2920 bool isPacked() const throw(INTERP_KERNEL::Exception);
2923 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2925 return MEDCoupling1DGTUMesh::New(name,type);
2928 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2930 return MEDCoupling1DGTUMesh::New(m);
2933 std::string __str__() const throw(INTERP_KERNEL::Exception)
2935 return self->simpleRepr();
2938 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2940 std::ostringstream oss;
2941 self->reprQuickOverview(oss);
2945 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2947 DataArrayInt *ret=self->getNodalConnectivityIndex();
2948 if(ret) ret->incrRef();
2952 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2954 DataArrayInt *ret1=0,*ret2=0;
2955 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2956 PyObject *ret0Py=ret0?Py_True:Py_False;
2958 PyObject *ret=PyTuple_New(3);
2959 PyTuple_SetItem(ret,0,ret0Py);
2960 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2961 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2965 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2968 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2969 PyObject *ret=PyTuple_New(2);
2970 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2971 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2972 PyTuple_SetItem(ret,1,ret1Py);
2976 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2978 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2979 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2980 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2983 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2985 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2986 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2987 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2990 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2992 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2993 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2994 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2999 //== MEDCoupling1DGTUMeshEnd
3001 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3004 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3005 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3006 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3007 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3008 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3009 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3012 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3014 int tmpp1=-1,tmpp2=-1;
3015 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3016 std::vector< std::pair<int,int> > inp;
3020 for(int i=0;i<tmpp1;i++)
3021 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3026 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3027 inp.resize(tmpp1/2);
3028 for(int i=0;i<tmpp1/2;i++)
3029 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3032 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3033 return self->buildStructuredSubPart(inp);
3036 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3038 int tmpp1=-1,tmpp2=-1;
3039 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
3040 std::vector< std::pair<int,int> > inp;
3044 for(int i=0;i<tmpp1;i++)
3045 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3050 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
3051 inp.resize(tmpp1/2);
3052 for(int i=0;i<tmpp1/2;i++)
3053 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3056 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
3058 int szArr,sw,iTypppArr;
3059 std::vector<int> stdvecTyyppArr;
3060 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3061 std::vector<int> tmp5(tmp4,tmp4+szArr);
3063 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3066 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3068 int szArr,sw,iTypppArr;
3069 std::vector<int> stdvecTyyppArr;
3070 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3071 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3074 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3076 int szArr,sw,iTypppArr;
3077 std::vector<int> stdvecTyyppArr;
3078 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3079 int szArr2,sw2,iTypppArr2;
3080 std::vector<int> stdvecTyyppArr2;
3081 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3082 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3083 std::vector< std::pair<int,int> > partCompactFormat;
3084 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3085 PyObject *ret=PyTuple_New(2);
3086 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3087 PyTuple_SetItem(ret,0,ret0Py);
3088 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3089 for(std::size_t i=0;i<partCompactFormat.size();i++)
3091 PyObject *tmp4=PyTuple_New(2);
3092 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3093 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3094 PyList_SetItem(ret1Py,i,tmp4);
3096 PyTuple_SetItem(ret,1,ret1Py);
3102 //== MEDCouplingCMesh
3104 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3107 static MEDCouplingCMesh *New();
3108 static MEDCouplingCMesh *New(const char *meshName);
3109 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3110 void setCoords(const DataArrayDouble *coordsX,
3111 const DataArrayDouble *coordsY=0,
3112 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3113 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3117 return MEDCouplingCMesh::New();
3119 MEDCouplingCMesh(const char *meshName)
3121 return MEDCouplingCMesh::New(meshName);
3123 std::string __str__() const throw(INTERP_KERNEL::Exception)
3125 return self->simpleRepr();
3127 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3129 std::ostringstream oss;
3130 self->reprQuickOverview(oss);
3133 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3135 DataArrayDouble *ret=self->getCoordsAt(i);
3143 //== MEDCouplingCMesh End
3145 //== MEDCouplingCurveLinearMesh
3147 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3150 static MEDCouplingCurveLinearMesh *New();
3151 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3152 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3153 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3155 MEDCouplingCurveLinearMesh()
3157 return MEDCouplingCurveLinearMesh::New();
3159 MEDCouplingCurveLinearMesh(const char *meshName)
3161 return MEDCouplingCurveLinearMesh::New(meshName);
3163 std::string __str__() const throw(INTERP_KERNEL::Exception)
3165 return self->simpleRepr();
3167 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3169 std::ostringstream oss;
3170 self->reprQuickOverview(oss);
3173 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3175 DataArrayDouble *ret=self->getCoords();
3180 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3182 int szArr,sw,iTypppArr;
3183 std::vector<int> stdvecTyyppArr;
3184 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3185 self->setNodeGridStructure(tmp,tmp+szArr);
3190 //== MEDCouplingCurveLinearMesh End
3193 namespace ParaMEDMEM
3195 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3198 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3199 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3200 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3201 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3202 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3203 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3204 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3205 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3206 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3207 std::string getName() const throw(INTERP_KERNEL::Exception);
3208 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3209 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3210 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3211 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3212 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3213 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3214 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3215 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3216 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3217 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3218 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3219 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3220 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3221 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3222 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3223 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3225 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3227 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3230 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3233 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3235 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3238 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3241 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3243 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3244 return convertIntArrToPyList3(ret);
3247 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3250 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3251 PyObject *ret=PyTuple_New(2);
3252 PyObject *ret0Py=ret0?Py_True:Py_False;
3254 PyTuple_SetItem(ret,0,ret0Py);
3255 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3259 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3261 DataArrayInt *ret1=0;
3262 MEDCouplingMesh *ret0=0;
3264 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3265 if (!SWIG_IsOK(res1))
3268 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3269 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3273 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3275 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3276 da2->checkAllocated();
3277 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3279 PyObject *res = PyList_New(2);
3280 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3281 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3285 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3287 DataArrayInt *ret1=0;
3289 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3290 PyObject *res=PyTuple_New(2);
3291 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3293 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3296 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3297 PyTuple_SetItem(res,1,res1);
3302 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3305 int v0; std::vector<int> v1;
3306 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3307 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3310 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3311 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3314 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3315 if (!SWIG_IsOK(res1))
3318 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3319 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3323 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3325 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3326 da2->checkAllocated();
3327 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3331 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3333 std::vector<int> tmp;
3334 self->getCellIdsHavingGaussLocalization(locId,tmp);
3335 DataArrayInt *ret=DataArrayInt::New();
3336 ret->alloc((int)tmp.size(),1);
3337 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3338 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3341 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3343 std::vector<int> inp0;
3344 convertPyToNewIntArr4(code,1,3,inp0);
3345 std::vector<const DataArrayInt *> inp1;
3346 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3347 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3352 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3355 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3356 static MEDCouplingFieldTemplate *New(TypeOfField type);
3357 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3358 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3361 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3363 return MEDCouplingFieldTemplate::New(f);
3366 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3368 return MEDCouplingFieldTemplate::New(type);
3371 std::string __str__() const throw(INTERP_KERNEL::Exception)
3373 return self->simpleRepr();
3376 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3378 std::ostringstream oss;
3379 self->reprQuickOverview(oss);
3385 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3388 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3389 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3390 void setTimeUnit(const char *unit);
3391 const char *getTimeUnit() const;
3392 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3393 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3394 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3395 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3396 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3397 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3398 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3399 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3400 MEDCouplingFieldDouble *deepCpy() const;
3401 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3402 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3403 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3404 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3405 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3406 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3407 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3408 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3409 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3410 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3411 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3412 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3413 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3414 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3415 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3416 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3417 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3418 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3419 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3420 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3421 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3422 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3423 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3424 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3425 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3426 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3427 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3428 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3429 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3430 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3431 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3432 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3433 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3434 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3435 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3436 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3437 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3438 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3439 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3440 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3441 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3442 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3443 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3444 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3445 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3446 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3447 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3448 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3449 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3450 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3451 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3452 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3453 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3454 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3455 double getMinValue() const throw(INTERP_KERNEL::Exception);
3456 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3457 double norm2() const throw(INTERP_KERNEL::Exception);
3458 double normMax() const throw(INTERP_KERNEL::Exception);
3459 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3460 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3461 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3462 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3463 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3464 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3465 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3466 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3467 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3468 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3469 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3470 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3471 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3472 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3473 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3474 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3475 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3476 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3477 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3478 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3479 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3480 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3482 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3484 return MEDCouplingFieldDouble::New(type,td);
3487 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3489 return MEDCouplingFieldDouble::New(ft,td);
3492 std::string __str__() const throw(INTERP_KERNEL::Exception)
3494 return self->simpleRepr();
3497 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3499 std::ostringstream oss;
3500 self->reprQuickOverview(oss);
3504 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3506 DataArrayDouble *ret=self->getArray();
3512 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3514 std::vector<DataArrayDouble *> arrs=self->getArrays();
3515 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3519 PyObject *ret=PyTuple_New(sz);
3520 for(int i=0;i<sz;i++)
3523 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3525 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3530 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3532 std::vector<const DataArrayDouble *> tmp;
3533 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3535 std::vector<DataArrayDouble *> arrs(sz);
3536 for(int i=0;i<sz;i++)
3537 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3538 self->setArrays(arrs);
3541 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3543 DataArrayDouble *ret=self->getEndArray();
3549 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3553 DataArrayDoubleTuple *aa;
3554 std::vector<double> bb;
3556 const MEDCouplingMesh *mesh=self->getMesh();
3558 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3559 int spaceDim=mesh->getSpaceDimension();
3560 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3561 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3563 int sz=self->getNumberOfComponents();
3564 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3565 self->getValueOn(spaceLoc,res);
3566 return convertDblArrToPyList(res,sz);
3569 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3571 int sz=self->getNumberOfComponents();
3572 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3573 self->getValueOnPos(i,j,k,res);
3574 return convertDblArrToPyList(res,sz);
3577 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3579 const MEDCouplingMesh *mesh(self->getMesh());
3581 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3584 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3585 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3586 mesh->getSpaceDimension(),true,nbPts);
3587 return self->getValueOnMulti(inp,nbPts);
3590 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3594 DataArrayDoubleTuple *aa;
3595 std::vector<double> bb;
3597 const MEDCouplingMesh *mesh=self->getMesh();
3599 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3600 int spaceDim=mesh->getSpaceDimension();
3601 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3602 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3605 int sz=self->getNumberOfComponents();
3606 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3607 self->getValueOn(spaceLoc,time,res);
3608 return convertDblArrToPyList(res,sz);
3611 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3613 if(self->getArray()!=0)
3614 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3617 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3618 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3619 self->setArray(arr);
3623 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3626 double tmp0=self->getTime(tmp1,tmp2);
3627 PyObject *res = PyList_New(3);
3628 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3629 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3630 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3634 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3637 double tmp0=self->getStartTime(tmp1,tmp2);
3638 PyObject *res = PyList_New(3);
3639 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3640 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3641 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3645 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3648 double tmp0=self->getEndTime(tmp1,tmp2);
3649 PyObject *res = PyList_New(3);
3650 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3651 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3652 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3655 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3657 int sz=self->getNumberOfComponents();
3658 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3659 self->accumulate(tmp);
3660 return convertDblArrToPyList(tmp,sz);
3662 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3664 int sz=self->getNumberOfComponents();
3665 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3666 self->integral(isWAbs,tmp);
3667 return convertDblArrToPyList(tmp,sz);
3669 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3671 int sz=self->getNumberOfComponents();
3672 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3673 self->getWeightedAverageValue(tmp,isWAbs);
3674 return convertDblArrToPyList(tmp,sz);
3676 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3678 int sz=self->getNumberOfComponents();
3679 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3681 return convertDblArrToPyList(tmp,sz);
3683 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3685 int sz=self->getNumberOfComponents();
3686 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3688 return convertDblArrToPyList(tmp,sz);
3690 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3692 int szArr,sw,iTypppArr;
3693 std::vector<int> stdvecTyyppArr;
3694 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3695 self->renumberCells(tmp,check);
3698 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3700 int szArr,sw,iTypppArr;
3701 std::vector<int> stdvecTyyppArr;
3702 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3703 self->renumberCellsWithoutMesh(tmp,check);
3706 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3708 int szArr,sw,iTypppArr;
3709 std::vector<int> stdvecTyyppArr;
3710 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3711 self->renumberNodes(tmp,eps);
3714 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3716 int szArr,sw,iTypppArr;
3717 std::vector<int> stdvecTyyppArr;
3718 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3719 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3722 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3726 std::vector<int> multiVal;
3727 std::pair<int, std::pair<int,int> > slic;
3728 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3729 const MEDCouplingMesh *mesh=self->getMesh();
3731 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3732 int nbc=mesh->getNumberOfCells();
3733 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3740 std::ostringstream oss;
3741 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3742 throw INTERP_KERNEL::Exception(oss.str().c_str());
3745 return self->buildSubPart(&singleVal,&singleVal+1);
3750 int tmp=nbc+singleVal;
3751 return self->buildSubPart(&tmp,&tmp+1);
3755 std::ostringstream oss;
3756 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3757 throw INTERP_KERNEL::Exception(oss.str().c_str());
3763 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3767 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3772 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3773 daIntTyypp->checkAllocated();
3774 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3777 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3781 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3783 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";
3784 if(PyTuple_Check(li))
3786 Py_ssize_t sz=PyTuple_Size(li);
3788 throw INTERP_KERNEL::Exception(msg);
3789 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3792 std::vector<int> multiVal;
3793 std::pair<int, std::pair<int,int> > slic;
3794 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3795 if(!self->getArray())
3796 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3798 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3799 catch(INTERP_KERNEL::Exception& e)
3800 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3801 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3802 DataArrayDouble *ret0Arr=ret0->getArray();
3804 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3809 std::vector<int> v2(1,singleVal);
3810 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3811 ret0->setArray(aarr);
3816 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3817 ret0->setArray(aarr);
3822 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3823 std::vector<int> v2(nbOfComp);
3824 for(int i=0;i<nbOfComp;i++)
3825 v2[i]=slic.first+i*slic.second.second;
3826 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3827 ret0->setArray(aarr);
3831 throw INTERP_KERNEL::Exception(msg);
3836 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3839 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3842 double r1=self->getMaxValue2(tmp);
3843 PyObject *ret=PyTuple_New(2);
3844 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3845 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3849 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3852 double r1=self->getMinValue2(tmp);
3853 PyObject *ret=PyTuple_New(2);
3854 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3855 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3859 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3861 std::vector<int> tmp;
3862 convertPyToNewIntArr3(li,tmp);
3863 return self->keepSelectedComponents(tmp);
3866 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3868 std::vector<int> tmp;
3869 convertPyToNewIntArr3(li,tmp);
3870 self->setSelectedComponents(f,tmp);
3873 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3876 DataArrayDouble *a,*a2;
3877 DataArrayDoubleTuple *aa,*aa2;
3878 std::vector<double> bb,bb2;
3881 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3882 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3883 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3884 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3886 return self->extractSlice3D(orig,vect,eps);
3889 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3891 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3894 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3896 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3899 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3901 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.";
3902 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3905 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3907 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3909 return (*self)-(*other);
3911 throw INTERP_KERNEL::Exception(msg);
3916 DataArrayDoubleTuple *aa;
3917 std::vector<double> bb;
3919 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3924 if(!self->getArray())
3925 throw INTERP_KERNEL::Exception(msg2);
3926 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3927 ret->applyLin(1.,-val);
3928 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3929 ret2->setArray(ret);
3934 if(!self->getArray())
3935 throw INTERP_KERNEL::Exception(msg2);
3936 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3937 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3938 ret2->setArray(ret);
3943 if(!self->getArray())
3944 throw INTERP_KERNEL::Exception(msg2);
3945 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3947 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3948 ret2->setArray(ret);
3953 if(!self->getArray())
3954 throw INTERP_KERNEL::Exception(msg2);
3955 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3956 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3957 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3958 ret2->setArray(ret);
3962 { throw INTERP_KERNEL::Exception(msg); }
3966 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3968 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3971 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3973 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3976 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3978 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3981 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3983 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.";
3984 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3987 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3989 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3991 return (*self)/(*other);
3993 throw INTERP_KERNEL::Exception(msg);
3998 DataArrayDoubleTuple *aa;
3999 std::vector<double> bb;
4001 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4007 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4008 if(!self->getArray())
4009 throw INTERP_KERNEL::Exception(msg2);
4010 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4011 ret->applyLin(1./val,0);
4012 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4013 ret2->setArray(ret);
4018 if(!self->getArray())
4019 throw INTERP_KERNEL::Exception(msg2);
4020 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4021 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4022 ret2->setArray(ret);
4027 if(!self->getArray())
4028 throw INTERP_KERNEL::Exception(msg2);
4029 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4030 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4031 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4032 ret2->setArray(ret);
4037 if(!self->getArray())
4038 throw INTERP_KERNEL::Exception(msg2);
4039 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4040 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4041 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4042 ret2->setArray(ret);
4046 { throw INTERP_KERNEL::Exception(msg); }
4050 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4052 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4055 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4057 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.";
4058 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4061 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4063 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4065 return (*self)^(*other);
4067 throw INTERP_KERNEL::Exception(msg);
4072 DataArrayDoubleTuple *aa;
4073 std::vector<double> bb;
4075 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4080 if(!self->getArray())
4081 throw INTERP_KERNEL::Exception(msg2);
4082 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4084 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4085 ret2->setArray(ret);
4090 if(!self->getArray())
4091 throw INTERP_KERNEL::Exception(msg2);
4092 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4093 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4094 ret2->setArray(ret);
4099 if(!self->getArray())
4100 throw INTERP_KERNEL::Exception(msg2);
4101 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4102 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4103 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4104 ret2->setArray(ret);
4109 if(!self->getArray())
4110 throw INTERP_KERNEL::Exception(msg2);
4111 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4112 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4113 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4114 ret2->setArray(ret);
4118 { throw INTERP_KERNEL::Exception(msg); }
4122 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4124 return self->negate();
4127 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4129 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.";
4130 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4133 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4135 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4139 Py_XINCREF(trueSelf);
4143 throw INTERP_KERNEL::Exception(msg);
4148 DataArrayDoubleTuple *aa;
4149 std::vector<double> bb;
4151 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4156 if(!self->getArray())
4157 throw INTERP_KERNEL::Exception(msg2);
4158 self->getArray()->applyLin(1.,val);
4159 Py_XINCREF(trueSelf);
4164 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4167 Py_XINCREF(trueSelf);
4172 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4173 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4174 ret2->setArray(aaa);
4176 Py_XINCREF(trueSelf);
4181 if(!self->getArray())
4182 throw INTERP_KERNEL::Exception(msg2);
4183 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4184 self->getArray()->addEqual(aaa);
4185 Py_XINCREF(trueSelf);
4189 { throw INTERP_KERNEL::Exception(msg); }
4193 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4195 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.";
4196 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4199 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4201 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4205 Py_XINCREF(trueSelf);
4209 throw INTERP_KERNEL::Exception(msg);
4214 DataArrayDoubleTuple *aa;
4215 std::vector<double> bb;
4217 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4222 if(!self->getArray())
4223 throw INTERP_KERNEL::Exception(msg2);
4224 self->getArray()->applyLin(1.,-val);
4225 Py_XINCREF(trueSelf);
4230 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4233 Py_XINCREF(trueSelf);
4238 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4239 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4240 ret2->setArray(aaa);
4242 Py_XINCREF(trueSelf);
4247 if(!self->getArray())
4248 throw INTERP_KERNEL::Exception(msg2);
4249 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4250 self->getArray()->substractEqual(aaa);
4251 Py_XINCREF(trueSelf);
4255 { throw INTERP_KERNEL::Exception(msg); }
4259 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4261 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.";
4262 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4265 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4267 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4271 Py_XINCREF(trueSelf);
4275 throw INTERP_KERNEL::Exception(msg);
4280 DataArrayDoubleTuple *aa;
4281 std::vector<double> bb;
4283 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4288 if(!self->getArray())
4289 throw INTERP_KERNEL::Exception(msg2);
4290 self->getArray()->applyLin(val,0);
4291 Py_XINCREF(trueSelf);
4296 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4299 Py_XINCREF(trueSelf);
4304 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4305 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4306 ret2->setArray(aaa);
4308 Py_XINCREF(trueSelf);
4313 if(!self->getArray())
4314 throw INTERP_KERNEL::Exception(msg2);
4315 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4316 self->getArray()->multiplyEqual(aaa);
4317 Py_XINCREF(trueSelf);
4321 { throw INTERP_KERNEL::Exception(msg); }
4325 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4327 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.";
4328 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4331 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4333 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4337 Py_XINCREF(trueSelf);
4341 throw INTERP_KERNEL::Exception(msg);
4346 DataArrayDoubleTuple *aa;
4347 std::vector<double> bb;
4349 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4355 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4356 if(!self->getArray())
4357 throw INTERP_KERNEL::Exception(msg2);
4358 self->getArray()->applyLin(1./val,0);
4359 Py_XINCREF(trueSelf);
4364 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4367 Py_XINCREF(trueSelf);
4372 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4373 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4374 ret2->setArray(aaa);
4376 Py_XINCREF(trueSelf);
4381 if(!self->getArray())
4382 throw INTERP_KERNEL::Exception(msg2);
4383 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4384 self->getArray()->divideEqual(aaa);
4385 Py_XINCREF(trueSelf);
4389 { throw INTERP_KERNEL::Exception(msg); }
4393 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4395 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.";
4396 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4399 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4401 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4405 Py_XINCREF(trueSelf);
4409 throw INTERP_KERNEL::Exception(msg);
4414 DataArrayDoubleTuple *aa;
4415 std::vector<double> bb;
4417 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4422 if(!self->getArray())
4423 throw INTERP_KERNEL::Exception(msg2);
4424 self->getArray()->applyPow(val);
4425 Py_XINCREF(trueSelf);
4430 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4433 Py_XINCREF(trueSelf);
4438 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4439 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4440 ret2->setArray(aaa);
4442 Py_XINCREF(trueSelf);
4447 if(!self->getArray())
4448 throw INTERP_KERNEL::Exception(msg2);
4449 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4450 self->getArray()->powEqual(aaa);
4451 Py_XINCREF(trueSelf);
4455 { throw INTERP_KERNEL::Exception(msg); }
4459 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4461 std::vector<const MEDCouplingFieldDouble *> tmp;
4462 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4463 return MEDCouplingFieldDouble::MergeFields(tmp);
4466 static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4468 std::vector<const MEDCouplingFieldDouble *> tmp;
4469 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4470 MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4475 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4478 int getNumberOfFields() const;
4479 MEDCouplingMultiFields *deepCpy() const;
4480 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4481 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4482 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4483 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4484 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4487 std::string __str__() const throw(INTERP_KERNEL::Exception)
4489 return self->simpleRepr();
4491 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4493 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4494 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4496 std::vector<MEDCouplingFieldDouble *> fs(sz);
4497 for(int i=0;i<sz;i++)
4498 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4499 return MEDCouplingMultiFields::New(fs);
4501 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4503 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4504 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4506 std::vector<MEDCouplingFieldDouble *> fs(sz);
4507 for(int i=0;i<sz;i++)
4508 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4509 return MEDCouplingMultiFields::New(fs);
4511 PyObject *getFields() const
4513 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4514 int sz=fields.size();
4515 PyObject *res = PyList_New(sz);
4516 for(int i=0;i<sz;i++)
4520 fields[i]->incrRef();
4521 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4525 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4530 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4532 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4536 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4539 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4541 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4543 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4545 PyObject *res = PyList_New(sz);
4546 for(int i=0;i<sz;i++)
4551 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4555 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4560 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4562 std::vector<int> refs;
4563 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4565 PyObject *res = PyList_New(sz);
4566 for(int i=0;i<sz;i++)
4571 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4575 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4579 PyObject *ret=PyTuple_New(2);
4580 PyTuple_SetItem(ret,0,res);
4581 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4584 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4586 std::vector<DataArrayDouble *> ms=self->getArrays();
4588 PyObject *res = PyList_New(sz);
4589 for(int i=0;i<sz;i++)
4594 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4598 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4603 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4605 std::vector< std::vector<int> > refs;
4606 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4608 PyObject *res = PyList_New(sz);
4609 PyObject *res2 = PyList_New(sz);
4610 for(int i=0;i<sz;i++)
4615 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4619 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4621 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4624 PyObject *ret=PyTuple_New(2);
4625 PyTuple_SetItem(ret,0,res);
4626 PyTuple_SetItem(ret,1,res2);
4632 class MEDCouplingDefinitionTime
4635 MEDCouplingDefinitionTime();
4636 void assign(const MEDCouplingDefinitionTime& other);
4637 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4638 double getTimeResolution() const;
4639 std::vector<double> getHotSpotsTime() const;
4642 std::string __str__() const throw(INTERP_KERNEL::Exception)
4644 std::ostringstream oss;
4645 self->appendRepr(oss);
4649 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4651 int meshId,arrId,arrIdInField,fieldId;
4652 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4653 PyObject *res=PyList_New(4);
4654 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4655 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4656 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4657 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4661 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4663 int meshId,arrId,arrIdInField,fieldId;
4664 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4665 PyObject *res=PyList_New(4);
4666 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4667 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4668 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4669 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4675 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4678 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4679 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4683 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4685 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4686 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4688 std::vector<MEDCouplingFieldDouble *> fs(sz);
4689 for(int i=0;i<sz;i++)
4690 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4691 return MEDCouplingFieldOverTime::New(fs);
4693 std::string __str__() const throw(INTERP_KERNEL::Exception)
4695 return self->simpleRepr();
4697 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4699 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4700 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4702 std::vector<MEDCouplingFieldDouble *> fs(sz);
4703 for(int i=0;i<sz;i++)
4704 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4705 return MEDCouplingFieldOverTime::New(fs);
4713 __filename=os.environ.get('PYTHONSTARTUP')
4714 if __filename and os.path.isfile(__filename):
4715 execfile(__filename)