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::getValueOnMulti;
211 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
212 %newobject ParaMEDMEM::DataArray::deepCpy;
213 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
214 %newobject ParaMEDMEM::DataArray::selectByTupleId;
215 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
216 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
217 %newobject ParaMEDMEM::DataArray::Aggregate;
218 %newobject ParaMEDMEM::DataArrayInt::New;
219 %newobject ParaMEDMEM::DataArrayInt::__iter__;
220 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
221 %newobject ParaMEDMEM::DataArrayInt::performCpy;
222 %newobject ParaMEDMEM::DataArrayInt::substr;
223 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
224 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
225 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
226 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
227 %newobject ParaMEDMEM::DataArrayInt::renumber;
228 %newobject ParaMEDMEM::DataArrayInt::renumberR;
229 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
230 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
231 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
232 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
233 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
234 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
235 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
236 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
237 %newobject ParaMEDMEM::DataArrayInt::negate;
238 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
239 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
240 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
241 %newobject ParaMEDMEM::DataArrayInt::Meld;
242 %newobject ParaMEDMEM::DataArrayInt::Add;
243 %newobject ParaMEDMEM::DataArrayInt::Substract;
244 %newobject ParaMEDMEM::DataArrayInt::Multiply;
245 %newobject ParaMEDMEM::DataArrayInt::Divide;
246 %newobject ParaMEDMEM::DataArrayInt::Pow;
247 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
248 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
249 %newobject ParaMEDMEM::DataArrayInt::Range;
250 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
251 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
252 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
253 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
254 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
255 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
256 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
257 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
258 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
259 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
260 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
261 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
262 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
263 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
264 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
265 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
266 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
267 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
268 %newobject ParaMEDMEM::DataArrayInt::__neg__;
269 %newobject ParaMEDMEM::DataArrayInt::__add__;
270 %newobject ParaMEDMEM::DataArrayInt::__radd__;
271 %newobject ParaMEDMEM::DataArrayInt::__sub__;
272 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
273 %newobject ParaMEDMEM::DataArrayInt::__mul__;
274 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
275 %newobject ParaMEDMEM::DataArrayInt::__div__;
276 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
277 %newobject ParaMEDMEM::DataArrayInt::__mod__;
278 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
279 %newobject ParaMEDMEM::DataArrayInt::__pow__;
280 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
281 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
282 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
283 %newobject ParaMEDMEM::DataArrayChar::renumber;
284 %newobject ParaMEDMEM::DataArrayChar::renumberR;
285 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
286 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
287 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
288 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
289 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
290 %newobject ParaMEDMEM::DataArrayChar::Meld;
291 %newobject ParaMEDMEM::DataArrayByte::New;
292 %newobject ParaMEDMEM::DataArrayByte::__iter__;
293 %newobject ParaMEDMEM::DataArrayByte::performCpy;
294 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
295 %newobject ParaMEDMEM::DataArrayChar::substr;
296 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
297 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
298 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
299 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
300 %newobject ParaMEDMEM::DataArrayDouble::New;
301 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
302 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
303 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
304 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
305 %newobject ParaMEDMEM::DataArrayDouble::Meld;
306 %newobject ParaMEDMEM::DataArrayDouble::Dot;
307 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
308 %newobject ParaMEDMEM::DataArrayDouble::Add;
309 %newobject ParaMEDMEM::DataArrayDouble::Substract;
310 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
311 %newobject ParaMEDMEM::DataArrayDouble::Divide;
312 %newobject ParaMEDMEM::DataArrayDouble::Pow;
313 %newobject ParaMEDMEM::DataArrayDouble::substr;
314 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
315 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
316 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
317 %newobject ParaMEDMEM::DataArrayDouble::negate;
318 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
319 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
320 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
321 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
322 %newobject ParaMEDMEM::DataArrayDouble::determinant;
323 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
324 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
325 %newobject ParaMEDMEM::DataArrayDouble::inverse;
326 %newobject ParaMEDMEM::DataArrayDouble::trace;
327 %newobject ParaMEDMEM::DataArrayDouble::deviator;
328 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
329 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
330 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
331 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
332 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
333 %newobject ParaMEDMEM::DataArrayDouble::renumber;
334 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
335 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
336 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
337 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
338 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
339 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
340 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
341 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
342 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
343 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
344 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
345 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
346 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
347 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
348 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
349 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
350 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
351 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
352 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
353 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
354 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
355 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
356 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
357 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
358 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
359 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
360 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
361 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
362 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
363 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
364 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
365 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
366 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
367 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
368 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
369 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
370 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
371 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
372 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
373 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
374 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
375 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
376 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
377 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
378 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
379 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
380 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
381 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
382 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
383 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
384 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
385 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
386 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
389 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
390 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
391 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
392 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
393 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
394 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
395 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
396 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
397 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
398 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
399 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
432 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
433 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
434 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
435 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
436 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
437 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
438 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
439 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
440 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
441 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
442 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
443 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
444 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
445 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
446 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
447 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
448 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
449 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
450 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
451 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
452 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
453 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
454 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
455 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
456 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
457 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
458 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
459 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
460 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
461 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
463 %feature("unref") DataArray "$this->decrRef();"
464 %feature("unref") DataArrayDouble "$this->decrRef();"
465 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
466 %feature("unref") MEDCouplingMesh "$this->decrRef();"
467 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
468 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
469 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
470 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
471 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
473 %feature("unref") DataArrayInt "$this->decrRef();"
474 %feature("unref") DataArrayChar "$this->decrRef();"
475 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
476 %feature("unref") DataArrayByte "$this->decrRef();"
477 %feature("unref") MEDCouplingField "$this->decrRef();"
478 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
479 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
480 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
481 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
482 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
483 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
484 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
485 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
486 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
488 %rename(assign) *::operator=;
489 %ignore ParaMEDMEM::RefCountObject::decrRef;
490 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
491 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
492 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
493 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
497 %rename (InterpKernelException) INTERP_KERNEL::Exception;
499 namespace INTERP_KERNEL
504 Exception(const char* what);
505 ~Exception() throw ();
506 const char *what() const throw ();
509 std::string __str__() const
511 return std::string(self->what());
522 void declareAsNew() const;
523 virtual void updateTime() const;
524 unsigned int getTimeOfThis() const;
552 CONST_ON_TIME_INTERVAL = 7
553 } TypeOfTimeDiscretization;
555 const char *MEDCouplingVersionStr();
556 int MEDCouplingVersion();
557 int MEDCouplingSizeOfVoidStar();
558 bool MEDCouplingByteOrder();
559 const char *MEDCouplingByteOrderStr();
565 RefCountObject(const RefCountObject& other);
568 bool decrRef() const;
569 void incrRef() const;
570 int getRCValue() const;
571 virtual std::size_t getHeapMemorySize() const;
577 PyObject *MEDCouplingVersionMajMinRel()
579 int tmp0=0,tmp1=0,tmp2=0;
580 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
581 PyObject *res = PyList_New(3);
582 PyList_SetItem(res,0,SWIG_From_int(tmp0));
583 PyList_SetItem(res,1,SWIG_From_int(tmp1));
584 PyList_SetItem(res,2,SWIG_From_int(tmp2));
588 bool MEDCouplingHasNumPyBindings()
597 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
599 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
600 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
601 if(PyRun_SimpleString(script)!=0)
602 throw INTERP_KERNEL::Exception(oss.str().c_str());
603 return std::string(script);
607 %include "MEDCouplingMemArray.i"
617 SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
618 SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11
619 } MEDCouplingMeshType;
622 class DataArrayDouble;
623 class MEDCouplingUMesh;
624 class MEDCouplingFieldDouble;
626 %extend RefCountObject
628 std::string getHiddenCppPointer() const
630 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
635 %extend MEDCouplingGaussLocalization
637 std::string __str__() const throw(INTERP_KERNEL::Exception)
639 return self->getStringRepr();
642 std::string __repr__() const throw(INTERP_KERNEL::Exception)
644 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
645 oss << self->getStringRepr();
652 class MEDCouplingMesh : public RefCountObject, public TimeLabel
655 void setName(const char *name);
656 std::string getName() const;
657 void setDescription(const char *descr);
658 std::string getDescription() const;
659 void setTime(double val, int iteration, int order);
660 void setTimeUnit(const char *unit);
661 const char *getTimeUnit() const;
662 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
663 bool isStructured() const throw(INTERP_KERNEL::Exception);
664 virtual MEDCouplingMesh *deepCpy() const;
665 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
666 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
667 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
668 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
669 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
670 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
671 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
672 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
673 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
674 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
675 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
676 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
677 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
678 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
679 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
680 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
681 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
682 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
683 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
684 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
685 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
686 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
687 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
688 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
689 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
691 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
692 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
693 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
694 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
695 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
696 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
697 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
698 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
699 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
700 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
701 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
702 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
703 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
704 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
705 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
706 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
707 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
710 std::string __str__() const throw(INTERP_KERNEL::Exception)
712 return self->simpleRepr();
715 PyObject *getTime() throw(INTERP_KERNEL::Exception)
718 double tmp0=self->getTime(tmp1,tmp2);
719 PyObject *res = PyList_New(3);
720 PyList_SetItem(res,0,SWIG_From_double(tmp0));
721 PyList_SetItem(res,1,SWIG_From_int(tmp1));
722 PyList_SetItem(res,2,SWIG_From_int(tmp2));
726 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
730 DataArrayDoubleTuple *aa;
731 std::vector<double> bb;
733 int spaceDim=self->getSpaceDimension();
734 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
735 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
736 return self->getCellContainingPoint(pos,eps);
739 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
743 DataArrayDoubleTuple *aa;
744 std::vector<double> bb;
746 int spaceDim=self->getSpaceDimension();
747 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
748 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
749 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
750 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
751 PyObject *ret=PyTuple_New(2);
752 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
753 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
757 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
759 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
760 int spaceDim=self->getSpaceDimension();
762 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
763 if (!SWIG_IsOK(res1))
766 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
767 int nbOfPoints=size/spaceDim;
770 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
772 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
776 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
778 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
779 da2->checkAllocated();
780 int size=da2->getNumberOfTuples();
781 int nbOfCompo=da2->getNumberOfComponents();
782 if(nbOfCompo!=spaceDim)
784 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
786 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
788 PyObject *ret=PyTuple_New(2);
789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
794 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
798 DataArrayDoubleTuple *aa;
799 std::vector<double> bb;
801 int spaceDim=self->getSpaceDimension();
802 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
803 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
804 std::vector<int> elts;
805 self->getCellsContainingPoint(pos,eps,elts);
806 DataArrayInt *ret=DataArrayInt::New();
807 ret->alloc((int)elts.size(),1);
808 std::copy(elts.begin(),elts.end(),ret->getPointer());
809 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
812 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
815 int v0; std::vector<int> v1;
816 const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
817 self->renumberCells(ids,check);
820 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
822 DataArrayInt *cellCor, *nodeCor;
823 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
824 PyObject *res = PyList_New(2);
825 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
826 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
830 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
832 DataArrayInt *cellCor=0,*nodeCor=0;
833 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
834 PyObject *res = PyList_New(2);
835 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
836 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
840 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
842 DataArrayInt *cellCor=0;
843 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
847 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
850 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
851 if (!SWIG_IsOK(res1))
854 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
855 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
859 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
861 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
862 da2->checkAllocated();
863 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
866 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
868 std::vector<int> conn;
869 self->getNodeIdsOfCell(cellId,conn);
870 return convertIntArrToPyList2(conn);
873 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
875 std::vector<double> coo;
876 self->getCoordinatesOfNode(nodeId,coo);
877 return convertDblArrToPyList2(coo);
880 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
884 DataArrayDoubleTuple *aa;
885 std::vector<double> bb;
887 int spaceDim=self->getSpaceDimension();
888 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
889 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
890 self->scale(pointPtr,factor);
893 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
895 int spaceDim=self->getSpaceDimension();
896 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
897 self->getBoundingBox(tmp);
898 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
902 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
905 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
906 PyObject *ret=PyTuple_New(2);
907 PyObject *ret0Py=ret0?Py_True:Py_False;
909 PyTuple_SetItem(ret,0,ret0Py);
910 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
914 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
916 int szArr,sw,iTypppArr;
917 std::vector<int> stdvecTyyppArr;
918 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
919 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
920 if(sw==3)//DataArrayInt
922 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
923 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
924 std::string name=argpt->getName();
926 ret->setName(name.c_str());
928 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
931 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
933 int szArr,sw,iTypppArr;
934 std::vector<int> stdvecTyyppArr;
936 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
937 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
938 if(sw==3)//DataArrayInt
940 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
941 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
942 std::string name=argpt->getName();
944 ret->setName(name.c_str());
947 PyObject *res = PyList_New(2);
948 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
949 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
950 PyList_SetItem(res,0,obj0);
951 PyList_SetItem(res,1,obj1);
955 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
959 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
960 PyObject *res = PyTuple_New(2);
961 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
964 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
966 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
967 PyTuple_SetItem(res,0,obj0);
968 PyTuple_SetItem(res,1,obj1);
972 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
974 std::vector<int> vals=self->getDistributionOfTypes();
976 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
977 PyObject *ret=PyList_New((int)vals.size()/3);
978 for(int j=0;j<(int)vals.size()/3;j++)
980 PyObject *ret1=PyList_New(3);
981 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
982 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
983 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
984 PyList_SetItem(ret,j,ret1);
989 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
991 std::vector<int> code;
992 std::vector<const DataArrayInt *> idsPerType;
993 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
994 convertPyToNewIntArr4(li,1,3,code);
995 return self->checkTypeConsistencyAndContig(code,idsPerType);
998 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1000 std::vector<int> code;
1001 std::vector<DataArrayInt *> idsInPflPerType;
1002 std::vector<DataArrayInt *> idsPerType;
1003 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1004 PyObject *ret=PyTuple_New(3);
1006 if(code.size()%3!=0)
1007 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1008 PyObject *ret0=PyList_New((int)code.size()/3);
1009 for(int j=0;j<(int)code.size()/3;j++)
1011 PyObject *ret00=PyList_New(3);
1012 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1013 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1014 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1015 PyList_SetItem(ret0,j,ret00);
1017 PyTuple_SetItem(ret,0,ret0);
1019 PyObject *ret1=PyList_New(idsInPflPerType.size());
1020 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1021 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1022 PyTuple_SetItem(ret,1,ret1);
1023 int n=idsPerType.size();
1024 PyObject *ret2=PyList_New(n);
1025 for(int i=0;i<n;i++)
1026 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1027 PyTuple_SetItem(ret,2,ret2);
1031 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1035 DataArrayDoubleTuple *aa;
1036 std::vector<double> bb;
1038 int spaceDim=self->getSpaceDimension();
1039 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1040 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1041 self->translate(vectorPtr);
1044 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1046 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1049 DataArrayDoubleTuple *aa;
1050 std::vector<double> bb;
1052 int spaceDim=self->getSpaceDimension();
1053 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1054 self->rotate(centerPtr,0,alpha);
1057 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1059 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1061 DataArrayDouble *a,*a2;
1062 DataArrayDoubleTuple *aa,*aa2;
1063 std::vector<double> bb,bb2;
1065 int spaceDim=self->getSpaceDimension();
1066 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1067 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
1068 self->rotate(centerPtr,vectorPtr,alpha);
1071 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1073 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1074 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1075 PyObject *res=PyList_New(result.size());
1076 for(int i=0;iL!=result.end(); i++, iL++)
1077 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1081 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1083 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1084 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1085 return MEDCouplingMesh::MergeMeshes(tmp);
1091 //== MEDCouplingMesh End
1093 %include "NormalizedUnstructuredMesh.hxx"
1094 %include "MEDCouplingNatureOfField.hxx"
1095 %include "MEDCouplingTimeDiscretization.hxx"
1097 namespace ParaMEDMEM
1099 class MEDCouplingGaussLocalization
1102 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1103 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1104 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1105 INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
1106 void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
1107 int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
1108 int getDimension() const throw(INTERP_KERNEL::Exception);
1109 int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
1110 std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
1111 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1112 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
1114 const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
1115 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1116 const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
1117 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
1118 const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
1119 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
1120 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1121 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
1122 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
1123 void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
1124 void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
1125 void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1127 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1131 %include "MEDCouplingFieldDiscretization.i"
1133 //== MEDCouplingPointSet
1135 namespace ParaMEDMEM
1137 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1140 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1141 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1142 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1143 void zipCoords() throw(INTERP_KERNEL::Exception);
1144 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1145 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1146 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1147 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1148 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1149 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1150 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1151 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1152 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1153 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1154 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1155 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1156 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1157 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1158 virtual DataArrayInt *findBoundaryNodes() const;
1159 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1160 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1161 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1162 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1163 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1164 virtual DataArrayDouble *getBoundingBoxForBBTree() const throw(INTERP_KERNEL::Exception);
1167 std::string __str__() const throw(INTERP_KERNEL::Exception)
1169 return self->simpleRepr();
1172 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1175 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1176 PyObject *res = PyList_New(2);
1177 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1178 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1182 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1184 DataArrayInt *comm, *commIndex;
1185 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1186 PyObject *res = PyList_New(2);
1187 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1188 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1192 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1194 DataArrayDouble *ret1=self->getCoords();
1197 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1200 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1202 int szArr,sw,iTypppArr;
1203 std::vector<int> stdvecTyyppArr;
1204 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1205 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1206 if(sw==3)//DataArrayInt
1208 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1209 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1210 std::string name=argpt->getName();
1212 ret->setName(name.c_str());
1214 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1217 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1219 int szArr,sw,iTypppArr;
1220 std::vector<int> stdvecTyyppArr;
1221 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1222 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1223 if(sw==3)//DataArrayInt
1225 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1226 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1227 std::string name=argpt->getName();
1229 ret->setName(name.c_str());
1231 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1234 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1236 int szArr,sw,iTypppArr;
1237 std::vector<int> stdvecTyyppArr;
1238 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1239 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1240 if(sw==3)//DataArrayInt
1242 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1243 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1244 std::string name=argpt->getName();
1246 ret->setName(name.c_str());
1248 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1251 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1253 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1254 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1257 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1259 int szArr,sw,iTypppArr;
1260 std::vector<int> stdvecTyyppArr;
1261 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1262 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1263 if(sw==3)//DataArrayInt
1265 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1266 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1267 std::string name=argpt->getName();
1269 ret->setName(name.c_str());
1271 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1274 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1276 int szArr,sw,iTypppArr;
1277 std::vector<int> stdvecTyyppArr;
1278 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1279 self->renumberNodes(tmp,newNbOfNodes);
1282 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1284 int szArr,sw,iTypppArr;
1285 std::vector<int> stdvecTyyppArr;
1286 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1287 self->renumberNodes2(tmp,newNbOfNodes);
1290 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1292 int spaceDim=self->getSpaceDimension();
1294 DataArrayDouble *a,*a2;
1295 DataArrayDoubleTuple *aa,*aa2;
1296 std::vector<double> bb,bb2;
1298 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1299 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1300 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1301 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1302 std::vector<int> nodes;
1303 self->findNodesOnLine(p,v,eps,nodes);
1304 DataArrayInt *ret=DataArrayInt::New();
1305 ret->alloc((int)nodes.size(),1);
1306 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1309 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1311 int spaceDim=self->getSpaceDimension();
1313 DataArrayDouble *a,*a2;
1314 DataArrayDoubleTuple *aa,*aa2;
1315 std::vector<double> bb,bb2;
1317 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1318 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1319 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1320 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1321 std::vector<int> nodes;
1322 self->findNodesOnPlane(p,v,eps,nodes);
1323 DataArrayInt *ret=DataArrayInt::New();
1324 ret->alloc((int)nodes.size(),1);
1325 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1326 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1329 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1333 DataArrayDoubleTuple *aa;
1334 std::vector<double> bb;
1336 int spaceDim=self->getSpaceDimension();
1337 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1338 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1339 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1340 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1343 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1345 DataArrayInt *c=0,*cI=0;
1349 DataArrayDoubleTuple *aa;
1350 std::vector<double> bb;
1352 int spaceDim=self->getSpaceDimension();
1353 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1354 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1355 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1356 PyObject *ret=PyTuple_New(2);
1357 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1358 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1362 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1364 DataArrayInt *c=0,*cI=0;
1365 int spaceDim=self->getSpaceDimension();
1368 DataArrayDoubleTuple *aa;
1369 std::vector<double> bb;
1372 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1373 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1375 PyObject *ret=PyTuple_New(2);
1376 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1377 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1381 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1385 DataArrayDoubleTuple *aa;
1386 std::vector<double> bb;
1388 int spaceDim=self->getSpaceDimension();
1389 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1390 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1392 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1393 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1396 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1400 std::vector<int> multiVal;
1401 std::pair<int, std::pair<int,int> > slic;
1402 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1403 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1407 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1409 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1411 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1413 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1417 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1419 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1420 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1421 self->getReverseNodalConnectivity(d0,d1);
1422 PyObject *ret=PyTuple_New(2);
1423 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1424 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1428 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1430 DataArrayInt *v0=0,*v1=0;
1431 self->findCommonCells(compType,startCellId,v0,v1);
1432 PyObject *res = PyList_New(2);
1433 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1434 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1439 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1442 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1443 if (!SWIG_IsOK(res1))
1446 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1447 self->renumberNodesInConn(tmp);
1451 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1453 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1454 da2->checkAllocated();
1455 self->renumberNodesInConn(da2->getConstPointer());
1459 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1462 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1463 PyObject *ret=PyTuple_New(2);
1464 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1465 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1469 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1471 DataArrayInt *ret=0;
1473 int szArr,sw,iTypppArr;
1474 std::vector<int> stdvecTyyppArr;
1475 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1476 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1480 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1484 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1485 PyObject *res = PyList_New(3);
1486 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1487 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1488 PyList_SetItem(res,2,SWIG_From_int(ret2));
1492 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1496 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1497 PyObject *res = PyList_New(3);
1498 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1499 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1500 PyList_SetItem(res,2,SWIG_From_int(ret2));
1504 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1507 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1508 if (!SWIG_IsOK(res1))
1511 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1512 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1516 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1518 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1519 da2->checkAllocated();
1520 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1524 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1528 std::vector<int> multiVal;
1529 std::pair<int, std::pair<int,int> > slic;
1530 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1531 int nbc=self->getNumberOfCells();
1532 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1539 std::ostringstream oss;
1540 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1541 throw INTERP_KERNEL::Exception(oss.str().c_str());
1544 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1549 int tmp=nbc+singleVal;
1550 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1554 std::ostringstream oss;
1555 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1556 throw INTERP_KERNEL::Exception(oss.str().c_str());
1562 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1566 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1571 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1572 daIntTyypp->checkAllocated();
1573 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1576 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1580 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1583 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1584 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1585 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1586 for(int i=0;i<sz;i++)
1587 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1590 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1593 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1595 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1596 std::vector<double> val3;
1597 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1598 "Rotate2DAlg",2,true,nbNodes);
1600 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1601 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1604 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1607 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1608 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1609 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1610 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1611 for(int i=0;i<sz;i++)
1612 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1615 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1618 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1620 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1621 std::vector<double> val3;
1622 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1623 "Rotate3DAlg",3,true,nbNodes);
1625 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1626 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1627 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1632 //== MEDCouplingPointSet End
1634 class MEDCouplingUMeshCell
1637 INTERP_KERNEL::NormalizedCellType getType() const;
1640 std::string __str__() const throw(INTERP_KERNEL::Exception)
1642 return self->repr();
1645 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1648 const int *r=self->getAllConn(ret2);
1649 PyObject *ret=PyTuple_New(ret2);
1650 for(int i=0;i<ret2;i++)
1651 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1657 class MEDCouplingUMeshCellIterator
1664 MEDCouplingUMeshCell *ret=self->nextt();
1666 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1669 PyErr_SetString(PyExc_StopIteration,"No more data.");
1676 class MEDCouplingUMeshCellByTypeIterator
1679 ~MEDCouplingUMeshCellByTypeIterator();
1684 MEDCouplingUMeshCellEntry *ret=self->nextt();
1686 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1689 PyErr_SetString(PyExc_StopIteration,"No more data.");
1696 class MEDCouplingUMeshCellByTypeEntry
1699 ~MEDCouplingUMeshCellByTypeEntry();
1702 MEDCouplingUMeshCellByTypeIterator *__iter__()
1704 return self->iterator();
1709 class MEDCouplingUMeshCellEntry
1712 INTERP_KERNEL::NormalizedCellType getType() const;
1713 int getNumberOfElems() const;
1716 MEDCouplingUMeshCellIterator *__iter__()
1718 return self->iterator();
1723 //== MEDCouplingUMesh
1725 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1728 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1729 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1730 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1731 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1732 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1733 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1734 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1735 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1736 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1737 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1738 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1739 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1740 void computeTypes() throw(INTERP_KERNEL::Exception);
1741 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1742 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1744 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1745 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1746 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1747 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1748 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1749 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1750 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1751 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1752 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1753 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1754 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1755 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1756 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1757 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1758 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1759 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1760 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1761 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1762 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1763 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1764 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1765 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1766 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1767 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1768 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1769 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1770 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1771 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1772 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1773 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1774 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1775 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1776 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1777 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1778 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1779 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1780 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1781 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1782 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1784 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1786 return MEDCouplingUMesh::New();
1789 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1791 return MEDCouplingUMesh::New(meshName,meshDim);
1794 std::string __str__() const throw(INTERP_KERNEL::Exception)
1796 return self->simpleRepr();
1799 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1801 std::ostringstream oss;
1802 self->reprQuickOverview(oss);
1806 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1808 return self->cellIterator();
1811 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1815 std::vector<int> multiVal;
1816 std::pair<int, std::pair<int,int> > slic;
1817 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1818 int nbc=self->getNumberOfCells();
1819 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1826 std::ostringstream oss;
1827 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1828 throw INTERP_KERNEL::Exception(oss.str().c_str());
1832 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1839 int tmp=nbc+singleVal;
1840 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1845 std::ostringstream oss;
1846 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1847 throw INTERP_KERNEL::Exception(oss.str().c_str());
1853 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1859 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1860 daIntTyypp->checkAllocated();
1861 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1865 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1869 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1873 std::vector<int> multiVal;
1874 std::pair<int, std::pair<int,int> > slic;
1875 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1876 int nbc=self->getNumberOfCells();
1877 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1884 std::ostringstream oss;
1885 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1886 throw INTERP_KERNEL::Exception(oss.str().c_str());
1890 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1897 int tmp=nbc+singleVal;
1898 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1903 std::ostringstream oss;
1904 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1905 throw INTERP_KERNEL::Exception(oss.str().c_str());
1911 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1916 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1922 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1923 daIntTyypp->checkAllocated();
1924 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1928 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1932 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1934 int szArr,sw,iTypppArr;
1935 std::vector<int> stdvecTyyppArr;
1936 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1939 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1940 throw INTERP_KERNEL::Exception(oss.str().c_str());
1942 self->insertNextCell(type,size,tmp);
1945 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1947 int szArr,sw,iTypppArr;
1948 std::vector<int> stdvecTyyppArr;
1949 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1950 self->insertNextCell(type,szArr,tmp);
1953 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1955 DataArrayInt *ret=self->getNodalConnectivity();
1960 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1962 DataArrayInt *ret=self->getNodalConnectivityIndex();
1967 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1969 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1970 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1971 PyObject *res = PyList_New(result.size());
1972 for (int i=0;iL!=result.end(); i++, iL++)
1973 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1977 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1979 int szArr,sw,iTypppArr;
1980 std::vector<int> stdvecTyyppArr;
1981 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1982 int nbOfDepthPeelingPerformed=0;
1983 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1984 PyObject *res=PyTuple_New(2);
1985 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1986 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1990 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1992 DataArrayInt *v0=0,*v1=0;
1993 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1994 PyObject *res = PyList_New(2);
1995 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1996 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2000 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2004 DataArrayDoubleTuple *aa;
2005 std::vector<double> bb;
2007 int nbOfCompo=self->getSpaceDimension();
2008 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2011 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2012 PyObject *ret=PyTuple_New(2);
2013 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2014 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2018 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2020 DataArrayInt *ret1=0;
2021 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2022 PyObject *ret=PyTuple_New(2);
2023 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2024 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2028 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2031 DataArrayInt *ret1(0);
2032 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2033 PyObject *ret=PyTuple_New(3);
2034 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2035 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2036 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2040 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2042 std::vector<int> cells;
2043 self->checkButterflyCells(cells,eps);
2044 DataArrayInt *ret=DataArrayInt::New();
2045 ret->alloc((int)cells.size(),1);
2046 std::copy(cells.begin(),cells.end(),ret->getPointer());
2047 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2050 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2052 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2054 PyObject *ret = PyList_New(sz);
2055 for(int i=0;i<sz;i++)
2056 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2060 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2062 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2063 int sz=retCpp.size();
2064 PyObject *ret=PyList_New(sz);
2065 for(int i=0;i<sz;i++)
2066 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2070 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2073 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2074 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2075 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2078 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2081 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2082 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2086 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2089 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2090 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2094 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2096 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2097 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2098 PyObject *ret=PyTuple_New(3);
2099 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2100 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2101 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2105 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2107 DataArrayInt *tmp0=0,*tmp1=0;
2108 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2109 PyObject *ret=PyTuple_New(2);
2110 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2111 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2115 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2119 std::vector<int> multiVal;
2120 std::pair<int, std::pair<int,int> > slic;
2121 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2122 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2126 return self->duplicateNodes(&singleVal,&singleVal+1);
2128 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2130 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2132 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2136 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2140 std::vector<int> multiVal;
2141 std::pair<int, std::pair<int,int> > slic;
2142 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2143 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2147 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2149 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2151 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2153 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2157 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2160 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2161 DataArrayInt *tmp0,*tmp1=0;
2162 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2163 PyObject *ret=PyTuple_New(2);
2164 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2171 DataArrayInt *ret0=0,*ret1=0;
2172 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2173 PyObject *ret=PyTuple_New(2);
2174 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2179 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2181 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2182 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2183 DataArrayInt *ret1=0,*ret2=0;
2184 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2185 PyObject *ret=PyTuple_New(3);
2186 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2187 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2194 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2195 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2196 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2197 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2200 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2203 std::vector<const MEDCouplingUMesh *> meshes;
2204 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2205 std::vector<DataArrayInt *> corr;
2206 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2208 PyObject *ret1=PyList_New(sz);
2209 for(int i=0;i<sz;i++)
2210 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2211 PyObject *ret=PyList_New(2);
2212 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2213 PyList_SetItem(ret,1,ret1);
2217 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2219 std::vector<MEDCouplingUMesh *> meshes;
2220 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2221 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2224 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2226 std::vector<MEDCouplingUMesh *> meshes;
2227 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2228 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2231 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2235 std::vector<int> multiVal;
2236 std::pair<int, std::pair<int,int> > slic;
2237 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2239 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2240 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2244 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2246 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2248 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2250 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2254 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2256 DataArrayInt *arrOut=0,*arrIndexOut=0;
2259 std::vector<int> multiVal;
2260 std::pair<int, std::pair<int,int> > slic;
2261 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2263 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2264 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2269 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2274 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2279 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2283 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2285 PyObject *ret=PyTuple_New(2);
2286 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2287 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2291 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2293 DataArrayInt *arrOut=0,*arrIndexOut=0;
2294 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2295 PyObject *ret=PyTuple_New(2);
2296 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2297 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2301 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2303 if(!PySlice_Check(slic))
2304 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2305 Py_ssize_t strt=2,stp=2,step=2;
2306 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2308 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2309 arrIndxIn->checkAllocated();
2310 if(arrIndxIn->getNumberOfComponents()!=1)
2311 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2312 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2313 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2314 DataArrayInt *arrOut=0,*arrIndexOut=0;
2315 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2316 PyObject *ret=PyTuple_New(2);
2317 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2318 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2322 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2323 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2324 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2326 DataArrayInt *arrOut=0,*arrIndexOut=0;
2329 std::vector<int> multiVal;
2330 std::pair<int, std::pair<int,int> > slic;
2331 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2333 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2334 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2339 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2344 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2349 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2353 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2355 PyObject *ret=PyTuple_New(2);
2356 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2361 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2362 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2366 std::vector<int> multiVal;
2367 std::pair<int, std::pair<int,int> > slic;
2368 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2370 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2371 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2376 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2381 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2386 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2390 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2394 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2398 DataArrayDoubleTuple *aa;
2399 std::vector<double> bb;
2401 int spaceDim=self->getSpaceDimension();
2402 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2403 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2405 std::vector<int> cells;
2406 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2407 DataArrayInt *ret=DataArrayInt::New();
2408 ret->alloc((int)cells.size(),1);
2409 std::copy(cells.begin(),cells.end(),ret->getPointer());
2410 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2413 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2417 DataArrayDoubleTuple *aa;
2418 std::vector<double> bb;
2420 int spaceDim=self->getSpaceDimension();
2421 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2422 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2423 self->orientCorrectly2DCells(v,polyOnly);
2426 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2428 std::vector<int> cells;
2429 self->arePolyhedronsNotCorrectlyOriented(cells);
2430 DataArrayInt *ret=DataArrayInt::New();
2431 ret->alloc((int)cells.size(),1);
2432 std::copy(cells.begin(),cells.end(),ret->getPointer());
2433 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2436 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2440 self->getFastAveragePlaneOfThis(vec,pos);
2442 std::copy(vec,vec+3,vals);
2443 std::copy(pos,pos+3,vals+3);
2444 return convertDblArrToPyListOfTuple(vals,3,2);
2447 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2449 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2450 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2451 return MEDCouplingUMesh::MergeUMeshes(tmp);
2454 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2457 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2458 PyObject *ret=PyTuple_New(2);
2459 PyObject *ret0Py=ret0?Py_True:Py_False;
2461 PyTuple_SetItem(ret,0,ret0Py);
2462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2469 bool ret0=self->areCellsIncludedIn2(other,ret1);
2470 PyObject *ret=PyTuple_New(2);
2471 PyObject *ret0Py=ret0?Py_True:Py_False;
2473 PyTuple_SetItem(ret,0,ret0Py);
2474 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2478 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2481 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2482 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2483 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2484 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2485 PyObject *ret=PyTuple_New(5);
2486 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2487 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2488 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2489 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2490 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2494 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2496 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2497 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2498 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2500 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2501 PyObject *ret=PyTuple_New(5);
2502 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2503 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2504 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2505 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2510 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2512 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2513 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2514 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2515 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2516 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2517 PyObject *ret=PyTuple_New(5);
2518 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2519 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2520 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2521 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2522 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2526 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2528 DataArrayInt *neighbors=0,*neighborsIdx=0;
2529 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2530 PyObject *ret=PyTuple_New(2);
2531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2532 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2536 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2538 DataArrayInt *neighbors=0,*neighborsIdx=0;
2539 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2540 PyObject *ret=PyTuple_New(2);
2541 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2548 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2549 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2550 DataArrayInt *d2,*d3,*d4,*dd5;
2551 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2552 PyObject *ret=PyTuple_New(7);
2553 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2554 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2555 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2556 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2557 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2559 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2563 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2566 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2567 da->checkAllocated();
2568 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2571 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2574 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2575 da->checkAllocated();
2576 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2579 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2582 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2583 da->checkAllocated();
2584 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2587 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2590 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2591 da->checkAllocated();
2592 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2593 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2594 PyObject *res = PyList_New(result.size());
2595 for (int i=0;iL!=result.end(); i++, iL++)
2596 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2600 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2603 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2604 da->checkAllocated();
2605 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2606 ret->setName(da->getName().c_str());
2610 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2612 DataArrayInt *cellNb1=0,*cellNb2=0;
2613 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2614 PyObject *ret=PyTuple_New(3);
2615 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2616 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2617 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2621 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2623 int spaceDim=self->getSpaceDimension();
2625 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2627 DataArrayDouble *a,*a2;
2628 DataArrayDoubleTuple *aa,*aa2;
2629 std::vector<double> bb,bb2;
2631 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2632 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2633 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2634 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2636 DataArrayInt *cellIds=0;
2637 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2638 PyObject *ret=PyTuple_New(2);
2639 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2644 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2646 int spaceDim=self->getSpaceDimension();
2648 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2650 DataArrayDouble *a,*a2;
2651 DataArrayDoubleTuple *aa,*aa2;
2652 std::vector<double> bb,bb2;
2654 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2655 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2656 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2657 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2659 DataArrayInt *cellIds=0;
2660 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2661 PyObject *ret=PyTuple_New(2);
2662 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2667 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2669 int spaceDim=self->getSpaceDimension();
2671 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2673 DataArrayDouble *a,*a2;
2674 DataArrayDoubleTuple *aa,*aa2;
2675 std::vector<double> bb,bb2;
2677 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2678 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2679 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2680 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2681 return self->getCellIdsCrossingPlane(orig,vect,eps);
2684 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2688 std::vector<int> pos2;
2689 DataArrayInt *pos3=0;
2690 DataArrayIntTuple *pos4=0;
2691 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2696 self->convertToPolyTypes(&pos1,&pos1+1);
2703 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2708 self->convertToPolyTypes(pos3->begin(),pos3->end());
2712 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2716 void convertAllToPoly();
2717 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2718 bool unPolyze() throw(INTERP_KERNEL::Exception);
2719 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2720 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2721 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2724 //== MEDCouplingUMesh End
2726 //== MEDCouplingExtrudedMesh
2728 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2731 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2732 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2734 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2736 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2739 std::string __str__() const throw(INTERP_KERNEL::Exception)
2741 return self->simpleRepr();
2744 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2746 std::ostringstream oss;
2747 self->reprQuickOverview(oss);
2751 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2753 MEDCouplingUMesh *ret=self->getMesh2D();
2756 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2758 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2760 MEDCouplingUMesh *ret=self->getMesh1D();
2763 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2765 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2767 DataArrayInt *ret=self->getMesh3DIds();
2770 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2775 //== MEDCouplingExtrudedMesh End
2777 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2780 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2781 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2782 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2783 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2784 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2785 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2788 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2790 int szArr,sw,iTypppArr;
2791 std::vector<int> stdvecTyyppArr;
2792 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2793 self->insertNextCell(tmp,tmp+szArr);
2796 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2798 DataArrayInt *ret=self->getNodalConnectivity();
2799 if(ret) ret->incrRef();
2803 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2805 std::vector< const MEDCoupling1GTUMesh *> parts;
2806 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2807 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2812 //== MEDCoupling1SGTUMesh
2814 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2817 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2818 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2819 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2820 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2821 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2822 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2823 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2826 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2828 return MEDCoupling1SGTUMesh::New(name,type);
2831 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2833 return MEDCoupling1SGTUMesh::New(m);
2836 std::string __str__() const throw(INTERP_KERNEL::Exception)
2838 return self->simpleRepr();
2841 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2843 std::ostringstream oss;
2844 self->reprQuickOverview(oss);
2848 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2850 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2851 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2852 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2855 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2857 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2858 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2859 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2864 //== MEDCoupling1SGTUMesh End
2866 //== MEDCoupling1DGTUMesh
2868 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2871 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2872 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2873 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2874 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2875 bool isPacked() const throw(INTERP_KERNEL::Exception);
2878 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2880 return MEDCoupling1DGTUMesh::New(name,type);
2883 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2885 return MEDCoupling1DGTUMesh::New(m);
2888 std::string __str__() const throw(INTERP_KERNEL::Exception)
2890 return self->simpleRepr();
2893 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2895 std::ostringstream oss;
2896 self->reprQuickOverview(oss);
2900 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2902 DataArrayInt *ret=self->getNodalConnectivityIndex();
2903 if(ret) ret->incrRef();
2907 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2909 DataArrayInt *ret1=0,*ret2=0;
2910 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2911 PyObject *ret0Py=ret0?Py_True:Py_False;
2913 PyObject *ret=PyTuple_New(3);
2914 PyTuple_SetItem(ret,0,ret0Py);
2915 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2916 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2920 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2923 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2924 PyObject *ret=PyTuple_New(2);
2925 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2926 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2927 PyTuple_SetItem(ret,1,ret1Py);
2931 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2933 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2934 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2935 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2938 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2940 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2941 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2942 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2945 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2947 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2948 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2949 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2954 //== MEDCoupling1DGTUMeshEnd
2956 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2959 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2960 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2961 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2962 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2963 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2964 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2967 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2969 int tmpp1=-1,tmpp2=-1;
2970 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2971 std::vector< std::pair<int,int> > inp;
2975 for(int i=0;i<tmpp1;i++)
2976 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2981 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2982 inp.resize(tmpp1/2);
2983 for(int i=0;i<tmpp1/2;i++)
2984 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2987 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2988 return self->buildStructuredSubPart(inp);
2991 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2993 int tmpp1=-1,tmpp2=-1;
2994 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2995 std::vector< std::pair<int,int> > inp;
2999 for(int i=0;i<tmpp1;i++)
3000 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3005 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
3006 inp.resize(tmpp1/2);
3007 for(int i=0;i<tmpp1/2;i++)
3008 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3011 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
3013 int szArr,sw,iTypppArr;
3014 std::vector<int> stdvecTyyppArr;
3015 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3016 std::vector<int> tmp5(tmp4,tmp4+szArr);
3018 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3021 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3023 int szArr,sw,iTypppArr;
3024 std::vector<int> stdvecTyyppArr;
3025 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3026 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3029 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3031 int szArr,sw,iTypppArr;
3032 std::vector<int> stdvecTyyppArr;
3033 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3034 int szArr2,sw2,iTypppArr2;
3035 std::vector<int> stdvecTyyppArr2;
3036 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3037 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3038 std::vector< std::pair<int,int> > partCompactFormat;
3039 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3040 PyObject *ret=PyTuple_New(2);
3041 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3042 PyTuple_SetItem(ret,0,ret0Py);
3043 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3044 for(std::size_t i=0;i<partCompactFormat.size();i++)
3046 PyObject *tmp4=PyTuple_New(2);
3047 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3048 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3049 PyList_SetItem(ret1Py,i,tmp4);
3051 PyTuple_SetItem(ret,1,ret1Py);
3057 //== MEDCouplingCMesh
3059 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3062 static MEDCouplingCMesh *New();
3063 static MEDCouplingCMesh *New(const char *meshName);
3064 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3065 void setCoords(const DataArrayDouble *coordsX,
3066 const DataArrayDouble *coordsY=0,
3067 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3068 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3072 return MEDCouplingCMesh::New();
3074 MEDCouplingCMesh(const char *meshName)
3076 return MEDCouplingCMesh::New(meshName);
3078 std::string __str__() const throw(INTERP_KERNEL::Exception)
3080 return self->simpleRepr();
3082 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3084 std::ostringstream oss;
3085 self->reprQuickOverview(oss);
3088 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3090 DataArrayDouble *ret=self->getCoordsAt(i);
3098 //== MEDCouplingCMesh End
3100 //== MEDCouplingCurveLinearMesh
3102 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3105 static MEDCouplingCurveLinearMesh *New();
3106 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3107 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3108 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3110 MEDCouplingCurveLinearMesh()
3112 return MEDCouplingCurveLinearMesh::New();
3114 MEDCouplingCurveLinearMesh(const char *meshName)
3116 return MEDCouplingCurveLinearMesh::New(meshName);
3118 std::string __str__() const throw(INTERP_KERNEL::Exception)
3120 return self->simpleRepr();
3122 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3124 std::ostringstream oss;
3125 self->reprQuickOverview(oss);
3128 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3130 DataArrayDouble *ret=self->getCoords();
3135 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3137 int szArr,sw,iTypppArr;
3138 std::vector<int> stdvecTyyppArr;
3139 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3140 self->setNodeGridStructure(tmp,tmp+szArr);
3145 //== MEDCouplingCurveLinearMesh End
3148 namespace ParaMEDMEM
3150 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3153 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3154 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3155 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3156 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3157 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3158 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3159 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3160 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3161 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3162 std::string getName() const throw(INTERP_KERNEL::Exception);
3163 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3164 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3165 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3166 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3167 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3168 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3169 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3170 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3171 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3172 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3173 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3174 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3175 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3176 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3177 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3178 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3180 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3182 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3185 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3188 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3190 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3193 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3196 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3198 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3199 return convertIntArrToPyList3(ret);
3202 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3205 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3206 PyObject *ret=PyTuple_New(2);
3207 PyObject *ret0Py=ret0?Py_True:Py_False;
3209 PyTuple_SetItem(ret,0,ret0Py);
3210 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3214 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3216 DataArrayInt *ret1=0;
3217 MEDCouplingMesh *ret0=0;
3219 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3220 if (!SWIG_IsOK(res1))
3223 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3224 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3228 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3230 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3231 da2->checkAllocated();
3232 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3234 PyObject *res = PyList_New(2);
3235 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3236 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3240 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3242 DataArrayInt *ret1=0;
3244 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3245 PyObject *res=PyTuple_New(2);
3246 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3248 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3251 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3252 PyTuple_SetItem(res,1,res1);
3257 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3260 int v0; std::vector<int> v1;
3261 const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3262 return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3265 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3266 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3269 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3270 if (!SWIG_IsOK(res1))
3273 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3274 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3278 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3280 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3281 da2->checkAllocated();
3282 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3286 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3288 std::vector<int> tmp;
3289 self->getCellIdsHavingGaussLocalization(locId,tmp);
3290 DataArrayInt *ret=DataArrayInt::New();
3291 ret->alloc((int)tmp.size(),1);
3292 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3296 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3298 std::vector<int> inp0;
3299 convertPyToNewIntArr4(code,1,3,inp0);
3300 std::vector<const DataArrayInt *> inp1;
3301 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3302 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3307 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3310 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3311 static MEDCouplingFieldTemplate *New(TypeOfField type);
3312 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3313 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3316 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3318 return MEDCouplingFieldTemplate::New(f);
3321 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3323 return MEDCouplingFieldTemplate::New(type);
3326 std::string __str__() const throw(INTERP_KERNEL::Exception)
3328 return self->simpleRepr();
3331 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3333 std::ostringstream oss;
3334 self->reprQuickOverview(oss);
3340 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3343 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3344 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3345 void setTimeUnit(const char *unit);
3346 const char *getTimeUnit() const;
3347 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3348 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3349 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3350 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3351 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3352 void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3353 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3354 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3355 MEDCouplingFieldDouble *deepCpy() const;
3356 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3357 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3358 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3359 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3360 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3361 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3362 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3363 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3364 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3365 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3366 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3367 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3368 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3369 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3370 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3371 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3372 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3373 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3374 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3375 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3376 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3377 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3378 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3379 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3380 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3381 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3382 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3383 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3384 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3385 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3386 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3387 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3388 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3389 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3390 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3391 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3392 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3393 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3394 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3395 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3396 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3397 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3398 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3399 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3400 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3401 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3402 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3403 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3404 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3405 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3406 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3407 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3408 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3409 double getMinValue() const throw(INTERP_KERNEL::Exception);
3410 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3411 double norm2() const throw(INTERP_KERNEL::Exception);
3412 double normMax() const throw(INTERP_KERNEL::Exception);
3413 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3414 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3415 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3416 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3417 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3418 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3419 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3420 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3421 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3422 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3423 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3424 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3425 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3426 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3427 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3428 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3429 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3430 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3431 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3432 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3433 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3434 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3436 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3438 return MEDCouplingFieldDouble::New(type,td);
3441 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3443 return MEDCouplingFieldDouble::New(ft,td);
3446 std::string __str__() const throw(INTERP_KERNEL::Exception)
3448 return self->simpleRepr();
3451 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3453 std::ostringstream oss;
3454 self->reprQuickOverview(oss);
3458 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3460 DataArrayDouble *ret=self->getArray();
3466 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3468 std::vector<DataArrayDouble *> arrs=self->getArrays();
3469 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3473 PyObject *ret=PyTuple_New(sz);
3474 for(int i=0;i<sz;i++)
3477 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3479 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3484 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3486 std::vector<const DataArrayDouble *> tmp;
3487 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3489 std::vector<DataArrayDouble *> arrs(sz);
3490 for(int i=0;i<sz;i++)
3491 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3492 self->setArrays(arrs);
3495 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3497 DataArrayDouble *ret=self->getEndArray();
3503 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3507 DataArrayDoubleTuple *aa;
3508 std::vector<double> bb;
3510 const MEDCouplingMesh *mesh=self->getMesh();
3512 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3513 int spaceDim=mesh->getSpaceDimension();
3514 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3515 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3517 int sz=self->getNumberOfComponents();
3518 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3519 self->getValueOn(spaceLoc,res);
3520 return convertDblArrToPyList(res,sz);
3523 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3525 int sz=self->getNumberOfComponents();
3526 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3527 self->getValueOnPos(i,j,k,res);
3528 return convertDblArrToPyList(res,sz);
3531 DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3533 const MEDCouplingMesh *mesh(self->getMesh());
3535 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3538 double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3539 const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3540 mesh->getSpaceDimension(),true,nbPts);
3541 return self->getValueOnMulti(inp,nbPts);
3544 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3548 DataArrayDoubleTuple *aa;
3549 std::vector<double> bb;
3551 const MEDCouplingMesh *mesh=self->getMesh();
3553 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3554 int spaceDim=mesh->getSpaceDimension();
3555 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3556 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3559 int sz=self->getNumberOfComponents();
3560 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3561 self->getValueOn(spaceLoc,time,res);
3562 return convertDblArrToPyList(res,sz);
3565 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3567 if(self->getArray()!=0)
3568 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3571 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3572 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3573 self->setArray(arr);
3577 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3580 double tmp0=self->getTime(tmp1,tmp2);
3581 PyObject *res = PyList_New(3);
3582 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3583 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3584 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3588 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3591 double tmp0=self->getStartTime(tmp1,tmp2);
3592 PyObject *res = PyList_New(3);
3593 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3594 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3595 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3599 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3602 double tmp0=self->getEndTime(tmp1,tmp2);
3603 PyObject *res = PyList_New(3);
3604 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3605 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3606 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3609 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3611 int sz=self->getNumberOfComponents();
3612 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3613 self->accumulate(tmp);
3614 return convertDblArrToPyList(tmp,sz);
3616 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3618 int sz=self->getNumberOfComponents();
3619 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3620 self->integral(isWAbs,tmp);
3621 return convertDblArrToPyList(tmp,sz);
3623 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3625 int sz=self->getNumberOfComponents();
3626 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3627 self->getWeightedAverageValue(tmp,isWAbs);
3628 return convertDblArrToPyList(tmp,sz);
3630 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3632 int sz=self->getNumberOfComponents();
3633 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3635 return convertDblArrToPyList(tmp,sz);
3637 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3639 int sz=self->getNumberOfComponents();
3640 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3642 return convertDblArrToPyList(tmp,sz);
3644 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3646 int szArr,sw,iTypppArr;
3647 std::vector<int> stdvecTyyppArr;
3648 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3649 self->renumberCells(tmp,check);
3652 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3654 int szArr,sw,iTypppArr;
3655 std::vector<int> stdvecTyyppArr;
3656 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3657 self->renumberCellsWithoutMesh(tmp,check);
3660 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3662 int szArr,sw,iTypppArr;
3663 std::vector<int> stdvecTyyppArr;
3664 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3665 self->renumberNodes(tmp,eps);
3668 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3670 int szArr,sw,iTypppArr;
3671 std::vector<int> stdvecTyyppArr;
3672 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3673 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3676 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3680 std::vector<int> multiVal;
3681 std::pair<int, std::pair<int,int> > slic;
3682 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3683 const MEDCouplingMesh *mesh=self->getMesh();
3685 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3686 int nbc=mesh->getNumberOfCells();
3687 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3694 std::ostringstream oss;
3695 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3696 throw INTERP_KERNEL::Exception(oss.str().c_str());
3699 return self->buildSubPart(&singleVal,&singleVal+1);
3704 int tmp=nbc+singleVal;
3705 return self->buildSubPart(&tmp,&tmp+1);
3709 std::ostringstream oss;
3710 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3711 throw INTERP_KERNEL::Exception(oss.str().c_str());
3717 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3721 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3726 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3727 daIntTyypp->checkAllocated();
3728 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3731 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3735 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3737 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";
3738 if(PyTuple_Check(li))
3740 Py_ssize_t sz=PyTuple_Size(li);
3742 throw INTERP_KERNEL::Exception(msg);
3743 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3746 std::vector<int> multiVal;
3747 std::pair<int, std::pair<int,int> > slic;
3748 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3749 if(!self->getArray())
3750 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3752 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3753 catch(INTERP_KERNEL::Exception& e)
3754 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3755 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3756 DataArrayDouble *ret0Arr=ret0->getArray();
3758 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3763 std::vector<int> v2(1,singleVal);
3764 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3765 ret0->setArray(aarr);
3770 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3771 ret0->setArray(aarr);
3776 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3777 std::vector<int> v2(nbOfComp);
3778 for(int i=0;i<nbOfComp;i++)
3779 v2[i]=slic.first+i*slic.second.second;
3780 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3781 ret0->setArray(aarr);
3785 throw INTERP_KERNEL::Exception(msg);
3790 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3793 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3796 double r1=self->getMaxValue2(tmp);
3797 PyObject *ret=PyTuple_New(2);
3798 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3799 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3803 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3806 double r1=self->getMinValue2(tmp);
3807 PyObject *ret=PyTuple_New(2);
3808 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3813 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3815 std::vector<int> tmp;
3816 convertPyToNewIntArr3(li,tmp);
3817 return self->keepSelectedComponents(tmp);
3820 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3822 std::vector<int> tmp;
3823 convertPyToNewIntArr3(li,tmp);
3824 self->setSelectedComponents(f,tmp);
3827 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3830 DataArrayDouble *a,*a2;
3831 DataArrayDoubleTuple *aa,*aa2;
3832 std::vector<double> bb,bb2;
3835 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3836 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3837 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3838 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3840 return self->extractSlice3D(orig,vect,eps);
3843 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3845 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3848 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3850 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3853 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3855 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.";
3856 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3859 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3861 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3863 return (*self)-(*other);
3865 throw INTERP_KERNEL::Exception(msg);
3870 DataArrayDoubleTuple *aa;
3871 std::vector<double> bb;
3873 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3878 if(!self->getArray())
3879 throw INTERP_KERNEL::Exception(msg2);
3880 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3881 ret->applyLin(1.,-val);
3882 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3883 ret2->setArray(ret);
3888 if(!self->getArray())
3889 throw INTERP_KERNEL::Exception(msg2);
3890 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3891 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3892 ret2->setArray(ret);
3897 if(!self->getArray())
3898 throw INTERP_KERNEL::Exception(msg2);
3899 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3900 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3901 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3902 ret2->setArray(ret);
3907 if(!self->getArray())
3908 throw INTERP_KERNEL::Exception(msg2);
3909 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3910 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3911 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3912 ret2->setArray(ret);
3916 { throw INTERP_KERNEL::Exception(msg); }
3920 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3922 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3925 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3927 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3930 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3932 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3935 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3937 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.";
3938 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3941 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3943 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3945 return (*self)/(*other);
3947 throw INTERP_KERNEL::Exception(msg);
3952 DataArrayDoubleTuple *aa;
3953 std::vector<double> bb;
3955 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3961 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3962 if(!self->getArray())
3963 throw INTERP_KERNEL::Exception(msg2);
3964 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3965 ret->applyLin(1./val,0);
3966 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3967 ret2->setArray(ret);
3972 if(!self->getArray())
3973 throw INTERP_KERNEL::Exception(msg2);
3974 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3975 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3976 ret2->setArray(ret);
3981 if(!self->getArray())
3982 throw INTERP_KERNEL::Exception(msg2);
3983 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3984 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3985 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3986 ret2->setArray(ret);
3991 if(!self->getArray())
3992 throw INTERP_KERNEL::Exception(msg2);
3993 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3994 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3995 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3996 ret2->setArray(ret);
4000 { throw INTERP_KERNEL::Exception(msg); }
4004 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4006 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4009 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4011 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.";
4012 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4015 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4017 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4019 return (*self)^(*other);
4021 throw INTERP_KERNEL::Exception(msg);
4026 DataArrayDoubleTuple *aa;
4027 std::vector<double> bb;
4029 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4034 if(!self->getArray())
4035 throw INTERP_KERNEL::Exception(msg2);
4036 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4038 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4039 ret2->setArray(ret);
4044 if(!self->getArray())
4045 throw INTERP_KERNEL::Exception(msg2);
4046 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4047 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4048 ret2->setArray(ret);
4053 if(!self->getArray())
4054 throw INTERP_KERNEL::Exception(msg2);
4055 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4056 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4057 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4058 ret2->setArray(ret);
4063 if(!self->getArray())
4064 throw INTERP_KERNEL::Exception(msg2);
4065 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4066 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4067 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4068 ret2->setArray(ret);
4072 { throw INTERP_KERNEL::Exception(msg); }
4076 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4078 return self->negate();
4081 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4083 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.";
4084 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4087 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4089 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4093 Py_XINCREF(trueSelf);
4097 throw INTERP_KERNEL::Exception(msg);
4102 DataArrayDoubleTuple *aa;
4103 std::vector<double> bb;
4105 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4110 if(!self->getArray())
4111 throw INTERP_KERNEL::Exception(msg2);
4112 self->getArray()->applyLin(1.,val);
4113 Py_XINCREF(trueSelf);
4118 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4121 Py_XINCREF(trueSelf);
4126 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4127 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4128 ret2->setArray(aaa);
4130 Py_XINCREF(trueSelf);
4135 if(!self->getArray())
4136 throw INTERP_KERNEL::Exception(msg2);
4137 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4138 self->getArray()->addEqual(aaa);
4139 Py_XINCREF(trueSelf);
4143 { throw INTERP_KERNEL::Exception(msg); }
4147 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4149 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.";
4150 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4153 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4155 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4159 Py_XINCREF(trueSelf);
4163 throw INTERP_KERNEL::Exception(msg);
4168 DataArrayDoubleTuple *aa;
4169 std::vector<double> bb;
4171 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4176 if(!self->getArray())
4177 throw INTERP_KERNEL::Exception(msg2);
4178 self->getArray()->applyLin(1.,-val);
4179 Py_XINCREF(trueSelf);
4184 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4187 Py_XINCREF(trueSelf);
4192 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4193 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4194 ret2->setArray(aaa);
4196 Py_XINCREF(trueSelf);
4201 if(!self->getArray())
4202 throw INTERP_KERNEL::Exception(msg2);
4203 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4204 self->getArray()->substractEqual(aaa);
4205 Py_XINCREF(trueSelf);
4209 { throw INTERP_KERNEL::Exception(msg); }
4213 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4215 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.";
4216 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4219 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4221 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4225 Py_XINCREF(trueSelf);
4229 throw INTERP_KERNEL::Exception(msg);
4234 DataArrayDoubleTuple *aa;
4235 std::vector<double> bb;
4237 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4242 if(!self->getArray())
4243 throw INTERP_KERNEL::Exception(msg2);
4244 self->getArray()->applyLin(val,0);
4245 Py_XINCREF(trueSelf);
4250 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4253 Py_XINCREF(trueSelf);
4258 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4259 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4260 ret2->setArray(aaa);
4262 Py_XINCREF(trueSelf);
4267 if(!self->getArray())
4268 throw INTERP_KERNEL::Exception(msg2);
4269 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4270 self->getArray()->multiplyEqual(aaa);
4271 Py_XINCREF(trueSelf);
4275 { throw INTERP_KERNEL::Exception(msg); }
4279 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4281 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.";
4282 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4285 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4287 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4291 Py_XINCREF(trueSelf);
4295 throw INTERP_KERNEL::Exception(msg);
4300 DataArrayDoubleTuple *aa;
4301 std::vector<double> bb;
4303 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4309 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4310 if(!self->getArray())
4311 throw INTERP_KERNEL::Exception(msg2);
4312 self->getArray()->applyLin(1./val,0);
4313 Py_XINCREF(trueSelf);
4318 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4321 Py_XINCREF(trueSelf);
4326 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4327 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4328 ret2->setArray(aaa);
4330 Py_XINCREF(trueSelf);
4335 if(!self->getArray())
4336 throw INTERP_KERNEL::Exception(msg2);
4337 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4338 self->getArray()->divideEqual(aaa);
4339 Py_XINCREF(trueSelf);
4343 { throw INTERP_KERNEL::Exception(msg); }
4347 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4349 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.";
4350 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4353 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4355 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4359 Py_XINCREF(trueSelf);
4363 throw INTERP_KERNEL::Exception(msg);
4368 DataArrayDoubleTuple *aa;
4369 std::vector<double> bb;
4371 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4376 if(!self->getArray())
4377 throw INTERP_KERNEL::Exception(msg2);
4378 self->getArray()->applyPow(val);
4379 Py_XINCREF(trueSelf);
4384 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4387 Py_XINCREF(trueSelf);
4392 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4393 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4394 ret2->setArray(aaa);
4396 Py_XINCREF(trueSelf);
4401 if(!self->getArray())
4402 throw INTERP_KERNEL::Exception(msg2);
4403 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4404 self->getArray()->powEqual(aaa);
4405 Py_XINCREF(trueSelf);
4409 { throw INTERP_KERNEL::Exception(msg); }
4413 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4415 std::vector<const MEDCouplingFieldDouble *> tmp;
4416 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4417 return MEDCouplingFieldDouble::MergeFields(tmp);
4420 static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4422 std::vector<const MEDCouplingFieldDouble *> tmp;
4423 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4424 MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4429 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4432 int getNumberOfFields() const;
4433 MEDCouplingMultiFields *deepCpy() const;
4434 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4435 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4436 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4437 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4438 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4441 std::string __str__() const throw(INTERP_KERNEL::Exception)
4443 return self->simpleRepr();
4445 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4447 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4448 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4450 std::vector<MEDCouplingFieldDouble *> fs(sz);
4451 for(int i=0;i<sz;i++)
4452 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4453 return MEDCouplingMultiFields::New(fs);
4455 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4457 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4458 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4460 std::vector<MEDCouplingFieldDouble *> fs(sz);
4461 for(int i=0;i<sz;i++)
4462 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4463 return MEDCouplingMultiFields::New(fs);
4465 PyObject *getFields() const
4467 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4468 int sz=fields.size();
4469 PyObject *res = PyList_New(sz);
4470 for(int i=0;i<sz;i++)
4474 fields[i]->incrRef();
4475 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4479 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4484 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4486 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4490 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4493 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4495 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4497 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4499 PyObject *res = PyList_New(sz);
4500 for(int i=0;i<sz;i++)
4505 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4509 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4514 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4516 std::vector<int> refs;
4517 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4519 PyObject *res = PyList_New(sz);
4520 for(int i=0;i<sz;i++)
4525 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4529 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4533 PyObject *ret=PyTuple_New(2);
4534 PyTuple_SetItem(ret,0,res);
4535 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4538 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4540 std::vector<DataArrayDouble *> ms=self->getArrays();
4542 PyObject *res = PyList_New(sz);
4543 for(int i=0;i<sz;i++)
4548 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4552 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4557 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4559 std::vector< std::vector<int> > refs;
4560 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4562 PyObject *res = PyList_New(sz);
4563 PyObject *res2 = PyList_New(sz);
4564 for(int i=0;i<sz;i++)
4569 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4573 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4575 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4578 PyObject *ret=PyTuple_New(2);
4579 PyTuple_SetItem(ret,0,res);
4580 PyTuple_SetItem(ret,1,res2);
4586 class MEDCouplingDefinitionTime
4589 MEDCouplingDefinitionTime();
4590 void assign(const MEDCouplingDefinitionTime& other);
4591 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4592 double getTimeResolution() const;
4593 std::vector<double> getHotSpotsTime() const;
4596 std::string __str__() const throw(INTERP_KERNEL::Exception)
4598 std::ostringstream oss;
4599 self->appendRepr(oss);
4603 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4605 int meshId,arrId,arrIdInField,fieldId;
4606 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4607 PyObject *res=PyList_New(4);
4608 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4609 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4610 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4611 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4615 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4617 int meshId,arrId,arrIdInField,fieldId;
4618 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4619 PyObject *res=PyList_New(4);
4620 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4621 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4622 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4623 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4629 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4632 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4633 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4637 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4639 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4640 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4642 std::vector<MEDCouplingFieldDouble *> fs(sz);
4643 for(int i=0;i<sz;i++)
4644 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4645 return MEDCouplingFieldOverTime::New(fs);
4647 std::string __str__() const throw(INTERP_KERNEL::Exception)
4649 return self->simpleRepr();
4651 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4653 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4654 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4656 std::vector<MEDCouplingFieldDouble *> fs(sz);
4657 for(int i=0;i<sz;i++)
4658 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4659 return MEDCouplingFieldOverTime::New(fs);
4667 __filename=os.environ.get('PYTHONSTARTUP')
4668 if __filename and os.path.isfile(__filename):
4669 execfile(__filename)