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;
489 %include "MEDCouplingMemArray.i"
496 UNSTRUCTURED_DESC = 6,
500 } MEDCouplingMeshType;
503 class DataArrayDouble;
504 class MEDCouplingUMesh;
505 class MEDCouplingFieldDouble;
507 %extend RefCountObject
509 std::string getHiddenCppPointer() const
511 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
516 %extend MEDCouplingGaussLocalization
518 std::string __str__() const throw(INTERP_KERNEL::Exception)
520 return self->getStringRepr();
523 std::string __repr__() const throw(INTERP_KERNEL::Exception)
525 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
526 oss << self->getStringRepr();
531 class MEDCouplingMesh : public RefCountObject, public TimeLabel
534 void setName(const char *name);
535 const char *getName() const;
536 void setDescription(const char *descr);
537 const char *getDescription() const;
538 void setTime(double val, int iteration, int order);
539 void setTimeUnit(const char *unit);
540 const char *getTimeUnit() const;
541 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
542 bool isStructured() const throw(INTERP_KERNEL::Exception);
543 virtual MEDCouplingMesh *deepCpy() const;
544 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
545 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
546 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
547 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
548 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
549 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
550 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
551 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
552 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
553 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
554 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
555 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
556 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
557 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
558 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
559 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
560 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
561 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
562 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
563 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
564 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
565 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
567 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
568 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
569 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
571 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
572 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
574 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
575 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
577 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
578 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
579 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
582 std::string __str__() const throw(INTERP_KERNEL::Exception)
584 return self->simpleRepr();
587 PyObject *getTime() throw(INTERP_KERNEL::Exception)
590 double tmp0=self->getTime(tmp1,tmp2);
591 PyObject *res = PyList_New(3);
592 PyList_SetItem(res,0,SWIG_From_double(tmp0));
593 PyList_SetItem(res,1,SWIG_From_int(tmp1));
594 PyList_SetItem(res,2,SWIG_From_int(tmp2));
598 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
602 DataArrayDoubleTuple *aa;
603 std::vector<double> bb;
605 int spaceDim=self->getSpaceDimension();
606 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
607 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
608 return self->getCellContainingPoint(pos,eps);
611 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
615 DataArrayDoubleTuple *aa;
616 std::vector<double> bb;
618 int spaceDim=self->getSpaceDimension();
619 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
620 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
621 std::vector<int> elts,eltsIndex;
622 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
623 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
624 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
625 d0->alloc(elts.size(),1);
626 d1->alloc(eltsIndex.size(),1);
627 std::copy(elts.begin(),elts.end(),d0->getPointer());
628 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
629 PyObject *ret=PyTuple_New(2);
630 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
631 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
635 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
637 std::vector<int> elts,eltsIndex;
638 int spaceDim=self->getSpaceDimension();
640 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
641 if (!SWIG_IsOK(res1))
644 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
645 int nbOfPoints=size/spaceDim;
648 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
650 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
654 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
656 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
657 da2->checkAllocated();
658 int size=da2->getNumberOfTuples();
659 int nbOfCompo=da2->getNumberOfComponents();
660 if(nbOfCompo!=spaceDim)
662 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
664 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
666 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
667 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
668 d0->alloc(elts.size(),1);
669 d1->alloc(eltsIndex.size(),1);
670 std::copy(elts.begin(),elts.end(),d0->getPointer());
671 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
672 PyObject *ret=PyTuple_New(2);
673 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
674 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
678 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
682 DataArrayDoubleTuple *aa;
683 std::vector<double> bb;
685 int spaceDim=self->getSpaceDimension();
686 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
687 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
688 std::vector<int> elts;
689 self->getCellsContainingPoint(pos,eps,elts);
690 DataArrayInt *ret=DataArrayInt::New();
691 ret->alloc((int)elts.size(),1);
692 std::copy(elts.begin(),elts.end(),ret->getPointer());
693 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
696 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
699 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
700 if (!SWIG_IsOK(res1))
703 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
704 self->renumberCells(tmp,check);
708 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
710 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
711 da2->checkAllocated();
712 self->renumberCells(da2->getConstPointer(),check);
716 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
718 DataArrayInt *cellCor, *nodeCor;
719 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
720 PyObject *res = PyList_New(2);
721 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
722 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
726 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
728 DataArrayInt *cellCor=0,*nodeCor=0;
729 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
730 PyObject *res = PyList_New(2);
731 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
732 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
736 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
738 DataArrayInt *cellCor=0;
739 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
743 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
746 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
747 if (!SWIG_IsOK(res1))
750 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
751 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
755 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
757 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
758 da2->checkAllocated();
759 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
762 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
764 std::vector<int> conn;
765 self->getNodeIdsOfCell(cellId,conn);
766 return convertIntArrToPyList2(conn);
769 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
771 std::vector<double> coo;
772 self->getCoordinatesOfNode(nodeId,coo);
773 return convertDblArrToPyList2(coo);
776 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
780 DataArrayDoubleTuple *aa;
781 std::vector<double> bb;
783 int spaceDim=self->getSpaceDimension();
784 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
785 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
786 self->scale(pointPtr,factor);
789 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
791 int spaceDim=self->getSpaceDimension();
792 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
793 self->getBoundingBox(tmp);
794 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
798 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
801 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
802 PyObject *ret=PyTuple_New(2);
803 PyObject *ret0Py=ret0?Py_True:Py_False;
805 PyTuple_SetItem(ret,0,ret0Py);
806 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
810 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
812 int szArr,sw,iTypppArr;
813 std::vector<int> stdvecTyyppArr;
814 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
815 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
816 if(sw==3)//DataArrayInt
818 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
819 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
820 std::string name=argpt->getName();
822 ret->setName(name.c_str());
824 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
827 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
829 int szArr,sw,iTypppArr;
830 std::vector<int> stdvecTyyppArr;
832 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
833 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
834 if(sw==3)//DataArrayInt
836 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
837 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
838 std::string name=argpt->getName();
840 ret->setName(name.c_str());
843 PyObject *res = PyList_New(2);
844 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
845 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
846 PyList_SetItem(res,0,obj0);
847 PyList_SetItem(res,1,obj1);
851 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
855 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
856 PyObject *res = PyTuple_New(2);
857 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
860 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
862 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
863 PyTuple_SetItem(res,0,obj0);
864 PyTuple_SetItem(res,1,obj1);
868 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
870 std::vector<int> vals=self->getDistributionOfTypes();
871 PyObject *ret=PyList_New((int)vals.size()/3);
872 for(int j=0;j<(int)vals.size()/3;j++)
874 PyObject *ret1=PyList_New(3);
875 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
876 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
877 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
878 PyList_SetItem(ret,j,ret1);
883 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
885 std::vector<int> code;
886 std::vector<const DataArrayInt *> idsPerType;
887 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
888 convertPyToNewIntArr4(li,1,3,code);
889 return self->checkTypeConsistencyAndContig(code,idsPerType);
892 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
894 std::vector<int> code;
895 std::vector<DataArrayInt *> idsInPflPerType;
896 std::vector<DataArrayInt *> idsPerType;
897 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
898 PyObject *ret=PyTuple_New(3);
899 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
900 PyObject *ret1=PyList_New(idsInPflPerType.size());
901 for(std::size_t j=0;j<idsInPflPerType.size();j++)
902 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
903 PyTuple_SetItem(ret,1,ret1);
904 int n=idsPerType.size();
905 PyObject *ret2=PyList_New(n);
907 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
908 PyTuple_SetItem(ret,2,ret2);
912 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
916 DataArrayDoubleTuple *aa;
917 std::vector<double> bb;
919 int spaceDim=self->getSpaceDimension();
920 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
921 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
922 self->translate(vectorPtr);
925 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
927 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
930 DataArrayDoubleTuple *aa;
931 std::vector<double> bb;
933 int spaceDim=self->getSpaceDimension();
934 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
935 self->rotate(centerPtr,0,alpha);
938 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
940 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
943 DataArrayDoubleTuple *aa;
944 std::vector<double> bb;
946 int spaceDim=self->getSpaceDimension();
947 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
948 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
949 self->rotate(centerPtr,vectorPtr,alpha);
952 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
954 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
955 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
956 PyObject *res=PyList_New(result.size());
957 for(int i=0;iL!=result.end(); i++, iL++)
958 PyList_SetItem(res,i,PyInt_FromLong(*iL));
962 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
964 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
965 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
966 return MEDCouplingMesh::MergeMeshes(tmp);
972 %include "NormalizedUnstructuredMesh.hxx"
973 %include "MEDCouplingNatureOfField.hxx"
974 %include "MEDCouplingTimeDiscretization.hxx"
975 %include "MEDCouplingGaussLocalization.hxx"
976 %include "MEDCouplingFieldDiscretization.hxx"
978 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
979 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
980 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
984 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
987 void updateTime() const;
988 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
989 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
990 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
991 void zipCoords() throw(INTERP_KERNEL::Exception);
992 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
993 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
994 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
995 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
996 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
997 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
998 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
999 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1000 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1001 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1002 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1003 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1004 virtual DataArrayInt *findBoundaryNodes() const;
1007 std::string __str__() const throw(INTERP_KERNEL::Exception)
1009 return self->simpleRepr();
1012 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1015 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1016 PyObject *res = PyList_New(2);
1017 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1018 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1022 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1024 DataArrayInt *comm, *commIndex;
1025 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1026 PyObject *res = PyList_New(2);
1027 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1028 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1032 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1034 DataArrayDouble *ret1=self->getCoords();
1037 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1040 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1042 int szArr,sw,iTypppArr;
1043 std::vector<int> stdvecTyyppArr;
1044 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1045 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1046 if(sw==3)//DataArrayInt
1048 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1049 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1050 std::string name=argpt->getName();
1052 ret->setName(name.c_str());
1054 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1057 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1059 int szArr,sw,iTypppArr;
1060 std::vector<int> stdvecTyyppArr;
1061 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1062 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1063 if(sw==3)//DataArrayInt
1065 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1066 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1067 std::string name=argpt->getName();
1069 ret->setName(name.c_str());
1071 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1074 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1076 int szArr,sw,iTypppArr;
1077 std::vector<int> stdvecTyyppArr;
1078 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1079 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1080 if(sw==3)//DataArrayInt
1082 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1083 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1084 std::string name=argpt->getName();
1086 ret->setName(name.c_str());
1088 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1091 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1093 int szArr,sw,iTypppArr;
1094 std::vector<int> stdvecTyyppArr;
1095 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1096 self->renumberNodes(tmp,newNbOfNodes);
1099 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1101 int szArr,sw,iTypppArr;
1102 std::vector<int> stdvecTyyppArr;
1103 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1104 self->renumberNodes2(tmp,newNbOfNodes);
1107 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1109 int spaceDim=self->getSpaceDimension();
1111 DataArrayDouble *a,*a2;
1112 DataArrayDoubleTuple *aa,*aa2;
1113 std::vector<double> bb,bb2;
1115 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1116 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1117 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1118 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1119 std::vector<int> nodes;
1120 self->findNodesOnLine(p,v,eps,nodes);
1121 DataArrayInt *ret=DataArrayInt::New();
1122 ret->alloc((int)nodes.size(),1);
1123 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1124 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1126 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1128 int spaceDim=self->getSpaceDimension();
1130 DataArrayDouble *a,*a2;
1131 DataArrayDoubleTuple *aa,*aa2;
1132 std::vector<double> bb,bb2;
1134 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1135 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1136 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1137 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1138 std::vector<int> nodes;
1139 self->findNodesOnPlane(p,v,eps,nodes);
1140 DataArrayInt *ret=DataArrayInt::New();
1141 ret->alloc((int)nodes.size(),1);
1142 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1143 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1146 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1150 DataArrayDoubleTuple *aa;
1151 std::vector<double> bb;
1153 int spaceDim=self->getSpaceDimension();
1154 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1155 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1156 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1157 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1160 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1162 DataArrayInt *c=0,*cI=0;
1166 DataArrayDoubleTuple *aa;
1167 std::vector<double> bb;
1169 int spaceDim=self->getSpaceDimension();
1170 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1171 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1172 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1173 PyObject *ret=PyTuple_New(2);
1174 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1175 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1179 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1181 DataArrayInt *c=0,*cI=0;
1182 int spaceDim=self->getSpaceDimension();
1185 DataArrayDoubleTuple *aa;
1186 std::vector<double> bb;
1189 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1190 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1192 PyObject *ret=PyTuple_New(2);
1193 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1198 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1202 DataArrayDoubleTuple *aa;
1203 std::vector<double> bb;
1205 int spaceDim=self->getSpaceDimension();
1206 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1207 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1209 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1210 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1213 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1217 std::vector<int> multiVal;
1218 std::pair<int, std::pair<int,int> > slic;
1219 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1220 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1224 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1226 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1228 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1230 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1234 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1237 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1238 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1239 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1240 for(int i=0;i<sz;i++)
1241 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1244 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1247 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1249 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1250 std::vector<double> val3;
1251 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1252 "Rotate2DAlg",2,true,nbNodes);
1254 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1255 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1258 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1261 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1262 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1263 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1264 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1265 for(int i=0;i<sz;i++)
1266 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1269 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1272 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1274 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1275 std::vector<double> val3;
1276 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1277 "Rotate3DAlg",3,true,nbNodes);
1279 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1280 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1281 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1286 class MEDCouplingUMeshCell
1289 INTERP_KERNEL::NormalizedCellType getType() const;
1292 std::string __str__() const throw(INTERP_KERNEL::Exception)
1294 return self->repr();
1297 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1300 const int *r=self->getAllConn(ret2);
1301 PyObject *ret=PyTuple_New(ret2);
1302 for(int i=0;i<ret2;i++)
1303 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1309 class MEDCouplingUMeshCellIterator
1316 MEDCouplingUMeshCell *ret=self->nextt();
1318 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1321 PyErr_SetString(PyExc_StopIteration,"No more data.");
1328 class MEDCouplingUMeshCellByTypeIterator
1331 ~MEDCouplingUMeshCellByTypeIterator();
1336 MEDCouplingUMeshCellEntry *ret=self->nextt();
1338 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1341 PyErr_SetString(PyExc_StopIteration,"No more data.");
1348 class MEDCouplingUMeshCellByTypeEntry
1351 ~MEDCouplingUMeshCellByTypeEntry();
1354 MEDCouplingUMeshCellByTypeIterator *__iter__()
1356 return self->iterator();
1361 class MEDCouplingUMeshCellEntry
1364 INTERP_KERNEL::NormalizedCellType getType() const;
1365 int getNumberOfElems() const;
1368 MEDCouplingUMeshCellIterator *__iter__()
1370 return self->iterator();
1375 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1378 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1379 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1380 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1381 void updateTime() const;
1382 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1383 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1384 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1385 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1386 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1387 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1388 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1389 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1390 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1391 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1392 void computeTypes() throw(INTERP_KERNEL::Exception);
1393 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1394 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1396 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1397 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1398 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1399 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1400 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1401 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1402 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1403 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1404 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1405 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1406 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1407 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1408 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1409 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1410 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1411 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1412 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1413 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1414 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1415 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1416 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1417 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1418 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1419 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1420 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1421 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1422 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1423 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1424 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1425 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1426 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1427 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1428 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1429 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1430 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1431 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1432 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1434 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1436 return MEDCouplingUMesh::New();
1439 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1441 return MEDCouplingUMesh::New(meshName,meshDim);
1444 std::string __str__() const throw(INTERP_KERNEL::Exception)
1446 return self->simpleRepr();
1449 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1451 std::ostringstream oss;
1452 self->reprQuickOverview(oss);
1456 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1458 return self->cellIterator();
1461 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1465 std::vector<int> multiVal;
1466 std::pair<int, std::pair<int,int> > slic;
1467 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1468 int nbc=self->getNumberOfCells();
1469 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1476 std::ostringstream oss;
1477 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1478 throw INTERP_KERNEL::Exception(oss.str().c_str());
1481 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1486 int tmp=nbc+singleVal;
1487 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1491 std::ostringstream oss;
1492 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1493 throw INTERP_KERNEL::Exception(oss.str().c_str());
1499 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1503 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1508 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1509 daIntTyypp->checkAllocated();
1510 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1513 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1517 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1521 std::vector<int> multiVal;
1522 std::pair<int, std::pair<int,int> > slic;
1523 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1524 int nbc=self->getNumberOfCells();
1525 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1532 std::ostringstream oss;
1533 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1534 throw INTERP_KERNEL::Exception(oss.str().c_str());
1538 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1545 int tmp=nbc+singleVal;
1546 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1551 std::ostringstream oss;
1552 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1553 throw INTERP_KERNEL::Exception(oss.str().c_str());
1559 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1565 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1566 daIntTyypp->checkAllocated();
1567 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1571 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1575 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1579 std::vector<int> multiVal;
1580 std::pair<int, std::pair<int,int> > slic;
1581 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1582 int nbc=self->getNumberOfCells();
1583 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1590 std::ostringstream oss;
1591 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1592 throw INTERP_KERNEL::Exception(oss.str().c_str());
1596 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1603 int tmp=nbc+singleVal;
1604 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1609 std::ostringstream oss;
1610 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1611 throw INTERP_KERNEL::Exception(oss.str().c_str());
1617 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1622 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1628 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1629 daIntTyypp->checkAllocated();
1630 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1634 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1638 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1640 int szArr,sw,iTypppArr;
1641 std::vector<int> stdvecTyyppArr;
1642 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1645 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1646 throw INTERP_KERNEL::Exception(oss.str().c_str());
1648 self->insertNextCell(type,size,tmp);
1651 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1653 int szArr,sw,iTypppArr;
1654 std::vector<int> stdvecTyyppArr;
1655 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1656 self->insertNextCell(type,szArr,tmp);
1659 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1661 DataArrayInt *ret=self->getNodalConnectivity();
1666 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1668 DataArrayInt *ret=self->getNodalConnectivityIndex();
1673 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1675 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1676 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1677 PyObject *res = PyList_New(result.size());
1678 for (int i=0;iL!=result.end(); i++, iL++)
1679 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1683 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1685 int szArr,sw,iTypppArr;
1686 std::vector<int> stdvecTyyppArr;
1687 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1688 int nbOfDepthPeelingPerformed=0;
1689 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1690 PyObject *res=PyTuple_New(2);
1691 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1692 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1696 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1698 DataArrayInt *v0=0,*v1=0;
1699 self->findCommonCells(compType,startCellId,v0,v1);
1700 PyObject *res = PyList_New(2);
1701 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1702 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1706 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1708 DataArrayInt *v0=0,*v1=0;
1709 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1710 PyObject *res = PyList_New(2);
1711 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1712 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1716 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1720 DataArrayDoubleTuple *aa;
1721 std::vector<double> bb;
1723 int nbOfCompo=self->getSpaceDimension();
1724 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1726 int cellId=-1,nodeId=-1;
1727 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1728 PyObject *ret=PyTuple_New(3);
1729 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1730 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1731 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1735 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1739 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1740 PyObject *res = PyList_New(3);
1741 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1742 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1743 PyList_SetItem(res,2,SWIG_From_int(ret2));
1746 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1750 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1751 PyObject *res = PyList_New(3);
1752 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1753 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1754 PyList_SetItem(res,2,SWIG_From_int(ret2));
1757 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1759 std::vector<int> cells;
1760 self->checkButterflyCells(cells,eps);
1761 DataArrayInt *ret=DataArrayInt::New();
1762 ret->alloc((int)cells.size(),1);
1763 std::copy(cells.begin(),cells.end(),ret->getPointer());
1764 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1767 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1769 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1771 PyObject *ret = PyList_New(sz);
1772 for(int i=0;i<sz;i++)
1773 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1777 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1779 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1780 int sz=retCpp.size();
1781 PyObject *ret=PyList_New(sz);
1782 for(int i=0;i<sz;i++)
1783 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1787 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1790 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1791 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1792 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1795 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1798 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1799 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1803 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1806 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1807 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1811 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1813 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1814 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1815 PyObject *ret=PyTuple_New(3);
1816 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1817 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1818 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1822 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1824 DataArrayInt *tmp0=0,*tmp1=0;
1825 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1826 PyObject *ret=PyTuple_New(2);
1827 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1828 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1832 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1836 std::vector<int> multiVal;
1837 std::pair<int, std::pair<int,int> > slic;
1838 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1839 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1843 return self->duplicateNodes(&singleVal,&singleVal+1);
1845 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1847 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1849 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1853 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1857 std::vector<int> multiVal;
1858 std::pair<int, std::pair<int,int> > slic;
1859 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1860 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1864 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1866 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1868 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1870 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1874 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1877 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1878 if (!SWIG_IsOK(res1))
1881 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1882 self->renumberNodesInConn(tmp);
1886 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1888 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1889 da2->checkAllocated();
1890 self->renumberNodesInConn(da2->getConstPointer());
1894 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1897 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1898 DataArrayInt *tmp0,*tmp1=0;
1899 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1900 PyObject *ret=PyTuple_New(2);
1901 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1902 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1906 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1908 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1909 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1910 DataArrayInt *ret1=0,*ret2=0;
1911 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1912 PyObject *ret=PyTuple_New(3);
1913 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1914 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1915 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1919 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1921 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1922 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1923 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1924 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1927 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1930 std::vector<const MEDCouplingUMesh *> meshes;
1931 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1932 std::vector<DataArrayInt *> corr;
1933 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1935 PyObject *ret1=PyList_New(sz);
1936 for(int i=0;i<sz;i++)
1937 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1938 PyObject *ret=PyList_New(2);
1939 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1940 PyList_SetItem(ret,1,ret1);
1944 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1946 std::vector<MEDCouplingUMesh *> meshes;
1947 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1948 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1951 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1953 std::vector<MEDCouplingUMesh *> meshes;
1954 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1955 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1958 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1962 std::vector<int> multiVal;
1963 std::pair<int, std::pair<int,int> > slic;
1964 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1966 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1967 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1971 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1973 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1975 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1977 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1981 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1983 DataArrayInt *arrOut=0,*arrIndexOut=0;
1986 std::vector<int> multiVal;
1987 std::pair<int, std::pair<int,int> > slic;
1988 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1990 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1991 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1996 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2001 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2006 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2010 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2012 PyObject *ret=PyTuple_New(2);
2013 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2014 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2018 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2019 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2020 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2022 DataArrayInt *arrOut=0,*arrIndexOut=0;
2025 std::vector<int> multiVal;
2026 std::pair<int, std::pair<int,int> > slic;
2027 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2029 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2030 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2035 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2040 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2045 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2049 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2051 PyObject *ret=PyTuple_New(2);
2052 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2053 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2057 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2058 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2062 std::vector<int> multiVal;
2063 std::pair<int, std::pair<int,int> > slic;
2064 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2066 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2067 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2072 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2077 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2082 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2086 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2090 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2094 DataArrayDoubleTuple *aa;
2095 std::vector<double> bb;
2097 int spaceDim=self->getSpaceDimension();
2098 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2099 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2101 std::vector<int> cells;
2102 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2103 DataArrayInt *ret=DataArrayInt::New();
2104 ret->alloc((int)cells.size(),1);
2105 std::copy(cells.begin(),cells.end(),ret->getPointer());
2106 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2109 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2113 DataArrayDoubleTuple *aa;
2114 std::vector<double> bb;
2116 int spaceDim=self->getSpaceDimension();
2117 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2118 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2119 self->orientCorrectly2DCells(v,polyOnly);
2122 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2124 std::vector<int> cells;
2125 self->arePolyhedronsNotCorrectlyOriented(cells);
2126 DataArrayInt *ret=DataArrayInt::New();
2127 ret->alloc((int)cells.size(),1);
2128 std::copy(cells.begin(),cells.end(),ret->getPointer());
2129 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2132 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2136 self->getFastAveragePlaneOfThis(vec,pos);
2138 std::copy(vec,vec+3,vals);
2139 std::copy(pos,pos+3,vals+3);
2140 return convertDblArrToPyListOfTuple(vals,3,2);
2143 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2145 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2146 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2147 return MEDCouplingUMesh::MergeUMeshes(tmp);
2150 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2153 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2154 PyObject *ret=PyTuple_New(2);
2155 PyObject *ret0Py=ret0?Py_True:Py_False;
2157 PyTuple_SetItem(ret,0,ret0Py);
2158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2165 bool ret0=self->areCellsIncludedIn2(other,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 *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2176 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2177 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2178 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2179 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2180 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2181 PyObject *ret=PyTuple_New(5);
2182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2185 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2192 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2193 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2194 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2195 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2196 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2197 PyObject *ret=PyTuple_New(5);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2201 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2208 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2209 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2210 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2211 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2212 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2213 PyObject *ret=PyTuple_New(5);
2214 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2215 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2217 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2224 DataArrayInt *neighbors=0,*neighborsIdx=0;
2225 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2226 PyObject *ret=PyTuple_New(2);
2227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2234 DataArrayInt *neighbors=0,*neighborsIdx=0;
2235 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2236 PyObject *ret=PyTuple_New(2);
2237 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2242 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2244 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2245 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2246 DataArrayInt *d2,*d3,*d4,*dd5;
2247 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2248 PyObject *ret=PyTuple_New(7);
2249 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2250 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2251 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2252 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2253 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2254 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2255 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2261 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2262 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2263 self->getReverseNodalConnectivity(d0,d1);
2264 PyObject *ret=PyTuple_New(2);
2265 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2266 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2270 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2273 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2274 da->checkAllocated();
2275 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2278 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2281 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2282 da->checkAllocated();
2283 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2286 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2289 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2290 da->checkAllocated();
2291 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2294 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2297 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2298 da->checkAllocated();
2299 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2300 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2301 PyObject *res = PyList_New(result.size());
2302 for (int i=0;iL!=result.end(); i++, iL++)
2303 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2307 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2310 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2311 da->checkAllocated();
2312 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2313 ret->setName(da->getName().c_str());
2317 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2320 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2321 if (!SWIG_IsOK(res1))
2324 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2325 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2329 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2331 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2332 da2->checkAllocated();
2333 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2337 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2340 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2347 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2349 DataArrayInt *cellNb1=0,*cellNb2=0;
2350 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2351 PyObject *ret=PyTuple_New(3);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2360 int spaceDim=self->getSpaceDimension();
2362 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2364 DataArrayDouble *a,*a2;
2365 DataArrayDoubleTuple *aa,*aa2;
2366 std::vector<double> bb,bb2;
2368 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2369 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2370 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2371 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2373 DataArrayInt *cellIds=0;
2374 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2375 PyObject *ret=PyTuple_New(2);
2376 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2377 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2381 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2383 int spaceDim=self->getSpaceDimension();
2385 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2387 DataArrayDouble *a,*a2;
2388 DataArrayDoubleTuple *aa,*aa2;
2389 std::vector<double> bb,bb2;
2391 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2392 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2393 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2394 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2396 DataArrayInt *cellIds=0;
2397 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2398 PyObject *ret=PyTuple_New(2);
2399 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2400 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2404 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2406 int spaceDim=self->getSpaceDimension();
2408 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2410 DataArrayDouble *a,*a2;
2411 DataArrayDoubleTuple *aa,*aa2;
2412 std::vector<double> bb,bb2;
2414 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2415 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2416 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2417 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2418 return self->getCellIdsCrossingPlane(orig,vect,eps);
2421 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2425 std::vector<int> pos2;
2426 DataArrayInt *pos3=0;
2427 DataArrayIntTuple *pos4=0;
2428 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2433 self->convertToPolyTypes(&pos1,&pos1+1);
2440 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2445 self->convertToPolyTypes(pos3->begin(),pos3->end());
2449 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2453 void convertAllToPoly();
2454 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2455 bool unPolyze() throw(INTERP_KERNEL::Exception);
2456 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2457 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2458 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2461 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2464 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2465 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2466 void updateTime() const throw(INTERP_KERNEL::Exception);
2468 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2470 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2473 std::string __str__() const throw(INTERP_KERNEL::Exception)
2475 return self->simpleRepr();
2478 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2480 std::ostringstream oss;
2481 self->reprQuickOverview(oss);
2485 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2487 MEDCouplingUMesh *ret=self->getMesh2D();
2490 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2492 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2494 MEDCouplingUMesh *ret=self->getMesh1D();
2497 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2499 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2501 DataArrayInt *ret=self->getMesh3DIds();
2504 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2509 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2512 void updateTime() const throw(INTERP_KERNEL::Exception);
2513 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2514 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2517 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2520 static MEDCouplingCMesh *New();
2521 static MEDCouplingCMesh *New(const char *meshName);
2522 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2523 void setCoords(const DataArrayDouble *coordsX,
2524 const DataArrayDouble *coordsY=0,
2525 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2526 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2530 return MEDCouplingCMesh::New();
2532 MEDCouplingCMesh(const char *meshName)
2534 return MEDCouplingCMesh::New(meshName);
2536 std::string __str__() const throw(INTERP_KERNEL::Exception)
2538 return self->simpleRepr();
2540 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2542 std::ostringstream oss;
2543 self->reprQuickOverview(oss);
2546 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2548 DataArrayDouble *ret=self->getCoordsAt(i);
2556 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2559 static MEDCouplingCurveLinearMesh *New();
2560 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2561 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2562 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2563 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2565 MEDCouplingCurveLinearMesh()
2567 return MEDCouplingCurveLinearMesh::New();
2569 MEDCouplingCurveLinearMesh(const char *meshName)
2571 return MEDCouplingCurveLinearMesh::New(meshName);
2573 std::string __str__() const throw(INTERP_KERNEL::Exception)
2575 return self->simpleRepr();
2577 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2579 std::ostringstream oss;
2580 self->reprQuickOverview(oss);
2583 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2585 DataArrayDouble *ret=self->getCoords();
2590 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2592 int szArr,sw,iTypppArr;
2593 std::vector<int> stdvecTyyppArr;
2594 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2595 self->setNodeGridStructure(tmp,tmp+szArr);
2602 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
2604 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
2606 int sz=0,sw=-1,val1=-1;
2607 std::vector<int> val2;
2608 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
2609 return self->clonePart(inp,inp+sz);
2612 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
2614 DataArrayInt *ret1=0;
2616 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
2617 PyObject *res=PyTuple_New(2);
2618 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2623 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2624 PyTuple_SetItem(res,1,res1);
2629 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2631 std::vector<int> vVal; int iVal=-1;
2633 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
2635 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
2636 DataArrayInt *ret0=0,*ret1=0;
2637 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
2638 PyObject *pyRet=PyTuple_New(2);
2639 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
2647 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2648 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2651 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
2653 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2654 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2657 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
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::MEDCouplingFieldDiscretizationGaussNE
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::MEDCouplingFieldDiscretizationPerCell
2671 PyObject *getArrayOfDiscIds() const
2673 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
2676 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2679 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
2681 std::vector<int> ret1;
2682 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
2683 std::size_t sz=ret0.size();
2684 PyObject *pyRet=PyTuple_New(2);
2685 PyObject *pyRet0=PyList_New((int)sz);
2686 PyObject *pyRet1=PyList_New((int)sz);
2687 for(std::size_t i=0;i<sz;i++)
2689 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2690 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
2692 PyTuple_SetItem(pyRet,0,pyRet0);
2693 PyTuple_SetItem(pyRet,1,pyRet1);
2698 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2700 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2703 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2704 PyObject *ret=PyTuple_New(2);
2705 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2706 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2711 namespace ParaMEDMEM
2713 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
2716 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
2717 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
2718 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2719 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2720 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
2721 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
2722 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2723 const char *getDescription() const throw(INTERP_KERNEL::Exception);
2724 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
2725 const char *getName() const throw(INTERP_KERNEL::Exception);
2726 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
2727 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
2728 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
2729 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
2730 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
2731 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
2732 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
2733 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
2734 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
2735 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
2736 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
2737 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
2738 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
2739 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
2740 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
2741 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
2743 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
2745 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
2748 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
2751 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
2753 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
2756 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
2759 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
2761 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
2762 return convertIntArrToPyList3(ret);
2765 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
2768 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
2769 PyObject *ret=PyTuple_New(2);
2770 PyObject *ret0Py=ret0?Py_True:Py_False;
2772 PyTuple_SetItem(ret,0,ret0Py);
2773 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2777 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
2779 DataArrayInt *ret1=0;
2780 MEDCouplingMesh *ret0=0;
2782 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2783 if (!SWIG_IsOK(res1))
2786 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2787 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
2791 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2793 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2794 da2->checkAllocated();
2795 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
2797 PyObject *res = PyList_New(2);
2798 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2799 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2803 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
2805 DataArrayInt *ret1=0;
2807 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
2808 PyObject *res=PyTuple_New(2);
2809 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2811 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2814 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2815 PyTuple_SetItem(res,1,res1);
2820 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
2824 std::vector<int> pos2;
2825 DataArrayInt *pos3=0;
2826 DataArrayIntTuple *pos4=0;
2827 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2832 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
2836 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
2840 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
2843 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
2847 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
2848 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
2851 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2852 if (!SWIG_IsOK(res1))
2855 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2856 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
2860 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2862 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2863 da2->checkAllocated();
2864 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
2868 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
2870 std::vector<int> tmp;
2871 self->getCellIdsHavingGaussLocalization(locId,tmp);
2872 DataArrayInt *ret=DataArrayInt::New();
2873 ret->alloc((int)tmp.size(),1);
2874 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2875 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2880 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
2883 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
2884 static MEDCouplingFieldTemplate *New(TypeOfField type);
2885 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2886 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2887 void updateTime() const;
2890 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
2892 return MEDCouplingFieldTemplate::New(f);
2895 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
2897 return MEDCouplingFieldTemplate::New(type);
2900 std::string __str__() const throw(INTERP_KERNEL::Exception)
2902 return self->simpleRepr();
2905 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2907 std::ostringstream oss;
2908 self->reprQuickOverview(oss);
2914 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
2917 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
2918 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
2919 void setTimeUnit(const char *unit);
2920 const char *getTimeUnit() const;
2921 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
2922 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2923 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2924 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2925 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2926 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
2927 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
2928 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
2929 MEDCouplingFieldDouble *deepCpy() const;
2930 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
2931 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
2932 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2933 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
2934 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
2935 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2936 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2937 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2938 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2939 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2940 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
2941 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2942 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
2943 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
2944 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
2945 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
2946 void setIteration(int it) throw(INTERP_KERNEL::Exception);
2947 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
2948 void setOrder(int order) throw(INTERP_KERNEL::Exception);
2949 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
2950 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
2951 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
2952 void updateTime() const throw(INTERP_KERNEL::Exception);
2953 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2954 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2955 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2956 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2957 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2958 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2959 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
2960 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
2961 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
2962 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
2963 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
2964 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
2965 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
2966 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
2967 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
2968 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
2969 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
2970 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
2971 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
2972 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2973 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2974 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
2975 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2976 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
2977 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
2978 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
2979 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
2980 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
2981 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
2982 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
2983 double getMaxValue() const throw(INTERP_KERNEL::Exception);
2984 double getMinValue() const throw(INTERP_KERNEL::Exception);
2985 double getAverageValue() const throw(INTERP_KERNEL::Exception);
2986 double norm2() const throw(INTERP_KERNEL::Exception);
2987 double normMax() const throw(INTERP_KERNEL::Exception);
2988 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
2989 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
2990 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
2991 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
2992 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
2993 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
2994 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
2995 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
2996 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
2997 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
2998 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
2999 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3000 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3001 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3002 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3003 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3004 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3005 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3006 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3007 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3008 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3009 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3011 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3013 return MEDCouplingFieldDouble::New(type,td);
3016 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3018 return MEDCouplingFieldDouble::New(ft,td);
3021 std::string __str__() const throw(INTERP_KERNEL::Exception)
3023 return self->simpleRepr();
3026 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3028 std::ostringstream oss;
3029 self->reprQuickOverview(oss);
3033 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3035 DataArrayDouble *ret=self->getArray();
3041 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3043 std::vector<DataArrayDouble *> arrs=self->getArrays();
3044 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3048 PyObject *ret=PyTuple_New(sz);
3049 for(int i=0;i<sz;i++)
3052 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3054 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3059 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3061 std::vector<const DataArrayDouble *> tmp;
3062 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3064 std::vector<DataArrayDouble *> arrs(sz);
3065 for(int i=0;i<sz;i++)
3066 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3067 self->setArrays(arrs);
3070 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3072 DataArrayDouble *ret=self->getEndArray();
3078 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3082 DataArrayDoubleTuple *aa;
3083 std::vector<double> bb;
3085 const MEDCouplingMesh *mesh=self->getMesh();
3087 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3088 int spaceDim=mesh->getSpaceDimension();
3089 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3090 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3092 int sz=self->getNumberOfComponents();
3093 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3094 self->getValueOn(spaceLoc,res);
3095 return convertDblArrToPyList(res,sz);
3098 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3100 int sz=self->getNumberOfComponents();
3101 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3102 self->getValueOnPos(i,j,k,res);
3103 return convertDblArrToPyList(res,sz);
3106 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3109 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3110 if (!SWIG_IsOK(res1))
3113 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3114 const MEDCouplingMesh *mesh=self->getMesh();
3116 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3117 int spaceDim=mesh->getSpaceDimension();
3118 int nbOfPoints=size/spaceDim;
3119 if(size%spaceDim!=0)
3121 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3123 return self->getValueOnMulti(tmp,nbOfPoints);
3127 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3129 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3130 da2->checkAllocated();
3131 int size=da2->getNumberOfTuples();
3132 int nbOfCompo=da2->getNumberOfComponents();
3133 const MEDCouplingMesh *mesh=self->getMesh();
3135 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3136 if(nbOfCompo!=mesh->getSpaceDimension())
3138 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3140 return self->getValueOnMulti(da2->getConstPointer(),size);
3144 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3148 DataArrayDoubleTuple *aa;
3149 std::vector<double> bb;
3151 const MEDCouplingMesh *mesh=self->getMesh();
3153 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3154 int spaceDim=mesh->getSpaceDimension();
3155 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3156 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3159 int sz=self->getNumberOfComponents();
3160 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3161 self->getValueOn(spaceLoc,time,res);
3162 return convertDblArrToPyList(res,sz);
3165 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
3167 if(self->getArray()!=0)
3170 double *tmp=convertPyToNewDblArr2(li,&sz);
3171 int nbTuples=self->getArray()->getNumberOfTuples();
3172 int nbOfCompo=self->getArray()->getNumberOfComponents();
3173 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
3176 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
3179 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3182 double tmp0=self->getTime(tmp1,tmp2);
3183 PyObject *res = PyList_New(3);
3184 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3185 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3186 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3190 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3193 double tmp0=self->getStartTime(tmp1,tmp2);
3194 PyObject *res = PyList_New(3);
3195 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3196 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3197 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3201 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3204 double tmp0=self->getEndTime(tmp1,tmp2);
3205 PyObject *res = PyList_New(3);
3206 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3207 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3208 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3211 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3213 int sz=self->getNumberOfComponents();
3214 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3215 self->accumulate(tmp);
3216 return convertDblArrToPyList(tmp,sz);
3218 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3220 int sz=self->getNumberOfComponents();
3221 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3222 self->integral(isWAbs,tmp);
3223 return convertDblArrToPyList(tmp,sz);
3225 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3227 int sz=self->getNumberOfComponents();
3228 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3229 self->getWeightedAverageValue(tmp,isWAbs);
3230 return convertDblArrToPyList(tmp,sz);
3232 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3234 int sz=self->getNumberOfComponents();
3235 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3237 return convertDblArrToPyList(tmp,sz);
3239 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3241 int sz=self->getNumberOfComponents();
3242 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3244 return convertDblArrToPyList(tmp,sz);
3246 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3249 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3250 if (!SWIG_IsOK(res1))
3253 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3254 self->renumberCells(tmp,check);
3258 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3260 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3261 da2->checkAllocated();
3262 self->renumberCells(da2->getConstPointer(),check);
3265 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3268 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3269 if (!SWIG_IsOK(res1))
3272 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3273 self->renumberNodes(tmp,eps);
3277 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3279 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3280 da2->checkAllocated();
3281 self->renumberNodes(da2->getConstPointer(),eps);
3285 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3289 std::vector<int> multiVal;
3290 std::pair<int, std::pair<int,int> > slic;
3291 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3292 const MEDCouplingMesh *mesh=self->getMesh();
3294 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3295 int nbc=mesh->getNumberOfCells();
3296 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3303 std::ostringstream oss;
3304 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3305 throw INTERP_KERNEL::Exception(oss.str().c_str());
3308 return self->buildSubPart(&singleVal,&singleVal+1);
3313 int tmp=nbc+singleVal;
3314 return self->buildSubPart(&tmp,&tmp+1);
3318 std::ostringstream oss;
3319 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3320 throw INTERP_KERNEL::Exception(oss.str().c_str());
3326 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3330 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3335 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3336 daIntTyypp->checkAllocated();
3337 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3340 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3344 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3346 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";
3347 if(PyTuple_Check(li))
3349 Py_ssize_t sz=PyTuple_Size(li);
3351 throw INTERP_KERNEL::Exception(msg);
3352 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3355 std::vector<int> multiVal;
3356 std::pair<int, std::pair<int,int> > slic;
3357 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3358 if(!self->getArray())
3359 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3361 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3362 catch(INTERP_KERNEL::Exception& e)
3363 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3364 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3365 DataArrayDouble *ret0Arr=ret0->getArray();
3367 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3372 std::vector<int> v2(1,singleVal);
3373 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(v2);
3374 ret0->setArray(aarr);
3379 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(multiVal);
3380 ret0->setArray(aarr);
3385 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3386 std::vector<int> v2(nbOfComp);
3387 for(int i=0;i<nbOfComp;i++)
3388 v2[i]=slic.first+i*slic.second.second;
3389 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=ret0Arr->keepSelectedComponents(v2);
3390 ret0->setArray(aarr);
3394 throw INTERP_KERNEL::Exception(msg);
3399 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3402 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3405 double r1=self->getMaxValue2(tmp);
3406 PyObject *ret=PyTuple_New(2);
3407 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3408 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3412 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3415 double r1=self->getMinValue2(tmp);
3416 PyObject *ret=PyTuple_New(2);
3417 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3418 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3422 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3424 std::vector<int> tmp;
3425 convertPyToNewIntArr3(li,tmp);
3426 return self->keepSelectedComponents(tmp);
3429 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3431 std::vector<int> tmp;
3432 convertPyToNewIntArr3(li,tmp);
3433 self->setSelectedComponents(f,tmp);
3436 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3439 DataArrayDouble *a,*a2;
3440 DataArrayDoubleTuple *aa,*aa2;
3441 std::vector<double> bb,bb2;
3444 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3445 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3446 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3447 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3449 return self->extractSlice3D(orig,vect,eps);
3452 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3454 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3457 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3459 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3462 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3464 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.";
3465 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3468 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3470 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3472 return (*self)-(*other);
3474 throw INTERP_KERNEL::Exception(msg);
3479 DataArrayDoubleTuple *aa;
3480 std::vector<double> bb;
3482 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3487 if(!self->getArray())
3488 throw INTERP_KERNEL::Exception(msg2);
3489 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3490 ret->applyLin(1.,-val);
3491 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3492 ret2->setArray(ret);
3497 if(!self->getArray())
3498 throw INTERP_KERNEL::Exception(msg2);
3499 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3500 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3501 ret2->setArray(ret);
3506 if(!self->getArray())
3507 throw INTERP_KERNEL::Exception(msg2);
3508 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3509 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3510 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3511 ret2->setArray(ret);
3516 if(!self->getArray())
3517 throw INTERP_KERNEL::Exception(msg2);
3518 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3519 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3520 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3521 ret2->setArray(ret);
3525 { throw INTERP_KERNEL::Exception(msg); }
3529 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3531 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3534 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3536 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3539 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3541 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3544 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3546 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.";
3547 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3550 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3552 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3554 return (*self)/(*other);
3556 throw INTERP_KERNEL::Exception(msg);
3561 DataArrayDoubleTuple *aa;
3562 std::vector<double> bb;
3564 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3570 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3571 if(!self->getArray())
3572 throw INTERP_KERNEL::Exception(msg2);
3573 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3574 ret->applyLin(1./val,0);
3575 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3576 ret2->setArray(ret);
3581 if(!self->getArray())
3582 throw INTERP_KERNEL::Exception(msg2);
3583 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3584 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3585 ret2->setArray(ret);
3590 if(!self->getArray())
3591 throw INTERP_KERNEL::Exception(msg2);
3592 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3593 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3594 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3595 ret2->setArray(ret);
3600 if(!self->getArray())
3601 throw INTERP_KERNEL::Exception(msg2);
3602 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3603 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3604 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3605 ret2->setArray(ret);
3609 { throw INTERP_KERNEL::Exception(msg); }
3613 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3615 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3618 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3620 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.";
3621 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3624 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3626 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3628 return (*self)^(*other);
3630 throw INTERP_KERNEL::Exception(msg);
3635 DataArrayDoubleTuple *aa;
3636 std::vector<double> bb;
3638 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3643 if(!self->getArray())
3644 throw INTERP_KERNEL::Exception(msg2);
3645 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3647 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3648 ret2->setArray(ret);
3653 if(!self->getArray())
3654 throw INTERP_KERNEL::Exception(msg2);
3655 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3656 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3657 ret2->setArray(ret);
3662 if(!self->getArray())
3663 throw INTERP_KERNEL::Exception(msg2);
3664 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3665 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3666 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3667 ret2->setArray(ret);
3672 if(!self->getArray())
3673 throw INTERP_KERNEL::Exception(msg2);
3674 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3675 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3676 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3677 ret2->setArray(ret);
3681 { throw INTERP_KERNEL::Exception(msg); }
3685 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3687 return self->negate();
3690 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3692 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.";
3693 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3696 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3698 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3702 Py_XINCREF(trueSelf);
3706 throw INTERP_KERNEL::Exception(msg);
3711 DataArrayDoubleTuple *aa;
3712 std::vector<double> bb;
3714 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3719 if(!self->getArray())
3720 throw INTERP_KERNEL::Exception(msg2);
3721 self->getArray()->applyLin(1.,val);
3722 Py_XINCREF(trueSelf);
3727 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3730 Py_XINCREF(trueSelf);
3735 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3736 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3737 ret2->setArray(aaa);
3739 Py_XINCREF(trueSelf);
3744 if(!self->getArray())
3745 throw INTERP_KERNEL::Exception(msg2);
3746 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3747 self->getArray()->addEqual(aaa);
3748 Py_XINCREF(trueSelf);
3752 { throw INTERP_KERNEL::Exception(msg); }
3756 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3758 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.";
3759 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
3762 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3764 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3768 Py_XINCREF(trueSelf);
3772 throw INTERP_KERNEL::Exception(msg);
3777 DataArrayDoubleTuple *aa;
3778 std::vector<double> bb;
3780 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3785 if(!self->getArray())
3786 throw INTERP_KERNEL::Exception(msg2);
3787 self->getArray()->applyLin(1.,-val);
3788 Py_XINCREF(trueSelf);
3793 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3796 Py_XINCREF(trueSelf);
3801 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3802 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3803 ret2->setArray(aaa);
3805 Py_XINCREF(trueSelf);
3810 if(!self->getArray())
3811 throw INTERP_KERNEL::Exception(msg2);
3812 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3813 self->getArray()->substractEqual(aaa);
3814 Py_XINCREF(trueSelf);
3818 { throw INTERP_KERNEL::Exception(msg); }
3822 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3824 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.";
3825 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
3828 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3830 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3834 Py_XINCREF(trueSelf);
3838 throw INTERP_KERNEL::Exception(msg);
3843 DataArrayDoubleTuple *aa;
3844 std::vector<double> bb;
3846 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3851 if(!self->getArray())
3852 throw INTERP_KERNEL::Exception(msg2);
3853 self->getArray()->applyLin(val,0);
3854 Py_XINCREF(trueSelf);
3859 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3862 Py_XINCREF(trueSelf);
3867 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3868 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3869 ret2->setArray(aaa);
3871 Py_XINCREF(trueSelf);
3876 if(!self->getArray())
3877 throw INTERP_KERNEL::Exception(msg2);
3878 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3879 self->getArray()->multiplyEqual(aaa);
3880 Py_XINCREF(trueSelf);
3884 { throw INTERP_KERNEL::Exception(msg); }
3888 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3890 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.";
3891 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
3894 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3896 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3900 Py_XINCREF(trueSelf);
3904 throw INTERP_KERNEL::Exception(msg);
3909 DataArrayDoubleTuple *aa;
3910 std::vector<double> bb;
3912 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3918 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
3919 if(!self->getArray())
3920 throw INTERP_KERNEL::Exception(msg2);
3921 self->getArray()->applyLin(1./val,0);
3922 Py_XINCREF(trueSelf);
3927 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3930 Py_XINCREF(trueSelf);
3935 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3936 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3937 ret2->setArray(aaa);
3939 Py_XINCREF(trueSelf);
3944 if(!self->getArray())
3945 throw INTERP_KERNEL::Exception(msg2);
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3947 self->getArray()->divideEqual(aaa);
3948 Py_XINCREF(trueSelf);
3952 { throw INTERP_KERNEL::Exception(msg); }
3956 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3958 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.";
3959 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
3962 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3964 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3968 Py_XINCREF(trueSelf);
3972 throw INTERP_KERNEL::Exception(msg);
3977 DataArrayDoubleTuple *aa;
3978 std::vector<double> bb;
3980 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3985 if(!self->getArray())
3986 throw INTERP_KERNEL::Exception(msg2);
3987 self->getArray()->applyPow(val);
3988 Py_XINCREF(trueSelf);
3993 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3996 Py_XINCREF(trueSelf);
4001 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4002 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4003 ret2->setArray(aaa);
4005 Py_XINCREF(trueSelf);
4010 if(!self->getArray())
4011 throw INTERP_KERNEL::Exception(msg2);
4012 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4013 self->getArray()->powEqual(aaa);
4014 Py_XINCREF(trueSelf);
4018 { throw INTERP_KERNEL::Exception(msg); }
4022 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4024 std::vector<const MEDCouplingFieldDouble *> tmp;
4025 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4026 return MEDCouplingFieldDouble::MergeFields(tmp);
4029 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4031 std::vector<const MEDCouplingFieldDouble *> tmp;
4032 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4033 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4038 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4041 int getNumberOfFields() const;
4042 MEDCouplingMultiFields *deepCpy() const;
4043 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4044 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4045 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4046 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4047 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4048 void updateTime() const throw(INTERP_KERNEL::Exception);
4051 std::string __str__() const throw(INTERP_KERNEL::Exception)
4053 return self->simpleRepr();
4055 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4057 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4058 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4060 std::vector<MEDCouplingFieldDouble *> fs(sz);
4061 for(int i=0;i<sz;i++)
4062 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4063 return MEDCouplingMultiFields::New(fs);
4065 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4067 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4068 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4070 std::vector<MEDCouplingFieldDouble *> fs(sz);
4071 for(int i=0;i<sz;i++)
4072 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4073 return MEDCouplingMultiFields::New(fs);
4075 PyObject *getFields() const
4077 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4078 int sz=fields.size();
4079 PyObject *res = PyList_New(sz);
4080 for(int i=0;i<sz;i++)
4084 fields[i]->incrRef();
4085 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4089 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4094 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4096 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4100 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4103 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4105 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4107 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4109 PyObject *res = PyList_New(sz);
4110 for(int i=0;i<sz;i++)
4115 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4119 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4124 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4126 std::vector<int> refs;
4127 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4129 PyObject *res = PyList_New(sz);
4130 for(int i=0;i<sz;i++)
4135 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4139 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4143 PyObject *ret=PyTuple_New(2);
4144 PyTuple_SetItem(ret,0,res);
4145 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4148 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4150 std::vector<DataArrayDouble *> ms=self->getArrays();
4152 PyObject *res = PyList_New(sz);
4153 for(int i=0;i<sz;i++)
4158 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4162 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4167 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4169 std::vector< std::vector<int> > refs;
4170 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4172 PyObject *res = PyList_New(sz);
4173 PyObject *res2 = PyList_New(sz);
4174 for(int i=0;i<sz;i++)
4179 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4183 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4185 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4188 PyObject *ret=PyTuple_New(2);
4189 PyTuple_SetItem(ret,0,res);
4190 PyTuple_SetItem(ret,1,res2);
4196 class MEDCouplingDefinitionTime
4199 MEDCouplingDefinitionTime();
4200 void assign(const MEDCouplingDefinitionTime& other);
4201 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4202 double getTimeResolution() const;
4203 std::vector<double> getHotSpotsTime() const;
4206 std::string __str__() const throw(INTERP_KERNEL::Exception)
4208 std::ostringstream oss;
4209 self->appendRepr(oss);
4213 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4215 int meshId,arrId,arrIdInField,fieldId;
4216 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4217 PyObject *res=PyList_New(4);
4218 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4219 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4220 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4221 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4225 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4227 int meshId,arrId,arrIdInField,fieldId;
4228 self->getIdsOnTimeLeft(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));
4239 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4242 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4243 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4247 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4249 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4250 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4252 std::vector<MEDCouplingFieldDouble *> fs(sz);
4253 for(int i=0;i<sz;i++)
4254 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4255 return MEDCouplingFieldOverTime::New(fs);
4257 std::string __str__() const throw(INTERP_KERNEL::Exception)
4259 return self->simpleRepr();
4261 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4263 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4264 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4266 std::vector<MEDCouplingFieldDouble *> fs(sz);
4267 for(int i=0;i<sz;i++)
4268 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4269 return MEDCouplingFieldOverTime::New(fs);
4277 __filename=os.environ.get('PYTHONSTARTUP')
4278 if __filename and os.path.isfile(__filename):
4279 execfile(__filename)