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;
566 std::string getHeapMemorySizeStr() const;
567 virtual std::size_t getHeapMemorySizeWithoutChildren() const;
568 virtual ~BigMemoryObject();
571 virtual PyObject *getDirectChildren() const
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 ));
582 class RefCountObjectOnly
585 bool decrRef() const;
586 void incrRef() const;
587 int getRCValue() const;
588 RefCountObjectOnly& operator=(const RefCountObjectOnly& other);
590 ~RefCountObjectOnly();
593 class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
602 PyObject *MEDCouplingVersionMajMinRel()
604 int tmp0=0,tmp1=0,tmp2=0;
605 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
606 PyObject *res = PyList_New(3);
607 PyList_SetItem(res,0,SWIG_From_int(tmp0));
608 PyList_SetItem(res,1,SWIG_From_int(tmp1));
609 PyList_SetItem(res,2,SWIG_From_int(tmp2));
613 bool MEDCouplingHasNumPyBindings()
622 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
624 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
625 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
626 if(PyRun_SimpleString(script)!=0)
627 throw INTERP_KERNEL::Exception(oss.str().c_str());
628 return std::string(script);
632 %include "MEDCouplingMemArray.i"
642 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
643 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11
644 } MEDCouplingMeshType;
647 class DataArrayDouble;
648 class MEDCouplingUMesh;
649 class MEDCouplingFieldDouble;
651 %extend RefCountObject
653 std::string getHiddenCppPointer() const
655 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
660 %extend MEDCouplingGaussLocalization
662 std::string __str__() const throw(INTERP_KERNEL::Exception)
664 return self->getStringRepr();
667 std::string __repr__() const throw(INTERP_KERNEL::Exception)
669 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
670 oss << self->getStringRepr();
677 class MEDCouplingMesh : public RefCountObject, public TimeLabel
680 void setName(const char *name);
681 std::string getName() const;
682 void setDescription(const char *descr);
683 std::string getDescription() const;
684 void setTime(double val, int iteration, int order);
685 void setTimeUnit(const char *unit);
686 const char *getTimeUnit() const;
687 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
688 bool isStructured() const throw(INTERP_KERNEL::Exception);
689 virtual MEDCouplingMesh *deepCpy() const;
690 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
691 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
692 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
693 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
694 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
695 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
696 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
697 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
698 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
699 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
700 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
701 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
702 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
703 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
704 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
705 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
706 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
707 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
708 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
709 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
710 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
711 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
712 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
713 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
714 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
716 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
717 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
718 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
719 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
720 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
721 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
722 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
723 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
724 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
725 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
726 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
727 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
728 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
729 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
730 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
731 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
732 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
735 std::string __str__() const throw(INTERP_KERNEL::Exception)
737 return self->simpleRepr();
740 PyObject *getTime() throw(INTERP_KERNEL::Exception)
743 double tmp0=self->getTime(tmp1,tmp2);
744 PyObject *res = PyList_New(3);
745 PyList_SetItem(res,0,SWIG_From_double(tmp0));
746 PyList_SetItem(res,1,SWIG_From_int(tmp1));
747 PyList_SetItem(res,2,SWIG_From_int(tmp2));
751 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
755 DataArrayDoubleTuple *aa;
756 std::vector<double> bb;
758 int spaceDim=self->getSpaceDimension();
759 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
760 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
761 return self->getCellContainingPoint(pos,eps);
764 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
768 DataArrayDoubleTuple *aa;
769 std::vector<double> bb;
771 int spaceDim=self->getSpaceDimension();
772 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
773 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
774 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
775 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
776 PyObject *ret=PyTuple_New(2);
777 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
778 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
782 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
784 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
785 int spaceDim=self->getSpaceDimension();
787 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
788 if (!SWIG_IsOK(res1))
791 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
792 int nbOfPoints=size/spaceDim;
795 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
797 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
801 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
803 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
804 da2->checkAllocated();
805 int size=da2->getNumberOfTuples();
806 int nbOfCompo=da2->getNumberOfComponents();
807 if(nbOfCompo!=spaceDim)
809 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
811 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
813 PyObject *ret=PyTuple_New(2);
814 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
815 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
819 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
823 DataArrayDoubleTuple *aa;
824 std::vector<double> bb;
826 int spaceDim=self->getSpaceDimension();
827 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
828 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
829 std::vector<int> elts;
830 self->getCellsContainingPoint(pos,eps,elts);
831 DataArrayInt *ret=DataArrayInt::New();
832 ret->alloc((int)elts.size(),1);
833 std::copy(elts.begin(),elts.end(),ret->getPointer());
834 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
837 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
840 int v0; std::vector<int> v1;
841 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
842 self->renumberCells(ids,check);
845 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
847 DataArrayInt *cellCor, *nodeCor;
848 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
849 PyObject *res = PyList_New(2);
850 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
851 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
855 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
857 DataArrayInt *cellCor=0,*nodeCor=0;
858 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
859 PyObject *res = PyList_New(2);
860 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
861 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
865 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
867 DataArrayInt *cellCor=0;
868 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
872 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
875 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
876 if (!SWIG_IsOK(res1))
879 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
880 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
884 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
886 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
887 da2->checkAllocated();
888 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
891 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
893 std::vector<int> conn;
894 self->getNodeIdsOfCell(cellId,conn);
895 return convertIntArrToPyList2(conn);
898 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
900 std::vector<double> coo;
901 self->getCoordinatesOfNode(nodeId,coo);
902 return convertDblArrToPyList2(coo);
905 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
909 DataArrayDoubleTuple *aa;
910 std::vector<double> bb;
912 int spaceDim=self->getSpaceDimension();
913 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
914 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
915 self->scale(pointPtr,factor);
918 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
920 int spaceDim=self->getSpaceDimension();
921 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
922 self->getBoundingBox(tmp);
923 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
927 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
930 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
931 PyObject *ret=PyTuple_New(2);
932 PyObject *ret0Py=ret0?Py_True:Py_False;
934 PyTuple_SetItem(ret,0,ret0Py);
935 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
939 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
941 int szArr,sw,iTypppArr;
942 std::vector<int> stdvecTyyppArr;
943 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
944 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
945 if(sw==3)//DataArrayInt
947 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
948 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
949 std::string name=argpt->getName();
951 ret->setName(name.c_str());
953 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
956 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
958 int szArr,sw,iTypppArr;
959 std::vector<int> stdvecTyyppArr;
961 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
962 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
963 if(sw==3)//DataArrayInt
965 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
966 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
967 std::string name=argpt->getName();
969 ret->setName(name.c_str());
972 PyObject *res = PyList_New(2);
973 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
974 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
975 PyList_SetItem(res,0,obj0);
976 PyList_SetItem(res,1,obj1);
980 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
984 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
985 PyObject *res = PyTuple_New(2);
986 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
989 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
991 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
992 PyTuple_SetItem(res,0,obj0);
993 PyTuple_SetItem(res,1,obj1);
997 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
999 std::vector<int> vals=self->getDistributionOfTypes();
1000 if(vals.size()%3!=0)
1001 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1002 PyObject *ret=PyList_New((int)vals.size()/3);
1003 for(int j=0;j<(int)vals.size()/3;j++)
1005 PyObject *ret1=PyList_New(3);
1006 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1007 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1008 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1009 PyList_SetItem(ret,j,ret1);
1014 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1016 std::vector<int> code;
1017 std::vector<const DataArrayInt *> idsPerType;
1018 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1019 convertPyToNewIntArr4(li,1,3,code);
1020 return self->checkTypeConsistencyAndContig(code,idsPerType);
1023 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1025 std::vector<int> code;
1026 std::vector<DataArrayInt *> idsInPflPerType;
1027 std::vector<DataArrayInt *> idsPerType;
1028 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1029 PyObject *ret=PyTuple_New(3);
1031 if(code.size()%3!=0)
1032 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1033 PyObject *ret0=PyList_New((int)code.size()/3);
1034 for(int j=0;j<(int)code.size()/3;j++)
1036 PyObject *ret00=PyList_New(3);
1037 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1038 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1039 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1040 PyList_SetItem(ret0,j,ret00);
1042 PyTuple_SetItem(ret,0,ret0);
1044 PyObject *ret1=PyList_New(idsInPflPerType.size());
1045 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1046 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1047 PyTuple_SetItem(ret,1,ret1);
1048 int n=idsPerType.size();
1049 PyObject *ret2=PyList_New(n);
1050 for(int i=0;i<n;i++)
1051 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052 PyTuple_SetItem(ret,2,ret2);
1056 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1060 DataArrayDoubleTuple *aa;
1061 std::vector<double> bb;
1063 int spaceDim=self->getSpaceDimension();
1064 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1065 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1066 self->translate(vectorPtr);
1069 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1071 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1074 DataArrayDoubleTuple *aa;
1075 std::vector<double> bb;
1077 int spaceDim=self->getSpaceDimension();
1078 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1079 self->rotate(centerPtr,0,alpha);
1082 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1084 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1086 DataArrayDouble *a,*a2;
1087 DataArrayDoubleTuple *aa,*aa2;
1088 std::vector<double> bb,bb2;
1090 int spaceDim=self->getSpaceDimension();
1091 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1092 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
1093 self->rotate(centerPtr,vectorPtr,alpha);
1096 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1098 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1099 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1100 PyObject *res=PyList_New(result.size());
1101 for(int i=0;iL!=result.end(); i++, iL++)
1102 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1106 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1108 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1109 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1110 return MEDCouplingMesh::MergeMeshes(tmp);
1116 //== MEDCouplingMesh End
1118 %include "NormalizedGeometricTypes"
1119 %include "MEDCouplingNatureOfFieldEnum"
1121 namespace ParaMEDMEM
1123 class MEDCouplingNatureOfField
1126 static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
1127 static std::string GetReprNoThrow(NatureOfField nat);
1128 static std::string GetAllPossibilitiesStr();
1132 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1133 // include "MEDCouplingTimeDiscretization.i"
1135 namespace ParaMEDMEM
1137 class MEDCouplingGaussLocalization
1140 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1141 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1142 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1143 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1144 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1145 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1146 int getDimension() const throw(INTERP_KERNEL::Exception);
1147 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1148 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1149 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1150 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1152 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1153 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1154 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1155 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1156 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1157 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1158 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1159 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1160 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1161 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1162 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1163 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1165 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1169 %include "MEDCouplingFieldDiscretization.i"
1171 //== MEDCouplingPointSet
1173 namespace ParaMEDMEM
1175 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1178 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1179 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1180 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1181 void zipCoords() throw(INTERP_KERNEL::Exception);
1182 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1183 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1184 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1185 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1186 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1187 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1188 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1189 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1190 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1191 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1192 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1193 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1194 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1195 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1196 virtual DataArrayInt *findBoundaryNodes() const;
1197 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1198 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1199 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1200 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1201 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1202 virtual DataArrayDouble *getBoundingBoxForBBTree() const throw(INTERP_KERNEL::Exception);
1205 std::string __str__() const throw(INTERP_KERNEL::Exception)
1207 return self->simpleRepr();
1210 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1213 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1214 PyObject *res = PyList_New(2);
1215 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1216 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1220 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1222 DataArrayInt *comm, *commIndex;
1223 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1224 PyObject *res = PyList_New(2);
1225 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1226 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1230 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1232 DataArrayDouble *ret1=self->getCoords();
1235 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1238 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1240 int szArr,sw,iTypppArr;
1241 std::vector<int> stdvecTyyppArr;
1242 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1243 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1244 if(sw==3)//DataArrayInt
1246 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1247 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1248 std::string name=argpt->getName();
1250 ret->setName(name.c_str());
1252 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1255 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1257 int szArr,sw,iTypppArr;
1258 std::vector<int> stdvecTyyppArr;
1259 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1260 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1261 if(sw==3)//DataArrayInt
1263 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1264 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1265 std::string name=argpt->getName();
1267 ret->setName(name.c_str());
1269 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1272 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1274 int szArr,sw,iTypppArr;
1275 std::vector<int> stdvecTyyppArr;
1276 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1277 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1278 if(sw==3)//DataArrayInt
1280 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1281 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1282 std::string name=argpt->getName();
1284 ret->setName(name.c_str());
1286 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1289 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1291 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1292 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1295 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1297 int szArr,sw,iTypppArr;
1298 std::vector<int> stdvecTyyppArr;
1299 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1300 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1301 if(sw==3)//DataArrayInt
1303 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1304 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1305 std::string name=argpt->getName();
1307 ret->setName(name.c_str());
1309 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1312 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1314 int szArr,sw,iTypppArr;
1315 std::vector<int> stdvecTyyppArr;
1316 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1317 self->renumberNodes(tmp,newNbOfNodes);
1320 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1322 int szArr,sw,iTypppArr;
1323 std::vector<int> stdvecTyyppArr;
1324 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1325 self->renumberNodes2(tmp,newNbOfNodes);
1328 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1330 int spaceDim=self->getSpaceDimension();
1332 DataArrayDouble *a,*a2;
1333 DataArrayDoubleTuple *aa,*aa2;
1334 std::vector<double> bb,bb2;
1336 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1337 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1338 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1339 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1340 std::vector<int> nodes;
1341 self->findNodesOnLine(p,v,eps,nodes);
1342 DataArrayInt *ret=DataArrayInt::New();
1343 ret->alloc((int)nodes.size(),1);
1344 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1345 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1347 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1349 int spaceDim=self->getSpaceDimension();
1351 DataArrayDouble *a,*a2;
1352 DataArrayDoubleTuple *aa,*aa2;
1353 std::vector<double> bb,bb2;
1355 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1356 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1357 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1358 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1359 std::vector<int> nodes;
1360 self->findNodesOnPlane(p,v,eps,nodes);
1361 DataArrayInt *ret=DataArrayInt::New();
1362 ret->alloc((int)nodes.size(),1);
1363 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1364 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1367 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1371 DataArrayDoubleTuple *aa;
1372 std::vector<double> bb;
1374 int spaceDim=self->getSpaceDimension();
1375 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1376 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1377 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1378 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1381 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1383 DataArrayInt *c=0,*cI=0;
1387 DataArrayDoubleTuple *aa;
1388 std::vector<double> bb;
1390 int spaceDim=self->getSpaceDimension();
1391 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1392 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1393 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1394 PyObject *ret=PyTuple_New(2);
1395 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1396 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1400 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1402 DataArrayInt *c=0,*cI=0;
1403 int spaceDim=self->getSpaceDimension();
1406 DataArrayDoubleTuple *aa;
1407 std::vector<double> bb;
1410 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1411 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1413 PyObject *ret=PyTuple_New(2);
1414 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1415 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1419 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1423 DataArrayDoubleTuple *aa;
1424 std::vector<double> bb;
1426 int spaceDim=self->getSpaceDimension();
1427 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1428 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1430 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1431 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1434 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1438 std::vector<int> multiVal;
1439 std::pair<int, std::pair<int,int> > slic;
1440 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1441 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1445 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1447 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1449 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1451 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1455 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1457 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1458 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1459 self->getReverseNodalConnectivity(d0,d1);
1460 PyObject *ret=PyTuple_New(2);
1461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1466 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1468 DataArrayInt *v0=0,*v1=0;
1469 self->findCommonCells(compType,startCellId,v0,v1);
1470 PyObject *res = PyList_New(2);
1471 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1472 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1477 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1480 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1481 if (!SWIG_IsOK(res1))
1484 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1485 self->renumberNodesInConn(tmp);
1489 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1491 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1492 da2->checkAllocated();
1493 self->renumberNodesInConn(da2->getConstPointer());
1497 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1500 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1501 PyObject *ret=PyTuple_New(2);
1502 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1503 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1507 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1509 DataArrayInt *ret=0;
1511 int szArr,sw,iTypppArr;
1512 std::vector<int> stdvecTyyppArr;
1513 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1514 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1518 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1522 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1523 PyObject *res = PyList_New(3);
1524 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1525 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1526 PyList_SetItem(res,2,SWIG_From_int(ret2));
1530 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1534 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1535 PyObject *res = PyList_New(3);
1536 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1537 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1538 PyList_SetItem(res,2,SWIG_From_int(ret2));
1542 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1545 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1546 if (!SWIG_IsOK(res1))
1549 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1550 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1554 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1556 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1557 da2->checkAllocated();
1558 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1562 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1566 std::vector<int> multiVal;
1567 std::pair<int, std::pair<int,int> > slic;
1568 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1569 int nbc=self->getNumberOfCells();
1570 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1577 std::ostringstream oss;
1578 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1579 throw INTERP_KERNEL::Exception(oss.str().c_str());
1582 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1587 int tmp=nbc+singleVal;
1588 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1592 std::ostringstream oss;
1593 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1594 throw INTERP_KERNEL::Exception(oss.str().c_str());
1600 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1604 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1609 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1610 daIntTyypp->checkAllocated();
1611 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1614 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1618 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1621 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1622 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1623 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1624 for(int i=0;i<sz;i++)
1625 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1628 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1631 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1633 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1634 std::vector<double> val3;
1635 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1636 "Rotate2DAlg",2,true,nbNodes);
1638 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1639 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1642 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1645 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1646 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1647 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1648 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1649 for(int i=0;i<sz;i++)
1650 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1653 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1656 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1658 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1659 std::vector<double> val3;
1660 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1661 "Rotate3DAlg",3,true,nbNodes);
1663 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1664 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1665 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1670 //== MEDCouplingPointSet End
1672 class MEDCouplingUMeshCell
1675 INTERP_KERNEL::NormalizedCellType getType() const;
1678 std::string __str__() const throw(INTERP_KERNEL::Exception)
1680 return self->repr();
1683 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1686 const int *r=self->getAllConn(ret2);
1687 PyObject *ret=PyTuple_New(ret2);
1688 for(int i=0;i<ret2;i++)
1689 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1695 class MEDCouplingUMeshCellIterator
1702 MEDCouplingUMeshCell *ret=self->nextt();
1704 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1707 PyErr_SetString(PyExc_StopIteration,"No more data.");
1714 class MEDCouplingUMeshCellByTypeIterator
1717 ~MEDCouplingUMeshCellByTypeIterator();
1722 MEDCouplingUMeshCellEntry *ret=self->nextt();
1724 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1727 PyErr_SetString(PyExc_StopIteration,"No more data.");
1734 class MEDCouplingUMeshCellByTypeEntry
1737 ~MEDCouplingUMeshCellByTypeEntry();
1740 MEDCouplingUMeshCellByTypeIterator *__iter__()
1742 return self->iterator();
1747 class MEDCouplingUMeshCellEntry
1750 INTERP_KERNEL::NormalizedCellType getType() const;
1751 int getNumberOfElems() const;
1754 MEDCouplingUMeshCellIterator *__iter__()
1756 return self->iterator();
1761 //== MEDCouplingUMesh
1763 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1766 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1767 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1768 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1769 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1770 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1771 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1772 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1773 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1774 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1775 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1776 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1777 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1778 void computeTypes() throw(INTERP_KERNEL::Exception);
1779 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1780 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1782 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1783 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1784 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1785 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1786 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1787 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1788 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1789 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1790 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1791 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1792 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1793 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1794 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1795 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1796 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1797 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1798 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1799 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1800 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1801 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1802 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1803 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1804 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1805 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1806 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1807 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1808 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1809 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1810 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1811 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1812 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1813 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1814 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1815 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1816 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1817 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1818 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1819 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1820 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1822 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1824 return MEDCouplingUMesh::New();
1827 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1829 return MEDCouplingUMesh::New(meshName,meshDim);
1832 std::string __str__() const throw(INTERP_KERNEL::Exception)
1834 return self->simpleRepr();
1837 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1839 std::ostringstream oss;
1840 self->reprQuickOverview(oss);
1844 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1846 return self->cellIterator();
1849 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1853 std::vector<int> multiVal;
1854 std::pair<int, std::pair<int,int> > slic;
1855 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1856 int nbc=self->getNumberOfCells();
1857 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1864 std::ostringstream oss;
1865 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1866 throw INTERP_KERNEL::Exception(oss.str().c_str());
1870 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1877 int tmp=nbc+singleVal;
1878 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1883 std::ostringstream oss;
1884 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1885 throw INTERP_KERNEL::Exception(oss.str().c_str());
1891 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1897 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1898 daIntTyypp->checkAllocated();
1899 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1903 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1907 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1911 std::vector<int> multiVal;
1912 std::pair<int, std::pair<int,int> > slic;
1913 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1914 int nbc=self->getNumberOfCells();
1915 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1922 std::ostringstream oss;
1923 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1924 throw INTERP_KERNEL::Exception(oss.str().c_str());
1928 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1935 int tmp=nbc+singleVal;
1936 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1941 std::ostringstream oss;
1942 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1943 throw INTERP_KERNEL::Exception(oss.str().c_str());
1949 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1954 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1960 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1961 daIntTyypp->checkAllocated();
1962 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1966 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1970 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1972 int szArr,sw,iTypppArr;
1973 std::vector<int> stdvecTyyppArr;
1974 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1977 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1978 throw INTERP_KERNEL::Exception(oss.str().c_str());
1980 self->insertNextCell(type,size,tmp);
1983 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1985 int szArr,sw,iTypppArr;
1986 std::vector<int> stdvecTyyppArr;
1987 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1988 self->insertNextCell(type,szArr,tmp);
1991 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1993 DataArrayInt *ret=self->getNodalConnectivity();
1998 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2000 DataArrayInt *ret=self->getNodalConnectivityIndex();
2005 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
2007 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
2008 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2009 PyObject *res = PyList_New(result.size());
2010 for (int i=0;iL!=result.end(); i++, iL++)
2011 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2015 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2017 int szArr,sw,iTypppArr;
2018 std::vector<int> stdvecTyyppArr;
2019 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2020 int nbOfDepthPeelingPerformed=0;
2021 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2022 PyObject *res=PyTuple_New(2);
2023 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2024 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2028 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2030 DataArrayInt *v0=0,*v1=0;
2031 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2032 PyObject *res = PyList_New(2);
2033 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2034 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2038 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2042 DataArrayDoubleTuple *aa;
2043 std::vector<double> bb;
2045 int nbOfCompo=self->getSpaceDimension();
2046 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2049 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2050 PyObject *ret=PyTuple_New(2);
2051 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2052 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2056 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2058 DataArrayInt *ret1=0;
2059 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2060 PyObject *ret=PyTuple_New(2);
2061 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2062 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2066 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2069 DataArrayInt *ret1(0);
2070 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2071 PyObject *ret=PyTuple_New(3);
2072 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2073 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2074 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2078 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2080 std::vector<int> cells;
2081 self->checkButterflyCells(cells,eps);
2082 DataArrayInt *ret=DataArrayInt::New();
2083 ret->alloc((int)cells.size(),1);
2084 std::copy(cells.begin(),cells.end(),ret->getPointer());
2085 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2088 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2090 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2092 PyObject *ret = PyList_New(sz);
2093 for(int i=0;i<sz;i++)
2094 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2098 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2100 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2101 int sz=retCpp.size();
2102 PyObject *ret=PyList_New(sz);
2103 for(int i=0;i<sz;i++)
2104 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2108 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2111 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2112 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2113 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2116 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2119 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2120 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2124 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2127 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2128 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2132 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2134 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2135 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2136 PyObject *ret=PyTuple_New(3);
2137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2138 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2139 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2143 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2145 DataArrayInt *tmp0=0,*tmp1=0;
2146 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2147 PyObject *ret=PyTuple_New(2);
2148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2153 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2157 std::vector<int> multiVal;
2158 std::pair<int, std::pair<int,int> > slic;
2159 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2160 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2164 return self->duplicateNodes(&singleVal,&singleVal+1);
2166 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2168 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2170 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2174 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2178 std::vector<int> multiVal;
2179 std::pair<int, std::pair<int,int> > slic;
2180 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2181 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2185 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2187 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2189 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2191 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2195 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2198 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2199 DataArrayInt *tmp0,*tmp1=0;
2200 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2201 PyObject *ret=PyTuple_New(2);
2202 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *ret0=0,*ret1=0;
2210 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2211 PyObject *ret=PyTuple_New(2);
2212 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2217 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2219 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2220 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2221 DataArrayInt *ret1=0,*ret2=0;
2222 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2223 PyObject *ret=PyTuple_New(3);
2224 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2225 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2230 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2232 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2233 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2234 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2235 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2238 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2241 std::vector<const MEDCouplingUMesh *> meshes;
2242 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2243 std::vector<DataArrayInt *> corr;
2244 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2246 PyObject *ret1=PyList_New(sz);
2247 for(int i=0;i<sz;i++)
2248 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2249 PyObject *ret=PyList_New(2);
2250 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2251 PyList_SetItem(ret,1,ret1);
2255 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2257 std::vector<MEDCouplingUMesh *> meshes;
2258 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2259 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2262 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2264 std::vector<MEDCouplingUMesh *> meshes;
2265 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2266 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2269 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2273 std::vector<int> multiVal;
2274 std::pair<int, std::pair<int,int> > slic;
2275 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2277 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2278 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2282 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2284 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2286 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2288 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2292 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2294 DataArrayInt *arrOut=0,*arrIndexOut=0;
2297 std::vector<int> multiVal;
2298 std::pair<int, std::pair<int,int> > slic;
2299 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2301 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2302 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2307 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2312 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2317 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2321 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2323 PyObject *ret=PyTuple_New(2);
2324 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2325 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2329 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2331 DataArrayInt *arrOut=0,*arrIndexOut=0;
2332 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2333 PyObject *ret=PyTuple_New(2);
2334 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2335 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2339 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2341 if(!PySlice_Check(slic))
2342 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2343 Py_ssize_t strt=2,stp=2,step=2;
2344 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2346 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2347 arrIndxIn->checkAllocated();
2348 if(arrIndxIn->getNumberOfComponents()!=1)
2349 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2350 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2351 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2352 DataArrayInt *arrOut=0,*arrIndexOut=0;
2353 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2354 PyObject *ret=PyTuple_New(2);
2355 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2356 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2360 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2361 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2362 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2364 DataArrayInt *arrOut=0,*arrIndexOut=0;
2367 std::vector<int> multiVal;
2368 std::pair<int, std::pair<int,int> > slic;
2369 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2371 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2372 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2377 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2382 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2387 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2391 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2393 PyObject *ret=PyTuple_New(2);
2394 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2395 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2399 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2400 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2404 std::vector<int> multiVal;
2405 std::pair<int, std::pair<int,int> > slic;
2406 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2408 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2409 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2414 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2419 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2424 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2428 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2432 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2436 DataArrayDoubleTuple *aa;
2437 std::vector<double> bb;
2439 int spaceDim=self->getSpaceDimension();
2440 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2441 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2443 std::vector<int> cells;
2444 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2445 DataArrayInt *ret=DataArrayInt::New();
2446 ret->alloc((int)cells.size(),1);
2447 std::copy(cells.begin(),cells.end(),ret->getPointer());
2448 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2451 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2455 DataArrayDoubleTuple *aa;
2456 std::vector<double> bb;
2458 int spaceDim=self->getSpaceDimension();
2459 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2460 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2461 self->orientCorrectly2DCells(v,polyOnly);
2464 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2466 std::vector<int> cells;
2467 self->arePolyhedronsNotCorrectlyOriented(cells);
2468 DataArrayInt *ret=DataArrayInt::New();
2469 ret->alloc((int)cells.size(),1);
2470 std::copy(cells.begin(),cells.end(),ret->getPointer());
2471 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2474 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2478 self->getFastAveragePlaneOfThis(vec,pos);
2480 std::copy(vec,vec+3,vals);
2481 std::copy(pos,pos+3,vals+3);
2482 return convertDblArrToPyListOfTuple(vals,3,2);
2485 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2487 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2488 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2489 return MEDCouplingUMesh::MergeUMeshes(tmp);
2492 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2495 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2496 PyObject *ret=PyTuple_New(2);
2497 PyObject *ret0Py=ret0?Py_True:Py_False;
2499 PyTuple_SetItem(ret,0,ret0Py);
2500 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2504 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2507 bool ret0=self->areCellsIncludedIn2(other,ret1);
2508 PyObject *ret=PyTuple_New(2);
2509 PyObject *ret0Py=ret0?Py_True:Py_False;
2511 PyTuple_SetItem(ret,0,ret0Py);
2512 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2516 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2518 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2519 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2520 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2521 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2522 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2523 PyObject *ret=PyTuple_New(5);
2524 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2525 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2526 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2527 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2528 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2532 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2534 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2535 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2536 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2537 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2538 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2539 PyObject *ret=PyTuple_New(5);
2540 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2541 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2543 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2548 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2550 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2551 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2552 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2553 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2554 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2555 PyObject *ret=PyTuple_New(5);
2556 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2557 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2559 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2564 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2566 DataArrayInt *neighbors=0,*neighborsIdx=0;
2567 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2568 PyObject *ret=PyTuple_New(2);
2569 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2570 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2574 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2576 DataArrayInt *neighbors=0,*neighborsIdx=0;
2577 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2578 PyObject *ret=PyTuple_New(2);
2579 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2580 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2584 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2586 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2587 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2588 DataArrayInt *d2,*d3,*d4,*dd5;
2589 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2590 PyObject *ret=PyTuple_New(7);
2591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2592 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2593 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2594 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2596 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2597 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2601 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2604 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2605 da->checkAllocated();
2606 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2609 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2612 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2613 da->checkAllocated();
2614 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2617 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2620 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2621 da->checkAllocated();
2622 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2625 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2628 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2629 da->checkAllocated();
2630 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2631 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2632 PyObject *res = PyList_New(result.size());
2633 for (int i=0;iL!=result.end(); i++, iL++)
2634 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2638 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2641 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2642 da->checkAllocated();
2643 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2644 ret->setName(da->getName().c_str());
2648 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2650 DataArrayInt *cellNb1=0,*cellNb2=0;
2651 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2652 PyObject *ret=PyTuple_New(3);
2653 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2654 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2659 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2661 int spaceDim=self->getSpaceDimension();
2663 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2665 DataArrayDouble *a,*a2;
2666 DataArrayDoubleTuple *aa,*aa2;
2667 std::vector<double> bb,bb2;
2669 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2670 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2671 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2672 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2674 DataArrayInt *cellIds=0;
2675 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2676 PyObject *ret=PyTuple_New(2);
2677 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2678 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2682 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2684 int spaceDim=self->getSpaceDimension();
2686 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2688 DataArrayDouble *a,*a2;
2689 DataArrayDoubleTuple *aa,*aa2;
2690 std::vector<double> bb,bb2;
2692 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2693 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2694 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2695 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2697 DataArrayInt *cellIds=0;
2698 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2699 PyObject *ret=PyTuple_New(2);
2700 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2701 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2705 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2707 int spaceDim=self->getSpaceDimension();
2709 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2711 DataArrayDouble *a,*a2;
2712 DataArrayDoubleTuple *aa,*aa2;
2713 std::vector<double> bb,bb2;
2715 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2716 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2717 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2718 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2719 return self->getCellIdsCrossingPlane(orig,vect,eps);
2722 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2726 std::vector<int> pos2;
2727 DataArrayInt *pos3=0;
2728 DataArrayIntTuple *pos4=0;
2729 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2734 self->convertToPolyTypes(&pos1,&pos1+1);
2741 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2746 self->convertToPolyTypes(pos3->begin(),pos3->end());
2750 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2754 void convertAllToPoly();
2755 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2756 bool unPolyze() throw(INTERP_KERNEL::Exception);
2757 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2758 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2759 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2762 //== MEDCouplingUMesh End
2764 //== MEDCouplingExtrudedMesh
2766 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2769 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2770 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2772 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2774 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2777 std::string __str__() const throw(INTERP_KERNEL::Exception)
2779 return self->simpleRepr();
2782 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2784 std::ostringstream oss;
2785 self->reprQuickOverview(oss);
2789 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2791 MEDCouplingUMesh *ret=self->getMesh2D();
2794 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2796 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2798 MEDCouplingUMesh *ret=self->getMesh1D();
2801 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2803 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2805 DataArrayInt *ret=self->getMesh3DIds();
2808 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2813 //== MEDCouplingExtrudedMesh End
2815 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2818 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2819 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2820 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2821 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2822 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2823 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2826 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2828 int szArr,sw,iTypppArr;
2829 std::vector<int> stdvecTyyppArr;
2830 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2831 self->insertNextCell(tmp,tmp+szArr);
2834 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2836 DataArrayInt *ret=self->getNodalConnectivity();
2837 if(ret) ret->incrRef();
2841 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2843 std::vector< const MEDCoupling1GTUMesh *> parts;
2844 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2845 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2850 //== MEDCoupling1SGTUMesh
2852 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2855 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2856 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2857 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2858 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2859 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2860 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2861 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2864 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2866 return MEDCoupling1SGTUMesh::New(name,type);
2869 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2871 return MEDCoupling1SGTUMesh::New(m);
2874 std::string __str__() const throw(INTERP_KERNEL::Exception)
2876 return self->simpleRepr();
2879 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2881 std::ostringstream oss;
2882 self->reprQuickOverview(oss);
2886 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2888 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2889 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2890 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2893 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(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::Merge1SGTUMeshesOnSameCoords(tmp);
2902 //== MEDCoupling1SGTUMesh End
2904 //== MEDCoupling1DGTUMesh
2906 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2909 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2910 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2911 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2912 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2913 bool isPacked() const throw(INTERP_KERNEL::Exception);
2916 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2918 return MEDCoupling1DGTUMesh::New(name,type);
2921 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2923 return MEDCoupling1DGTUMesh::New(m);
2926 std::string __str__() const throw(INTERP_KERNEL::Exception)
2928 return self->simpleRepr();
2931 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2933 std::ostringstream oss;
2934 self->reprQuickOverview(oss);
2938 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2940 DataArrayInt *ret=self->getNodalConnectivityIndex();
2941 if(ret) ret->incrRef();
2945 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2947 DataArrayInt *ret1=0,*ret2=0;
2948 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2949 PyObject *ret0Py=ret0?Py_True:Py_False;
2951 PyObject *ret=PyTuple_New(3);
2952 PyTuple_SetItem(ret,0,ret0Py);
2953 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2954 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2958 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2961 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2962 PyObject *ret=PyTuple_New(2);
2963 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2964 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2965 PyTuple_SetItem(ret,1,ret1Py);
2969 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2971 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2972 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2973 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2976 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(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::Merge1DGTUMeshesOnSameCoords(tmp);
2983 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2985 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2986 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2987 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2992 //== MEDCoupling1DGTUMeshEnd
2994 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2997 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2998 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2999 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3000 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3001 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3002 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3005 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3007 int tmpp1=-1,tmpp2=-1;
3008 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3009 std::vector< std::pair<int,int> > inp;
3013 for(int i=0;i<tmpp1;i++)
3014 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3019 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3020 inp.resize(tmpp1/2);
3021 for(int i=0;i<tmpp1/2;i++)
3022 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3025 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3026 return self->buildStructuredSubPart(inp);
3029 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3031 int tmpp1=-1,tmpp2=-1;
3032 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
3033 std::vector< std::pair<int,int> > inp;
3037 for(int i=0;i<tmpp1;i++)
3038 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3043 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
3044 inp.resize(tmpp1/2);
3045 for(int i=0;i<tmpp1/2;i++)
3046 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3049 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
3051 int szArr,sw,iTypppArr;
3052 std::vector<int> stdvecTyyppArr;
3053 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3054 std::vector<int> tmp5(tmp4,tmp4+szArr);
3056 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3059 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3061 int szArr,sw,iTypppArr;
3062 std::vector<int> stdvecTyyppArr;
3063 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3064 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3067 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3069 int szArr,sw,iTypppArr;
3070 std::vector<int> stdvecTyyppArr;
3071 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3072 int szArr2,sw2,iTypppArr2;
3073 std::vector<int> stdvecTyyppArr2;
3074 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3075 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3076 std::vector< std::pair<int,int> > partCompactFormat;
3077 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3078 PyObject *ret=PyTuple_New(2);
3079 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3080 PyTuple_SetItem(ret,0,ret0Py);
3081 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3082 for(std::size_t i=0;i<partCompactFormat.size();i++)
3084 PyObject *tmp4=PyTuple_New(2);
3085 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3086 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3087 PyList_SetItem(ret1Py,i,tmp4);
3089 PyTuple_SetItem(ret,1,ret1Py);
3095 //== MEDCouplingCMesh
3097 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3100 static MEDCouplingCMesh *New();
3101 static MEDCouplingCMesh *New(const char *meshName);
3102 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3103 void setCoords(const DataArrayDouble *coordsX,
3104 const DataArrayDouble *coordsY=0,
3105 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3106 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3110 return MEDCouplingCMesh::New();
3112 MEDCouplingCMesh(const char *meshName)
3114 return MEDCouplingCMesh::New(meshName);
3116 std::string __str__() const throw(INTERP_KERNEL::Exception)
3118 return self->simpleRepr();
3120 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3122 std::ostringstream oss;
3123 self->reprQuickOverview(oss);
3126 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3128 DataArrayDouble *ret=self->getCoordsAt(i);
3136 //== MEDCouplingCMesh End
3138 //== MEDCouplingCurveLinearMesh
3140 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3143 static MEDCouplingCurveLinearMesh *New();
3144 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3145 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3146 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3148 MEDCouplingCurveLinearMesh()
3150 return MEDCouplingCurveLinearMesh::New();
3152 MEDCouplingCurveLinearMesh(const char *meshName)
3154 return MEDCouplingCurveLinearMesh::New(meshName);
3156 std::string __str__() const throw(INTERP_KERNEL::Exception)
3158 return self->simpleRepr();
3160 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3162 std::ostringstream oss;
3163 self->reprQuickOverview(oss);
3166 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3168 DataArrayDouble *ret=self->getCoords();
3173 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3175 int szArr,sw,iTypppArr;
3176 std::vector<int> stdvecTyyppArr;
3177 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3178 self->setNodeGridStructure(tmp,tmp+szArr);
3183 //== MEDCouplingCurveLinearMesh End
3186 namespace ParaMEDMEM
3188 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3191 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3192 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3193 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3194 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3195 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3196 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3197 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3198 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3199 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3200 std::string getName() const throw(INTERP_KERNEL::Exception);
3201 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3202 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3203 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3204 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3205 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3206 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3207 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3208 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3209 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3210 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3211 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3212 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3213 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3214 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3215 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3216 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3218 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3220 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3223 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3226 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3228 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3231 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3234 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3236 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3237 return convertIntArrToPyList3(ret);
3240 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3243 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3244 PyObject *ret=PyTuple_New(2);
3245 PyObject *ret0Py=ret0?Py_True:Py_False;
3247 PyTuple_SetItem(ret,0,ret0Py);
3248 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3252 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3254 DataArrayInt *ret1=0;
3255 MEDCouplingMesh *ret0=0;
3257 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3258 if (!SWIG_IsOK(res1))
3261 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3262 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3266 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3268 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3269 da2->checkAllocated();
3270 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3272 PyObject *res = PyList_New(2);
3273 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3274 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3278 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3280 DataArrayInt *ret1=0;
3282 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3283 PyObject *res=PyTuple_New(2);
3284 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3286 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3289 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3290 PyTuple_SetItem(res,1,res1);
3295 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3298 int v0; std::vector<int> v1;
3299 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3300 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3303 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3304 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3307 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3308 if (!SWIG_IsOK(res1))
3311 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3312 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3316 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3318 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3319 da2->checkAllocated();
3320 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3324 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3326 std::vector<int> tmp;
3327 self->getCellIdsHavingGaussLocalization(locId,tmp);
3328 DataArrayInt *ret=DataArrayInt::New();
3329 ret->alloc((int)tmp.size(),1);
3330 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3331 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3334 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3336 std::vector<int> inp0;
3337 convertPyToNewIntArr4(code,1,3,inp0);
3338 std::vector<const DataArrayInt *> inp1;
3339 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3340 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3345 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3348 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3349 static MEDCouplingFieldTemplate *New(TypeOfField type);
3350 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3351 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3354 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3356 return MEDCouplingFieldTemplate::New(f);
3359 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3361 return MEDCouplingFieldTemplate::New(type);
3364 std::string __str__() const throw(INTERP_KERNEL::Exception)
3366 return self->simpleRepr();
3369 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3371 std::ostringstream oss;
3372 self->reprQuickOverview(oss);
3378 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3381 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3382 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3383 void setTimeUnit(const char *unit);
3384 const char *getTimeUnit() const;
3385 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3386 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3387 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3388 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3389 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3390 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3391 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3392 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3393 MEDCouplingFieldDouble *deepCpy() const;
3394 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3395 MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3396 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3397 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3398 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3399 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3400 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3401 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3402 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3403 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3404 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3405 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3406 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3407 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3408 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3409 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3410 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3411 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3412 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3413 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3414 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3415 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3416 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3417 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3418 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3419 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3420 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3421 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3422 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3423 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3424 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3425 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3426 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3427 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3428 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3429 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3430 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3431 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3432 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3433 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3434 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3435 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3436 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3437 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3438 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3439 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3440 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3441 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3442 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3443 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3444 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3445 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3446 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3447 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3448 double getMinValue() const throw(INTERP_KERNEL::Exception);
3449 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3450 double norm2() const throw(INTERP_KERNEL::Exception);
3451 double normMax() const throw(INTERP_KERNEL::Exception);
3452 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3453 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3454 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3455 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3456 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3457 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3458 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3459 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3460 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3461 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3462 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3463 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3464 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3465 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3466 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3467 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3468 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3469 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3470 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3471 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3472 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3473 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3475 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3477 return MEDCouplingFieldDouble::New(type,td);
3480 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3482 return MEDCouplingFieldDouble::New(ft,td);
3485 std::string __str__() const throw(INTERP_KERNEL::Exception)
3487 return self->simpleRepr();
3490 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3492 std::ostringstream oss;
3493 self->reprQuickOverview(oss);
3497 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3499 DataArrayDouble *ret=self->getArray();
3505 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3507 std::vector<DataArrayDouble *> arrs=self->getArrays();
3508 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3512 PyObject *ret=PyTuple_New(sz);
3513 for(int i=0;i<sz;i++)
3516 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3518 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3523 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3525 std::vector<const DataArrayDouble *> tmp;
3526 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3528 std::vector<DataArrayDouble *> arrs(sz);
3529 for(int i=0;i<sz;i++)
3530 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3531 self->setArrays(arrs);
3534 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3536 DataArrayDouble *ret=self->getEndArray();
3542 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3546 DataArrayDoubleTuple *aa;
3547 std::vector<double> bb;
3549 const MEDCouplingMesh *mesh=self->getMesh();
3551 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3552 int spaceDim=mesh->getSpaceDimension();
3553 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3554 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3556 int sz=self->getNumberOfComponents();
3557 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3558 self->getValueOn(spaceLoc,res);
3559 return convertDblArrToPyList(res,sz);
3562 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3564 int sz=self->getNumberOfComponents();
3565 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3566 self->getValueOnPos(i,j,k,res);
3567 return convertDblArrToPyList(res,sz);
3570 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3572 const MEDCouplingMesh *mesh(self->getMesh());
3574 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3577 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3578 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3579 mesh->getSpaceDimension(),true,nbPts);
3580 return self->getValueOnMulti(inp,nbPts);
3583 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3587 DataArrayDoubleTuple *aa;
3588 std::vector<double> bb;
3590 const MEDCouplingMesh *mesh=self->getMesh();
3592 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3593 int spaceDim=mesh->getSpaceDimension();
3594 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3595 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3598 int sz=self->getNumberOfComponents();
3599 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3600 self->getValueOn(spaceLoc,time,res);
3601 return convertDblArrToPyList(res,sz);
3604 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3606 if(self->getArray()!=0)
3607 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3610 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3611 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3612 self->setArray(arr);
3616 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3619 double tmp0=self->getTime(tmp1,tmp2);
3620 PyObject *res = PyList_New(3);
3621 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3622 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3623 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3627 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3630 double tmp0=self->getStartTime(tmp1,tmp2);
3631 PyObject *res = PyList_New(3);
3632 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3633 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3634 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3638 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3641 double tmp0=self->getEndTime(tmp1,tmp2);
3642 PyObject *res = PyList_New(3);
3643 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3644 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3645 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3648 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3650 int sz=self->getNumberOfComponents();
3651 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3652 self->accumulate(tmp);
3653 return convertDblArrToPyList(tmp,sz);
3655 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3657 int sz=self->getNumberOfComponents();
3658 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3659 self->integral(isWAbs,tmp);
3660 return convertDblArrToPyList(tmp,sz);
3662 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3664 int sz=self->getNumberOfComponents();
3665 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3666 self->getWeightedAverageValue(tmp,isWAbs);
3667 return convertDblArrToPyList(tmp,sz);
3669 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3671 int sz=self->getNumberOfComponents();
3672 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3674 return convertDblArrToPyList(tmp,sz);
3676 PyObject *normL2() 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 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3685 int szArr,sw,iTypppArr;
3686 std::vector<int> stdvecTyyppArr;
3687 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3688 self->renumberCells(tmp,check);
3691 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3693 int szArr,sw,iTypppArr;
3694 std::vector<int> stdvecTyyppArr;
3695 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3696 self->renumberCellsWithoutMesh(tmp,check);
3699 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3701 int szArr,sw,iTypppArr;
3702 std::vector<int> stdvecTyyppArr;
3703 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3704 self->renumberNodes(tmp,eps);
3707 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3709 int szArr,sw,iTypppArr;
3710 std::vector<int> stdvecTyyppArr;
3711 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3712 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3715 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3719 std::vector<int> multiVal;
3720 std::pair<int, std::pair<int,int> > slic;
3721 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3722 const MEDCouplingMesh *mesh=self->getMesh();
3724 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3725 int nbc=mesh->getNumberOfCells();
3726 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3733 std::ostringstream oss;
3734 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3735 throw INTERP_KERNEL::Exception(oss.str().c_str());
3738 return self->buildSubPart(&singleVal,&singleVal+1);
3743 int tmp=nbc+singleVal;
3744 return self->buildSubPart(&tmp,&tmp+1);
3748 std::ostringstream oss;
3749 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3750 throw INTERP_KERNEL::Exception(oss.str().c_str());
3756 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3760 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3765 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3766 daIntTyypp->checkAllocated();
3767 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3770 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3774 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3776 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";
3777 if(PyTuple_Check(li))
3779 Py_ssize_t sz=PyTuple_Size(li);
3781 throw INTERP_KERNEL::Exception(msg);
3782 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3785 std::vector<int> multiVal;
3786 std::pair<int, std::pair<int,int> > slic;
3787 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3788 if(!self->getArray())
3789 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3791 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3792 catch(INTERP_KERNEL::Exception& e)
3793 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3794 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3795 DataArrayDouble *ret0Arr=ret0->getArray();
3797 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3802 std::vector<int> v2(1,singleVal);
3803 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3804 ret0->setArray(aarr);
3809 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3810 ret0->setArray(aarr);
3815 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3816 std::vector<int> v2(nbOfComp);
3817 for(int i=0;i<nbOfComp;i++)
3818 v2[i]=slic.first+i*slic.second.second;
3819 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3820 ret0->setArray(aarr);
3824 throw INTERP_KERNEL::Exception(msg);
3829 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3832 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3835 double r1=self->getMaxValue2(tmp);
3836 PyObject *ret=PyTuple_New(2);
3837 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3838 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3842 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3845 double r1=self->getMinValue2(tmp);
3846 PyObject *ret=PyTuple_New(2);
3847 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3848 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3852 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3854 std::vector<int> tmp;
3855 convertPyToNewIntArr3(li,tmp);
3856 return self->keepSelectedComponents(tmp);
3859 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3861 std::vector<int> tmp;
3862 convertPyToNewIntArr3(li,tmp);
3863 self->setSelectedComponents(f,tmp);
3866 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3869 DataArrayDouble *a,*a2;
3870 DataArrayDoubleTuple *aa,*aa2;
3871 std::vector<double> bb,bb2;
3874 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3875 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3876 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3877 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3879 return self->extractSlice3D(orig,vect,eps);
3882 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3884 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3887 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3889 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3892 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3894 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.";
3895 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3898 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3900 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3902 return (*self)-(*other);
3904 throw INTERP_KERNEL::Exception(msg);
3909 DataArrayDoubleTuple *aa;
3910 std::vector<double> bb;
3912 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3917 if(!self->getArray())
3918 throw INTERP_KERNEL::Exception(msg2);
3919 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3920 ret->applyLin(1.,-val);
3921 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3922 ret2->setArray(ret);
3927 if(!self->getArray())
3928 throw INTERP_KERNEL::Exception(msg2);
3929 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3930 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3931 ret2->setArray(ret);
3936 if(!self->getArray())
3937 throw INTERP_KERNEL::Exception(msg2);
3938 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3939 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3940 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3941 ret2->setArray(ret);
3946 if(!self->getArray())
3947 throw INTERP_KERNEL::Exception(msg2);
3948 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3949 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3950 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3951 ret2->setArray(ret);
3955 { throw INTERP_KERNEL::Exception(msg); }
3959 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3961 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3964 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3966 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3969 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3971 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3974 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3976 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.";
3977 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3980 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3982 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3984 return (*self)/(*other);
3986 throw INTERP_KERNEL::Exception(msg);
3991 DataArrayDoubleTuple *aa;
3992 std::vector<double> bb;
3994 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4000 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4001 if(!self->getArray())
4002 throw INTERP_KERNEL::Exception(msg2);
4003 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4004 ret->applyLin(1./val,0);
4005 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4006 ret2->setArray(ret);
4011 if(!self->getArray())
4012 throw INTERP_KERNEL::Exception(msg2);
4013 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4014 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4015 ret2->setArray(ret);
4020 if(!self->getArray())
4021 throw INTERP_KERNEL::Exception(msg2);
4022 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4023 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4024 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4025 ret2->setArray(ret);
4030 if(!self->getArray())
4031 throw INTERP_KERNEL::Exception(msg2);
4032 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4033 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4034 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4035 ret2->setArray(ret);
4039 { throw INTERP_KERNEL::Exception(msg); }
4043 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4045 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4048 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4050 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.";
4051 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4054 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4056 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4058 return (*self)^(*other);
4060 throw INTERP_KERNEL::Exception(msg);
4065 DataArrayDoubleTuple *aa;
4066 std::vector<double> bb;
4068 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4073 if(!self->getArray())
4074 throw INTERP_KERNEL::Exception(msg2);
4075 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4077 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4078 ret2->setArray(ret);
4083 if(!self->getArray())
4084 throw INTERP_KERNEL::Exception(msg2);
4085 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4086 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4087 ret2->setArray(ret);
4092 if(!self->getArray())
4093 throw INTERP_KERNEL::Exception(msg2);
4094 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4095 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4096 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4097 ret2->setArray(ret);
4102 if(!self->getArray())
4103 throw INTERP_KERNEL::Exception(msg2);
4104 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4105 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4106 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4107 ret2->setArray(ret);
4111 { throw INTERP_KERNEL::Exception(msg); }
4115 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4117 return self->negate();
4120 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4122 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.";
4123 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4126 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4128 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4132 Py_XINCREF(trueSelf);
4136 throw INTERP_KERNEL::Exception(msg);
4141 DataArrayDoubleTuple *aa;
4142 std::vector<double> bb;
4144 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4149 if(!self->getArray())
4150 throw INTERP_KERNEL::Exception(msg2);
4151 self->getArray()->applyLin(1.,val);
4152 Py_XINCREF(trueSelf);
4157 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4160 Py_XINCREF(trueSelf);
4165 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4166 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4167 ret2->setArray(aaa);
4169 Py_XINCREF(trueSelf);
4174 if(!self->getArray())
4175 throw INTERP_KERNEL::Exception(msg2);
4176 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4177 self->getArray()->addEqual(aaa);
4178 Py_XINCREF(trueSelf);
4182 { throw INTERP_KERNEL::Exception(msg); }
4186 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4188 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.";
4189 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4192 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4194 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4198 Py_XINCREF(trueSelf);
4202 throw INTERP_KERNEL::Exception(msg);
4207 DataArrayDoubleTuple *aa;
4208 std::vector<double> bb;
4210 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4215 if(!self->getArray())
4216 throw INTERP_KERNEL::Exception(msg2);
4217 self->getArray()->applyLin(1.,-val);
4218 Py_XINCREF(trueSelf);
4223 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4226 Py_XINCREF(trueSelf);
4231 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4232 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4233 ret2->setArray(aaa);
4235 Py_XINCREF(trueSelf);
4240 if(!self->getArray())
4241 throw INTERP_KERNEL::Exception(msg2);
4242 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4243 self->getArray()->substractEqual(aaa);
4244 Py_XINCREF(trueSelf);
4248 { throw INTERP_KERNEL::Exception(msg); }
4252 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4254 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.";
4255 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4258 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4260 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4264 Py_XINCREF(trueSelf);
4268 throw INTERP_KERNEL::Exception(msg);
4273 DataArrayDoubleTuple *aa;
4274 std::vector<double> bb;
4276 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4281 if(!self->getArray())
4282 throw INTERP_KERNEL::Exception(msg2);
4283 self->getArray()->applyLin(val,0);
4284 Py_XINCREF(trueSelf);
4289 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4292 Py_XINCREF(trueSelf);
4297 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4298 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4299 ret2->setArray(aaa);
4301 Py_XINCREF(trueSelf);
4306 if(!self->getArray())
4307 throw INTERP_KERNEL::Exception(msg2);
4308 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4309 self->getArray()->multiplyEqual(aaa);
4310 Py_XINCREF(trueSelf);
4314 { throw INTERP_KERNEL::Exception(msg); }
4318 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4320 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.";
4321 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4324 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4326 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4330 Py_XINCREF(trueSelf);
4334 throw INTERP_KERNEL::Exception(msg);
4339 DataArrayDoubleTuple *aa;
4340 std::vector<double> bb;
4342 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4348 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4349 if(!self->getArray())
4350 throw INTERP_KERNEL::Exception(msg2);
4351 self->getArray()->applyLin(1./val,0);
4352 Py_XINCREF(trueSelf);
4357 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4360 Py_XINCREF(trueSelf);
4365 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4366 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4367 ret2->setArray(aaa);
4369 Py_XINCREF(trueSelf);
4374 if(!self->getArray())
4375 throw INTERP_KERNEL::Exception(msg2);
4376 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4377 self->getArray()->divideEqual(aaa);
4378 Py_XINCREF(trueSelf);
4382 { throw INTERP_KERNEL::Exception(msg); }
4386 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4388 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.";
4389 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4392 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4394 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4398 Py_XINCREF(trueSelf);
4402 throw INTERP_KERNEL::Exception(msg);
4407 DataArrayDoubleTuple *aa;
4408 std::vector<double> bb;
4410 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4415 if(!self->getArray())
4416 throw INTERP_KERNEL::Exception(msg2);
4417 self->getArray()->applyPow(val);
4418 Py_XINCREF(trueSelf);
4423 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4426 Py_XINCREF(trueSelf);
4431 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4432 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4433 ret2->setArray(aaa);
4435 Py_XINCREF(trueSelf);
4440 if(!self->getArray())
4441 throw INTERP_KERNEL::Exception(msg2);
4442 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4443 self->getArray()->powEqual(aaa);
4444 Py_XINCREF(trueSelf);
4448 { throw INTERP_KERNEL::Exception(msg); }
4452 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4454 std::vector<const MEDCouplingFieldDouble *> tmp;
4455 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4456 return MEDCouplingFieldDouble::MergeFields(tmp);
4459 static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4461 std::vector<const MEDCouplingFieldDouble *> tmp;
4462 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4463 MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4468 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4471 int getNumberOfFields() const;
4472 MEDCouplingMultiFields *deepCpy() const;
4473 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4474 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4475 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4476 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4477 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4480 std::string __str__() const throw(INTERP_KERNEL::Exception)
4482 return self->simpleRepr();
4484 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4486 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4487 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4489 std::vector<MEDCouplingFieldDouble *> fs(sz);
4490 for(int i=0;i<sz;i++)
4491 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4492 return MEDCouplingMultiFields::New(fs);
4494 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4496 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4497 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4499 std::vector<MEDCouplingFieldDouble *> fs(sz);
4500 for(int i=0;i<sz;i++)
4501 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4502 return MEDCouplingMultiFields::New(fs);
4504 PyObject *getFields() const
4506 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4507 int sz=fields.size();
4508 PyObject *res = PyList_New(sz);
4509 for(int i=0;i<sz;i++)
4513 fields[i]->incrRef();
4514 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4518 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4523 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4525 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4529 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4532 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4534 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4536 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4538 PyObject *res = PyList_New(sz);
4539 for(int i=0;i<sz;i++)
4544 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4548 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4553 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4555 std::vector<int> refs;
4556 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4558 PyObject *res = PyList_New(sz);
4559 for(int i=0;i<sz;i++)
4564 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4568 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4572 PyObject *ret=PyTuple_New(2);
4573 PyTuple_SetItem(ret,0,res);
4574 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4577 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4579 std::vector<DataArrayDouble *> ms=self->getArrays();
4581 PyObject *res = PyList_New(sz);
4582 for(int i=0;i<sz;i++)
4587 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4591 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4596 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4598 std::vector< std::vector<int> > refs;
4599 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4601 PyObject *res = PyList_New(sz);
4602 PyObject *res2 = PyList_New(sz);
4603 for(int i=0;i<sz;i++)
4608 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4612 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4614 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4617 PyObject *ret=PyTuple_New(2);
4618 PyTuple_SetItem(ret,0,res);
4619 PyTuple_SetItem(ret,1,res2);
4625 class MEDCouplingDefinitionTime
4628 MEDCouplingDefinitionTime();
4629 void assign(const MEDCouplingDefinitionTime& other);
4630 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4631 double getTimeResolution() const;
4632 std::vector<double> getHotSpotsTime() const;
4635 std::string __str__() const throw(INTERP_KERNEL::Exception)
4637 std::ostringstream oss;
4638 self->appendRepr(oss);
4642 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4644 int meshId,arrId,arrIdInField,fieldId;
4645 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4646 PyObject *res=PyList_New(4);
4647 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4648 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4649 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4650 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4654 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4656 int meshId,arrId,arrIdInField,fieldId;
4657 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4658 PyObject *res=PyList_New(4);
4659 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4660 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4661 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4662 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4668 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4671 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4672 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4676 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4678 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4679 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4681 std::vector<MEDCouplingFieldDouble *> fs(sz);
4682 for(int i=0;i<sz;i++)
4683 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4684 return MEDCouplingFieldOverTime::New(fs);
4686 std::string __str__() const throw(INTERP_KERNEL::Exception)
4688 return self->simpleRepr();
4690 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4692 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4693 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4695 std::vector<MEDCouplingFieldDouble *> fs(sz);
4696 for(int i=0;i<sz;i++)
4697 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4698 return MEDCouplingFieldOverTime::New(fs);
4706 __filename=os.environ.get('PYTHONSTARTUP')
4707 if __filename and os.path.isfile(__filename):
4708 execfile(__filename)