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::DataArray*
82 $result=convertDataArray($1,$owner);
85 %typemap(out) ParaMEDMEM::DataArrayChar*
87 $result=convertDataArrayChar($1,$owner);
91 %init %{ import_array(); %}
94 %feature("autodoc", "1");
95 %feature("docstring");
97 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
98 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
99 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
100 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
101 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
102 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
103 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
104 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
105 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
106 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
107 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
108 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
109 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
110 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
111 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
132 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
133 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
134 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
135 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
136 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
137 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
138 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
139 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
140 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
141 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
143 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
144 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
145 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
146 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
147 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
148 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
149 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
150 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
151 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
152 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
153 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
154 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
155 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
156 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
157 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
158 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
159 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
160 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
161 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
162 %newobject ParaMEDMEM::DataArrayInt::New;
163 %newobject ParaMEDMEM::DataArrayInt::__iter__;
164 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
165 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
166 %newobject ParaMEDMEM::DataArrayInt::performCpy;
167 %newobject ParaMEDMEM::DataArrayInt::substr;
168 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
169 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
170 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
171 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
172 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
173 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
174 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
175 %newobject ParaMEDMEM::DataArrayInt::renumber;
176 %newobject ParaMEDMEM::DataArrayInt::renumberR;
177 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
178 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
179 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
180 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
181 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
182 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
183 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
184 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
185 %newobject ParaMEDMEM::DataArrayInt::negate;
186 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
187 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
188 %newobject ParaMEDMEM::DataArrayInt::Meld;
189 %newobject ParaMEDMEM::DataArrayInt::Add;
190 %newobject ParaMEDMEM::DataArrayInt::Substract;
191 %newobject ParaMEDMEM::DataArrayInt::Multiply;
192 %newobject ParaMEDMEM::DataArrayInt::Divide;
193 %newobject ParaMEDMEM::DataArrayInt::Pow;
194 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
195 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
196 %newobject ParaMEDMEM::DataArrayInt::Range;
197 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
198 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
199 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
200 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
201 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
202 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
203 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
204 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
205 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
206 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
207 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
208 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
209 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
210 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
211 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
212 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
213 %newobject ParaMEDMEM::DataArrayInt::__neg__;
214 %newobject ParaMEDMEM::DataArrayInt::__add__;
215 %newobject ParaMEDMEM::DataArrayInt::__radd__;
216 %newobject ParaMEDMEM::DataArrayInt::__sub__;
217 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
218 %newobject ParaMEDMEM::DataArrayInt::__mul__;
219 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
220 %newobject ParaMEDMEM::DataArrayInt::__div__;
221 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
222 %newobject ParaMEDMEM::DataArrayInt::__mod__;
223 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
224 %newobject ParaMEDMEM::DataArrayInt::__pow__;
225 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
226 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
227 %newobject ParaMEDMEM::DataArrayChar::deepCpy;
228 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
229 %newobject ParaMEDMEM::DataArrayChar::renumber;
230 %newobject ParaMEDMEM::DataArrayChar::renumberR;
231 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
232 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
233 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
234 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
235 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
236 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
237 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
238 %newobject ParaMEDMEM::DataArrayChar::Meld;
239 %newobject ParaMEDMEM::DataArrayByte::New;
240 %newobject ParaMEDMEM::DataArrayByte::__iter__;
241 %newobject ParaMEDMEM::DataArrayByte::performCpy;
242 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
243 %newobject ParaMEDMEM::DataArrayChar::substr;
244 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
245 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
246 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
247 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
248 %newobject ParaMEDMEM::DataArrayDouble::New;
249 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
250 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
251 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
252 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
253 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
254 %newobject ParaMEDMEM::DataArrayDouble::Meld;
255 %newobject ParaMEDMEM::DataArrayDouble::Dot;
256 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
257 %newobject ParaMEDMEM::DataArrayDouble::Add;
258 %newobject ParaMEDMEM::DataArrayDouble::Substract;
259 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
260 %newobject ParaMEDMEM::DataArrayDouble::Divide;
261 %newobject ParaMEDMEM::DataArrayDouble::Pow;
262 %newobject ParaMEDMEM::DataArrayDouble::substr;
263 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
264 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
265 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
266 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
267 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
268 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
269 %newobject ParaMEDMEM::DataArrayDouble::negate;
270 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
271 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
272 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
273 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
274 %newobject ParaMEDMEM::DataArrayDouble::determinant;
275 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
276 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
277 %newobject ParaMEDMEM::DataArrayDouble::inverse;
278 %newobject ParaMEDMEM::DataArrayDouble::trace;
279 %newobject ParaMEDMEM::DataArrayDouble::deviator;
280 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
281 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
282 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
283 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
284 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
285 %newobject ParaMEDMEM::DataArrayDouble::renumber;
286 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
287 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
288 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
289 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
290 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
291 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
292 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
293 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
294 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
295 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
296 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
297 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
298 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
299 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
300 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
301 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
302 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
303 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
304 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
305 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
306 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
307 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
308 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
309 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
310 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
311 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
312 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
313 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
314 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
315 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
316 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
317 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
318 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
319 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
320 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
321 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
322 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
323 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
324 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
325 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
326 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
327 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
328 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
329 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
330 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
331 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
332 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
333 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
334 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
335 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
336 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
337 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
338 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
339 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
340 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
341 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
342 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
343 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
344 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
345 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
346 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
347 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
348 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
349 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
350 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
351 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
352 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
353 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
354 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
355 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
356 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
357 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
358 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
359 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
360 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
361 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
362 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
363 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
364 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
365 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
366 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
367 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
368 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
369 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
370 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
371 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
372 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
373 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
374 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
375 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
376 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
377 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
378 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
379 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
380 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
381 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
382 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
383 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
384 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
385 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
386 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
387 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
389 %feature("unref") DataArray "$this->decrRef();"
390 %feature("unref") DataArrayDouble "$this->decrRef();"
391 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
392 %feature("unref") MEDCouplingMesh "$this->decrRef();"
393 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
394 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
395 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
396 %feature("unref") DataArrayInt "$this->decrRef();"
397 %feature("unref") DataArrayChar "$this->decrRef();"
398 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
399 %feature("unref") DataArrayByte "$this->decrRef();"
400 %feature("unref") MEDCouplingField "$this->decrRef();"
401 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
402 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
403 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
404 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
405 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
406 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
407 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
408 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
409 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
411 %rename(assign) *::operator=;
412 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
413 %ignore ParaMEDMEM::RefCountObject::decrRef;
414 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
415 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
416 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
417 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
421 %rename (InterpKernelException) INTERP_KERNEL::Exception;
423 namespace INTERP_KERNEL
428 Exception(const char* what);
429 ~Exception() throw ();
430 const char *what() const throw ();
433 std::string __str__() const
435 return std::string(self->what());
441 %include "MEDCouplingTimeLabel.hxx"
465 CONST_ON_TIME_INTERVAL = 7
466 } TypeOfTimeDiscretization;
468 const char *MEDCouplingVersionStr();
469 int MEDCouplingVersion();
470 int MEDCouplingSizeOfVoidStar();
471 PyObject *MEDCouplingVersionMajMinRel()
473 int tmp0=0,tmp1=0,tmp2=0;
474 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
475 PyObject *res = PyList_New(3);
476 PyList_SetItem(res,0,SWIG_From_int(tmp0));
477 PyList_SetItem(res,1,SWIG_From_int(tmp1));
478 PyList_SetItem(res,2,SWIG_From_int(tmp2));
486 RefCountObject(const RefCountObject& other);
489 bool decrRef() const;
490 void incrRef() const;
491 virtual std::size_t getHeapMemorySize() const;
497 bool MEDCouplingHasNumPyBindings()
506 std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
508 static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
509 std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
510 if(PyRun_SimpleString(script)!=0)
511 throw INTERP_KERNEL::Exception(oss.str().c_str());
512 return std::string(script);
516 %include "MEDCouplingMemArray.i"
523 UNSTRUCTURED_DESC = 6,
527 } MEDCouplingMeshType;
530 class DataArrayDouble;
531 class MEDCouplingUMesh;
532 class MEDCouplingFieldDouble;
534 %extend RefCountObject
536 std::string getHiddenCppPointer() const
538 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
543 %extend MEDCouplingGaussLocalization
545 std::string __str__() const throw(INTERP_KERNEL::Exception)
547 return self->getStringRepr();
550 std::string __repr__() const throw(INTERP_KERNEL::Exception)
552 std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
553 oss << self->getStringRepr();
558 class MEDCouplingMesh : public RefCountObject, public TimeLabel
561 void setName(const char *name);
562 const char *getName() const;
563 void setDescription(const char *descr);
564 const char *getDescription() const;
565 void setTime(double val, int iteration, int order);
566 void setTimeUnit(const char *unit);
567 const char *getTimeUnit() const;
568 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
569 bool isStructured() const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingMesh *deepCpy() const;
571 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
572 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
573 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
574 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
575 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
576 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
577 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
578 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
579 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
580 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
581 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
588 virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
589 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
590 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
591 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
592 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
593 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
595 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
596 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
597 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
598 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
599 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
600 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
601 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
602 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
603 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
604 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
605 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
606 static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
607 static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
608 static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
609 static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
610 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
611 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
614 std::string __str__() const throw(INTERP_KERNEL::Exception)
616 return self->simpleRepr();
619 PyObject *getTime() throw(INTERP_KERNEL::Exception)
622 double tmp0=self->getTime(tmp1,tmp2);
623 PyObject *res = PyList_New(3);
624 PyList_SetItem(res,0,SWIG_From_double(tmp0));
625 PyList_SetItem(res,1,SWIG_From_int(tmp1));
626 PyList_SetItem(res,2,SWIG_From_int(tmp2));
630 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
634 DataArrayDoubleTuple *aa;
635 std::vector<double> bb;
637 int spaceDim=self->getSpaceDimension();
638 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
639 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
640 return self->getCellContainingPoint(pos,eps);
643 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
647 DataArrayDoubleTuple *aa;
648 std::vector<double> bb;
650 int spaceDim=self->getSpaceDimension();
651 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
652 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
653 std::vector<int> elts,eltsIndex;
654 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
655 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
656 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
657 d0->alloc(elts.size(),1);
658 d1->alloc(eltsIndex.size(),1);
659 std::copy(elts.begin(),elts.end(),d0->getPointer());
660 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
661 PyObject *ret=PyTuple_New(2);
662 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
667 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
669 std::vector<int> elts,eltsIndex;
670 int spaceDim=self->getSpaceDimension();
672 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
673 if (!SWIG_IsOK(res1))
676 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
677 int nbOfPoints=size/spaceDim;
680 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
682 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
686 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
688 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
689 da2->checkAllocated();
690 int size=da2->getNumberOfTuples();
691 int nbOfCompo=da2->getNumberOfComponents();
692 if(nbOfCompo!=spaceDim)
694 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
696 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
698 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
699 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
700 d0->alloc(elts.size(),1);
701 d1->alloc(eltsIndex.size(),1);
702 std::copy(elts.begin(),elts.end(),d0->getPointer());
703 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
704 PyObject *ret=PyTuple_New(2);
705 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
706 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
710 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
714 DataArrayDoubleTuple *aa;
715 std::vector<double> bb;
717 int spaceDim=self->getSpaceDimension();
718 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
719 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
720 std::vector<int> elts;
721 self->getCellsContainingPoint(pos,eps,elts);
722 DataArrayInt *ret=DataArrayInt::New();
723 ret->alloc((int)elts.size(),1);
724 std::copy(elts.begin(),elts.end(),ret->getPointer());
725 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
728 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
731 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
732 if (!SWIG_IsOK(res1))
735 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
736 self->renumberCells(tmp,check);
740 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
742 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
743 da2->checkAllocated();
744 self->renumberCells(da2->getConstPointer(),check);
748 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
750 DataArrayInt *cellCor, *nodeCor;
751 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
752 PyObject *res = PyList_New(2);
753 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
754 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
758 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
760 DataArrayInt *cellCor=0,*nodeCor=0;
761 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
762 PyObject *res = PyList_New(2);
763 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
764 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
768 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
770 DataArrayInt *cellCor=0;
771 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
775 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
778 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
779 if (!SWIG_IsOK(res1))
782 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
783 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
787 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
789 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
790 da2->checkAllocated();
791 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
794 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
796 std::vector<int> conn;
797 self->getNodeIdsOfCell(cellId,conn);
798 return convertIntArrToPyList2(conn);
801 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
803 std::vector<double> coo;
804 self->getCoordinatesOfNode(nodeId,coo);
805 return convertDblArrToPyList2(coo);
808 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
812 DataArrayDoubleTuple *aa;
813 std::vector<double> bb;
815 int spaceDim=self->getSpaceDimension();
816 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
817 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
818 self->scale(pointPtr,factor);
821 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
823 int spaceDim=self->getSpaceDimension();
824 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
825 self->getBoundingBox(tmp);
826 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
830 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
833 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
834 PyObject *ret=PyTuple_New(2);
835 PyObject *ret0Py=ret0?Py_True:Py_False;
837 PyTuple_SetItem(ret,0,ret0Py);
838 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
842 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
844 int szArr,sw,iTypppArr;
845 std::vector<int> stdvecTyyppArr;
846 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
847 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
848 if(sw==3)//DataArrayInt
850 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
851 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
852 std::string name=argpt->getName();
854 ret->setName(name.c_str());
856 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
859 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
861 int szArr,sw,iTypppArr;
862 std::vector<int> stdvecTyyppArr;
864 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
865 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
866 if(sw==3)//DataArrayInt
868 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
869 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
870 std::string name=argpt->getName();
872 ret->setName(name.c_str());
875 PyObject *res = PyList_New(2);
876 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
877 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
878 PyList_SetItem(res,0,obj0);
879 PyList_SetItem(res,1,obj1);
883 PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
887 MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
888 PyObject *res = PyTuple_New(2);
889 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
892 obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
894 obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
895 PyTuple_SetItem(res,0,obj0);
896 PyTuple_SetItem(res,1,obj1);
900 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
902 std::vector<int> vals=self->getDistributionOfTypes();
903 PyObject *ret=PyList_New((int)vals.size()/3);
904 for(int j=0;j<(int)vals.size()/3;j++)
906 PyObject *ret1=PyList_New(3);
907 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
908 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
909 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
910 PyList_SetItem(ret,j,ret1);
915 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
917 std::vector<int> code;
918 std::vector<const DataArrayInt *> idsPerType;
919 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
920 convertPyToNewIntArr4(li,1,3,code);
921 return self->checkTypeConsistencyAndContig(code,idsPerType);
924 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
926 std::vector<int> code;
927 std::vector<DataArrayInt *> idsInPflPerType;
928 std::vector<DataArrayInt *> idsPerType;
929 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
930 PyObject *ret=PyTuple_New(3);
931 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
932 PyObject *ret1=PyList_New(idsInPflPerType.size());
933 for(std::size_t j=0;j<idsInPflPerType.size();j++)
934 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
935 PyTuple_SetItem(ret,1,ret1);
936 int n=idsPerType.size();
937 PyObject *ret2=PyList_New(n);
939 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
940 PyTuple_SetItem(ret,2,ret2);
944 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
948 DataArrayDoubleTuple *aa;
949 std::vector<double> bb;
951 int spaceDim=self->getSpaceDimension();
952 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
953 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
954 self->translate(vectorPtr);
957 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
959 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
962 DataArrayDoubleTuple *aa;
963 std::vector<double> bb;
965 int spaceDim=self->getSpaceDimension();
966 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
967 self->rotate(centerPtr,0,alpha);
970 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
972 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
974 DataArrayDouble *a,*a2;
975 DataArrayDoubleTuple *aa,*aa2;
976 std::vector<double> bb,bb2;
978 int spaceDim=self->getSpaceDimension();
979 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
980 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
981 self->rotate(centerPtr,vectorPtr,alpha);
984 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
986 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
987 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
988 PyObject *res=PyList_New(result.size());
989 for(int i=0;iL!=result.end(); i++, iL++)
990 PyList_SetItem(res,i,PyInt_FromLong(*iL));
994 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
996 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
997 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
998 return MEDCouplingMesh::MergeMeshes(tmp);
1004 %include "NormalizedUnstructuredMesh.hxx"
1005 %include "MEDCouplingNatureOfField.hxx"
1006 %include "MEDCouplingTimeDiscretization.hxx"
1007 %include "MEDCouplingGaussLocalization.hxx"
1008 %include "MEDCouplingFieldDiscretization.hxx"
1010 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1011 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1012 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1014 namespace ParaMEDMEM
1016 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1019 void updateTime() const;
1020 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1021 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1022 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1023 void zipCoords() throw(INTERP_KERNEL::Exception);
1024 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1025 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1026 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1027 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1028 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1029 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1030 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1031 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1032 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1033 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1034 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1035 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1036 virtual DataArrayInt *findBoundaryNodes() const;
1039 std::string __str__() const throw(INTERP_KERNEL::Exception)
1041 return self->simpleRepr();
1044 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1047 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1048 PyObject *res = PyList_New(2);
1049 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1050 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1054 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1056 DataArrayInt *comm, *commIndex;
1057 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1058 PyObject *res = PyList_New(2);
1059 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1060 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1064 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1066 DataArrayDouble *ret1=self->getCoords();
1069 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1072 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1074 int szArr,sw,iTypppArr;
1075 std::vector<int> stdvecTyyppArr;
1076 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1077 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1078 if(sw==3)//DataArrayInt
1080 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1081 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1082 std::string name=argpt->getName();
1084 ret->setName(name.c_str());
1086 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1089 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1091 int szArr,sw,iTypppArr;
1092 std::vector<int> stdvecTyyppArr;
1093 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1094 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1095 if(sw==3)//DataArrayInt
1097 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1098 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1099 std::string name=argpt->getName();
1101 ret->setName(name.c_str());
1103 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1106 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1108 int szArr,sw,iTypppArr;
1109 std::vector<int> stdvecTyyppArr;
1110 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1111 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1112 if(sw==3)//DataArrayInt
1114 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1115 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1116 std::string name=argpt->getName();
1118 ret->setName(name.c_str());
1120 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1123 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1125 int szArr,sw,iTypppArr;
1126 std::vector<int> stdvecTyyppArr;
1127 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1128 self->renumberNodes(tmp,newNbOfNodes);
1131 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1133 int szArr,sw,iTypppArr;
1134 std::vector<int> stdvecTyyppArr;
1135 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1136 self->renumberNodes2(tmp,newNbOfNodes);
1139 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1141 int spaceDim=self->getSpaceDimension();
1143 DataArrayDouble *a,*a2;
1144 DataArrayDoubleTuple *aa,*aa2;
1145 std::vector<double> bb,bb2;
1147 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1148 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1149 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1150 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1151 std::vector<int> nodes;
1152 self->findNodesOnLine(p,v,eps,nodes);
1153 DataArrayInt *ret=DataArrayInt::New();
1154 ret->alloc((int)nodes.size(),1);
1155 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1156 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1158 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1160 int spaceDim=self->getSpaceDimension();
1162 DataArrayDouble *a,*a2;
1163 DataArrayDoubleTuple *aa,*aa2;
1164 std::vector<double> bb,bb2;
1166 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1167 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1168 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1169 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1170 std::vector<int> nodes;
1171 self->findNodesOnPlane(p,v,eps,nodes);
1172 DataArrayInt *ret=DataArrayInt::New();
1173 ret->alloc((int)nodes.size(),1);
1174 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1175 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1178 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1182 DataArrayDoubleTuple *aa;
1183 std::vector<double> bb;
1185 int spaceDim=self->getSpaceDimension();
1186 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1187 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1188 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1189 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1192 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1194 DataArrayInt *c=0,*cI=0;
1198 DataArrayDoubleTuple *aa;
1199 std::vector<double> bb;
1201 int spaceDim=self->getSpaceDimension();
1202 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1203 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1204 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1205 PyObject *ret=PyTuple_New(2);
1206 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1207 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1211 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1213 DataArrayInt *c=0,*cI=0;
1214 int spaceDim=self->getSpaceDimension();
1217 DataArrayDoubleTuple *aa;
1218 std::vector<double> bb;
1221 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1222 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1224 PyObject *ret=PyTuple_New(2);
1225 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1226 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1230 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1234 DataArrayDoubleTuple *aa;
1235 std::vector<double> bb;
1237 int spaceDim=self->getSpaceDimension();
1238 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1239 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1241 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1242 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1245 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1249 std::vector<int> multiVal;
1250 std::pair<int, std::pair<int,int> > slic;
1251 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1252 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1256 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1258 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1260 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1262 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1266 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1269 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1270 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1271 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1272 for(int i=0;i<sz;i++)
1273 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1276 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1279 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1281 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1282 std::vector<double> val3;
1283 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1284 "Rotate2DAlg",2,true,nbNodes);
1286 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1287 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1290 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1293 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1294 INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1295 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1296 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1297 for(int i=0;i<sz;i++)
1298 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1301 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1304 INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1306 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1307 std::vector<double> val3;
1308 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1309 "Rotate3DAlg",3,true,nbNodes);
1311 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1312 INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1313 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1318 class MEDCouplingUMeshCell
1321 INTERP_KERNEL::NormalizedCellType getType() const;
1324 std::string __str__() const throw(INTERP_KERNEL::Exception)
1326 return self->repr();
1329 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1332 const int *r=self->getAllConn(ret2);
1333 PyObject *ret=PyTuple_New(ret2);
1334 for(int i=0;i<ret2;i++)
1335 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1341 class MEDCouplingUMeshCellIterator
1348 MEDCouplingUMeshCell *ret=self->nextt();
1350 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1353 PyErr_SetString(PyExc_StopIteration,"No more data.");
1360 class MEDCouplingUMeshCellByTypeIterator
1363 ~MEDCouplingUMeshCellByTypeIterator();
1368 MEDCouplingUMeshCellEntry *ret=self->nextt();
1370 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1373 PyErr_SetString(PyExc_StopIteration,"No more data.");
1380 class MEDCouplingUMeshCellByTypeEntry
1383 ~MEDCouplingUMeshCellByTypeEntry();
1386 MEDCouplingUMeshCellByTypeIterator *__iter__()
1388 return self->iterator();
1393 class MEDCouplingUMeshCellEntry
1396 INTERP_KERNEL::NormalizedCellType getType() const;
1397 int getNumberOfElems() const;
1400 MEDCouplingUMeshCellIterator *__iter__()
1402 return self->iterator();
1407 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1410 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1411 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1412 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1413 void updateTime() const;
1414 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1415 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1416 void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1417 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1418 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1419 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1420 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1421 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1422 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1423 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1424 void computeTypes() throw(INTERP_KERNEL::Exception);
1425 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1426 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1428 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1429 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1430 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1431 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1432 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1433 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1434 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1435 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1436 DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1437 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1438 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1439 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1440 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1441 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1442 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1443 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1444 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1445 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1446 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1447 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1448 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1449 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1450 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1451 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1452 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1453 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1454 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1455 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1456 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1457 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1458 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1459 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1460 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1461 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1462 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1463 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1464 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1465 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1467 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1469 return MEDCouplingUMesh::New();
1472 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1474 return MEDCouplingUMesh::New(meshName,meshDim);
1477 std::string __str__() const throw(INTERP_KERNEL::Exception)
1479 return self->simpleRepr();
1482 std::string __repr__() const throw(INTERP_KERNEL::Exception)
1484 std::ostringstream oss;
1485 self->reprQuickOverview(oss);
1489 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1491 return self->cellIterator();
1494 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1498 std::vector<int> multiVal;
1499 std::pair<int, std::pair<int,int> > slic;
1500 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1501 int nbc=self->getNumberOfCells();
1502 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1509 std::ostringstream oss;
1510 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1511 throw INTERP_KERNEL::Exception(oss.str().c_str());
1514 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1519 int tmp=nbc+singleVal;
1520 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1524 std::ostringstream oss;
1525 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1526 throw INTERP_KERNEL::Exception(oss.str().c_str());
1532 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1536 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1541 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1542 daIntTyypp->checkAllocated();
1543 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1546 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1550 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1554 std::vector<int> multiVal;
1555 std::pair<int, std::pair<int,int> > slic;
1556 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1557 int nbc=self->getNumberOfCells();
1558 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1565 std::ostringstream oss;
1566 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1567 throw INTERP_KERNEL::Exception(oss.str().c_str());
1571 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1578 int tmp=nbc+singleVal;
1579 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1584 std::ostringstream oss;
1585 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1586 throw INTERP_KERNEL::Exception(oss.str().c_str());
1592 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1598 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1599 daIntTyypp->checkAllocated();
1600 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1604 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1608 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1612 std::vector<int> multiVal;
1613 std::pair<int, std::pair<int,int> > slic;
1614 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1615 int nbc=self->getNumberOfCells();
1616 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1623 std::ostringstream oss;
1624 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1625 throw INTERP_KERNEL::Exception(oss.str().c_str());
1629 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1636 int tmp=nbc+singleVal;
1637 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1642 std::ostringstream oss;
1643 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1644 throw INTERP_KERNEL::Exception(oss.str().c_str());
1650 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1655 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1661 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1662 daIntTyypp->checkAllocated();
1663 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1667 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1671 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1673 int szArr,sw,iTypppArr;
1674 std::vector<int> stdvecTyyppArr;
1675 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1678 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1679 throw INTERP_KERNEL::Exception(oss.str().c_str());
1681 self->insertNextCell(type,size,tmp);
1684 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1686 int szArr,sw,iTypppArr;
1687 std::vector<int> stdvecTyyppArr;
1688 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1689 self->insertNextCell(type,szArr,tmp);
1692 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1694 DataArrayInt *ret=self->getNodalConnectivity();
1699 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1701 DataArrayInt *ret=self->getNodalConnectivityIndex();
1706 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1708 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1709 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1710 PyObject *res = PyList_New(result.size());
1711 for (int i=0;iL!=result.end(); i++, iL++)
1712 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1716 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1718 int szArr,sw,iTypppArr;
1719 std::vector<int> stdvecTyyppArr;
1720 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1721 int nbOfDepthPeelingPerformed=0;
1722 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1723 PyObject *res=PyTuple_New(2);
1724 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1725 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1729 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1731 DataArrayInt *v0=0,*v1=0;
1732 self->findCommonCells(compType,startCellId,v0,v1);
1733 PyObject *res = PyList_New(2);
1734 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1735 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1739 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1741 DataArrayInt *v0=0,*v1=0;
1742 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1743 PyObject *res = PyList_New(2);
1744 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1745 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1749 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1753 DataArrayDoubleTuple *aa;
1754 std::vector<double> bb;
1756 int nbOfCompo=self->getSpaceDimension();
1757 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1760 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1761 PyObject *ret=PyTuple_New(2);
1762 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1763 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1767 PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1769 DataArrayInt *ret1=0;
1770 DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1771 PyObject *ret=PyTuple_New(2);
1772 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1773 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1777 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1781 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1782 PyObject *res = PyList_New(3);
1783 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1784 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1785 PyList_SetItem(res,2,SWIG_From_int(ret2));
1788 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1792 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1793 PyObject *res = PyList_New(3);
1794 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1795 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1796 PyList_SetItem(res,2,SWIG_From_int(ret2));
1799 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1801 std::vector<int> cells;
1802 self->checkButterflyCells(cells,eps);
1803 DataArrayInt *ret=DataArrayInt::New();
1804 ret->alloc((int)cells.size(),1);
1805 std::copy(cells.begin(),cells.end(),ret->getPointer());
1806 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1809 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1811 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1813 PyObject *ret = PyList_New(sz);
1814 for(int i=0;i<sz;i++)
1815 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1819 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1821 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1822 int sz=retCpp.size();
1823 PyObject *ret=PyList_New(sz);
1824 for(int i=0;i<sz;i++)
1825 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1829 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1832 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1833 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1834 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1837 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1840 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1841 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1845 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1848 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1849 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1853 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1855 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1856 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1857 PyObject *ret=PyTuple_New(3);
1858 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1859 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1860 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1864 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1866 DataArrayInt *tmp0=0,*tmp1=0;
1867 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1868 PyObject *ret=PyTuple_New(2);
1869 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1870 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1874 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1878 std::vector<int> multiVal;
1879 std::pair<int, std::pair<int,int> > slic;
1880 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1881 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1885 return self->duplicateNodes(&singleVal,&singleVal+1);
1887 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1889 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1891 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1895 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1899 std::vector<int> multiVal;
1900 std::pair<int, std::pair<int,int> > slic;
1901 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1902 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1906 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1908 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1910 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1912 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1916 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1919 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1920 if (!SWIG_IsOK(res1))
1923 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1924 self->renumberNodesInConn(tmp);
1928 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1930 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1931 da2->checkAllocated();
1932 self->renumberNodesInConn(da2->getConstPointer());
1936 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1939 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1940 DataArrayInt *tmp0,*tmp1=0;
1941 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1942 PyObject *ret=PyTuple_New(2);
1943 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1944 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1948 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1950 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1951 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1952 DataArrayInt *ret1=0,*ret2=0;
1953 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1954 PyObject *ret=PyTuple_New(3);
1955 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1956 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1957 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1961 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1963 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1964 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1965 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1966 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1969 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1972 std::vector<const MEDCouplingUMesh *> meshes;
1973 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1974 std::vector<DataArrayInt *> corr;
1975 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1977 PyObject *ret1=PyList_New(sz);
1978 for(int i=0;i<sz;i++)
1979 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1980 PyObject *ret=PyList_New(2);
1981 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1982 PyList_SetItem(ret,1,ret1);
1986 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1988 std::vector<MEDCouplingUMesh *> meshes;
1989 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1990 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1993 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1995 std::vector<MEDCouplingUMesh *> meshes;
1996 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1997 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2000 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2004 std::vector<int> multiVal;
2005 std::pair<int, std::pair<int,int> > slic;
2006 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2008 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2009 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2013 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2015 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2017 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2019 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2023 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2025 DataArrayInt *arrOut=0,*arrIndexOut=0;
2028 std::vector<int> multiVal;
2029 std::pair<int, std::pair<int,int> > slic;
2030 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2032 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2033 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2038 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2043 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2048 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2052 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2054 PyObject *ret=PyTuple_New(2);
2055 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2056 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2060 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2061 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2062 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2064 DataArrayInt *arrOut=0,*arrIndexOut=0;
2067 std::vector<int> multiVal;
2068 std::pair<int, std::pair<int,int> > slic;
2069 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2071 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2072 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2077 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2082 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2087 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2091 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2093 PyObject *ret=PyTuple_New(2);
2094 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2095 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2099 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2100 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2104 std::vector<int> multiVal;
2105 std::pair<int, std::pair<int,int> > slic;
2106 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2108 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2109 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2114 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2119 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2124 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2128 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2132 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2136 DataArrayDoubleTuple *aa;
2137 std::vector<double> bb;
2139 int spaceDim=self->getSpaceDimension();
2140 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2141 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2143 std::vector<int> cells;
2144 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2145 DataArrayInt *ret=DataArrayInt::New();
2146 ret->alloc((int)cells.size(),1);
2147 std::copy(cells.begin(),cells.end(),ret->getPointer());
2148 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2151 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2155 DataArrayDoubleTuple *aa;
2156 std::vector<double> bb;
2158 int spaceDim=self->getSpaceDimension();
2159 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2160 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2161 self->orientCorrectly2DCells(v,polyOnly);
2164 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2166 std::vector<int> cells;
2167 self->arePolyhedronsNotCorrectlyOriented(cells);
2168 DataArrayInt *ret=DataArrayInt::New();
2169 ret->alloc((int)cells.size(),1);
2170 std::copy(cells.begin(),cells.end(),ret->getPointer());
2171 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2174 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2178 self->getFastAveragePlaneOfThis(vec,pos);
2180 std::copy(vec,vec+3,vals);
2181 std::copy(pos,pos+3,vals+3);
2182 return convertDblArrToPyListOfTuple(vals,3,2);
2185 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2187 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2188 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2189 return MEDCouplingUMesh::MergeUMeshes(tmp);
2192 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2195 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2196 PyObject *ret=PyTuple_New(2);
2197 PyObject *ret0Py=ret0?Py_True:Py_False;
2199 PyTuple_SetItem(ret,0,ret0Py);
2200 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2207 bool ret0=self->areCellsIncludedIn2(other,ret1);
2208 PyObject *ret=PyTuple_New(2);
2209 PyObject *ret0Py=ret0?Py_True:Py_False;
2211 PyTuple_SetItem(ret,0,ret0Py);
2212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2218 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2219 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2220 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2221 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2222 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2223 PyObject *ret=PyTuple_New(5);
2224 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2225 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2227 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2234 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2235 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2236 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2237 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2238 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2239 PyObject *ret=PyTuple_New(5);
2240 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2241 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2242 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2243 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2248 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2250 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2251 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2252 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2253 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2254 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2255 PyObject *ret=PyTuple_New(5);
2256 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2257 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2258 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2260 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2264 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2266 DataArrayInt *neighbors=0,*neighborsIdx=0;
2267 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2268 PyObject *ret=PyTuple_New(2);
2269 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2270 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2274 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2276 DataArrayInt *neighbors=0,*neighborsIdx=0;
2277 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2278 PyObject *ret=PyTuple_New(2);
2279 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2284 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2286 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2287 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2288 DataArrayInt *d2,*d3,*d4,*dd5;
2289 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2290 PyObject *ret=PyTuple_New(7);
2291 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2292 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2293 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2294 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2295 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2296 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2297 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2301 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2303 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2304 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2305 self->getReverseNodalConnectivity(d0,d1);
2306 PyObject *ret=PyTuple_New(2);
2307 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2308 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2312 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2315 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2316 da->checkAllocated();
2317 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2320 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2323 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2324 da->checkAllocated();
2325 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2328 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2331 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2332 da->checkAllocated();
2333 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2336 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2339 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2340 da->checkAllocated();
2341 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2342 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2343 PyObject *res = PyList_New(result.size());
2344 for (int i=0;iL!=result.end(); i++, iL++)
2345 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2349 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2352 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2353 da->checkAllocated();
2354 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2355 ret->setName(da->getName().c_str());
2359 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2362 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2363 if (!SWIG_IsOK(res1))
2366 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2367 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2371 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2373 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2374 da2->checkAllocated();
2375 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2379 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2382 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2383 PyObject *ret=PyTuple_New(2);
2384 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2385 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2389 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2391 DataArrayInt *cellNb1=0,*cellNb2=0;
2392 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2393 PyObject *ret=PyTuple_New(3);
2394 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2395 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2396 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2402 int spaceDim=self->getSpaceDimension();
2404 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2406 DataArrayDouble *a,*a2;
2407 DataArrayDoubleTuple *aa,*aa2;
2408 std::vector<double> bb,bb2;
2410 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2411 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2412 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2413 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2415 DataArrayInt *cellIds=0;
2416 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2417 PyObject *ret=PyTuple_New(2);
2418 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2419 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2423 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2425 int spaceDim=self->getSpaceDimension();
2427 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2429 DataArrayDouble *a,*a2;
2430 DataArrayDoubleTuple *aa,*aa2;
2431 std::vector<double> bb,bb2;
2433 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2434 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2435 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2436 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2438 DataArrayInt *cellIds=0;
2439 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2440 PyObject *ret=PyTuple_New(2);
2441 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2442 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2446 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2448 int spaceDim=self->getSpaceDimension();
2450 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2452 DataArrayDouble *a,*a2;
2453 DataArrayDoubleTuple *aa,*aa2;
2454 std::vector<double> bb,bb2;
2456 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2457 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2458 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2459 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2460 return self->getCellIdsCrossingPlane(orig,vect,eps);
2463 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2467 std::vector<int> pos2;
2468 DataArrayInt *pos3=0;
2469 DataArrayIntTuple *pos4=0;
2470 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2475 self->convertToPolyTypes(&pos1,&pos1+1);
2482 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2487 self->convertToPolyTypes(pos3->begin(),pos3->end());
2491 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2495 void convertAllToPoly();
2496 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2497 bool unPolyze() throw(INTERP_KERNEL::Exception);
2498 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2499 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2500 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2503 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2506 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2507 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2508 void updateTime() const throw(INTERP_KERNEL::Exception);
2510 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2512 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2515 std::string __str__() const throw(INTERP_KERNEL::Exception)
2517 return self->simpleRepr();
2520 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2522 std::ostringstream oss;
2523 self->reprQuickOverview(oss);
2527 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2529 MEDCouplingUMesh *ret=self->getMesh2D();
2532 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2534 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2536 MEDCouplingUMesh *ret=self->getMesh1D();
2539 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2541 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2543 DataArrayInt *ret=self->getMesh3DIds();
2546 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2551 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2554 void updateTime() const throw(INTERP_KERNEL::Exception);
2555 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2556 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2559 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2562 static MEDCouplingCMesh *New();
2563 static MEDCouplingCMesh *New(const char *meshName);
2564 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2565 void setCoords(const DataArrayDouble *coordsX,
2566 const DataArrayDouble *coordsY=0,
2567 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2568 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2572 return MEDCouplingCMesh::New();
2574 MEDCouplingCMesh(const char *meshName)
2576 return MEDCouplingCMesh::New(meshName);
2578 std::string __str__() const throw(INTERP_KERNEL::Exception)
2580 return self->simpleRepr();
2582 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2584 std::ostringstream oss;
2585 self->reprQuickOverview(oss);
2588 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2590 DataArrayDouble *ret=self->getCoordsAt(i);
2598 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2601 static MEDCouplingCurveLinearMesh *New();
2602 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2603 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2604 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2605 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2607 MEDCouplingCurveLinearMesh()
2609 return MEDCouplingCurveLinearMesh::New();
2611 MEDCouplingCurveLinearMesh(const char *meshName)
2613 return MEDCouplingCurveLinearMesh::New(meshName);
2615 std::string __str__() const throw(INTERP_KERNEL::Exception)
2617 return self->simpleRepr();
2619 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2621 std::ostringstream oss;
2622 self->reprQuickOverview(oss);
2625 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2627 DataArrayDouble *ret=self->getCoords();
2632 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2634 int szArr,sw,iTypppArr;
2635 std::vector<int> stdvecTyyppArr;
2636 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2637 self->setNodeGridStructure(tmp,tmp+szArr);
2644 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
2646 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
2648 int sz=0,sw=-1,val1=-1;
2649 std::vector<int> val2;
2650 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
2651 return self->clonePart(inp,inp+sz);
2654 PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
2656 DataArrayInt *ret1=0;
2658 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
2659 PyObject *res=PyTuple_New(2);
2660 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2662 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2665 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2666 PyTuple_SetItem(res,1,res1);
2671 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2673 std::vector<int> vVal; int iVal=-1;
2675 const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
2677 throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
2678 DataArrayInt *ret0=0,*ret1=0;
2679 self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
2680 PyObject *pyRet=PyTuple_New(2);
2681 PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2682 PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
2689 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2690 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2693 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
2695 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2696 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2699 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
2701 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2702 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2705 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
2707 PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
2708 { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
2711 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
2713 PyObject *getArrayOfDiscIds() const
2715 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
2718 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2721 PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
2723 std::vector<int> ret1;
2724 std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
2725 std::size_t sz=ret0.size();
2726 PyObject *pyRet=PyTuple_New(2);
2727 PyObject *pyRet0=PyList_New((int)sz);
2728 PyObject *pyRet1=PyList_New((int)sz);
2729 for(std::size_t i=0;i<sz;i++)
2731 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
2734 PyTuple_SetItem(pyRet,0,pyRet0);
2735 PyTuple_SetItem(pyRet,1,pyRet1);
2740 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2742 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2745 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2746 PyObject *ret=PyTuple_New(2);
2747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2748 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2753 namespace ParaMEDMEM
2755 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
2758 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
2759 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
2760 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2761 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
2762 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
2763 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
2764 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2765 const char *getDescription() const throw(INTERP_KERNEL::Exception);
2766 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
2767 const char *getName() const throw(INTERP_KERNEL::Exception);
2768 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
2769 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
2770 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
2771 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
2772 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
2773 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
2774 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
2775 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
2776 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
2777 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
2778 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
2779 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
2780 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
2781 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
2782 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
2783 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
2785 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
2787 MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
2790 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
2793 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
2795 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
2798 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
2801 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
2803 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
2804 return convertIntArrToPyList3(ret);
2807 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
2810 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
2811 PyObject *ret=PyTuple_New(2);
2812 PyObject *ret0Py=ret0?Py_True:Py_False;
2814 PyTuple_SetItem(ret,0,ret0Py);
2815 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2819 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
2821 DataArrayInt *ret1=0;
2822 MEDCouplingMesh *ret0=0;
2824 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2825 if (!SWIG_IsOK(res1))
2828 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2829 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
2833 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2835 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2836 da2->checkAllocated();
2837 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
2839 PyObject *res = PyList_New(2);
2840 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2841 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2845 PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
2847 DataArrayInt *ret1=0;
2849 MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
2850 PyObject *res=PyTuple_New(2);
2851 PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
2853 PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
2856 PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
2857 PyTuple_SetItem(res,1,res1);
2862 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
2866 std::vector<int> pos2;
2867 DataArrayInt *pos3=0;
2868 DataArrayIntTuple *pos4=0;
2869 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2874 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
2878 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
2882 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
2885 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
2889 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
2890 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
2893 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2894 if (!SWIG_IsOK(res1))
2897 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2898 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
2902 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2904 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2905 da2->checkAllocated();
2906 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
2910 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
2912 std::vector<int> tmp;
2913 self->getCellIdsHavingGaussLocalization(locId,tmp);
2914 DataArrayInt *ret=DataArrayInt::New();
2915 ret->alloc((int)tmp.size(),1);
2916 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2917 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2922 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
2925 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
2926 static MEDCouplingFieldTemplate *New(TypeOfField type);
2927 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2928 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2929 void updateTime() const;
2932 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
2934 return MEDCouplingFieldTemplate::New(f);
2937 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
2939 return MEDCouplingFieldTemplate::New(type);
2942 std::string __str__() const throw(INTERP_KERNEL::Exception)
2944 return self->simpleRepr();
2947 std::string __repr__() const throw(INTERP_KERNEL::Exception)
2949 std::ostringstream oss;
2950 self->reprQuickOverview(oss);
2956 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
2959 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
2960 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
2961 void setTimeUnit(const char *unit);
2962 const char *getTimeUnit() const;
2963 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
2964 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2965 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
2966 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2967 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
2968 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
2969 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
2970 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
2971 MEDCouplingFieldDouble *deepCpy() const;
2972 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
2973 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
2974 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
2975 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
2976 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
2977 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2978 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
2979 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2980 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2981 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
2982 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
2983 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2984 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
2985 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
2986 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
2987 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
2988 void setIteration(int it) throw(INTERP_KERNEL::Exception);
2989 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
2990 void setOrder(int order) throw(INTERP_KERNEL::Exception);
2991 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
2992 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
2993 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
2994 void updateTime() const throw(INTERP_KERNEL::Exception);
2995 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2996 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
2997 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2998 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
2999 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3000 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3001 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3002 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3003 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3004 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3005 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3006 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3007 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3008 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3009 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3010 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3011 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3012 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3013 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3014 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3015 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3016 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3017 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3018 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3019 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3020 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3021 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3022 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3023 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3024 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3025 double getMaxValue() const throw(INTERP_KERNEL::Exception);
3026 double getMinValue() const throw(INTERP_KERNEL::Exception);
3027 double getAverageValue() const throw(INTERP_KERNEL::Exception);
3028 double norm2() const throw(INTERP_KERNEL::Exception);
3029 double normMax() const throw(INTERP_KERNEL::Exception);
3030 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3031 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3032 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3033 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3034 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3035 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3036 MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3037 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3038 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3039 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3040 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3041 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3042 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3043 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3044 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3045 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3046 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3047 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3048 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3049 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3050 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3051 MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3053 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3055 return MEDCouplingFieldDouble::New(type,td);
3058 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3060 return MEDCouplingFieldDouble::New(ft,td);
3063 std::string __str__() const throw(INTERP_KERNEL::Exception)
3065 return self->simpleRepr();
3068 std::string __repr__() const throw(INTERP_KERNEL::Exception)
3070 std::ostringstream oss;
3071 self->reprQuickOverview(oss);
3075 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3077 DataArrayDouble *ret=self->getArray();
3083 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3085 std::vector<DataArrayDouble *> arrs=self->getArrays();
3086 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3090 PyObject *ret=PyTuple_New(sz);
3091 for(int i=0;i<sz;i++)
3094 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3096 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3101 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3103 std::vector<const DataArrayDouble *> tmp;
3104 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3106 std::vector<DataArrayDouble *> arrs(sz);
3107 for(int i=0;i<sz;i++)
3108 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3109 self->setArrays(arrs);
3112 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3114 DataArrayDouble *ret=self->getEndArray();
3120 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3124 DataArrayDoubleTuple *aa;
3125 std::vector<double> bb;
3127 const MEDCouplingMesh *mesh=self->getMesh();
3129 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3130 int spaceDim=mesh->getSpaceDimension();
3131 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3132 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3134 int sz=self->getNumberOfComponents();
3135 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3136 self->getValueOn(spaceLoc,res);
3137 return convertDblArrToPyList(res,sz);
3140 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3142 int sz=self->getNumberOfComponents();
3143 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3144 self->getValueOnPos(i,j,k,res);
3145 return convertDblArrToPyList(res,sz);
3148 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3151 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
3152 if (!SWIG_IsOK(res1))
3155 INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3156 const MEDCouplingMesh *mesh=self->getMesh();
3158 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3159 int spaceDim=mesh->getSpaceDimension();
3160 int nbOfPoints=size/spaceDim;
3161 if(size%spaceDim!=0)
3163 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3165 return self->getValueOnMulti(tmp,nbOfPoints);
3169 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3171 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3172 da2->checkAllocated();
3173 int size=da2->getNumberOfTuples();
3174 int nbOfCompo=da2->getNumberOfComponents();
3175 const MEDCouplingMesh *mesh=self->getMesh();
3177 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3178 if(nbOfCompo!=mesh->getSpaceDimension())
3180 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3182 return self->getValueOnMulti(da2->getConstPointer(),size);
3186 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3190 DataArrayDoubleTuple *aa;
3191 std::vector<double> bb;
3193 const MEDCouplingMesh *mesh=self->getMesh();
3195 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3196 int spaceDim=mesh->getSpaceDimension();
3197 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3198 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3201 int sz=self->getNumberOfComponents();
3202 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3203 self->getValueOn(spaceLoc,time,res);
3204 return convertDblArrToPyList(res,sz);
3207 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3209 if(self->getArray()!=0)
3210 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3213 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3214 ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3215 self->setArray(arr);
3219 PyObject *getTime() throw(INTERP_KERNEL::Exception)
3222 double tmp0=self->getTime(tmp1,tmp2);
3223 PyObject *res = PyList_New(3);
3224 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3225 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3226 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3230 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3233 double tmp0=self->getStartTime(tmp1,tmp2);
3234 PyObject *res = PyList_New(3);
3235 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3236 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3237 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3241 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3244 double tmp0=self->getEndTime(tmp1,tmp2);
3245 PyObject *res = PyList_New(3);
3246 PyList_SetItem(res,0,SWIG_From_double(tmp0));
3247 PyList_SetItem(res,1,SWIG_From_int(tmp1));
3248 PyList_SetItem(res,2,SWIG_From_int(tmp2));
3251 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3253 int sz=self->getNumberOfComponents();
3254 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3255 self->accumulate(tmp);
3256 return convertDblArrToPyList(tmp,sz);
3258 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3260 int sz=self->getNumberOfComponents();
3261 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3262 self->integral(isWAbs,tmp);
3263 return convertDblArrToPyList(tmp,sz);
3265 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3267 int sz=self->getNumberOfComponents();
3268 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3269 self->getWeightedAverageValue(tmp,isWAbs);
3270 return convertDblArrToPyList(tmp,sz);
3272 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3274 int sz=self->getNumberOfComponents();
3275 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3277 return convertDblArrToPyList(tmp,sz);
3279 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3281 int sz=self->getNumberOfComponents();
3282 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3284 return convertDblArrToPyList(tmp,sz);
3286 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3289 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3290 if (!SWIG_IsOK(res1))
3293 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3294 self->renumberCells(tmp,check);
3298 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3300 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3301 da2->checkAllocated();
3302 self->renumberCells(da2->getConstPointer(),check);
3305 void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3308 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3309 if (!SWIG_IsOK(res1))
3312 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3313 self->renumberNodes(tmp,eps);
3317 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3319 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3320 da2->checkAllocated();
3321 self->renumberNodes(da2->getConstPointer(),eps);
3325 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3329 std::vector<int> multiVal;
3330 std::pair<int, std::pair<int,int> > slic;
3331 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3332 const MEDCouplingMesh *mesh=self->getMesh();
3334 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3335 int nbc=mesh->getNumberOfCells();
3336 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3343 std::ostringstream oss;
3344 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3345 throw INTERP_KERNEL::Exception(oss.str().c_str());
3348 return self->buildSubPart(&singleVal,&singleVal+1);
3353 int tmp=nbc+singleVal;
3354 return self->buildSubPart(&tmp,&tmp+1);
3358 std::ostringstream oss;
3359 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3360 throw INTERP_KERNEL::Exception(oss.str().c_str());
3366 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3370 return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3375 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3376 daIntTyypp->checkAllocated();
3377 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3380 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3384 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3386 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";
3387 if(PyTuple_Check(li))
3389 Py_ssize_t sz=PyTuple_Size(li);
3391 throw INTERP_KERNEL::Exception(msg);
3392 PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3395 std::vector<int> multiVal;
3396 std::pair<int, std::pair<int,int> > slic;
3397 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3398 if(!self->getArray())
3399 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3401 { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3402 catch(INTERP_KERNEL::Exception& e)
3403 { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3404 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3405 DataArrayDouble *ret0Arr=ret0->getArray();
3407 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3412 std::vector<int> v2(1,singleVal);
3413 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3414 ret0->setArray(aarr);
3419 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3420 ret0->setArray(aarr);
3425 int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3426 std::vector<int> v2(nbOfComp);
3427 for(int i=0;i<nbOfComp;i++)
3428 v2[i]=slic.first+i*slic.second.second;
3429 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3430 ret0->setArray(aarr);
3434 throw INTERP_KERNEL::Exception(msg);
3439 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3442 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3445 double r1=self->getMaxValue2(tmp);
3446 PyObject *ret=PyTuple_New(2);
3447 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3448 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3452 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3455 double r1=self->getMinValue2(tmp);
3456 PyObject *ret=PyTuple_New(2);
3457 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3458 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3462 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3464 std::vector<int> tmp;
3465 convertPyToNewIntArr3(li,tmp);
3466 return self->keepSelectedComponents(tmp);
3469 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3471 std::vector<int> tmp;
3472 convertPyToNewIntArr3(li,tmp);
3473 self->setSelectedComponents(f,tmp);
3476 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3479 DataArrayDouble *a,*a2;
3480 DataArrayDoubleTuple *aa,*aa2;
3481 std::vector<double> bb,bb2;
3484 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3485 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3486 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3487 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3489 return self->extractSlice3D(orig,vect,eps);
3492 MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3494 return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3497 MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3499 return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3502 MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3504 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.";
3505 const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3508 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3510 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3512 return (*self)-(*other);
3514 throw INTERP_KERNEL::Exception(msg);
3519 DataArrayDoubleTuple *aa;
3520 std::vector<double> bb;
3522 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3527 if(!self->getArray())
3528 throw INTERP_KERNEL::Exception(msg2);
3529 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3530 ret->applyLin(1.,-val);
3531 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3532 ret2->setArray(ret);
3537 if(!self->getArray())
3538 throw INTERP_KERNEL::Exception(msg2);
3539 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3540 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3541 ret2->setArray(ret);
3546 if(!self->getArray())
3547 throw INTERP_KERNEL::Exception(msg2);
3548 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3549 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3550 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3551 ret2->setArray(ret);
3556 if(!self->getArray())
3557 throw INTERP_KERNEL::Exception(msg2);
3558 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3559 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3560 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3561 ret2->setArray(ret);
3565 { throw INTERP_KERNEL::Exception(msg); }
3569 MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3571 return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3574 MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3576 return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3579 MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3581 return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3584 MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3586 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.";
3587 const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3590 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3592 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3594 return (*self)/(*other);
3596 throw INTERP_KERNEL::Exception(msg);
3601 DataArrayDoubleTuple *aa;
3602 std::vector<double> bb;
3604 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3610 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3611 if(!self->getArray())
3612 throw INTERP_KERNEL::Exception(msg2);
3613 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3614 ret->applyLin(1./val,0);
3615 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3616 ret2->setArray(ret);
3621 if(!self->getArray())
3622 throw INTERP_KERNEL::Exception(msg2);
3623 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3624 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3625 ret2->setArray(ret);
3630 if(!self->getArray())
3631 throw INTERP_KERNEL::Exception(msg2);
3632 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3633 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3634 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3635 ret2->setArray(ret);
3640 if(!self->getArray())
3641 throw INTERP_KERNEL::Exception(msg2);
3642 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3643 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3644 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3645 ret2->setArray(ret);
3649 { throw INTERP_KERNEL::Exception(msg); }
3653 MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3655 return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3658 MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3660 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.";
3661 const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3664 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3666 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3668 return (*self)^(*other);
3670 throw INTERP_KERNEL::Exception(msg);
3675 DataArrayDoubleTuple *aa;
3676 std::vector<double> bb;
3678 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3683 if(!self->getArray())
3684 throw INTERP_KERNEL::Exception(msg2);
3685 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3687 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3688 ret2->setArray(ret);
3693 if(!self->getArray())
3694 throw INTERP_KERNEL::Exception(msg2);
3695 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3696 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3697 ret2->setArray(ret);
3702 if(!self->getArray())
3703 throw INTERP_KERNEL::Exception(msg2);
3704 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3705 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3706 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3707 ret2->setArray(ret);
3712 if(!self->getArray())
3713 throw INTERP_KERNEL::Exception(msg2);
3714 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3715 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3716 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3717 ret2->setArray(ret);
3721 { throw INTERP_KERNEL::Exception(msg); }
3725 MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3727 return self->negate();
3730 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3732 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.";
3733 const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3736 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3738 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3742 Py_XINCREF(trueSelf);
3746 throw INTERP_KERNEL::Exception(msg);
3751 DataArrayDoubleTuple *aa;
3752 std::vector<double> bb;
3754 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3759 if(!self->getArray())
3760 throw INTERP_KERNEL::Exception(msg2);
3761 self->getArray()->applyLin(1.,val);
3762 Py_XINCREF(trueSelf);
3767 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3770 Py_XINCREF(trueSelf);
3775 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3776 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3777 ret2->setArray(aaa);
3779 Py_XINCREF(trueSelf);
3784 if(!self->getArray())
3785 throw INTERP_KERNEL::Exception(msg2);
3786 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3787 self->getArray()->addEqual(aaa);
3788 Py_XINCREF(trueSelf);
3792 { throw INTERP_KERNEL::Exception(msg); }
3796 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3798 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.";
3799 const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
3802 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3804 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3808 Py_XINCREF(trueSelf);
3812 throw INTERP_KERNEL::Exception(msg);
3817 DataArrayDoubleTuple *aa;
3818 std::vector<double> bb;
3820 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3825 if(!self->getArray())
3826 throw INTERP_KERNEL::Exception(msg2);
3827 self->getArray()->applyLin(1.,-val);
3828 Py_XINCREF(trueSelf);
3833 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3836 Py_XINCREF(trueSelf);
3841 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3842 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3843 ret2->setArray(aaa);
3845 Py_XINCREF(trueSelf);
3850 if(!self->getArray())
3851 throw INTERP_KERNEL::Exception(msg2);
3852 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3853 self->getArray()->substractEqual(aaa);
3854 Py_XINCREF(trueSelf);
3858 { throw INTERP_KERNEL::Exception(msg); }
3862 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3864 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.";
3865 const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
3868 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3870 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3874 Py_XINCREF(trueSelf);
3878 throw INTERP_KERNEL::Exception(msg);
3883 DataArrayDoubleTuple *aa;
3884 std::vector<double> bb;
3886 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3891 if(!self->getArray())
3892 throw INTERP_KERNEL::Exception(msg2);
3893 self->getArray()->applyLin(val,0);
3894 Py_XINCREF(trueSelf);
3899 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3902 Py_XINCREF(trueSelf);
3907 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3908 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3909 ret2->setArray(aaa);
3911 Py_XINCREF(trueSelf);
3916 if(!self->getArray())
3917 throw INTERP_KERNEL::Exception(msg2);
3918 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3919 self->getArray()->multiplyEqual(aaa);
3920 Py_XINCREF(trueSelf);
3924 { throw INTERP_KERNEL::Exception(msg); }
3928 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3930 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.";
3931 const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
3934 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3936 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3940 Py_XINCREF(trueSelf);
3944 throw INTERP_KERNEL::Exception(msg);
3949 DataArrayDoubleTuple *aa;
3950 std::vector<double> bb;
3952 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3958 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
3959 if(!self->getArray())
3960 throw INTERP_KERNEL::Exception(msg2);
3961 self->getArray()->applyLin(1./val,0);
3962 Py_XINCREF(trueSelf);
3967 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3970 Py_XINCREF(trueSelf);
3975 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3976 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3977 ret2->setArray(aaa);
3979 Py_XINCREF(trueSelf);
3984 if(!self->getArray())
3985 throw INTERP_KERNEL::Exception(msg2);
3986 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3987 self->getArray()->divideEqual(aaa);
3988 Py_XINCREF(trueSelf);
3992 { throw INTERP_KERNEL::Exception(msg); }
3996 PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3998 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.";
3999 const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4002 if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4004 MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4008 Py_XINCREF(trueSelf);
4012 throw INTERP_KERNEL::Exception(msg);
4017 DataArrayDoubleTuple *aa;
4018 std::vector<double> bb;
4020 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4025 if(!self->getArray())
4026 throw INTERP_KERNEL::Exception(msg2);
4027 self->getArray()->applyPow(val);
4028 Py_XINCREF(trueSelf);
4033 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4036 Py_XINCREF(trueSelf);
4041 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4042 MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4043 ret2->setArray(aaa);
4045 Py_XINCREF(trueSelf);
4050 if(!self->getArray())
4051 throw INTERP_KERNEL::Exception(msg2);
4052 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4053 self->getArray()->powEqual(aaa);
4054 Py_XINCREF(trueSelf);
4058 { throw INTERP_KERNEL::Exception(msg); }
4062 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4064 std::vector<const MEDCouplingFieldDouble *> tmp;
4065 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4066 return MEDCouplingFieldDouble::MergeFields(tmp);
4069 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4071 std::vector<const MEDCouplingFieldDouble *> tmp;
4072 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4073 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4078 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4081 int getNumberOfFields() const;
4082 MEDCouplingMultiFields *deepCpy() const;
4083 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4084 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4085 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4086 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4087 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4088 void updateTime() const throw(INTERP_KERNEL::Exception);
4091 std::string __str__() const throw(INTERP_KERNEL::Exception)
4093 return self->simpleRepr();
4095 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4097 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4098 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4100 std::vector<MEDCouplingFieldDouble *> fs(sz);
4101 for(int i=0;i<sz;i++)
4102 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4103 return MEDCouplingMultiFields::New(fs);
4105 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4107 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4108 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4110 std::vector<MEDCouplingFieldDouble *> fs(sz);
4111 for(int i=0;i<sz;i++)
4112 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4113 return MEDCouplingMultiFields::New(fs);
4115 PyObject *getFields() const
4117 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4118 int sz=fields.size();
4119 PyObject *res = PyList_New(sz);
4120 for(int i=0;i<sz;i++)
4124 fields[i]->incrRef();
4125 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4129 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4134 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4136 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4140 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4143 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4145 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4147 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4149 PyObject *res = PyList_New(sz);
4150 for(int i=0;i<sz;i++)
4155 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4159 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4164 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4166 std::vector<int> refs;
4167 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4169 PyObject *res = PyList_New(sz);
4170 for(int i=0;i<sz;i++)
4175 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4179 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4183 PyObject *ret=PyTuple_New(2);
4184 PyTuple_SetItem(ret,0,res);
4185 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4188 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4190 std::vector<DataArrayDouble *> ms=self->getArrays();
4192 PyObject *res = PyList_New(sz);
4193 for(int i=0;i<sz;i++)
4198 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4202 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4207 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4209 std::vector< std::vector<int> > refs;
4210 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4212 PyObject *res = PyList_New(sz);
4213 PyObject *res2 = PyList_New(sz);
4214 for(int i=0;i<sz;i++)
4219 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4223 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4225 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4228 PyObject *ret=PyTuple_New(2);
4229 PyTuple_SetItem(ret,0,res);
4230 PyTuple_SetItem(ret,1,res2);
4236 class MEDCouplingDefinitionTime
4239 MEDCouplingDefinitionTime();
4240 void assign(const MEDCouplingDefinitionTime& other);
4241 bool isEqual(const MEDCouplingDefinitionTime& other) const;
4242 double getTimeResolution() const;
4243 std::vector<double> getHotSpotsTime() const;
4246 std::string __str__() const throw(INTERP_KERNEL::Exception)
4248 std::ostringstream oss;
4249 self->appendRepr(oss);
4253 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4255 int meshId,arrId,arrIdInField,fieldId;
4256 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4257 PyObject *res=PyList_New(4);
4258 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4259 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4260 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4261 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4265 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4267 int meshId,arrId,arrIdInField,fieldId;
4268 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4269 PyObject *res=PyList_New(4);
4270 PyList_SetItem(res,0,PyInt_FromLong(meshId));
4271 PyList_SetItem(res,1,PyInt_FromLong(arrId));
4272 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4273 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4279 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4282 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4283 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4287 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4289 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4290 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4292 std::vector<MEDCouplingFieldDouble *> fs(sz);
4293 for(int i=0;i<sz;i++)
4294 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4295 return MEDCouplingFieldOverTime::New(fs);
4297 std::string __str__() const throw(INTERP_KERNEL::Exception)
4299 return self->simpleRepr();
4301 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4303 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4304 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4306 std::vector<MEDCouplingFieldDouble *> fs(sz);
4307 for(int i=0;i<sz;i++)
4308 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4309 return MEDCouplingFieldOverTime::New(fs);
4317 __filename=os.environ.get('PYTHONSTARTUP')
4318 if __filename and os.path.isfile(__filename):
4319 execfile(__filename)