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 "MEDCouplingField.hxx"
34 #include "MEDCouplingFieldDouble.hxx"
35 #include "MEDCouplingFieldTemplate.hxx"
36 #include "MEDCouplingGaussLocalization.hxx"
37 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
38 #include "MEDCouplingMultiFields.hxx"
39 #include "MEDCouplingFieldOverTime.hxx"
40 #include "MEDCouplingDefinitionTime.hxx"
41 #include "MEDCouplingFieldDiscretization.hxx"
42 #include "MEDCouplingTypemaps.i"
44 #include "InterpKernelAutoPtr.hxx"
46 using namespace ParaMEDMEM;
47 using namespace INTERP_KERNEL;
51 %template(ivec) std::vector<int>;
52 %template(dvec) std::vector<double>;
53 %template(svec) std::vector<std::string>;
55 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
57 $result=convertMesh($1,$owner);
60 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
62 $result=convertMesh($1,$owner);
65 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
67 $result=convertMesh($1,$owner);
70 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
72 $result=convertFieldDiscretization($1,$owner);
75 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
77 $result=convertMultiFields($1,$owner);
80 %typemap(out) ParaMEDMEM::DataArrayChar*
82 $result=convertDataArrayChar($1,$owner);
86 %init %{ import_array(); %}
89 %feature("autodoc", "1");
90 %feature("docstring");
92 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
93 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
94 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
95 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
96 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
97 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
98 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
99 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
100 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
101 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
102 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
103 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
104 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
105 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
132 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
133 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
134 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
135 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
136 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
137 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
138 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
139 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
140 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
141 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
143 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
144 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
145 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
146 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
147 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
148 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
149 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
150 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
151 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
152 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
153 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
154 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
155 %newobject ParaMEDMEM::DataArrayInt::New;
156 %newobject ParaMEDMEM::DataArrayInt::__iter__;
157 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
158 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
159 %newobject ParaMEDMEM::DataArrayInt::performCpy;
160 %newobject ParaMEDMEM::DataArrayInt::substr;
161 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
162 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
163 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
164 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
165 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
166 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
167 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
168 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
169 %newobject ParaMEDMEM::DataArrayInt::renumber;
170 %newobject ParaMEDMEM::DataArrayInt::renumberR;
171 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
172 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
173 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
174 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
175 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
176 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
177 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
178 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
179 %newobject ParaMEDMEM::DataArrayInt::negate;
180 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
181 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
182 %newobject ParaMEDMEM::DataArrayInt::Meld;
183 %newobject ParaMEDMEM::DataArrayInt::Add;
184 %newobject ParaMEDMEM::DataArrayInt::Substract;
185 %newobject ParaMEDMEM::DataArrayInt::Multiply;
186 %newobject ParaMEDMEM::DataArrayInt::Divide;
187 %newobject ParaMEDMEM::DataArrayInt::Pow;
188 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
189 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
190 %newobject ParaMEDMEM::DataArrayInt::Range;
191 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
192 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
193 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
194 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
195 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
196 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
197 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
198 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
199 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
200 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
201 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
202 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
203 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
204 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
205 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
206 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
207 %newobject ParaMEDMEM::DataArrayInt::__neg__;
208 %newobject ParaMEDMEM::DataArrayInt::__add__;
209 %newobject ParaMEDMEM::DataArrayInt::__radd__;
210 %newobject ParaMEDMEM::DataArrayInt::__sub__;
211 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
212 %newobject ParaMEDMEM::DataArrayInt::__mul__;
213 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
214 %newobject ParaMEDMEM::DataArrayInt::__div__;
215 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
216 %newobject ParaMEDMEM::DataArrayInt::__mod__;
217 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
218 %newobject ParaMEDMEM::DataArrayInt::__pow__;
219 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
220 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
221 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
222 %newobject ParaMEDMEM::DataArrayChar::renumber;
223 %newobject ParaMEDMEM::DataArrayChar::renumberR;
224 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
225 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
226 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
227 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
228 %newobject ParaMEDMEM::DataArrayChar::keepSelectedComponents;
229 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
230 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
231 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
232 %newobject ParaMEDMEM::DataArrayChar::Meld;
233 %newobject ParaMEDMEM::DataArrayByte::New;
234 %newobject ParaMEDMEM::DataArrayByte::__iter__;
235 %newobject ParaMEDMEM::DataArrayByte::deepCpy;
236 %newobject ParaMEDMEM::DataArrayByte::performCpy;
237 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
238 %newobject ParaMEDMEM::DataArrayChar::substr;
239 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
240 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
241 %newobject ParaMEDMEM::DataArrayAsciiChar::deepCpy;
242 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
243 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
244 %newobject ParaMEDMEM::DataArrayDouble::New;
245 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
246 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
247 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
248 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
249 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
250 %newobject ParaMEDMEM::DataArrayDouble::Meld;
251 %newobject ParaMEDMEM::DataArrayDouble::Dot;
252 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
253 %newobject ParaMEDMEM::DataArrayDouble::Add;
254 %newobject ParaMEDMEM::DataArrayDouble::Substract;
255 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
256 %newobject ParaMEDMEM::DataArrayDouble::Divide;
257 %newobject ParaMEDMEM::DataArrayDouble::Pow;
258 %newobject ParaMEDMEM::DataArrayDouble::substr;
259 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
260 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
261 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
262 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
263 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
264 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
265 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
266 %newobject ParaMEDMEM::DataArrayDouble::negate;
267 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
268 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
269 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
270 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
271 %newobject ParaMEDMEM::DataArrayDouble::determinant;
272 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
273 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
274 %newobject ParaMEDMEM::DataArrayDouble::inverse;
275 %newobject ParaMEDMEM::DataArrayDouble::trace;
276 %newobject ParaMEDMEM::DataArrayDouble::deviator;
277 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
278 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
279 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
280 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
281 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
282 %newobject ParaMEDMEM::DataArrayDouble::renumber;
283 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
284 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
285 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
286 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
287 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
288 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
289 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
290 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
291 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
292 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
293 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
294 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
295 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
296 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
297 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
298 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
299 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
300 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
301 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
302 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
303 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
304 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
305 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
306 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
307 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
308 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
309 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
310 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
311 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
312 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
313 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
314 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
315 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
316 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
317 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
318 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
319 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
320 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
321 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
322 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
323 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
324 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
325 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
326 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
327 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
328 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
329 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
330 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
331 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
332 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
333 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
334 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
335 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
336 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
337 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
338 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
339 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
340 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
341 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
342 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
343 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
344 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
345 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
346 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
347 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
348 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
349 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
350 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
351 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
352 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
353 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
354 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
355 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
356 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
357 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
358 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
359 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
360 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
361 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
362 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
363 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
364 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
365 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
366 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
367 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
368 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
369 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
370 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
371 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
372 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
373 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
374 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
375 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
376 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
377 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
378 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
379 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
380 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
381 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
382 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
384 %feature("unref") DataArray "$this->decrRef();"
385 %feature("unref") DataArrayDouble "$this->decrRef();"
386 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
387 %feature("unref") MEDCouplingMesh "$this->decrRef();"
388 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
389 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
390 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
391 %feature("unref") DataArrayInt "$this->decrRef();"
392 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
393 %feature("unref") DataArrayByte "$this->decrRef();"
394 %feature("unref") MEDCouplingField "$this->decrRef();"
395 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
396 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
397 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
398 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
399 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
400 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
401 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
402 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
403 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
405 %rename(assign) *::operator=;
406 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
407 %ignore ParaMEDMEM::RefCountObject::decrRef;
408 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
409 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
410 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
411 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
415 %rename (InterpKernelException) INTERP_KERNEL::Exception;
417 namespace INTERP_KERNEL
422 Exception(const char* what);
423 ~Exception() throw ();
424 const char *what() const throw ();
427 std::string __str__() const
429 return std::string(self->what());
435 %include "MEDCouplingTimeLabel.hxx"
459 CONST_ON_TIME_INTERVAL = 7
460 } TypeOfTimeDiscretization;
462 const char *MEDCouplingVersionStr();
463 int MEDCouplingVersion();
464 int MEDCouplingSizeOfVoidStar();
465 PyObject *MEDCouplingVersionMajMinRel()
467 int tmp0=0,tmp1=0,tmp2=0;
468 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
469 PyObject *res = PyList_New(3);
470 PyList_SetItem(res,0,SWIG_From_int(tmp0));
471 PyList_SetItem(res,1,SWIG_From_int(tmp1));
472 PyList_SetItem(res,2,SWIG_From_int(tmp2));
480 RefCountObject(const RefCountObject& other);
483 bool decrRef() const;
484 void incrRef() const;
485 virtual std::size_t getHeapMemorySize() const;
491 bool MEDCouplingHasNumpyBindings()
501 %include "MEDCouplingMemArray.i"
508 UNSTRUCTURED_DESC = 6,
512 } MEDCouplingMeshType;
515 class DataArrayDouble;
516 class MEDCouplingUMesh;
517 class MEDCouplingFieldDouble;
519 %extend RefCountObject
521 std::string getHiddenCppPointer() const
523 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
528 %extend MEDCouplingGaussLocalization
530 std::string __str__() const throw(INTERP_KERNEL::Exception)
532 return self->getStringRepr();
535 std::string __repr__() const throw(INTERP_KERNEL::Exception)
537 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
538 oss << self->getStringRepr();
543 class MEDCouplingMesh : public RefCountObject, public TimeLabel
546 void setName(const char *name);
547 const char *getName() const;
548 void setDescription(const char *descr);
549 const char *getDescription() const;
550 void setTime(double val, int iteration, int order);
551 void setTimeUnit(const char *unit);
552 const char *getTimeUnit() const;
553 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
554 bool isStructured() const throw(INTERP_KERNEL::Exception);
555 virtual MEDCouplingMesh *deepCpy() const;
556 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
557 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
558 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
559 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
560 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
561 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
562 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
563 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
564 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
565 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
566 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
572 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
573 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
574 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
575 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
576 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
577 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
579 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
580 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
581 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
582 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
583 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
584 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
585 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
586 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
587 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
589 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
590 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
591 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
594 std::string __str__() const throw(INTERP_KERNEL::Exception)
596 return self->simpleRepr();
599 PyObject *getTime() throw(INTERP_KERNEL::Exception)
602 double tmp0=self->getTime(tmp1,tmp2);
603 PyObject *res = PyList_New(3);
604 PyList_SetItem(res,0,SWIG_From_double(tmp0));
605 PyList_SetItem(res,1,SWIG_From_int(tmp1));
606 PyList_SetItem(res,2,SWIG_From_int(tmp2));
610 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
614 DataArrayDoubleTuple *aa;
615 std::vector<double> bb;
617 int spaceDim=self->getSpaceDimension();
618 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
619 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
620 return self->getCellContainingPoint(pos,eps);
623 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
627 DataArrayDoubleTuple *aa;
628 std::vector<double> bb;
630 int spaceDim=self->getSpaceDimension();
631 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
632 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
633 std::vector<int> elts,eltsIndex;
634 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
635 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
636 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
637 d0->alloc(elts.size(),1);
638 d1->alloc(eltsIndex.size(),1);
639 std::copy(elts.begin(),elts.end(),d0->getPointer());
640 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
641 PyObject *ret=PyTuple_New(2);
642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
643 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
647 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
649 std::vector<int> elts,eltsIndex;
650 int spaceDim=self->getSpaceDimension();
652 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
653 if (!SWIG_IsOK(res1))
656 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
657 int nbOfPoints=size/spaceDim;
660 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
662 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
666 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
668 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
669 da2->checkAllocated();
670 int size=da2->getNumberOfTuples();
671 int nbOfCompo=da2->getNumberOfComponents();
672 if(nbOfCompo!=spaceDim)
674 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
676 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
678 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
679 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
680 d0->alloc(elts.size(),1);
681 d1->alloc(eltsIndex.size(),1);
682 std::copy(elts.begin(),elts.end(),d0->getPointer());
683 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
684 PyObject *ret=PyTuple_New(2);
685 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
686 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
690 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
694 DataArrayDoubleTuple *aa;
695 std::vector<double> bb;
697 int spaceDim=self->getSpaceDimension();
698 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
699 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
700 std::vector<int> elts;
701 self->getCellsContainingPoint(pos,eps,elts);
702 DataArrayInt *ret=DataArrayInt::New();
703 ret->alloc((int)elts.size(),1);
704 std::copy(elts.begin(),elts.end(),ret->getPointer());
705 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
708 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
711 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
712 if (!SWIG_IsOK(res1))
715 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
716 self->renumberCells(tmp,check);
720 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
722 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
723 da2->checkAllocated();
724 self->renumberCells(da2->getConstPointer(),check);
728 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
730 DataArrayInt *cellCor, *nodeCor;
731 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
732 PyObject *res = PyList_New(2);
733 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
734 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
738 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
740 DataArrayInt *cellCor=0,*nodeCor=0;
741 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
742 PyObject *res = PyList_New(2);
743 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
744 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
748 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
750 DataArrayInt *cellCor=0;
751 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
755 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
758 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
759 if (!SWIG_IsOK(res1))
762 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
763 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
767 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
769 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
770 da2->checkAllocated();
771 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
774 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
776 std::vector<int> conn;
777 self->getNodeIdsOfCell(cellId,conn);
778 return convertIntArrToPyList2(conn);
781 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
783 std::vector<double> coo;
784 self->getCoordinatesOfNode(nodeId,coo);
785 return convertDblArrToPyList2(coo);
788 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
792 DataArrayDoubleTuple *aa;
793 std::vector<double> bb;
795 int spaceDim=self->getSpaceDimension();
796 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
797 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
798 self->scale(pointPtr,factor);
801 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
803 int spaceDim=self->getSpaceDimension();
804 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
805 self->getBoundingBox(tmp);
806 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
810 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
813 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
814 PyObject *ret=PyTuple_New(2);
815 PyObject *ret0Py=ret0?Py_True:Py_False;
817 PyTuple_SetItem(ret,0,ret0Py);
818 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
822 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
824 int szArr,sw,iTypppArr;
825 std::vector<int> stdvecTyyppArr;
826 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
827 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
828 if(sw==3)//DataArrayInt
830 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
831 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
832 std::string name=argpt->getName();
834 ret->setName(name.c_str());
836 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
839 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
841 int szArr,sw,iTypppArr;
842 std::vector<int> stdvecTyyppArr;
844 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
845 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
846 if(sw==3)//DataArrayInt
848 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
849 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
850 std::string name=argpt->getName();
852 ret->setName(name.c_str());
855 PyObject *res = PyList_New(2);
856 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
857 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
858 PyList_SetItem(res,0,obj0);
859 PyList_SetItem(res,1,obj1);
863 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
867 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
868 PyObject *res = PyTuple_New(2);
869 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
872 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
874 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
875 PyTuple_SetItem(res,0,obj0);
876 PyTuple_SetItem(res,1,obj1);
880 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
882 std::vector<int> vals=self->getDistributionOfTypes();
883 PyObject *ret=PyList_New((int)vals.size()/3);
884 for(int j=0;j<(int)vals.size()/3;j++)
886 PyObject *ret1=PyList_New(3);
887 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
888 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
889 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
890 PyList_SetItem(ret,j,ret1);
895 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
897 std::vector<int> code;
898 std::vector<const DataArrayInt *> idsPerType;
899 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
900 convertPyToNewIntArr4(li,1,3,code);
901 return self->checkTypeConsistencyAndContig(code,idsPerType);
904 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
906 std::vector<int> code;
907 std::vector<DataArrayInt *> idsInPflPerType;
908 std::vector<DataArrayInt *> idsPerType;
909 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
910 PyObject *ret=PyTuple_New(3);
911 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
912 PyObject *ret1=PyList_New(idsInPflPerType.size());
913 for(std::size_t j=0;j<idsInPflPerType.size();j++)
914 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
915 PyTuple_SetItem(ret,1,ret1);
916 int n=idsPerType.size();
917 PyObject *ret2=PyList_New(n);
919 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
920 PyTuple_SetItem(ret,2,ret2);
924 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
928 DataArrayDoubleTuple *aa;
929 std::vector<double> bb;
931 int spaceDim=self->getSpaceDimension();
932 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
933 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
934 self->translate(vectorPtr);
937 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
939 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
942 DataArrayDoubleTuple *aa;
943 std::vector<double> bb;
945 int spaceDim=self->getSpaceDimension();
946 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
947 self->rotate(centerPtr,0,alpha);
950 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
952 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
955 DataArrayDoubleTuple *aa;
956 std::vector<double> bb;
958 int spaceDim=self->getSpaceDimension();
959 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
960 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
961 self->rotate(centerPtr,vectorPtr,alpha);
964 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
966 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
967 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
968 PyObject *res=PyList_New(result.size());
969 for(int i=0;iL!=result.end(); i++, iL++)
970 PyList_SetItem(res,i,PyInt_FromLong(*iL));
974 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
976 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
977 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
978 return MEDCouplingMesh::MergeMeshes(tmp);
984 %include "NormalizedUnstructuredMesh.hxx"
985 %include "MEDCouplingNatureOfField.hxx"
986 %include "MEDCouplingTimeDiscretization.hxx"
987 %include "MEDCouplingGaussLocalization.hxx"
988 %include "MEDCouplingFieldDiscretization.hxx"
990 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
991 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
992 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
996 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
999 void updateTime() const;
1000 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1001 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1002 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1003 void zipCoords() throw(INTERP_KERNEL::Exception);
1004 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1005 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1006 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1007 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1008 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1009 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1010 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1011 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1012 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1013 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1014 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1015 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1016 virtual DataArrayInt *findBoundaryNodes() const;
1019 std::string __str__() const throw(INTERP_KERNEL::Exception)
1021 return self->simpleRepr();
1024 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1027 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1028 PyObject *res = PyList_New(2);
1029 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1030 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1034 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1036 DataArrayInt *comm, *commIndex;
1037 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1038 PyObject *res = PyList_New(2);
1039 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1040 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1044 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1046 DataArrayDouble *ret1=self->getCoords();
1049 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1052 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1054 int szArr,sw,iTypppArr;
1055 std::vector<int> stdvecTyyppArr;
1056 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1057 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1058 if(sw==3)//DataArrayInt
1060 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1061 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1062 std::string name=argpt->getName();
1064 ret->setName(name.c_str());
1066 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1069 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1071 int szArr,sw,iTypppArr;
1072 std::vector<int> stdvecTyyppArr;
1073 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1074 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1075 if(sw==3)//DataArrayInt
1077 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1078 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1079 std::string name=argpt->getName();
1081 ret->setName(name.c_str());
1083 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1086 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1088 int szArr,sw,iTypppArr;
1089 std::vector<int> stdvecTyyppArr;
1090 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1091 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1092 if(sw==3)//DataArrayInt
1094 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1095 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1096 std::string name=argpt->getName();
1098 ret->setName(name.c_str());
1100 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1103 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1105 int szArr,sw,iTypppArr;
1106 std::vector<int> stdvecTyyppArr;
1107 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1108 self->renumberNodes(tmp,newNbOfNodes);
1111 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1113 int szArr,sw,iTypppArr;
1114 std::vector<int> stdvecTyyppArr;
1115 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1116 self->renumberNodes2(tmp,newNbOfNodes);
1119 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1121 int spaceDim=self->getSpaceDimension();
1123 DataArrayDouble *a,*a2;
1124 DataArrayDoubleTuple *aa,*aa2;
1125 std::vector<double> bb,bb2;
1127 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1128 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1129 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1130 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1131 std::vector<int> nodes;
1132 self->findNodesOnLine(p,v,eps,nodes);
1133 DataArrayInt *ret=DataArrayInt::New();
1134 ret->alloc((int)nodes.size(),1);
1135 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1136 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1138 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1140 int spaceDim=self->getSpaceDimension();
1142 DataArrayDouble *a,*a2;
1143 DataArrayDoubleTuple *aa,*aa2;
1144 std::vector<double> bb,bb2;
1146 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1147 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1148 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1149 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1150 std::vector<int> nodes;
1151 self->findNodesOnPlane(p,v,eps,nodes);
1152 DataArrayInt *ret=DataArrayInt::New();
1153 ret->alloc((int)nodes.size(),1);
1154 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1155 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1158 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1162 DataArrayDoubleTuple *aa;
1163 std::vector<double> bb;
1165 int spaceDim=self->getSpaceDimension();
1166 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1167 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1168 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1169 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1172 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1174 DataArrayInt *c=0,*cI=0;
1178 DataArrayDoubleTuple *aa;
1179 std::vector<double> bb;
1181 int spaceDim=self->getSpaceDimension();
1182 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1183 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1184 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1185 PyObject *ret=PyTuple_New(2);
1186 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1187 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1191 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1193 DataArrayInt *c=0,*cI=0;
1194 int spaceDim=self->getSpaceDimension();
1197 DataArrayDoubleTuple *aa;
1198 std::vector<double> bb;
1201 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1202 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1204 PyObject *ret=PyTuple_New(2);
1205 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1210 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1214 DataArrayDoubleTuple *aa;
1215 std::vector<double> bb;
1217 int spaceDim=self->getSpaceDimension();
1218 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1219 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1221 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1222 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1225 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1229 std::vector<int> multiVal;
1230 std::pair<int, std::pair<int,int> > slic;
1231 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1232 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1236 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1238 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1240 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1242 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1246 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1249 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1250 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1251 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1252 for(int i=0;i<sz;i++)
1253 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1256 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1259 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1261 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1262 std::vector<double> val3;
1263 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1264 "Rotate2DAlg",2,true,nbNodes);
1266 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1267 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1270 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1273 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1274 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1275 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1276 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1277 for(int i=0;i<sz;i++)
1278 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1281 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1284 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1286 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1287 std::vector<double> val3;
1288 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1289 "Rotate3DAlg",3,true,nbNodes);
1291 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1292 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1293 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1298 class MEDCouplingUMeshCell
1301 INTERP_KERNEL::NormalizedCellType getType() const;
1304 std::string __str__() const throw(INTERP_KERNEL::Exception)
1306 return self->repr();
1309 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1312 const int *r=self->getAllConn(ret2);
1313 PyObject *ret=PyTuple_New(ret2);
1314 for(int i=0;i<ret2;i++)
1315 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1321 class MEDCouplingUMeshCellIterator
1328 MEDCouplingUMeshCell *ret=self->nextt();
1330 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1333 PyErr_SetString(PyExc_StopIteration,"No more data.");
1340 class MEDCouplingUMeshCellByTypeIterator
1343 ~MEDCouplingUMeshCellByTypeIterator();
1348 MEDCouplingUMeshCellEntry *ret=self->nextt();
1350 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1353 PyErr_SetString(PyExc_StopIteration,"No more data.");
1360 class MEDCouplingUMeshCellByTypeEntry
1363 ~MEDCouplingUMeshCellByTypeEntry();
1366 MEDCouplingUMeshCellByTypeIterator *__iter__()
1368 return self->iterator();
1373 class MEDCouplingUMeshCellEntry
1376 INTERP_KERNEL::NormalizedCellType getType() const;
1377 int getNumberOfElems() const;
1380 MEDCouplingUMeshCellIterator *__iter__()
1382 return self->iterator();
1387 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1390 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1391 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1392 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1393 void updateTime() const;
1394 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1395 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1396 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1397 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1398 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1399 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1400 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1401 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1402 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1403 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1404 void computeTypes() throw(INTERP_KERNEL::Exception);
1405 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1406 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1408 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1409 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1410 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1411 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1412 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1413 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1414 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1415 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1416 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1417 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1418 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1419 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1420 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1421 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1422 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1423 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1424 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1425 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1426 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1427 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1428 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1429 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1430 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1431 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1432 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1433 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1434 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1435 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1436 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1437 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1438 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1439 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1440 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1441 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1442 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1443 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1444 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1446 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1448 return MEDCouplingUMesh::New();
1451 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1453 return MEDCouplingUMesh::New(meshName,meshDim);
1456 std::string __str__() const throw(INTERP_KERNEL::Exception)
1458 return self->simpleRepr();
1461 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1463 std::ostringstream oss;
1464 self->reprQuickOverview(oss);
1468 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1470 return self->cellIterator();
1473 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1477 std::vector<int> multiVal;
1478 std::pair<int, std::pair<int,int> > slic;
1479 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1480 int nbc=self->getNumberOfCells();
1481 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1488 std::ostringstream oss;
1489 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1490 throw INTERP_KERNEL::Exception(oss.str().c_str());
1493 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1498 int tmp=nbc+singleVal;
1499 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1503 std::ostringstream oss;
1504 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1505 throw INTERP_KERNEL::Exception(oss.str().c_str());
1511 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1515 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1520 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1521 daIntTyypp->checkAllocated();
1522 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1525 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1529 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1533 std::vector<int> multiVal;
1534 std::pair<int, std::pair<int,int> > slic;
1535 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1536 int nbc=self->getNumberOfCells();
1537 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1544 std::ostringstream oss;
1545 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1546 throw INTERP_KERNEL::Exception(oss.str().c_str());
1550 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1557 int tmp=nbc+singleVal;
1558 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1563 std::ostringstream oss;
1564 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1565 throw INTERP_KERNEL::Exception(oss.str().c_str());
1571 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1577 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1578 daIntTyypp->checkAllocated();
1579 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1583 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1587 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1591 std::vector<int> multiVal;
1592 std::pair<int, std::pair<int,int> > slic;
1593 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1594 int nbc=self->getNumberOfCells();
1595 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1602 std::ostringstream oss;
1603 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1604 throw INTERP_KERNEL::Exception(oss.str().c_str());
1608 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1615 int tmp=nbc+singleVal;
1616 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1621 std::ostringstream oss;
1622 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1623 throw INTERP_KERNEL::Exception(oss.str().c_str());
1629 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1634 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1640 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1641 daIntTyypp->checkAllocated();
1642 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1646 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1650 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1652 int szArr,sw,iTypppArr;
1653 std::vector<int> stdvecTyyppArr;
1654 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1657 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1658 throw INTERP_KERNEL::Exception(oss.str().c_str());
1660 self->insertNextCell(type,size,tmp);
1663 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1665 int szArr,sw,iTypppArr;
1666 std::vector<int> stdvecTyyppArr;
1667 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1668 self->insertNextCell(type,szArr,tmp);
1671 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1673 DataArrayInt *ret=self->getNodalConnectivity();
1678 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1680 DataArrayInt *ret=self->getNodalConnectivityIndex();
1685 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1687 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1688 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1689 PyObject *res = PyList_New(result.size());
1690 for (int i=0;iL!=result.end(); i++, iL++)
1691 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1695 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1697 int szArr,sw,iTypppArr;
1698 std::vector<int> stdvecTyyppArr;
1699 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1700 int nbOfDepthPeelingPerformed=0;
1701 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1702 PyObject *res=PyTuple_New(2);
1703 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1704 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1708 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1710 DataArrayInt *v0=0,*v1=0;
1711 self->findCommonCells(compType,startCellId,v0,v1);
1712 PyObject *res = PyList_New(2);
1713 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1714 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1718 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1720 DataArrayInt *v0=0,*v1=0;
1721 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1722 PyObject *res = PyList_New(2);
1723 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1724 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1728 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1732 DataArrayDoubleTuple *aa;
1733 std::vector<double> bb;
1735 int nbOfCompo=self->getSpaceDimension();
1736 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1738 int cellId=-1,nodeId=-1;
1739 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1740 PyObject *ret=PyTuple_New(3);
1741 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1742 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1743 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1747 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1751 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1752 PyObject *res = PyList_New(3);
1753 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1754 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1755 PyList_SetItem(res,2,SWIG_From_int(ret2));
1758 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1762 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1763 PyObject *res = PyList_New(3);
1764 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1765 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1766 PyList_SetItem(res,2,SWIG_From_int(ret2));
1769 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1771 std::vector<int> cells;
1772 self->checkButterflyCells(cells,eps);
1773 DataArrayInt *ret=DataArrayInt::New();
1774 ret->alloc((int)cells.size(),1);
1775 std::copy(cells.begin(),cells.end(),ret->getPointer());
1776 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1779 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1781 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1783 PyObject *ret = PyList_New(sz);
1784 for(int i=0;i<sz;i++)
1785 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1789 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1791 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1792 int sz=retCpp.size();
1793 PyObject *ret=PyList_New(sz);
1794 for(int i=0;i<sz;i++)
1795 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1799 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1802 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1803 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1804 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1807 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1810 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1811 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1815 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1818 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1819 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1823 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1825 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1826 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1827 PyObject *ret=PyTuple_New(3);
1828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1830 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1834 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1836 DataArrayInt *tmp0=0,*tmp1=0;
1837 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1838 PyObject *ret=PyTuple_New(2);
1839 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1840 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1844 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1848 std::vector<int> multiVal;
1849 std::pair<int, std::pair<int,int> > slic;
1850 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1851 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1855 return self->duplicateNodes(&singleVal,&singleVal+1);
1857 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1859 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1861 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1865 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1869 std::vector<int> multiVal;
1870 std::pair<int, std::pair<int,int> > slic;
1871 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1872 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1876 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1878 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1880 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1882 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1886 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1889 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1890 if (!SWIG_IsOK(res1))
1893 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1894 self->renumberNodesInConn(tmp);
1898 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1900 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1901 da2->checkAllocated();
1902 self->renumberNodesInConn(da2->getConstPointer());
1906 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1909 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1910 DataArrayInt *tmp0,*tmp1=0;
1911 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1912 PyObject *ret=PyTuple_New(2);
1913 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1914 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1918 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1920 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1921 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1922 DataArrayInt *ret1=0,*ret2=0;
1923 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1924 PyObject *ret=PyTuple_New(3);
1925 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1926 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1927 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1931 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1933 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1934 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1935 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1936 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1939 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1942 std::vector<const MEDCouplingUMesh *> meshes;
1943 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1944 std::vector<DataArrayInt *> corr;
1945 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1947 PyObject *ret1=PyList_New(sz);
1948 for(int i=0;i<sz;i++)
1949 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1950 PyObject *ret=PyList_New(2);
1951 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1952 PyList_SetItem(ret,1,ret1);
1956 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1958 std::vector<MEDCouplingUMesh *> meshes;
1959 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1960 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1963 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1965 std::vector<MEDCouplingUMesh *> meshes;
1966 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1967 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1970 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1974 std::vector<int> multiVal;
1975 std::pair<int, std::pair<int,int> > slic;
1976 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1978 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1979 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1983 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1985 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1987 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1989 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1993 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1995 DataArrayInt *arrOut=0,*arrIndexOut=0;
1998 std::vector<int> multiVal;
1999 std::pair<int, std::pair<int,int> > slic;
2000 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2002 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2003 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2008 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2013 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2018 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2022 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2024 PyObject *ret=PyTuple_New(2);
2025 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2026 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2030 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2031 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2032 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2034 DataArrayInt *arrOut=0,*arrIndexOut=0;
2037 std::vector<int> multiVal;
2038 std::pair<int, std::pair<int,int> > slic;
2039 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2041 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2042 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2047 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2052 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2057 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2061 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2063 PyObject *ret=PyTuple_New(2);
2064 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2065 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2069 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2070 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2074 std::vector<int> multiVal;
2075 std::pair<int, std::pair<int,int> > slic;
2076 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2078 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2079 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2084 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2089 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2094 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2098 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2102 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2106 DataArrayDoubleTuple *aa;
2107 std::vector<double> bb;
2109 int spaceDim=self->getSpaceDimension();
2110 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2111 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2113 std::vector<int> cells;
2114 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2115 DataArrayInt *ret=DataArrayInt::New();
2116 ret->alloc((int)cells.size(),1);
2117 std::copy(cells.begin(),cells.end(),ret->getPointer());
2118 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2121 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2125 DataArrayDoubleTuple *aa;
2126 std::vector<double> bb;
2128 int spaceDim=self->getSpaceDimension();
2129 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2130 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2131 self->orientCorrectly2DCells(v,polyOnly);
2134 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2136 std::vector<int> cells;
2137 self->arePolyhedronsNotCorrectlyOriented(cells);
2138 DataArrayInt *ret=DataArrayInt::New();
2139 ret->alloc((int)cells.size(),1);
2140 std::copy(cells.begin(),cells.end(),ret->getPointer());
2141 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2144 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2148 self->getFastAveragePlaneOfThis(vec,pos);
2150 std::copy(vec,vec+3,vals);
2151 std::copy(pos,pos+3,vals+3);
2152 return convertDblArrToPyListOfTuple(vals,3,2);
2155 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2157 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2158 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2159 return MEDCouplingUMesh::MergeUMeshes(tmp);
2162 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2165 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2166 PyObject *ret=PyTuple_New(2);
2167 PyObject *ret0Py=ret0?Py_True:Py_False;
2169 PyTuple_SetItem(ret,0,ret0Py);
2170 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2174 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2177 bool ret0=self->areCellsIncludedIn2(other,ret1);
2178 PyObject *ret=PyTuple_New(2);
2179 PyObject *ret0Py=ret0?Py_True:Py_False;
2181 PyTuple_SetItem(ret,0,ret0Py);
2182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2188 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2189 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2190 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2191 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2192 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2193 PyObject *ret=PyTuple_New(5);
2194 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2195 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2197 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2204 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2205 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2206 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2207 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2208 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2209 PyObject *ret=PyTuple_New(5);
2210 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2211 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2220 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2221 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2222 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2223 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2224 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2225 PyObject *ret=PyTuple_New(5);
2226 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2227 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2230 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2234 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2236 DataArrayInt *neighbors=0,*neighborsIdx=0;
2237 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2238 PyObject *ret=PyTuple_New(2);
2239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2246 DataArrayInt *neighbors=0,*neighborsIdx=0;
2247 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2248 PyObject *ret=PyTuple_New(2);
2249 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2250 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2254 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2256 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2257 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2258 DataArrayInt *d2,*d3,*d4,*dd5;
2259 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2260 PyObject *ret=PyTuple_New(7);
2261 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2262 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2263 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2264 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2265 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2266 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2267 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2271 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2273 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2274 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2275 self->getReverseNodalConnectivity(d0,d1);
2276 PyObject *ret=PyTuple_New(2);
2277 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2282 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2285 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2286 da->checkAllocated();
2287 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2290 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2293 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2294 da->checkAllocated();
2295 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2298 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2301 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2302 da->checkAllocated();
2303 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2306 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2309 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2310 da->checkAllocated();
2311 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2312 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2313 PyObject *res = PyList_New(result.size());
2314 for (int i=0;iL!=result.end(); i++, iL++)
2315 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2319 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2322 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2323 da->checkAllocated();
2324 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2325 ret->setName(da->getName().c_str());
2329 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2332 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2333 if (!SWIG_IsOK(res1))
2336 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2337 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2341 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2343 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2344 da2->checkAllocated();
2345 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2349 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2352 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2353 PyObject *ret=PyTuple_New(2);
2354 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2355 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2359 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2361 DataArrayInt *cellNb1=0,*cellNb2=0;
2362 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2363 PyObject *ret=PyTuple_New(3);
2364 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2365 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2366 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2370 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2372 int spaceDim=self->getSpaceDimension();
2374 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2376 DataArrayDouble *a,*a2;
2377 DataArrayDoubleTuple *aa,*aa2;
2378 std::vector<double> bb,bb2;
2380 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2381 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2382 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2383 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2385 DataArrayInt *cellIds=0;
2386 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2387 PyObject *ret=PyTuple_New(2);
2388 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2389 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2393 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2395 int spaceDim=self->getSpaceDimension();
2397 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2399 DataArrayDouble *a,*a2;
2400 DataArrayDoubleTuple *aa,*aa2;
2401 std::vector<double> bb,bb2;
2403 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2404 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2405 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2406 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2408 DataArrayInt *cellIds=0;
2409 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2410 PyObject *ret=PyTuple_New(2);
2411 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2412 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2418 int spaceDim=self->getSpaceDimension();
2420 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2422 DataArrayDouble *a,*a2;
2423 DataArrayDoubleTuple *aa,*aa2;
2424 std::vector<double> bb,bb2;
2426 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2427 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2428 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2429 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2430 return self->getCellIdsCrossingPlane(orig,vect,eps);
2433 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2437 std::vector<int> pos2;
2438 DataArrayInt *pos3=0;
2439 DataArrayIntTuple *pos4=0;
2440 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2445 self->convertToPolyTypes(&pos1,&pos1+1);
2452 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2457 self->convertToPolyTypes(pos3->begin(),pos3->end());
2461 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2465 void convertAllToPoly();
2466 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2467 bool unPolyze() throw(INTERP_KERNEL::Exception);
2468 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2469 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2470 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2473 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2476 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2477 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2478 void updateTime() const throw(INTERP_KERNEL::Exception);
2480 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2482 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2485 std::string __str__() const throw(INTERP_KERNEL::Exception)
2487 return self->simpleRepr();
2490 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2492 std::ostringstream oss;
2493 self->reprQuickOverview(oss);
2497 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2499 MEDCouplingUMesh *ret=self->getMesh2D();
2502 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2504 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2506 MEDCouplingUMesh *ret=self->getMesh1D();
2509 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2511 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2513 DataArrayInt *ret=self->getMesh3DIds();
2516 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2521 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2524 void updateTime() const throw(INTERP_KERNEL::Exception);
2525 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2526 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2529 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2532 static MEDCouplingCMesh *New();
2533 static MEDCouplingCMesh *New(const char *meshName);
2534 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2535 void setCoords(const DataArrayDouble *coordsX,
2536 const DataArrayDouble *coordsY=0,
2537 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2538 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2542 return MEDCouplingCMesh::New();
2544 MEDCouplingCMesh(const char *meshName)
2546 return MEDCouplingCMesh::New(meshName);
2548 std::string __str__() const throw(INTERP_KERNEL::Exception)
2550 return self->simpleRepr();
2552 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2554 std::ostringstream oss;
2555 self->reprQuickOverview(oss);
2558 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2560 DataArrayDouble *ret=self->getCoordsAt(i);
2568 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2571 static MEDCouplingCurveLinearMesh *New();
2572 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2573 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2574 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2575 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2577 MEDCouplingCurveLinearMesh()
2579 return MEDCouplingCurveLinearMesh::New();
2581 MEDCouplingCurveLinearMesh(const char *meshName)
2583 return MEDCouplingCurveLinearMesh::New(meshName);
2585 std::string __str__() const throw(INTERP_KERNEL::Exception)
2587 return self->simpleRepr();
2589 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2591 std::ostringstream oss;
2592 self->reprQuickOverview(oss);
2595 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2597 DataArrayDouble *ret=self->getCoords();
2602 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2604 int szArr,sw,iTypppArr;
2605 std::vector<int> stdvecTyyppArr;
2606 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2607 self->setNodeGridStructure(tmp,tmp+szArr);
2614 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
2616 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
2618 int sz=0,sw=-1,val1=-1;
2619 std::vector<int> val2;
2620 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
2621 return self->clonePart(inp,inp+sz);
2624 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
2626 DataArrayInt *ret1=0;
2628 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
2629 PyObject *res=PyTuple_New(2);
2630 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2632 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2635 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2636 PyTuple_SetItem(res,1,res1);
2641 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2643 std::vector<int> vVal; int iVal=-1;
2645 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
2647 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
2648 DataArrayInt *ret0=0,*ret1=0;
2649 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
2650 PyObject *pyRet=PyTuple_New(2);
2651 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2652 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2657 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
2659 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2660 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2663 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
2665 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2666 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2669 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
2671 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2672 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2675 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
2677 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2678 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2681 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
2683 PyObject *getArrayOfDiscIds() const
2685 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
2688 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2691 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
2693 std::vector<int> ret1;
2694 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
2695 std::size_t sz=ret0.size();
2696 PyObject *pyRet=PyTuple_New(2);
2697 PyObject *pyRet0=PyList_New((int)sz);
2698 PyObject *pyRet1=PyList_New((int)sz);
2699 for(std::size_t i=0;i<sz;i++)
2701 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2702 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
2704 PyTuple_SetItem(pyRet,0,pyRet0);
2705 PyTuple_SetItem(pyRet,1,pyRet1);
2710 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2712 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2715 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2716 PyObject *ret=PyTuple_New(2);
2717 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2718 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2723 namespace ParaMEDMEM
2725 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
2728 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
2729 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
2730 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2731 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2732 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
2733 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
2734 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2735 const char *getDescription() const throw(INTERP_KERNEL::Exception);
2736 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
2737 const char *getName() const throw(INTERP_KERNEL::Exception);
2738 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
2739 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
2740 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
2741 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
2742 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
2743 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
2744 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
2745 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
2746 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
2747 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
2748 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
2749 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
2750 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
2751 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
2752 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
2753 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
2755 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
2757 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
2760 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
2763 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
2765 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
2768 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
2771 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
2773 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
2774 return convertIntArrToPyList3(ret);
2777 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
2780 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
2781 PyObject *ret=PyTuple_New(2);
2782 PyObject *ret0Py=ret0?Py_True:Py_False;
2784 PyTuple_SetItem(ret,0,ret0Py);
2785 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2789 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
2791 DataArrayInt *ret1=0;
2792 MEDCouplingMesh *ret0=0;
2794 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2795 if (!SWIG_IsOK(res1))
2798 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2799 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
2803 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2805 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2806 da2->checkAllocated();
2807 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
2809 PyObject *res = PyList_New(2);
2810 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2811 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2815 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
2817 DataArrayInt *ret1=0;
2819 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
2820 PyObject *res=PyTuple_New(2);
2821 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2823 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2826 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2827 PyTuple_SetItem(res,1,res1);
2832 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
2836 std::vector<int> pos2;
2837 DataArrayInt *pos3=0;
2838 DataArrayIntTuple *pos4=0;
2839 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2844 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
2848 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
2852 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
2855 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
2859 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
2860 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
2863 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2864 if (!SWIG_IsOK(res1))
2867 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2868 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
2872 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2874 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2875 da2->checkAllocated();
2876 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
2880 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
2882 std::vector<int> tmp;
2883 self->getCellIdsHavingGaussLocalization(locId,tmp);
2884 DataArrayInt *ret=DataArrayInt::New();
2885 ret->alloc((int)tmp.size(),1);
2886 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2887 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2892 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
2895 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
2896 static MEDCouplingFieldTemplate *New(TypeOfField type);
2897 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2898 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2899 void updateTime() const;
2902 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
2904 return MEDCouplingFieldTemplate::New(f);
2907 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
2909 return MEDCouplingFieldTemplate::New(type);
2912 std::string __str__() const throw(INTERP_KERNEL::Exception)
2914 return self->simpleRepr();
2917 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2919 std::ostringstream oss;
2920 self->reprQuickOverview(oss);
2926 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
2929 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
2930 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
2931 void setTimeUnit(const char *unit);
2932 const char *getTimeUnit() const;
2933 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
2934 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2935 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2936 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2937 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2938 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
2939 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
2940 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
2941 MEDCouplingFieldDouble *deepCpy() const;
2942 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
2943 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
2944 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2945 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
2946 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
2947 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2948 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2949 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2950 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2951 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2952 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
2953 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2954 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
2955 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
2956 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
2957 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
2958 void setIteration(int it) throw(INTERP_KERNEL::Exception);
2959 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
2960 void setOrder(int order) throw(INTERP_KERNEL::Exception);
2961 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
2962 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
2963 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
2964 void updateTime() const throw(INTERP_KERNEL::Exception);
2965 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2966 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2967 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2968 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2969 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2970 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2971 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
2972 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
2973 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
2974 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
2975 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
2976 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
2977 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
2978 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
2979 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
2980 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
2981 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
2982 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
2983 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
2984 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2985 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2986 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
2987 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2988 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2989 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
2990 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
2991 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
2992 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
2993 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
2994 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2995 double getMaxValue() const throw(INTERP_KERNEL::Exception);
2996 double getMinValue() const throw(INTERP_KERNEL::Exception);
2997 double getAverageValue() const throw(INTERP_KERNEL::Exception);
2998 double norm2() const throw(INTERP_KERNEL::Exception);
2999 double normMax() const throw(INTERP_KERNEL::Exception);
3000 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3001 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3002 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3003 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3004 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3005 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3006 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3007 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3008 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3009 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3010 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3011 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3012 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3013 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3014 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3015 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3016 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3017 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3018 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3019 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3020 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3021 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3023 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3025 return MEDCouplingFieldDouble::New(type,td);
3028 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3030 return MEDCouplingFieldDouble::New(ft,td);
3033 std::string __str__() const throw(INTERP_KERNEL::Exception)
3035 return self->simpleRepr();
3038 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3040 std::ostringstream oss;
3041 self->reprQuickOverview(oss);
3045 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3047 DataArrayDouble *ret=self->getArray();
3053 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3055 std::vector<DataArrayDouble *> arrs=self->getArrays();
3056 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3060 PyObject *ret=PyTuple_New(sz);
3061 for(int i=0;i<sz;i++)
3064 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3066 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3071 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3073 std::vector<const DataArrayDouble *> tmp;
3074 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3076 std::vector<DataArrayDouble *> arrs(sz);
3077 for(int i=0;i<sz;i++)
3078 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3079 self->setArrays(arrs);
3082 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3084 DataArrayDouble *ret=self->getEndArray();
3090 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3094 DataArrayDoubleTuple *aa;
3095 std::vector<double> bb;
3097 const MEDCouplingMesh *mesh=self->getMesh();
3099 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3100 int spaceDim=mesh->getSpaceDimension();
3101 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3102 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3104 int sz=self->getNumberOfComponents();
3105 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3106 self->getValueOn(spaceLoc,res);
3107 return convertDblArrToPyList(res,sz);
3110 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3112 int sz=self->getNumberOfComponents();
3113 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3114 self->getValueOnPos(i,j,k,res);
3115 return convertDblArrToPyList(res,sz);
3118 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3121 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3122 if (!SWIG_IsOK(res1))
3125 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3126 const MEDCouplingMesh *mesh=self->getMesh();
3128 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3129 int spaceDim=mesh->getSpaceDimension();
3130 int nbOfPoints=size/spaceDim;
3131 if(size%spaceDim!=0)
3133 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3135 return self->getValueOnMulti(tmp,nbOfPoints);
3139 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3141 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3142 da2->checkAllocated();
3143 int size=da2->getNumberOfTuples();
3144 int nbOfCompo=da2->getNumberOfComponents();
3145 const MEDCouplingMesh *mesh=self->getMesh();
3147 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3148 if(nbOfCompo!=mesh->getSpaceDimension())
3150 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3152 return self->getValueOnMulti(da2->getConstPointer(),size);
3156 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3160 DataArrayDoubleTuple *aa;
3161 std::vector<double> bb;
3163 const MEDCouplingMesh *mesh=self->getMesh();
3165 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3166 int spaceDim=mesh->getSpaceDimension();
3167 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3168 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3171 int sz=self->getNumberOfComponents();
3172 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3173 self->getValueOn(spaceLoc,time,res);
3174 return convertDblArrToPyList(res,sz);
3177 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
3179 if(self->getArray()!=0)
3182 double *tmp=convertPyToNewDblArr2(li,&sz);
3183 int nbTuples=self->getArray()->getNumberOfTuples();
3184 int nbOfCompo=self->getArray()->getNumberOfComponents();
3185 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
3188 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
3191 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3194 double tmp0=self->getTime(tmp1,tmp2);
3195 PyObject *res = PyList_New(3);
3196 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3197 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3198 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3202 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3205 double tmp0=self->getStartTime(tmp1,tmp2);
3206 PyObject *res = PyList_New(3);
3207 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3208 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3209 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3213 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3216 double tmp0=self->getEndTime(tmp1,tmp2);
3217 PyObject *res = PyList_New(3);
3218 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3219 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3220 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3223 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3225 int sz=self->getNumberOfComponents();
3226 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3227 self->accumulate(tmp);
3228 return convertDblArrToPyList(tmp,sz);
3230 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3232 int sz=self->getNumberOfComponents();
3233 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3234 self->integral(isWAbs,tmp);
3235 return convertDblArrToPyList(tmp,sz);
3237 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3239 int sz=self->getNumberOfComponents();
3240 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3241 self->getWeightedAverageValue(tmp,isWAbs);
3242 return convertDblArrToPyList(tmp,sz);
3244 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3246 int sz=self->getNumberOfComponents();
3247 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3249 return convertDblArrToPyList(tmp,sz);
3251 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3253 int sz=self->getNumberOfComponents();
3254 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3256 return convertDblArrToPyList(tmp,sz);
3258 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3261 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3262 if (!SWIG_IsOK(res1))
3265 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3266 self->renumberCells(tmp,check);
3270 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3272 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3273 da2->checkAllocated();
3274 self->renumberCells(da2->getConstPointer(),check);
3277 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3280 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3281 if (!SWIG_IsOK(res1))
3284 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3285 self->renumberNodes(tmp,eps);
3289 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3291 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3292 da2->checkAllocated();
3293 self->renumberNodes(da2->getConstPointer(),eps);
3297 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3301 std::vector<int> multiVal;
3302 std::pair<int, std::pair<int,int> > slic;
3303 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3304 const MEDCouplingMesh *mesh=self->getMesh();
3306 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3307 int nbc=mesh->getNumberOfCells();
3308 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3315 std::ostringstream oss;
3316 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3317 throw INTERP_KERNEL::Exception(oss.str().c_str());
3320 return self->buildSubPart(&singleVal,&singleVal+1);
3325 int tmp=nbc+singleVal;
3326 return self->buildSubPart(&tmp,&tmp+1);
3330 std::ostringstream oss;
3331 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3332 throw INTERP_KERNEL::Exception(oss.str().c_str());
3338 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3342 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3347 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3348 daIntTyypp->checkAllocated();
3349 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3352 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3356 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3358 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";
3359 if(PyTuple_Check(li))
3361 Py_ssize_t sz=PyTuple_Size(li);
3363 throw INTERP_KERNEL::Exception(msg);
3364 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3367 std::vector<int> multiVal;
3368 std::pair<int, std::pair<int,int> > slic;
3369 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3370 if(!self->getArray())
3371 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3373 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3374 catch(INTERP_KERNEL::Exception& e)
3375 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3376 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3377 DataArrayDouble *ret0Arr=ret0->getArray();
3379 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3384 std::vector<int> v2(1,singleVal);
3385 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(v2);
3386 ret0->setArray(aarr);
3391 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(multiVal);
3392 ret0->setArray(aarr);
3397 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3398 std::vector<int> v2(nbOfComp);
3399 for(int i=0;i<nbOfComp;i++)
3400 v2[i]=slic.first+i*slic.second.second;
3401 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(v2);
3402 ret0->setArray(aarr);
3406 throw INTERP_KERNEL::Exception(msg);
3411 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3414 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3417 double r1=self->getMaxValue2(tmp);
3418 PyObject *ret=PyTuple_New(2);
3419 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3420 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3424 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3427 double r1=self->getMinValue2(tmp);
3428 PyObject *ret=PyTuple_New(2);
3429 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3430 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3434 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3436 std::vector<int> tmp;
3437 convertPyToNewIntArr3(li,tmp);
3438 return self->keepSelectedComponents(tmp);
3441 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3443 std::vector<int> tmp;
3444 convertPyToNewIntArr3(li,tmp);
3445 self->setSelectedComponents(f,tmp);
3448 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3451 DataArrayDouble *a,*a2;
3452 DataArrayDoubleTuple *aa,*aa2;
3453 std::vector<double> bb,bb2;
3456 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3457 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3458 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3459 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3461 return self->extractSlice3D(orig,vect,eps);
3464 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3466 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3469 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3471 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3474 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3476 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.";
3477 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3480 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3482 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3484 return (*self)-(*other);
3486 throw INTERP_KERNEL::Exception(msg);
3491 DataArrayDoubleTuple *aa;
3492 std::vector<double> bb;
3494 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3499 if(!self->getArray())
3500 throw INTERP_KERNEL::Exception(msg2);
3501 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3502 ret->applyLin(1.,-val);
3503 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3504 ret2->setArray(ret);
3509 if(!self->getArray())
3510 throw INTERP_KERNEL::Exception(msg2);
3511 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3512 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3513 ret2->setArray(ret);
3518 if(!self->getArray())
3519 throw INTERP_KERNEL::Exception(msg2);
3520 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3521 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3522 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3523 ret2->setArray(ret);
3528 if(!self->getArray())
3529 throw INTERP_KERNEL::Exception(msg2);
3530 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3531 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3532 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3533 ret2->setArray(ret);
3537 { throw INTERP_KERNEL::Exception(msg); }
3541 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3543 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3546 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3548 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3551 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3553 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3556 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3558 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.";
3559 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3562 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3564 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3566 return (*self)/(*other);
3568 throw INTERP_KERNEL::Exception(msg);
3573 DataArrayDoubleTuple *aa;
3574 std::vector<double> bb;
3576 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3582 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3583 if(!self->getArray())
3584 throw INTERP_KERNEL::Exception(msg2);
3585 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3586 ret->applyLin(1./val,0);
3587 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3588 ret2->setArray(ret);
3593 if(!self->getArray())
3594 throw INTERP_KERNEL::Exception(msg2);
3595 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3596 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3597 ret2->setArray(ret);
3602 if(!self->getArray())
3603 throw INTERP_KERNEL::Exception(msg2);
3604 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3605 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3606 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3607 ret2->setArray(ret);
3612 if(!self->getArray())
3613 throw INTERP_KERNEL::Exception(msg2);
3614 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3615 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3616 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3617 ret2->setArray(ret);
3621 { throw INTERP_KERNEL::Exception(msg); }
3625 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3627 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3630 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3632 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.";
3633 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3636 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3638 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3640 return (*self)^(*other);
3642 throw INTERP_KERNEL::Exception(msg);
3647 DataArrayDoubleTuple *aa;
3648 std::vector<double> bb;
3650 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3655 if(!self->getArray())
3656 throw INTERP_KERNEL::Exception(msg2);
3657 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3659 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3660 ret2->setArray(ret);
3665 if(!self->getArray())
3666 throw INTERP_KERNEL::Exception(msg2);
3667 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3668 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3669 ret2->setArray(ret);
3674 if(!self->getArray())
3675 throw INTERP_KERNEL::Exception(msg2);
3676 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3677 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3678 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3679 ret2->setArray(ret);
3684 if(!self->getArray())
3685 throw INTERP_KERNEL::Exception(msg2);
3686 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3687 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3688 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3689 ret2->setArray(ret);
3693 { throw INTERP_KERNEL::Exception(msg); }
3697 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3699 return self->negate();
3702 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3704 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.";
3705 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3708 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3710 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3714 Py_XINCREF(trueSelf);
3718 throw INTERP_KERNEL::Exception(msg);
3723 DataArrayDoubleTuple *aa;
3724 std::vector<double> bb;
3726 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3731 if(!self->getArray())
3732 throw INTERP_KERNEL::Exception(msg2);
3733 self->getArray()->applyLin(1.,val);
3734 Py_XINCREF(trueSelf);
3739 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3742 Py_XINCREF(trueSelf);
3747 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3748 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3749 ret2->setArray(aaa);
3751 Py_XINCREF(trueSelf);
3756 if(!self->getArray())
3757 throw INTERP_KERNEL::Exception(msg2);
3758 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3759 self->getArray()->addEqual(aaa);
3760 Py_XINCREF(trueSelf);
3764 { throw INTERP_KERNEL::Exception(msg); }
3768 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3770 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.";
3771 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
3774 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3776 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3780 Py_XINCREF(trueSelf);
3784 throw INTERP_KERNEL::Exception(msg);
3789 DataArrayDoubleTuple *aa;
3790 std::vector<double> bb;
3792 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3797 if(!self->getArray())
3798 throw INTERP_KERNEL::Exception(msg2);
3799 self->getArray()->applyLin(1.,-val);
3800 Py_XINCREF(trueSelf);
3805 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3808 Py_XINCREF(trueSelf);
3813 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3814 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3815 ret2->setArray(aaa);
3817 Py_XINCREF(trueSelf);
3822 if(!self->getArray())
3823 throw INTERP_KERNEL::Exception(msg2);
3824 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3825 self->getArray()->substractEqual(aaa);
3826 Py_XINCREF(trueSelf);
3830 { throw INTERP_KERNEL::Exception(msg); }
3834 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3836 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.";
3837 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
3840 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3842 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3846 Py_XINCREF(trueSelf);
3850 throw INTERP_KERNEL::Exception(msg);
3855 DataArrayDoubleTuple *aa;
3856 std::vector<double> bb;
3858 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3863 if(!self->getArray())
3864 throw INTERP_KERNEL::Exception(msg2);
3865 self->getArray()->applyLin(val,0);
3866 Py_XINCREF(trueSelf);
3871 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3874 Py_XINCREF(trueSelf);
3879 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3880 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3881 ret2->setArray(aaa);
3883 Py_XINCREF(trueSelf);
3888 if(!self->getArray())
3889 throw INTERP_KERNEL::Exception(msg2);
3890 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3891 self->getArray()->multiplyEqual(aaa);
3892 Py_XINCREF(trueSelf);
3896 { throw INTERP_KERNEL::Exception(msg); }
3900 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3902 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.";
3903 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
3906 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3908 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3912 Py_XINCREF(trueSelf);
3916 throw INTERP_KERNEL::Exception(msg);
3921 DataArrayDoubleTuple *aa;
3922 std::vector<double> bb;
3924 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3930 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
3931 if(!self->getArray())
3932 throw INTERP_KERNEL::Exception(msg2);
3933 self->getArray()->applyLin(1./val,0);
3934 Py_XINCREF(trueSelf);
3939 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3942 Py_XINCREF(trueSelf);
3947 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3948 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3949 ret2->setArray(aaa);
3951 Py_XINCREF(trueSelf);
3956 if(!self->getArray())
3957 throw INTERP_KERNEL::Exception(msg2);
3958 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3959 self->getArray()->divideEqual(aaa);
3960 Py_XINCREF(trueSelf);
3964 { throw INTERP_KERNEL::Exception(msg); }
3968 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3970 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.";
3971 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
3974 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3976 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3980 Py_XINCREF(trueSelf);
3984 throw INTERP_KERNEL::Exception(msg);
3989 DataArrayDoubleTuple *aa;
3990 std::vector<double> bb;
3992 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3997 if(!self->getArray())
3998 throw INTERP_KERNEL::Exception(msg2);
3999 self->getArray()->applyPow(val);
4000 Py_XINCREF(trueSelf);
4005 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4008 Py_XINCREF(trueSelf);
4013 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4014 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4015 ret2->setArray(aaa);
4017 Py_XINCREF(trueSelf);
4022 if(!self->getArray())
4023 throw INTERP_KERNEL::Exception(msg2);
4024 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4025 self->getArray()->powEqual(aaa);
4026 Py_XINCREF(trueSelf);
4030 { throw INTERP_KERNEL::Exception(msg); }
4034 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4036 std::vector<const MEDCouplingFieldDouble *> tmp;
4037 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4038 return MEDCouplingFieldDouble::MergeFields(tmp);
4041 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4043 std::vector<const MEDCouplingFieldDouble *> tmp;
4044 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4045 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4050 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4053 int getNumberOfFields() const;
4054 MEDCouplingMultiFields *deepCpy() const;
4055 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4056 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4057 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4058 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4059 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4060 void updateTime() const throw(INTERP_KERNEL::Exception);
4063 std::string __str__() const throw(INTERP_KERNEL::Exception)
4065 return self->simpleRepr();
4067 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4069 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4070 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4072 std::vector<MEDCouplingFieldDouble *> fs(sz);
4073 for(int i=0;i<sz;i++)
4074 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4075 return MEDCouplingMultiFields::New(fs);
4077 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4079 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4080 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4082 std::vector<MEDCouplingFieldDouble *> fs(sz);
4083 for(int i=0;i<sz;i++)
4084 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4085 return MEDCouplingMultiFields::New(fs);
4087 PyObject *getFields() const
4089 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4090 int sz=fields.size();
4091 PyObject *res = PyList_New(sz);
4092 for(int i=0;i<sz;i++)
4096 fields[i]->incrRef();
4097 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4101 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4106 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4108 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4112 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4115 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4117 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4119 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4121 PyObject *res = PyList_New(sz);
4122 for(int i=0;i<sz;i++)
4127 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4131 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4136 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4138 std::vector<int> refs;
4139 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4141 PyObject *res = PyList_New(sz);
4142 for(int i=0;i<sz;i++)
4147 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4151 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4155 PyObject *ret=PyTuple_New(2);
4156 PyTuple_SetItem(ret,0,res);
4157 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4160 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4162 std::vector<DataArrayDouble *> ms=self->getArrays();
4164 PyObject *res = PyList_New(sz);
4165 for(int i=0;i<sz;i++)
4170 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4174 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4179 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4181 std::vector< std::vector<int> > refs;
4182 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4184 PyObject *res = PyList_New(sz);
4185 PyObject *res2 = PyList_New(sz);
4186 for(int i=0;i<sz;i++)
4191 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4195 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4197 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4200 PyObject *ret=PyTuple_New(2);
4201 PyTuple_SetItem(ret,0,res);
4202 PyTuple_SetItem(ret,1,res2);
4208 class MEDCouplingDefinitionTime
4211 MEDCouplingDefinitionTime();
4212 void assign(const MEDCouplingDefinitionTime& other);
4213 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4214 double getTimeResolution() const;
4215 std::vector<double> getHotSpotsTime() const;
4218 std::string __str__() const throw(INTERP_KERNEL::Exception)
4220 std::ostringstream oss;
4221 self->appendRepr(oss);
4225 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4227 int meshId,arrId,arrIdInField,fieldId;
4228 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4229 PyObject *res=PyList_New(4);
4230 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4231 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4232 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4233 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4237 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4239 int meshId,arrId,arrIdInField,fieldId;
4240 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4241 PyObject *res=PyList_New(4);
4242 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4243 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4244 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4245 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4251 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4254 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4255 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4259 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4261 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4262 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4264 std::vector<MEDCouplingFieldDouble *> fs(sz);
4265 for(int i=0;i<sz;i++)
4266 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4267 return MEDCouplingFieldOverTime::New(fs);
4269 std::string __str__() const throw(INTERP_KERNEL::Exception)
4271 return self->simpleRepr();
4273 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4275 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4276 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4278 std::vector<MEDCouplingFieldDouble *> fs(sz);
4279 for(int i=0;i<sz;i++)
4280 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4281 return MEDCouplingFieldOverTime::New(fs);
4289 __filename=os.environ.get('PYTHONSTARTUP')
4290 if __filename and os.path.isfile(__filename):
4291 execfile(__filename)