1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #define MEDCOUPLING_EXPORT
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingTypemaps.i"
45 #include "InterpKernelAutoPtr.hxx"
47 using namespace ParaMEDMEM;
48 using namespace INTERP_KERNEL;
52 %template(ivec) std::vector<int>;
53 %template(dvec) std::vector<double>;
54 %template(svec) std::vector<std::string>;
57 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
59 $result=convertMesh($1,$owner);
62 %typemap(out) MEDCouplingMesh*
64 $result=convertMesh($1,$owner);
69 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
71 $result=convertMesh($1,$owner);
74 %typemap(out) MEDCouplingPointSet*
76 $result=convertMesh($1,$owner);
82 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
84 $result=convertMesh($1,$owner);
87 %typemap(out) MEDCoupling1GTUMesh*
89 $result=convertMesh($1,$owner);
94 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
96 $result=convertMesh($1,$owner);
99 %typemap(out) MEDCouplingStructuredMesh*
101 $result=convertMesh($1,$owner);
106 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
108 $result=convertFieldDiscretization($1,$owner);
111 %typemap(out) MEDCouplingFieldDiscretization*
113 $result=convertFieldDiscretization($1,$owner);
118 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
120 $result=convertMultiFields($1,$owner);
123 %typemap(out) MEDCouplingMultiFields*
125 $result=convertMultiFields($1,$owner);
130 %typemap(out) ParaMEDMEM::DataArray*
132 $result=convertDataArray($1,$owner);
135 %typemap(out) DataArray*
137 $result=convertDataArray($1,$owner);
142 %typemap(out) ParaMEDMEM::DataArrayChar*
144 $result=convertDataArrayChar($1,$owner);
147 %typemap(out) DataArrayChar*
149 $result=convertDataArrayChar($1,$owner);
154 %init %{ import_array(); %}
157 %feature("autodoc", "1");
158 %feature("docstring");
160 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
161 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
162 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
163 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
164 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
165 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
166 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
167 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
168 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
169 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
170 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
171 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
172 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
173 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
174 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
223 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
224 %newobject ParaMEDMEM::DataArray::deepCpy;
225 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
226 %newobject ParaMEDMEM::DataArray::selectByTupleId;
227 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
228 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
229 %newobject ParaMEDMEM::DataArray::Aggregate;
230 %newobject ParaMEDMEM::DataArrayInt::New;
231 %newobject ParaMEDMEM::DataArrayInt::__iter__;
232 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
233 %newobject ParaMEDMEM::DataArrayInt::performCpy;
234 %newobject ParaMEDMEM::DataArrayInt::substr;
235 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
236 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
237 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
238 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
239 %newobject ParaMEDMEM::DataArrayInt::renumber;
240 %newobject ParaMEDMEM::DataArrayInt::renumberR;
241 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
244 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
249 %newobject ParaMEDMEM::DataArrayInt::negate;
250 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
251 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
252 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
253 %newobject ParaMEDMEM::DataArrayInt::Meld;
254 %newobject ParaMEDMEM::DataArrayInt::Add;
255 %newobject ParaMEDMEM::DataArrayInt::Substract;
256 %newobject ParaMEDMEM::DataArrayInt::Multiply;
257 %newobject ParaMEDMEM::DataArrayInt::Divide;
258 %newobject ParaMEDMEM::DataArrayInt::Pow;
259 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
260 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
261 %newobject ParaMEDMEM::DataArrayInt::Range;
262 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
264 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
265 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
267 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
268 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
269 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
270 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
271 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
272 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
273 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
274 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
275 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
276 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
277 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
278 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
279 %newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
280 %newobject ParaMEDMEM::DataArrayInt::__neg__;
281 %newobject ParaMEDMEM::DataArrayInt::__add__;
282 %newobject ParaMEDMEM::DataArrayInt::__radd__;
283 %newobject ParaMEDMEM::DataArrayInt::__sub__;
284 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
285 %newobject ParaMEDMEM::DataArrayInt::__mul__;
286 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
287 %newobject ParaMEDMEM::DataArrayInt::__div__;
288 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
289 %newobject ParaMEDMEM::DataArrayInt::__mod__;
290 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
291 %newobject ParaMEDMEM::DataArrayInt::__pow__;
292 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
293 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
294 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
295 %newobject ParaMEDMEM::DataArrayChar::renumber;
296 %newobject ParaMEDMEM::DataArrayChar::renumberR;
297 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
298 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
299 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
300 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
301 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
302 %newobject ParaMEDMEM::DataArrayChar::Meld;
303 %newobject ParaMEDMEM::DataArrayByte::New;
304 %newobject ParaMEDMEM::DataArrayByte::__iter__;
305 %newobject ParaMEDMEM::DataArrayByte::performCpy;
306 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
307 %newobject ParaMEDMEM::DataArrayChar::substr;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
309 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
310 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
311 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
312 %newobject ParaMEDMEM::DataArrayDouble::New;
313 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
314 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
315 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
317 %newobject ParaMEDMEM::DataArrayDouble::Meld;
318 %newobject ParaMEDMEM::DataArrayDouble::Dot;
319 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
320 %newobject ParaMEDMEM::DataArrayDouble::Add;
321 %newobject ParaMEDMEM::DataArrayDouble::Substract;
322 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
323 %newobject ParaMEDMEM::DataArrayDouble::Divide;
324 %newobject ParaMEDMEM::DataArrayDouble::Pow;
325 %newobject ParaMEDMEM::DataArrayDouble::substr;
326 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
327 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
328 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
329 %newobject ParaMEDMEM::DataArrayDouble::negate;
330 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
331 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
332 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
333 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
334 %newobject ParaMEDMEM::DataArrayDouble::determinant;
335 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
336 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
337 %newobject ParaMEDMEM::DataArrayDouble::inverse;
338 %newobject ParaMEDMEM::DataArrayDouble::trace;
339 %newobject ParaMEDMEM::DataArrayDouble::deviator;
340 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
341 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
342 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
343 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
344 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
345 %newobject ParaMEDMEM::DataArrayDouble::renumber;
346 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
347 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
348 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
349 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
350 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
351 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
352 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
353 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
354 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
355 %newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
356 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
357 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
358 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
359 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
360 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
361 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
362 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
363 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
364 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
365 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
366 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
367 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
368 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
369 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
370 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
371 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
372 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
373 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
374 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
375 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
376 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
377 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
378 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
379 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
380 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
381 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
382 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
383 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
384 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
385 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
386 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
398 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
399 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
400 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
441 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
442 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
443 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
444 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
445 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
446 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
447 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
448 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
450 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
451 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
452 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
453 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
456 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
457 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
458 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
459 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
460 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
461 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
462 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
463 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
464 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
465 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
466 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
467 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
468 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
469 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
470 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
471 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
472 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
473 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
475 %feature("unref") DataArray "$this->decrRef();"
476 %feature("unref") DataArrayDouble "$this->decrRef();"
477 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
478 %feature("unref") MEDCouplingMesh "$this->decrRef();"
479 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
480 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
481 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
482 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
483 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
484 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
485 %feature("unref") DataArrayInt "$this->decrRef();"
486 %feature("unref") DataArrayChar "$this->decrRef();"
487 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
488 %feature("unref") DataArrayByte "$this->decrRef();"
489 %feature("unref") MEDCouplingField "$this->decrRef();"
490 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
491 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
492 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
493 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
494 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
495 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
496 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
497 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
498 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
500 %rename(assign) *::operator=;
501 %ignore ParaMEDMEM::RefCountObject::decrRef;
502 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
503 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
504 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
505 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
509 %rename (InterpKernelException) INTERP_KERNEL::Exception;
511 namespace INTERP_KERNEL
516 Exception(const char* what);
517 ~Exception() throw ();
518 const char *what() const throw ();
521 std::string __str__() const
523 return std::string(self->what());
534 void declareAsNew() const;
535 virtual void updateTime() const;
536 unsigned int getTimeOfThis() const;
564 CONST_ON_TIME_INTERVAL = 7
565 } TypeOfTimeDiscretization;
567 const char *MEDCouplingVersionStr();
568 int MEDCouplingVersion();
569 int MEDCouplingSizeOfVoidStar();
575 RefCountObject(const RefCountObject& other);
578 bool decrRef() const;
579 void incrRef() const;
580 int getRCValue() const;
581 virtual std::size_t getHeapMemorySize() const;
587 PyObject *MEDCouplingVersionMajMinRel()
589 int tmp0=0,tmp1=0,tmp2=0;
590 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
591 PyObject *res = PyList_New(3);
592 PyList_SetItem(res,0,SWIG_From_int(tmp0));
593 PyList_SetItem(res,1,SWIG_From_int(tmp1));
594 PyList_SetItem(res,2,SWIG_From_int(tmp2));
598 bool MEDCouplingHasNumPyBindings()
607 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
609 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
610 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
611 if(PyRun_SimpleString(script)!=0)
612 throw INTERP_KERNEL::Exception(oss.str().c_str());
613 return std::string(script);
617 %include "MEDCouplingMemArray.i"
624 UNSTRUCTURED_DESC = 6,
628 } MEDCouplingMeshType;
631 class DataArrayDouble;
632 class MEDCouplingUMesh;
633 class MEDCouplingFieldDouble;
635 %extend RefCountObject
637 std::string getHiddenCppPointer() const
639 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
644 %extend MEDCouplingGaussLocalization
646 std::string __str__() const throw(INTERP_KERNEL::Exception)
648 return self->getStringRepr();
651 std::string __repr__() const throw(INTERP_KERNEL::Exception)
653 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
654 oss << self->getStringRepr();
661 class MEDCouplingMesh : public RefCountObject, public TimeLabel
664 void setName(const char *name);
665 std::string getName() const;
666 void setDescription(const char *descr);
667 std::string getDescription() const;
668 void setTime(double val, int iteration, int order);
669 void setTimeUnit(const char *unit);
670 const char *getTimeUnit() const;
671 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
672 bool isStructured() const throw(INTERP_KERNEL::Exception);
673 virtual MEDCouplingMesh *deepCpy() const;
674 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
675 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
676 virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
677 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
678 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
679 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
680 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
681 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
682 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
683 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
684 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
685 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
686 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
687 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
688 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
689 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
690 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
691 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
692 virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
693 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
694 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
695 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
696 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
697 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
698 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
700 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
701 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
702 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
703 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
704 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
705 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
706 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
707 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
708 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
709 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
710 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
711 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
712 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
713 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
714 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
715 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
716 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
719 std::string __str__() const throw(INTERP_KERNEL::Exception)
721 return self->simpleRepr();
724 PyObject *getTime() throw(INTERP_KERNEL::Exception)
727 double tmp0=self->getTime(tmp1,tmp2);
728 PyObject *res = PyList_New(3);
729 PyList_SetItem(res,0,SWIG_From_double(tmp0));
730 PyList_SetItem(res,1,SWIG_From_int(tmp1));
731 PyList_SetItem(res,2,SWIG_From_int(tmp2));
735 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
739 DataArrayDoubleTuple *aa;
740 std::vector<double> bb;
742 int spaceDim=self->getSpaceDimension();
743 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
744 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
745 return self->getCellContainingPoint(pos,eps);
748 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
752 DataArrayDoubleTuple *aa;
753 std::vector<double> bb;
755 int spaceDim=self->getSpaceDimension();
756 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
757 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
758 std::vector<int> elts,eltsIndex;
759 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
760 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
761 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
762 d0->alloc(elts.size(),1);
763 d1->alloc(eltsIndex.size(),1);
764 std::copy(elts.begin(),elts.end(),d0->getPointer());
765 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
766 PyObject *ret=PyTuple_New(2);
767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
768 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
772 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
774 std::vector<int> elts,eltsIndex;
775 int spaceDim=self->getSpaceDimension();
777 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
778 if (!SWIG_IsOK(res1))
781 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
782 int nbOfPoints=size/spaceDim;
785 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
787 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
791 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
793 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
794 da2->checkAllocated();
795 int size=da2->getNumberOfTuples();
796 int nbOfCompo=da2->getNumberOfComponents();
797 if(nbOfCompo!=spaceDim)
799 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
801 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
803 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
804 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
805 d0->alloc(elts.size(),1);
806 d1->alloc(eltsIndex.size(),1);
807 std::copy(elts.begin(),elts.end(),d0->getPointer());
808 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
809 PyObject *ret=PyTuple_New(2);
810 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
811 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
815 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
819 DataArrayDoubleTuple *aa;
820 std::vector<double> bb;
822 int spaceDim=self->getSpaceDimension();
823 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
824 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
825 std::vector<int> elts;
826 self->getCellsContainingPoint(pos,eps,elts);
827 DataArrayInt *ret=DataArrayInt::New();
828 ret->alloc((int)elts.size(),1);
829 std::copy(elts.begin(),elts.end(),ret->getPointer());
830 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
833 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
836 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
837 if (!SWIG_IsOK(res1))
840 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
841 self->renumberCells(tmp,check);
845 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
847 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
848 da2->checkAllocated();
849 self->renumberCells(da2->getConstPointer(),check);
853 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
855 DataArrayInt *cellCor, *nodeCor;
856 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
857 PyObject *res = PyList_New(2);
858 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
859 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
863 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
865 DataArrayInt *cellCor=0,*nodeCor=0;
866 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
867 PyObject *res = PyList_New(2);
868 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
869 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
873 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
875 DataArrayInt *cellCor=0;
876 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
880 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
883 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
884 if (!SWIG_IsOK(res1))
887 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
888 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
892 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
894 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
895 da2->checkAllocated();
896 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
899 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
901 std::vector<int> conn;
902 self->getNodeIdsOfCell(cellId,conn);
903 return convertIntArrToPyList2(conn);
906 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
908 std::vector<double> coo;
909 self->getCoordinatesOfNode(nodeId,coo);
910 return convertDblArrToPyList2(coo);
913 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
917 DataArrayDoubleTuple *aa;
918 std::vector<double> bb;
920 int spaceDim=self->getSpaceDimension();
921 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
922 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
923 self->scale(pointPtr,factor);
926 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
928 int spaceDim=self->getSpaceDimension();
929 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
930 self->getBoundingBox(tmp);
931 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
935 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
938 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
939 PyObject *ret=PyTuple_New(2);
940 PyObject *ret0Py=ret0?Py_True:Py_False;
942 PyTuple_SetItem(ret,0,ret0Py);
943 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
947 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
949 int szArr,sw,iTypppArr;
950 std::vector<int> stdvecTyyppArr;
951 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
952 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
953 if(sw==3)//DataArrayInt
955 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
956 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
957 std::string name=argpt->getName();
959 ret->setName(name.c_str());
961 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
964 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
966 int szArr,sw,iTypppArr;
967 std::vector<int> stdvecTyyppArr;
969 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
970 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
971 if(sw==3)//DataArrayInt
973 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
974 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
975 std::string name=argpt->getName();
977 ret->setName(name.c_str());
980 PyObject *res = PyList_New(2);
981 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
982 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
983 PyList_SetItem(res,0,obj0);
984 PyList_SetItem(res,1,obj1);
988 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
992 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
993 PyObject *res = PyTuple_New(2);
994 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
997 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
999 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1000 PyTuple_SetItem(res,0,obj0);
1001 PyTuple_SetItem(res,1,obj1);
1005 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1007 std::vector<int> vals=self->getDistributionOfTypes();
1008 if(vals.size()%3!=0)
1009 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1010 PyObject *ret=PyList_New((int)vals.size()/3);
1011 for(int j=0;j<(int)vals.size()/3;j++)
1013 PyObject *ret1=PyList_New(3);
1014 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1015 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1016 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1017 PyList_SetItem(ret,j,ret1);
1022 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1024 std::vector<int> code;
1025 std::vector<const DataArrayInt *> idsPerType;
1026 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1027 convertPyToNewIntArr4(li,1,3,code);
1028 return self->checkTypeConsistencyAndContig(code,idsPerType);
1031 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1033 std::vector<int> code;
1034 std::vector<DataArrayInt *> idsInPflPerType;
1035 std::vector<DataArrayInt *> idsPerType;
1036 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1037 PyObject *ret=PyTuple_New(3);
1039 if(code.size()%3!=0)
1040 throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1041 PyObject *ret0=PyList_New((int)code.size()/3);
1042 for(int j=0;j<(int)code.size()/3;j++)
1044 PyObject *ret00=PyList_New(3);
1045 PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1046 PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1047 PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1048 PyList_SetItem(ret0,j,ret00);
1050 PyTuple_SetItem(ret,0,ret0);
1052 PyObject *ret1=PyList_New(idsInPflPerType.size());
1053 for(std::size_t j=0;j<idsInPflPerType.size();j++)
1054 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1055 PyTuple_SetItem(ret,1,ret1);
1056 int n=idsPerType.size();
1057 PyObject *ret2=PyList_New(n);
1058 for(int i=0;i<n;i++)
1059 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1060 PyTuple_SetItem(ret,2,ret2);
1064 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1068 DataArrayDoubleTuple *aa;
1069 std::vector<double> bb;
1071 int spaceDim=self->getSpaceDimension();
1072 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1073 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1074 self->translate(vectorPtr);
1077 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1079 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1082 DataArrayDoubleTuple *aa;
1083 std::vector<double> bb;
1085 int spaceDim=self->getSpaceDimension();
1086 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1087 self->rotate(centerPtr,0,alpha);
1090 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1092 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1094 DataArrayDouble *a,*a2;
1095 DataArrayDoubleTuple *aa,*aa2;
1096 std::vector<double> bb,bb2;
1098 int spaceDim=self->getSpaceDimension();
1099 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1100 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
1101 self->rotate(centerPtr,vectorPtr,alpha);
1104 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1106 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1107 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1108 PyObject *res=PyList_New(result.size());
1109 for(int i=0;iL!=result.end(); i++, iL++)
1110 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1114 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1116 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1117 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1118 return MEDCouplingMesh::MergeMeshes(tmp);
1124 //== MEDCouplingMesh End
1126 %include "NormalizedUnstructuredMesh.hxx"
1127 %include "MEDCouplingNatureOfField.hxx"
1128 %include "MEDCouplingTimeDiscretization.hxx"
1129 %include "MEDCouplingGaussLocalization.hxx"
1130 %include "MEDCouplingFieldDiscretization.hxx"
1132 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1133 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1134 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1136 //== MEDCouplingPointSet
1138 namespace ParaMEDMEM
1140 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1143 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1144 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1145 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1146 void zipCoords() throw(INTERP_KERNEL::Exception);
1147 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1148 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1149 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1150 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1151 virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1152 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1153 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1154 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1155 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1156 static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1157 virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1158 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1159 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1160 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1161 virtual DataArrayInt *findBoundaryNodes() const;
1162 virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1163 virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1164 virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1165 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1166 virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1167 virtual DataArrayDouble *getBoundingBoxForBBTree() const throw(INTERP_KERNEL::Exception);
1170 std::string __str__() const throw(INTERP_KERNEL::Exception)
1172 return self->simpleRepr();
1175 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1178 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1179 PyObject *res = PyList_New(2);
1180 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1181 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1185 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1187 DataArrayInt *comm, *commIndex;
1188 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1189 PyObject *res = PyList_New(2);
1190 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1191 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1195 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1197 DataArrayDouble *ret1=self->getCoords();
1200 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1203 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1205 int szArr,sw,iTypppArr;
1206 std::vector<int> stdvecTyyppArr;
1207 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1208 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1209 if(sw==3)//DataArrayInt
1211 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1212 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1213 std::string name=argpt->getName();
1215 ret->setName(name.c_str());
1217 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1220 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1222 int szArr,sw,iTypppArr;
1223 std::vector<int> stdvecTyyppArr;
1224 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1225 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1226 if(sw==3)//DataArrayInt
1228 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1229 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1230 std::string name=argpt->getName();
1232 ret->setName(name.c_str());
1234 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1237 virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1239 int szArr,sw,iTypppArr;
1240 std::vector<int> stdvecTyyppArr;
1241 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1242 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1243 if(sw==3)//DataArrayInt
1245 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1246 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1247 std::string name=argpt->getName();
1249 ret->setName(name.c_str());
1251 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1254 virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1256 MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1257 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1260 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1262 int szArr,sw,iTypppArr;
1263 std::vector<int> stdvecTyyppArr;
1264 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1265 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1266 if(sw==3)//DataArrayInt
1268 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1269 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1270 std::string name=argpt->getName();
1272 ret->setName(name.c_str());
1274 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1277 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1279 int szArr,sw,iTypppArr;
1280 std::vector<int> stdvecTyyppArr;
1281 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1282 self->renumberNodes(tmp,newNbOfNodes);
1285 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1287 int szArr,sw,iTypppArr;
1288 std::vector<int> stdvecTyyppArr;
1289 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1290 self->renumberNodes2(tmp,newNbOfNodes);
1293 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1295 int spaceDim=self->getSpaceDimension();
1297 DataArrayDouble *a,*a2;
1298 DataArrayDoubleTuple *aa,*aa2;
1299 std::vector<double> bb,bb2;
1301 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1302 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1303 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1304 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1305 std::vector<int> nodes;
1306 self->findNodesOnLine(p,v,eps,nodes);
1307 DataArrayInt *ret=DataArrayInt::New();
1308 ret->alloc((int)nodes.size(),1);
1309 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1310 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1312 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1314 int spaceDim=self->getSpaceDimension();
1316 DataArrayDouble *a,*a2;
1317 DataArrayDoubleTuple *aa,*aa2;
1318 std::vector<double> bb,bb2;
1320 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1321 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1322 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1323 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1324 std::vector<int> nodes;
1325 self->findNodesOnPlane(p,v,eps,nodes);
1326 DataArrayInt *ret=DataArrayInt::New();
1327 ret->alloc((int)nodes.size(),1);
1328 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1329 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1332 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1336 DataArrayDoubleTuple *aa;
1337 std::vector<double> bb;
1339 int spaceDim=self->getSpaceDimension();
1340 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1341 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1342 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1343 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1346 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1348 DataArrayInt *c=0,*cI=0;
1352 DataArrayDoubleTuple *aa;
1353 std::vector<double> bb;
1355 int spaceDim=self->getSpaceDimension();
1356 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1357 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1358 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1359 PyObject *ret=PyTuple_New(2);
1360 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1361 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1365 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1367 DataArrayInt *c=0,*cI=0;
1368 int spaceDim=self->getSpaceDimension();
1371 DataArrayDoubleTuple *aa;
1372 std::vector<double> bb;
1375 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1376 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1378 PyObject *ret=PyTuple_New(2);
1379 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1380 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1384 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1388 DataArrayDoubleTuple *aa;
1389 std::vector<double> bb;
1391 int spaceDim=self->getSpaceDimension();
1392 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1393 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1395 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1396 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1399 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1403 std::vector<int> multiVal;
1404 std::pair<int, std::pair<int,int> > slic;
1405 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1406 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1410 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1412 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1414 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1416 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1420 virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1422 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1423 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1424 self->getReverseNodalConnectivity(d0,d1);
1425 PyObject *ret=PyTuple_New(2);
1426 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1427 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1431 virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1433 DataArrayInt *v0=0,*v1=0;
1434 self->findCommonCells(compType,startCellId,v0,v1);
1435 PyObject *res = PyList_New(2);
1436 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1437 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1442 virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1445 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1446 if (!SWIG_IsOK(res1))
1449 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1450 self->renumberNodesInConn(tmp);
1454 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1456 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1457 da2->checkAllocated();
1458 self->renumberNodesInConn(da2->getConstPointer());
1462 virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1465 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1466 PyObject *ret=PyTuple_New(2);
1467 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1468 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1472 virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1474 DataArrayInt *ret=0;
1476 int szArr,sw,iTypppArr;
1477 std::vector<int> stdvecTyyppArr;
1478 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1479 self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1483 virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1487 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1488 PyObject *res = PyList_New(3);
1489 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1490 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1491 PyList_SetItem(res,2,SWIG_From_int(ret2));
1495 virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1499 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1500 PyObject *res = PyList_New(3);
1501 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1502 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1503 PyList_SetItem(res,2,SWIG_From_int(ret2));
1507 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1510 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1511 if (!SWIG_IsOK(res1))
1514 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1515 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1519 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1521 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1522 da2->checkAllocated();
1523 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1527 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1531 std::vector<int> multiVal;
1532 std::pair<int, std::pair<int,int> > slic;
1533 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1534 int nbc=self->getNumberOfCells();
1535 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1542 std::ostringstream oss;
1543 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1544 throw INTERP_KERNEL::Exception(oss.str().c_str());
1547 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1552 int tmp=nbc+singleVal;
1553 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1557 std::ostringstream oss;
1558 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1559 throw INTERP_KERNEL::Exception(oss.str().c_str());
1565 return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1569 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1574 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1575 daIntTyypp->checkAllocated();
1576 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1579 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1583 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1586 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1587 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1588 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1589 for(int i=0;i<sz;i++)
1590 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1593 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1596 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1598 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1599 std::vector<double> val3;
1600 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1601 "Rotate2DAlg",2,true,nbNodes);
1603 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1604 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1607 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1610 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1611 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1612 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1613 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1614 for(int i=0;i<sz;i++)
1615 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1618 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1621 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1623 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1624 std::vector<double> val3;
1625 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1626 "Rotate3DAlg",3,true,nbNodes);
1628 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1629 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1630 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1635 //== MEDCouplingPointSet End
1637 class MEDCouplingUMeshCell
1640 INTERP_KERNEL::NormalizedCellType getType() const;
1643 std::string __str__() const throw(INTERP_KERNEL::Exception)
1645 return self->repr();
1648 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1651 const int *r=self->getAllConn(ret2);
1652 PyObject *ret=PyTuple_New(ret2);
1653 for(int i=0;i<ret2;i++)
1654 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1660 class MEDCouplingUMeshCellIterator
1667 MEDCouplingUMeshCell *ret=self->nextt();
1669 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1672 PyErr_SetString(PyExc_StopIteration,"No more data.");
1679 class MEDCouplingUMeshCellByTypeIterator
1682 ~MEDCouplingUMeshCellByTypeIterator();
1687 MEDCouplingUMeshCellEntry *ret=self->nextt();
1689 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1692 PyErr_SetString(PyExc_StopIteration,"No more data.");
1699 class MEDCouplingUMeshCellByTypeEntry
1702 ~MEDCouplingUMeshCellByTypeEntry();
1705 MEDCouplingUMeshCellByTypeIterator *__iter__()
1707 return self->iterator();
1712 class MEDCouplingUMeshCellEntry
1715 INTERP_KERNEL::NormalizedCellType getType() const;
1716 int getNumberOfElems() const;
1719 MEDCouplingUMeshCellIterator *__iter__()
1721 return self->iterator();
1726 //== MEDCouplingUMesh
1728 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1731 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1732 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1733 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1734 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1735 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1736 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1737 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1738 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1739 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1740 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1741 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1742 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1743 void computeTypes() throw(INTERP_KERNEL::Exception);
1744 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1745 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1747 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1748 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1749 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1750 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1751 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1752 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1753 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1754 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1755 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1756 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1757 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1758 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1759 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1760 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1761 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1762 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1763 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1764 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1765 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1766 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1767 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1768 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1769 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1770 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1771 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1772 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1773 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1774 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1775 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1776 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1777 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1778 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1779 ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1780 DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1781 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1782 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1783 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1784 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1785 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1787 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1789 return MEDCouplingUMesh::New();
1792 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1794 return MEDCouplingUMesh::New(meshName,meshDim);
1797 std::string __str__() const throw(INTERP_KERNEL::Exception)
1799 return self->simpleRepr();
1802 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1804 std::ostringstream oss;
1805 self->reprQuickOverview(oss);
1809 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1811 return self->cellIterator();
1814 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1818 std::vector<int> multiVal;
1819 std::pair<int, std::pair<int,int> > slic;
1820 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1821 int nbc=self->getNumberOfCells();
1822 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1829 std::ostringstream oss;
1830 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1831 throw INTERP_KERNEL::Exception(oss.str().c_str());
1835 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1842 int tmp=nbc+singleVal;
1843 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1848 std::ostringstream oss;
1849 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1850 throw INTERP_KERNEL::Exception(oss.str().c_str());
1856 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1862 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1863 daIntTyypp->checkAllocated();
1864 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1868 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1872 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1876 std::vector<int> multiVal;
1877 std::pair<int, std::pair<int,int> > slic;
1878 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1879 int nbc=self->getNumberOfCells();
1880 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1887 std::ostringstream oss;
1888 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1889 throw INTERP_KERNEL::Exception(oss.str().c_str());
1893 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1900 int tmp=nbc+singleVal;
1901 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1906 std::ostringstream oss;
1907 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1908 throw INTERP_KERNEL::Exception(oss.str().c_str());
1914 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1919 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1925 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1926 daIntTyypp->checkAllocated();
1927 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1931 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1935 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1937 int szArr,sw,iTypppArr;
1938 std::vector<int> stdvecTyyppArr;
1939 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1942 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1943 throw INTERP_KERNEL::Exception(oss.str().c_str());
1945 self->insertNextCell(type,size,tmp);
1948 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1950 int szArr,sw,iTypppArr;
1951 std::vector<int> stdvecTyyppArr;
1952 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1953 self->insertNextCell(type,szArr,tmp);
1956 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1958 DataArrayInt *ret=self->getNodalConnectivity();
1963 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1965 DataArrayInt *ret=self->getNodalConnectivityIndex();
1970 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1972 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1973 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1974 PyObject *res = PyList_New(result.size());
1975 for (int i=0;iL!=result.end(); i++, iL++)
1976 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1980 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1982 int szArr,sw,iTypppArr;
1983 std::vector<int> stdvecTyyppArr;
1984 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1985 int nbOfDepthPeelingPerformed=0;
1986 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1987 PyObject *res=PyTuple_New(2);
1988 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1989 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1993 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1995 DataArrayInt *v0=0,*v1=0;
1996 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1997 PyObject *res = PyList_New(2);
1998 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1999 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2003 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2007 DataArrayDoubleTuple *aa;
2008 std::vector<double> bb;
2010 int nbOfCompo=self->getSpaceDimension();
2011 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2014 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2015 PyObject *ret=PyTuple_New(2);
2016 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2017 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2021 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2023 DataArrayInt *ret1=0;
2024 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2025 PyObject *ret=PyTuple_New(2);
2026 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2027 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2031 PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
2034 DataArrayInt *ret1(0);
2035 MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2036 PyObject *ret=PyTuple_New(3);
2037 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2038 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2039 PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2043 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2045 std::vector<int> cells;
2046 self->checkButterflyCells(cells,eps);
2047 DataArrayInt *ret=DataArrayInt::New();
2048 ret->alloc((int)cells.size(),1);
2049 std::copy(cells.begin(),cells.end(),ret->getPointer());
2050 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2053 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2055 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2057 PyObject *ret = PyList_New(sz);
2058 for(int i=0;i<sz;i++)
2059 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2063 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2065 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2066 int sz=retCpp.size();
2067 PyObject *ret=PyList_New(sz);
2068 for(int i=0;i<sz;i++)
2069 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2073 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2076 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2077 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2078 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2081 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2084 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2085 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2089 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2092 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2093 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2097 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2099 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2100 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2101 PyObject *ret=PyTuple_New(3);
2102 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2103 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2104 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2108 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2110 DataArrayInt *tmp0=0,*tmp1=0;
2111 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2112 PyObject *ret=PyTuple_New(2);
2113 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2114 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2118 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2122 std::vector<int> multiVal;
2123 std::pair<int, std::pair<int,int> > slic;
2124 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2125 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2129 return self->duplicateNodes(&singleVal,&singleVal+1);
2131 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2133 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2135 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2139 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2143 std::vector<int> multiVal;
2144 std::pair<int, std::pair<int,int> > slic;
2145 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2146 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2150 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2152 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2154 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2156 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2160 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2163 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2164 DataArrayInt *tmp0,*tmp1=0;
2165 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2166 PyObject *ret=PyTuple_New(2);
2167 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2174 DataArrayInt *ret0=0,*ret1=0;
2175 self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2176 PyObject *ret=PyTuple_New(2);
2177 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2182 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2184 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2185 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2186 DataArrayInt *ret1=0,*ret2=0;
2187 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2188 PyObject *ret=PyTuple_New(3);
2189 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2190 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2191 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2195 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2197 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2198 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2199 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2200 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2203 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2206 std::vector<const MEDCouplingUMesh *> meshes;
2207 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2208 std::vector<DataArrayInt *> corr;
2209 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2211 PyObject *ret1=PyList_New(sz);
2212 for(int i=0;i<sz;i++)
2213 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyObject *ret=PyList_New(2);
2215 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2216 PyList_SetItem(ret,1,ret1);
2220 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2222 std::vector<MEDCouplingUMesh *> meshes;
2223 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2224 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2227 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2229 std::vector<MEDCouplingUMesh *> meshes;
2230 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2231 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2234 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2238 std::vector<int> multiVal;
2239 std::pair<int, std::pair<int,int> > slic;
2240 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2242 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2243 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2247 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2249 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2251 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2253 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2257 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2259 DataArrayInt *arrOut=0,*arrIndexOut=0;
2262 std::vector<int> multiVal;
2263 std::pair<int, std::pair<int,int> > slic;
2264 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2266 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2267 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2272 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2277 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2282 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2286 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2288 PyObject *ret=PyTuple_New(2);
2289 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2290 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2294 static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2296 DataArrayInt *arrOut=0,*arrIndexOut=0;
2297 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2298 PyObject *ret=PyTuple_New(2);
2299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2300 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2304 static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2306 if(!PySlice_Check(slic))
2307 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2308 Py_ssize_t strt=2,stp=2,step=2;
2309 PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2311 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2312 arrIndxIn->checkAllocated();
2313 if(arrIndxIn->getNumberOfComponents()!=1)
2314 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2315 if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2316 throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2317 DataArrayInt *arrOut=0,*arrIndexOut=0;
2318 MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2319 PyObject *ret=PyTuple_New(2);
2320 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2321 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2325 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2326 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2327 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2329 DataArrayInt *arrOut=0,*arrIndexOut=0;
2332 std::vector<int> multiVal;
2333 std::pair<int, std::pair<int,int> > slic;
2334 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2336 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2337 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2342 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2347 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2352 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2356 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2358 PyObject *ret=PyTuple_New(2);
2359 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2360 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2364 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2365 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2369 std::vector<int> multiVal;
2370 std::pair<int, std::pair<int,int> > slic;
2371 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2373 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2374 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2379 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2384 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2389 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2393 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2397 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2401 DataArrayDoubleTuple *aa;
2402 std::vector<double> bb;
2404 int spaceDim=self->getSpaceDimension();
2405 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2406 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2408 std::vector<int> cells;
2409 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2410 DataArrayInt *ret=DataArrayInt::New();
2411 ret->alloc((int)cells.size(),1);
2412 std::copy(cells.begin(),cells.end(),ret->getPointer());
2413 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2416 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2420 DataArrayDoubleTuple *aa;
2421 std::vector<double> bb;
2423 int spaceDim=self->getSpaceDimension();
2424 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2425 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2426 self->orientCorrectly2DCells(v,polyOnly);
2429 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2431 std::vector<int> cells;
2432 self->arePolyhedronsNotCorrectlyOriented(cells);
2433 DataArrayInt *ret=DataArrayInt::New();
2434 ret->alloc((int)cells.size(),1);
2435 std::copy(cells.begin(),cells.end(),ret->getPointer());
2436 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2439 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2443 self->getFastAveragePlaneOfThis(vec,pos);
2445 std::copy(vec,vec+3,vals);
2446 std::copy(pos,pos+3,vals+3);
2447 return convertDblArrToPyListOfTuple(vals,3,2);
2450 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2452 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2453 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2454 return MEDCouplingUMesh::MergeUMeshes(tmp);
2457 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2460 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2461 PyObject *ret=PyTuple_New(2);
2462 PyObject *ret0Py=ret0?Py_True:Py_False;
2464 PyTuple_SetItem(ret,0,ret0Py);
2465 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2472 bool ret0=self->areCellsIncludedIn2(other,ret1);
2473 PyObject *ret=PyTuple_New(2);
2474 PyObject *ret0Py=ret0?Py_True:Py_False;
2476 PyTuple_SetItem(ret,0,ret0Py);
2477 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2481 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2483 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2484 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2485 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2486 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2487 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2488 PyObject *ret=PyTuple_New(5);
2489 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2490 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2491 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2492 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2493 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2497 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2499 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2500 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2501 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2502 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2503 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2504 PyObject *ret=PyTuple_New(5);
2505 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2506 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2508 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2509 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2513 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2515 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2516 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2517 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2518 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2519 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2520 PyObject *ret=PyTuple_New(5);
2521 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2522 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2525 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2529 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2531 DataArrayInt *neighbors=0,*neighborsIdx=0;
2532 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2533 PyObject *ret=PyTuple_New(2);
2534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2535 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2541 DataArrayInt *neighbors=0,*neighborsIdx=0;
2542 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2543 PyObject *ret=PyTuple_New(2);
2544 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2549 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2551 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2552 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2553 DataArrayInt *d2,*d3,*d4,*dd5;
2554 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2555 PyObject *ret=PyTuple_New(7);
2556 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2557 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2558 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2559 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2561 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2566 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2569 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2570 da->checkAllocated();
2571 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2574 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2577 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2578 da->checkAllocated();
2579 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2582 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2585 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2586 da->checkAllocated();
2587 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2590 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2593 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2594 da->checkAllocated();
2595 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2596 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2597 PyObject *res = PyList_New(result.size());
2598 for (int i=0;iL!=result.end(); i++, iL++)
2599 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2603 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2606 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2607 da->checkAllocated();
2608 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2609 ret->setName(da->getName().c_str());
2613 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2615 DataArrayInt *cellNb1=0,*cellNb2=0;
2616 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2617 PyObject *ret=PyTuple_New(3);
2618 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2619 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2626 int spaceDim=self->getSpaceDimension();
2628 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2630 DataArrayDouble *a,*a2;
2631 DataArrayDoubleTuple *aa,*aa2;
2632 std::vector<double> bb,bb2;
2634 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2635 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2636 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2637 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2639 DataArrayInt *cellIds=0;
2640 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2641 PyObject *ret=PyTuple_New(2);
2642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2643 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2647 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2649 int spaceDim=self->getSpaceDimension();
2651 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2653 DataArrayDouble *a,*a2;
2654 DataArrayDoubleTuple *aa,*aa2;
2655 std::vector<double> bb,bb2;
2657 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2658 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2659 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2660 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2662 DataArrayInt *cellIds=0;
2663 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2664 PyObject *ret=PyTuple_New(2);
2665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2666 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2670 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2672 int spaceDim=self->getSpaceDimension();
2674 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2676 DataArrayDouble *a,*a2;
2677 DataArrayDoubleTuple *aa,*aa2;
2678 std::vector<double> bb,bb2;
2680 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2681 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2682 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2683 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2684 return self->getCellIdsCrossingPlane(orig,vect,eps);
2687 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2691 std::vector<int> pos2;
2692 DataArrayInt *pos3=0;
2693 DataArrayIntTuple *pos4=0;
2694 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2699 self->convertToPolyTypes(&pos1,&pos1+1);
2706 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2711 self->convertToPolyTypes(pos3->begin(),pos3->end());
2715 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2719 void convertAllToPoly();
2720 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2721 bool unPolyze() throw(INTERP_KERNEL::Exception);
2722 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2723 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2724 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2727 //== MEDCouplingUMesh End
2729 //== MEDCouplingExtrudedMesh
2731 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2734 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2735 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2737 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2739 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2742 std::string __str__() const throw(INTERP_KERNEL::Exception)
2744 return self->simpleRepr();
2747 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2749 std::ostringstream oss;
2750 self->reprQuickOverview(oss);
2754 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2756 MEDCouplingUMesh *ret=self->getMesh2D();
2759 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2761 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2763 MEDCouplingUMesh *ret=self->getMesh1D();
2766 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2768 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2770 DataArrayInt *ret=self->getMesh3DIds();
2773 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2778 //== MEDCouplingExtrudedMesh End
2780 class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2783 static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2784 static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2785 INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2786 int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2787 virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2788 virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2791 virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2793 int szArr,sw,iTypppArr;
2794 std::vector<int> stdvecTyyppArr;
2795 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2796 self->insertNextCell(tmp,tmp+szArr);
2799 virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2801 DataArrayInt *ret=self->getNodalConnectivity();
2802 if(ret) ret->incrRef();
2806 static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2808 std::vector< const MEDCoupling1GTUMesh *> parts;
2809 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2810 return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2815 //== MEDCoupling1SGTUMesh
2817 class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2820 static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2821 static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2822 void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2823 int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2824 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2825 MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2826 MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2829 MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2831 return MEDCoupling1SGTUMesh::New(name,type);
2834 MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2836 return MEDCoupling1SGTUMesh::New(m);
2839 std::string __str__() const throw(INTERP_KERNEL::Exception)
2841 return self->simpleRepr();
2844 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2846 std::ostringstream oss;
2847 self->reprQuickOverview(oss);
2851 static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2853 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2854 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2855 return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2858 static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2860 std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2861 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2862 return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2867 //== MEDCoupling1SGTUMesh End
2869 //== MEDCoupling1DGTUMesh
2871 class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2874 static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2875 static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2876 void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2877 MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2878 bool isPacked() const throw(INTERP_KERNEL::Exception);
2881 MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2883 return MEDCoupling1DGTUMesh::New(name,type);
2886 MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2888 return MEDCoupling1DGTUMesh::New(m);
2891 std::string __str__() const throw(INTERP_KERNEL::Exception)
2893 return self->simpleRepr();
2896 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2898 std::ostringstream oss;
2899 self->reprQuickOverview(oss);
2903 DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2905 DataArrayInt *ret=self->getNodalConnectivityIndex();
2906 if(ret) ret->incrRef();
2910 PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2912 DataArrayInt *ret1=0,*ret2=0;
2913 bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2914 PyObject *ret0Py=ret0?Py_True:Py_False;
2916 PyObject *ret=PyTuple_New(3);
2917 PyTuple_SetItem(ret,0,ret0Py);
2918 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2919 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2923 PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2926 MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2927 PyObject *ret=PyTuple_New(2);
2928 PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2929 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2930 PyTuple_SetItem(ret,1,ret1Py);
2934 static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2936 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2937 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2938 return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2941 static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2943 std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2944 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2945 return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2948 static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2950 std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2951 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2952 return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2957 //== MEDCoupling1DGTUMeshEnd
2959 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2962 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2963 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2964 virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2965 std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2966 MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2967 static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2970 virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2972 int tmpp1=-1,tmpp2=-1;
2973 std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2974 std::vector< std::pair<int,int> > inp;
2978 for(int i=0;i<tmpp1;i++)
2979 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2984 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2985 inp.resize(tmpp1/2);
2986 for(int i=0;i<tmpp1/2;i++)
2987 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2990 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2991 return self->buildStructuredSubPart(inp);
2994 static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2996 int tmpp1=-1,tmpp2=-1;
2997 std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2998 std::vector< std::pair<int,int> > inp;
3002 for(int i=0;i<tmpp1;i++)
3003 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3008 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
3009 inp.resize(tmpp1/2);
3010 for(int i=0;i<tmpp1/2;i++)
3011 { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3014 throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
3016 int szArr,sw,iTypppArr;
3017 std::vector<int> stdvecTyyppArr;
3018 const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3019 std::vector<int> tmp5(tmp4,tmp4+szArr);
3021 return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3024 static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3026 int szArr,sw,iTypppArr;
3027 std::vector<int> stdvecTyyppArr;
3028 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3029 return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3032 static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3034 int szArr,sw,iTypppArr;
3035 std::vector<int> stdvecTyyppArr;
3036 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3037 int szArr2,sw2,iTypppArr2;
3038 std::vector<int> stdvecTyyppArr2;
3039 const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3040 std::vector<int> tmp3(tmp2,tmp2+szArr2);
3041 std::vector< std::pair<int,int> > partCompactFormat;
3042 bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3043 PyObject *ret=PyTuple_New(2);
3044 PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3045 PyTuple_SetItem(ret,0,ret0Py);
3046 PyObject *ret1Py=PyList_New(partCompactFormat.size());
3047 for(std::size_t i=0;i<partCompactFormat.size();i++)
3049 PyObject *tmp4=PyTuple_New(2);
3050 PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3051 PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3052 PyList_SetItem(ret1Py,i,tmp4);
3054 PyTuple_SetItem(ret,1,ret1Py);
3060 //== MEDCouplingCMesh
3062 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3065 static MEDCouplingCMesh *New();
3066 static MEDCouplingCMesh *New(const char *meshName);
3067 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3068 void setCoords(const DataArrayDouble *coordsX,
3069 const DataArrayDouble *coordsY=0,
3070 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3071 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3075 return MEDCouplingCMesh::New();
3077 MEDCouplingCMesh(const char *meshName)
3079 return MEDCouplingCMesh::New(meshName);
3081 std::string __str__() const throw(INTERP_KERNEL::Exception)
3083 return self->simpleRepr();
3085 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3087 std::ostringstream oss;
3088 self->reprQuickOverview(oss);
3091 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3093 DataArrayDouble *ret=self->getCoordsAt(i);
3101 //== MEDCouplingCMesh End
3103 //== MEDCouplingCurveLinearMesh
3105 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3108 static MEDCouplingCurveLinearMesh *New();
3109 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3110 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3111 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3113 MEDCouplingCurveLinearMesh()
3115 return MEDCouplingCurveLinearMesh::New();
3117 MEDCouplingCurveLinearMesh(const char *meshName)
3119 return MEDCouplingCurveLinearMesh::New(meshName);
3121 std::string __str__() const throw(INTERP_KERNEL::Exception)
3123 return self->simpleRepr();
3125 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3127 std::ostringstream oss;
3128 self->reprQuickOverview(oss);
3131 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3133 DataArrayDouble *ret=self->getCoords();
3138 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3140 int szArr,sw,iTypppArr;
3141 std::vector<int> stdvecTyyppArr;
3142 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3143 self->setNodeGridStructure(tmp,tmp+szArr);
3148 //== MEDCouplingCurveLinearMesh End
3151 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3153 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3155 int sz=0,sw=-1,val1=-1;
3156 std::vector<int> val2;
3157 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3158 return self->clonePart(inp,inp+sz);
3161 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3163 DataArrayInt *ret1=0;
3165 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3166 PyObject *res=PyTuple_New(2);
3167 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3169 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3172 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3173 PyTuple_SetItem(res,1,res1);
3178 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3180 std::vector<int> vVal; int iVal=-1;
3182 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3184 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3185 DataArrayInt *ret0=0,*ret1=0;
3186 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3187 PyObject *pyRet=PyTuple_New(2);
3188 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3189 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3193 int getNumberOfTuplesExpectedRegardingCode(const MEDCouplingMesh *mesh, PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3195 std::vector<int> inp0;
3196 convertPyToNewIntArr4(code,1,3,inp0);
3197 std::vector<const DataArrayInt *> inp1;
3198 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3199 return self->getNumberOfTuplesExpectedRegardingCode(mesh,inp0,inp1);
3203 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3205 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3206 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3209 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3211 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3212 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3215 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3217 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3218 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3221 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3223 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3224 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3227 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3229 PyObject *getArrayOfDiscIds() const
3231 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3234 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3237 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3239 std::vector<int> ret1;
3240 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3241 std::size_t sz=ret0.size();
3242 PyObject *pyRet=PyTuple_New(2);
3243 PyObject *pyRet0=PyList_New((int)sz);
3244 PyObject *pyRet1=PyList_New((int)sz);
3245 for(std::size_t i=0;i<sz;i++)
3247 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3248 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3250 PyTuple_SetItem(pyRet,0,pyRet0);
3251 PyTuple_SetItem(pyRet,1,pyRet1);
3256 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3258 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3261 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3262 PyObject *ret=PyTuple_New(2);
3263 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3264 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3269 namespace ParaMEDMEM
3271 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3274 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3275 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3276 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3277 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3278 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3279 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3280 void setName(const char *name) throw(INTERP_KERNEL::Exception);
3281 std::string getDescription() const throw(INTERP_KERNEL::Exception);
3282 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3283 std::string getName() const throw(INTERP_KERNEL::Exception);
3284 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3285 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3286 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3287 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3288 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3289 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3290 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3291 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3292 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3293 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3294 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3295 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3296 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3297 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3298 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3299 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3301 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3303 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3306 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3309 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3311 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3314 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3317 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3319 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3320 return convertIntArrToPyList3(ret);
3323 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3326 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3327 PyObject *ret=PyTuple_New(2);
3328 PyObject *ret0Py=ret0?Py_True:Py_False;
3330 PyTuple_SetItem(ret,0,ret0Py);
3331 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3335 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3337 DataArrayInt *ret1=0;
3338 MEDCouplingMesh *ret0=0;
3340 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3341 if (!SWIG_IsOK(res1))
3344 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3345 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3349 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3351 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3352 da2->checkAllocated();
3353 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3355 PyObject *res = PyList_New(2);
3356 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3357 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3361 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3363 DataArrayInt *ret1=0;
3365 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3366 PyObject *res=PyTuple_New(2);
3367 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3369 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3372 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3373 PyTuple_SetItem(res,1,res1);
3378 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3382 std::vector<int> pos2;
3383 DataArrayInt *pos3=0;
3384 DataArrayIntTuple *pos4=0;
3385 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3390 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3394 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3398 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3401 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3405 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3406 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3409 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3410 if (!SWIG_IsOK(res1))
3413 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3414 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3418 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3420 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3421 da2->checkAllocated();
3422 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3426 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3428 std::vector<int> tmp;
3429 self->getCellIdsHavingGaussLocalization(locId,tmp);
3430 DataArrayInt *ret=DataArrayInt::New();
3431 ret->alloc((int)tmp.size(),1);
3432 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3433 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3436 int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3438 std::vector<int> inp0;
3439 convertPyToNewIntArr4(code,1,3,inp0);
3440 std::vector<const DataArrayInt *> inp1;
3441 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3442 return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3447 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3450 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3451 static MEDCouplingFieldTemplate *New(TypeOfField type);
3452 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3453 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3456 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3458 return MEDCouplingFieldTemplate::New(f);
3461 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3463 return MEDCouplingFieldTemplate::New(type);
3466 std::string __str__() const throw(INTERP_KERNEL::Exception)
3468 return self->simpleRepr();
3471 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3473 std::ostringstream oss;
3474 self->reprQuickOverview(oss);
3480 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3483 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3484 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3485 void setTimeUnit(const char *unit);
3486 const char *getTimeUnit() const;
3487 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3488 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3489 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3490 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3491 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3492 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3493 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3494 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3495 MEDCouplingFieldDouble *deepCpy() const;
3496 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3497 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3498 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3499 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3500 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3501 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3502 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3503 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3504 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3505 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3506 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3507 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3508 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3509 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3510 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3511 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3512 void setIteration(int it) throw(INTERP_KERNEL::Exception);
3513 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3514 void setOrder(int order) throw(INTERP_KERNEL::Exception);
3515 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3516 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3517 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3518 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3519 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3520 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3521 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3522 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3523 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3524 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3525 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3526 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3527 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3528 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3529 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3530 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3531 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3532 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3533 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3534 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3535 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3536 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3537 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3538 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3539 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3540 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3541 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3542 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3543 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3544 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3545 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3546 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3547 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3548 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3549 double getMinValue() const throw(INTERP_KERNEL::Exception);
3550 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3551 double norm2() const throw(INTERP_KERNEL::Exception);
3552 double normMax() const throw(INTERP_KERNEL::Exception);
3553 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3554 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3555 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3556 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3557 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3558 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3559 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3560 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3561 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3562 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3563 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3564 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3565 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3566 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3567 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3568 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3569 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3570 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3571 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3572 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3573 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3574 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3576 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3578 return MEDCouplingFieldDouble::New(type,td);
3581 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3583 return MEDCouplingFieldDouble::New(ft,td);
3586 std::string __str__() const throw(INTERP_KERNEL::Exception)
3588 return self->simpleRepr();
3591 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3593 std::ostringstream oss;
3594 self->reprQuickOverview(oss);
3598 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3600 DataArrayDouble *ret=self->getArray();
3606 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3608 std::vector<DataArrayDouble *> arrs=self->getArrays();
3609 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3613 PyObject *ret=PyTuple_New(sz);
3614 for(int i=0;i<sz;i++)
3617 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3619 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3624 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3626 std::vector<const DataArrayDouble *> tmp;
3627 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3629 std::vector<DataArrayDouble *> arrs(sz);
3630 for(int i=0;i<sz;i++)
3631 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3632 self->setArrays(arrs);
3635 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3637 DataArrayDouble *ret=self->getEndArray();
3643 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3647 DataArrayDoubleTuple *aa;
3648 std::vector<double> bb;
3650 const MEDCouplingMesh *mesh=self->getMesh();
3652 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3653 int spaceDim=mesh->getSpaceDimension();
3654 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3655 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3657 int sz=self->getNumberOfComponents();
3658 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3659 self->getValueOn(spaceLoc,res);
3660 return convertDblArrToPyList(res,sz);
3663 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3665 int sz=self->getNumberOfComponents();
3666 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3667 self->getValueOnPos(i,j,k,res);
3668 return convertDblArrToPyList(res,sz);
3671 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3674 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3675 if (!SWIG_IsOK(res1))
3678 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3679 const MEDCouplingMesh *mesh=self->getMesh();
3681 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3682 int spaceDim=mesh->getSpaceDimension();
3683 int nbOfPoints=size/spaceDim;
3684 if(size%spaceDim!=0)
3686 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3688 return self->getValueOnMulti(tmp,nbOfPoints);
3692 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3694 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3695 da2->checkAllocated();
3696 int size=da2->getNumberOfTuples();
3697 int nbOfCompo=da2->getNumberOfComponents();
3698 const MEDCouplingMesh *mesh=self->getMesh();
3700 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3701 if(nbOfCompo!=mesh->getSpaceDimension())
3703 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3705 return self->getValueOnMulti(da2->getConstPointer(),size);
3709 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3713 DataArrayDoubleTuple *aa;
3714 std::vector<double> bb;
3716 const MEDCouplingMesh *mesh=self->getMesh();
3718 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3719 int spaceDim=mesh->getSpaceDimension();
3720 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3721 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3724 int sz=self->getNumberOfComponents();
3725 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3726 self->getValueOn(spaceLoc,time,res);
3727 return convertDblArrToPyList(res,sz);
3730 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3732 if(self->getArray()!=0)
3733 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3736 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3737 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3738 self->setArray(arr);
3742 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3745 double tmp0=self->getTime(tmp1,tmp2);
3746 PyObject *res = PyList_New(3);
3747 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3748 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3749 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3753 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3756 double tmp0=self->getStartTime(tmp1,tmp2);
3757 PyObject *res = PyList_New(3);
3758 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3759 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3760 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3764 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3767 double tmp0=self->getEndTime(tmp1,tmp2);
3768 PyObject *res = PyList_New(3);
3769 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3770 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3771 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3774 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3776 int sz=self->getNumberOfComponents();
3777 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3778 self->accumulate(tmp);
3779 return convertDblArrToPyList(tmp,sz);
3781 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3783 int sz=self->getNumberOfComponents();
3784 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3785 self->integral(isWAbs,tmp);
3786 return convertDblArrToPyList(tmp,sz);
3788 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3790 int sz=self->getNumberOfComponents();
3791 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3792 self->getWeightedAverageValue(tmp,isWAbs);
3793 return convertDblArrToPyList(tmp,sz);
3795 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3797 int sz=self->getNumberOfComponents();
3798 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3800 return convertDblArrToPyList(tmp,sz);
3802 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3804 int sz=self->getNumberOfComponents();
3805 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3807 return convertDblArrToPyList(tmp,sz);
3809 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3811 int szArr,sw,iTypppArr;
3812 std::vector<int> stdvecTyyppArr;
3813 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3814 self->renumberCells(tmp,check);
3817 void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3819 int szArr,sw,iTypppArr;
3820 std::vector<int> stdvecTyyppArr;
3821 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3822 self->renumberCellsWithoutMesh(tmp,check);
3825 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3827 int szArr,sw,iTypppArr;
3828 std::vector<int> stdvecTyyppArr;
3829 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3830 self->renumberNodes(tmp,eps);
3833 void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3835 int szArr,sw,iTypppArr;
3836 std::vector<int> stdvecTyyppArr;
3837 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3838 self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3841 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3845 std::vector<int> multiVal;
3846 std::pair<int, std::pair<int,int> > slic;
3847 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3848 const MEDCouplingMesh *mesh=self->getMesh();
3850 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3851 int nbc=mesh->getNumberOfCells();
3852 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3859 std::ostringstream oss;
3860 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3861 throw INTERP_KERNEL::Exception(oss.str().c_str());
3864 return self->buildSubPart(&singleVal,&singleVal+1);
3869 int tmp=nbc+singleVal;
3870 return self->buildSubPart(&tmp,&tmp+1);
3874 std::ostringstream oss;
3875 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3876 throw INTERP_KERNEL::Exception(oss.str().c_str());
3882 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3886 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3891 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3892 daIntTyypp->checkAllocated();
3893 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3896 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3900 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3902 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";
3903 if(PyTuple_Check(li))
3905 Py_ssize_t sz=PyTuple_Size(li);
3907 throw INTERP_KERNEL::Exception(msg);
3908 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3911 std::vector<int> multiVal;
3912 std::pair<int, std::pair<int,int> > slic;
3913 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3914 if(!self->getArray())
3915 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3917 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3918 catch(INTERP_KERNEL::Exception& e)
3919 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3920 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3921 DataArrayDouble *ret0Arr=ret0->getArray();
3923 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3928 std::vector<int> v2(1,singleVal);
3929 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3930 ret0->setArray(aarr);
3935 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3936 ret0->setArray(aarr);
3941 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3942 std::vector<int> v2(nbOfComp);
3943 for(int i=0;i<nbOfComp;i++)
3944 v2[i]=slic.first+i*slic.second.second;
3945 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3946 ret0->setArray(aarr);
3950 throw INTERP_KERNEL::Exception(msg);
3955 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3958 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3961 double r1=self->getMaxValue2(tmp);
3962 PyObject *ret=PyTuple_New(2);
3963 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3964 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3968 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3971 double r1=self->getMinValue2(tmp);
3972 PyObject *ret=PyTuple_New(2);
3973 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3974 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3978 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3980 std::vector<int> tmp;
3981 convertPyToNewIntArr3(li,tmp);
3982 return self->keepSelectedComponents(tmp);
3985 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3987 std::vector<int> tmp;
3988 convertPyToNewIntArr3(li,tmp);
3989 self->setSelectedComponents(f,tmp);
3992 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3995 DataArrayDouble *a,*a2;
3996 DataArrayDoubleTuple *aa,*aa2;
3997 std::vector<double> bb,bb2;
4000 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4001 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4002 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4003 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4005 return self->extractSlice3D(orig,vect,eps);
4008 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4010 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4013 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4015 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4018 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4020 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.";
4021 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4024 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4026 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4028 return (*self)-(*other);
4030 throw INTERP_KERNEL::Exception(msg);
4035 DataArrayDoubleTuple *aa;
4036 std::vector<double> bb;
4038 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4043 if(!self->getArray())
4044 throw INTERP_KERNEL::Exception(msg2);
4045 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4046 ret->applyLin(1.,-val);
4047 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4048 ret2->setArray(ret);
4053 if(!self->getArray())
4054 throw INTERP_KERNEL::Exception(msg2);
4055 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4056 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4057 ret2->setArray(ret);
4062 if(!self->getArray())
4063 throw INTERP_KERNEL::Exception(msg2);
4064 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4065 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4066 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4067 ret2->setArray(ret);
4072 if(!self->getArray())
4073 throw INTERP_KERNEL::Exception(msg2);
4074 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4075 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4076 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4077 ret2->setArray(ret);
4081 { throw INTERP_KERNEL::Exception(msg); }
4085 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4087 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4090 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4092 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4095 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4097 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4100 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4102 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.";
4103 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4106 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4108 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4110 return (*self)/(*other);
4112 throw INTERP_KERNEL::Exception(msg);
4117 DataArrayDoubleTuple *aa;
4118 std::vector<double> bb;
4120 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4126 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4127 if(!self->getArray())
4128 throw INTERP_KERNEL::Exception(msg2);
4129 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4130 ret->applyLin(1./val,0);
4131 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4132 ret2->setArray(ret);
4137 if(!self->getArray())
4138 throw INTERP_KERNEL::Exception(msg2);
4139 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4140 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4141 ret2->setArray(ret);
4146 if(!self->getArray())
4147 throw INTERP_KERNEL::Exception(msg2);
4148 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4149 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4150 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4151 ret2->setArray(ret);
4156 if(!self->getArray())
4157 throw INTERP_KERNEL::Exception(msg2);
4158 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4159 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4160 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4161 ret2->setArray(ret);
4165 { throw INTERP_KERNEL::Exception(msg); }
4169 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4171 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4174 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4176 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.";
4177 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4180 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4182 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4184 return (*self)^(*other);
4186 throw INTERP_KERNEL::Exception(msg);
4191 DataArrayDoubleTuple *aa;
4192 std::vector<double> bb;
4194 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4199 if(!self->getArray())
4200 throw INTERP_KERNEL::Exception(msg2);
4201 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4203 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4204 ret2->setArray(ret);
4209 if(!self->getArray())
4210 throw INTERP_KERNEL::Exception(msg2);
4211 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4212 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4213 ret2->setArray(ret);
4218 if(!self->getArray())
4219 throw INTERP_KERNEL::Exception(msg2);
4220 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4221 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4222 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4223 ret2->setArray(ret);
4228 if(!self->getArray())
4229 throw INTERP_KERNEL::Exception(msg2);
4230 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4231 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4232 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4233 ret2->setArray(ret);
4237 { throw INTERP_KERNEL::Exception(msg); }
4241 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4243 return self->negate();
4246 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4248 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.";
4249 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4252 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4254 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4258 Py_XINCREF(trueSelf);
4262 throw INTERP_KERNEL::Exception(msg);
4267 DataArrayDoubleTuple *aa;
4268 std::vector<double> bb;
4270 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4275 if(!self->getArray())
4276 throw INTERP_KERNEL::Exception(msg2);
4277 self->getArray()->applyLin(1.,val);
4278 Py_XINCREF(trueSelf);
4283 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4286 Py_XINCREF(trueSelf);
4291 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4292 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4293 ret2->setArray(aaa);
4295 Py_XINCREF(trueSelf);
4300 if(!self->getArray())
4301 throw INTERP_KERNEL::Exception(msg2);
4302 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4303 self->getArray()->addEqual(aaa);
4304 Py_XINCREF(trueSelf);
4308 { throw INTERP_KERNEL::Exception(msg); }
4312 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4314 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.";
4315 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4318 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4320 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4324 Py_XINCREF(trueSelf);
4328 throw INTERP_KERNEL::Exception(msg);
4333 DataArrayDoubleTuple *aa;
4334 std::vector<double> bb;
4336 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4341 if(!self->getArray())
4342 throw INTERP_KERNEL::Exception(msg2);
4343 self->getArray()->applyLin(1.,-val);
4344 Py_XINCREF(trueSelf);
4349 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4352 Py_XINCREF(trueSelf);
4357 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4358 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4359 ret2->setArray(aaa);
4361 Py_XINCREF(trueSelf);
4366 if(!self->getArray())
4367 throw INTERP_KERNEL::Exception(msg2);
4368 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4369 self->getArray()->substractEqual(aaa);
4370 Py_XINCREF(trueSelf);
4374 { throw INTERP_KERNEL::Exception(msg); }
4378 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4380 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.";
4381 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4384 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4386 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4390 Py_XINCREF(trueSelf);
4394 throw INTERP_KERNEL::Exception(msg);
4399 DataArrayDoubleTuple *aa;
4400 std::vector<double> bb;
4402 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4407 if(!self->getArray())
4408 throw INTERP_KERNEL::Exception(msg2);
4409 self->getArray()->applyLin(val,0);
4410 Py_XINCREF(trueSelf);
4415 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4418 Py_XINCREF(trueSelf);
4423 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4424 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4425 ret2->setArray(aaa);
4427 Py_XINCREF(trueSelf);
4432 if(!self->getArray())
4433 throw INTERP_KERNEL::Exception(msg2);
4434 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4435 self->getArray()->multiplyEqual(aaa);
4436 Py_XINCREF(trueSelf);
4440 { throw INTERP_KERNEL::Exception(msg); }
4444 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4446 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.";
4447 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4450 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4452 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4456 Py_XINCREF(trueSelf);
4460 throw INTERP_KERNEL::Exception(msg);
4465 DataArrayDoubleTuple *aa;
4466 std::vector<double> bb;
4468 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4474 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4475 if(!self->getArray())
4476 throw INTERP_KERNEL::Exception(msg2);
4477 self->getArray()->applyLin(1./val,0);
4478 Py_XINCREF(trueSelf);
4483 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4486 Py_XINCREF(trueSelf);
4491 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4492 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4493 ret2->setArray(aaa);
4495 Py_XINCREF(trueSelf);
4500 if(!self->getArray())
4501 throw INTERP_KERNEL::Exception(msg2);
4502 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4503 self->getArray()->divideEqual(aaa);
4504 Py_XINCREF(trueSelf);
4508 { throw INTERP_KERNEL::Exception(msg); }
4512 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4514 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.";
4515 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4518 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4520 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4524 Py_XINCREF(trueSelf);
4528 throw INTERP_KERNEL::Exception(msg);
4533 DataArrayDoubleTuple *aa;
4534 std::vector<double> bb;
4536 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4541 if(!self->getArray())
4542 throw INTERP_KERNEL::Exception(msg2);
4543 self->getArray()->applyPow(val);
4544 Py_XINCREF(trueSelf);
4549 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4552 Py_XINCREF(trueSelf);
4557 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4558 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4559 ret2->setArray(aaa);
4561 Py_XINCREF(trueSelf);
4566 if(!self->getArray())
4567 throw INTERP_KERNEL::Exception(msg2);
4568 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4569 self->getArray()->powEqual(aaa);
4570 Py_XINCREF(trueSelf);
4574 { throw INTERP_KERNEL::Exception(msg); }
4578 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4580 std::vector<const MEDCouplingFieldDouble *> tmp;
4581 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4582 return MEDCouplingFieldDouble::MergeFields(tmp);
4585 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4587 std::vector<const MEDCouplingFieldDouble *> tmp;
4588 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4589 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4594 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4597 int getNumberOfFields() const;
4598 MEDCouplingMultiFields *deepCpy() const;
4599 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4600 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4601 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4602 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4603 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4606 std::string __str__() const throw(INTERP_KERNEL::Exception)
4608 return self->simpleRepr();
4610 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4612 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4613 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4615 std::vector<MEDCouplingFieldDouble *> fs(sz);
4616 for(int i=0;i<sz;i++)
4617 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4618 return MEDCouplingMultiFields::New(fs);
4620 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4622 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4623 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4625 std::vector<MEDCouplingFieldDouble *> fs(sz);
4626 for(int i=0;i<sz;i++)
4627 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4628 return MEDCouplingMultiFields::New(fs);
4630 PyObject *getFields() const
4632 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4633 int sz=fields.size();
4634 PyObject *res = PyList_New(sz);
4635 for(int i=0;i<sz;i++)
4639 fields[i]->incrRef();
4640 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4644 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4649 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4651 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4655 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4658 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4660 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4662 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4664 PyObject *res = PyList_New(sz);
4665 for(int i=0;i<sz;i++)
4670 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4674 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4679 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4681 std::vector<int> refs;
4682 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4684 PyObject *res = PyList_New(sz);
4685 for(int i=0;i<sz;i++)
4690 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4694 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4698 PyObject *ret=PyTuple_New(2);
4699 PyTuple_SetItem(ret,0,res);
4700 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4703 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4705 std::vector<DataArrayDouble *> ms=self->getArrays();
4707 PyObject *res = PyList_New(sz);
4708 for(int i=0;i<sz;i++)
4713 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4717 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4722 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4724 std::vector< std::vector<int> > refs;
4725 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4727 PyObject *res = PyList_New(sz);
4728 PyObject *res2 = PyList_New(sz);
4729 for(int i=0;i<sz;i++)
4734 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4738 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4740 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4743 PyObject *ret=PyTuple_New(2);
4744 PyTuple_SetItem(ret,0,res);
4745 PyTuple_SetItem(ret,1,res2);
4751 class MEDCouplingDefinitionTime
4754 MEDCouplingDefinitionTime();
4755 void assign(const MEDCouplingDefinitionTime& other);
4756 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4757 double getTimeResolution() const;
4758 std::vector<double> getHotSpotsTime() const;
4761 std::string __str__() const throw(INTERP_KERNEL::Exception)
4763 std::ostringstream oss;
4764 self->appendRepr(oss);
4768 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4770 int meshId,arrId,arrIdInField,fieldId;
4771 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4772 PyObject *res=PyList_New(4);
4773 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4774 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4775 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4776 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4780 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4782 int meshId,arrId,arrIdInField,fieldId;
4783 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4784 PyObject *res=PyList_New(4);
4785 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4786 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4787 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4788 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4794 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4797 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4798 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4802 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4804 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4805 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4807 std::vector<MEDCouplingFieldDouble *> fs(sz);
4808 for(int i=0;i<sz;i++)
4809 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4810 return MEDCouplingFieldOverTime::New(fs);
4812 std::string __str__() const throw(INTERP_KERNEL::Exception)
4814 return self->simpleRepr();
4816 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4818 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4819 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4821 std::vector<MEDCouplingFieldDouble *> fs(sz);
4822 for(int i=0;i<sz;i++)
4823 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4824 return MEDCouplingFieldOverTime::New(fs);
4832 __filename=os.environ.get('PYTHONSTARTUP')
4833 if __filename and os.path.isfile(__filename):
4834 execfile(__filename)