1 // Copyright (C) 2007-2012 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;
50 %template(ivec) std::vector<int>;
51 %template(dvec) std::vector<double>;
52 %template(svec) std::vector<std::string>;
54 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
56 $result=convertMesh($1,$owner);
59 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
61 $result=convertMesh($1,$owner);
64 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
66 $result=convertMesh($1,$owner);
69 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
71 $result=convertFieldDiscretization($1,$owner);
74 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
76 $result=convertMultiFields($1,$owner);
79 %typemap(out) ParaMEDMEM::DataArrayChar*
81 $result=convertDataArrayChar($1,$owner);
85 %init %{ import_array(); %}
88 %feature("autodoc", "1");
89 %feature("docstring");
91 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
92 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
93 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
94 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
95 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
96 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
97 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
98 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
99 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
100 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
101 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
102 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
103 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
104 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
105 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
132 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
133 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
134 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator+;
135 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator-;
136 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator*;
137 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
138 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
139 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
140 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
141 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
143 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
144 %newobject ParaMEDMEM::DataArrayInt::New;
145 %newobject ParaMEDMEM::DataArrayInt::__iter__;
146 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
147 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
148 %newobject ParaMEDMEM::DataArrayInt::performCpy;
149 %newobject ParaMEDMEM::DataArrayInt::substr;
150 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
151 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
152 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
153 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
154 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
155 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
156 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
157 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
158 %newobject ParaMEDMEM::DataArrayInt::renumber;
159 %newobject ParaMEDMEM::DataArrayInt::renumberR;
160 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
161 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
162 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
163 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
164 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
165 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
166 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
167 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
168 %newobject ParaMEDMEM::DataArrayInt::negate;
169 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
170 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
171 %newobject ParaMEDMEM::DataArrayInt::Meld;
172 %newobject ParaMEDMEM::DataArrayInt::Add;
173 %newobject ParaMEDMEM::DataArrayInt::Substract;
174 %newobject ParaMEDMEM::DataArrayInt::Multiply;
175 %newobject ParaMEDMEM::DataArrayInt::Divide;
176 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
177 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
178 %newobject ParaMEDMEM::DataArrayInt::Range;
179 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
180 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
181 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
182 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
183 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
184 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
185 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
186 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
187 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
188 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
189 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
190 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
191 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
192 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
193 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
194 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
195 %newobject ParaMEDMEM::DataArrayInt::__neg__;
196 %newobject ParaMEDMEM::DataArrayInt::__add__;
197 %newobject ParaMEDMEM::DataArrayInt::__radd__;
198 %newobject ParaMEDMEM::DataArrayInt::__sub__;
199 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
200 %newobject ParaMEDMEM::DataArrayInt::__mul__;
201 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
202 %newobject ParaMEDMEM::DataArrayInt::__div__;
203 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
204 %newobject ParaMEDMEM::DataArrayInt::__mod__;
205 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
206 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
207 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
208 %newobject ParaMEDMEM::DataArrayChar::renumber;
209 %newobject ParaMEDMEM::DataArrayChar::renumberR;
210 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
211 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
212 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
213 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
214 %newobject ParaMEDMEM::DataArrayChar::keepSelectedComponents;
215 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
216 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
217 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
218 %newobject ParaMEDMEM::DataArrayChar::Meld;
219 %newobject ParaMEDMEM::DataArrayByte::New;
220 %newobject ParaMEDMEM::DataArrayByte::__iter__;
221 %newobject ParaMEDMEM::DataArrayByte::deepCpy;
222 %newobject ParaMEDMEM::DataArrayByte::performCpy;
223 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
224 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
225 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
226 %newobject ParaMEDMEM::DataArrayAsciiChar::deepCpy;
227 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
228 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
229 %newobject ParaMEDMEM::DataArrayDouble::New;
230 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
231 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
232 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
233 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
234 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
235 %newobject ParaMEDMEM::DataArrayDouble::Meld;
236 %newobject ParaMEDMEM::DataArrayDouble::Dot;
237 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
238 %newobject ParaMEDMEM::DataArrayDouble::Add;
239 %newobject ParaMEDMEM::DataArrayDouble::Substract;
240 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
241 %newobject ParaMEDMEM::DataArrayDouble::Divide;
242 %newobject ParaMEDMEM::DataArrayDouble::substr;
243 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
244 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
245 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
246 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
247 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
248 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
249 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
250 %newobject ParaMEDMEM::DataArrayDouble::negate;
251 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
252 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
253 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
254 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
255 %newobject ParaMEDMEM::DataArrayDouble::determinant;
256 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
257 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
258 %newobject ParaMEDMEM::DataArrayDouble::inverse;
259 %newobject ParaMEDMEM::DataArrayDouble::trace;
260 %newobject ParaMEDMEM::DataArrayDouble::deviator;
261 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
262 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
263 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
264 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
265 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
266 %newobject ParaMEDMEM::DataArrayDouble::renumber;
267 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
268 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
269 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
270 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
271 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
272 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
273 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
274 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
275 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
276 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
277 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
278 %newobject ParaMEDMEM::DataArrayDouble::__add__;
279 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
280 %newobject ParaMEDMEM::DataArrayDouble::__sub__;
281 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
282 %newobject ParaMEDMEM::DataArrayDouble::__mul__;
283 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
284 %newobject ParaMEDMEM::DataArrayDouble::__div__;
285 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
286 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
287 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
288 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
289 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
290 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
291 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
292 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
293 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
294 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
295 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
296 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
297 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
298 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
299 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
300 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
301 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
302 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
303 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
304 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
305 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
306 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
307 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
308 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
309 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
310 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
317 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
318 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
319 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
320 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
321 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
322 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
323 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
324 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
325 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
326 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
327 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
328 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
329 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
330 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
331 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
332 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
333 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
334 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
335 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
336 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
337 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
338 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
339 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
340 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
341 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
342 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
343 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
344 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
345 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
346 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
347 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
348 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
349 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
350 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
351 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
352 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
353 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
354 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
355 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
356 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
357 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
358 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
359 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
360 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
361 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
362 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
363 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
364 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
365 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
366 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
368 %feature("unref") DataArrayDouble "$this->decrRef();"
369 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
370 %feature("unref") MEDCouplingMesh "$this->decrRef();"
371 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
372 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
373 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
374 %feature("unref") DataArrayInt "$this->decrRef();"
375 %feature("unref") MEDCouplingField "$this->decrRef();"
376 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
377 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
378 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
379 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
380 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
381 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
382 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
383 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
384 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
386 %rename(assign) *::operator=;
387 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
388 %ignore ParaMEDMEM::RefCountObject::decrRef;
389 %ignore ParaMEDMEM::MemArray::operator=;
390 %ignore ParaMEDMEM::MemArray::operator[];
391 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
392 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
393 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
394 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
395 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
396 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
397 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
398 %ignore ParaMEDMEM::DataArrayByteIterator::nextt;
399 %ignore ParaMEDMEM::DataArrayByteTuple::repr;
400 %ignore ParaMEDMEM::DataArrayByteTuple::byteValue;
401 %ignore ParaMEDMEM::DataArrayAsciiCharIterator::nextt;
402 %ignore ParaMEDMEM::DataArrayAsciiCharTuple::repr;
403 %ignore ParaMEDMEM::DataArrayAsciiCharTuple::asciiCharValue;
404 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
405 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
406 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
407 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
408 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
409 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
410 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
414 %rename (InterpKernelException) INTERP_KERNEL::Exception;
416 namespace INTERP_KERNEL
421 Exception(const char* what);
422 ~Exception() throw ();
423 const char *what() const throw ();
426 std::string __str__() const
428 return std::string(self->what());
434 %include "MEDCouplingTimeLabel.hxx"
458 CONST_ON_TIME_INTERVAL = 7
459 } TypeOfTimeDiscretization;
461 const char *MEDCouplingVersionStr();
462 int MEDCouplingVersion();
463 PyObject *MEDCouplingVersionMajMinRel()
465 int tmp0=0,tmp1=0,tmp2=0;
466 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
467 PyObject *res = PyList_New(3);
468 PyList_SetItem(res,0,SWIG_From_int(tmp0));
469 PyList_SetItem(res,1,SWIG_From_int(tmp1));
470 PyList_SetItem(res,2,SWIG_From_int(tmp2));
478 RefCountObject(const RefCountObject& other);
481 bool decrRef() const;
482 void incrRef() const;
483 virtual std::size_t getHeapMemorySize() const;
492 UNSTRUCTURED_DESC = 6,
496 } MEDCouplingMeshType;
499 class DataArrayDouble;
500 class MEDCouplingUMesh;
501 class MEDCouplingFieldDouble;
503 %extend RefCountObject
505 std::string getHiddenCppPointer() const
507 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
512 class MEDCouplingMesh : public RefCountObject, public TimeLabel
515 void setName(const char *name);
516 const char *getName() const;
517 void setDescription(const char *descr);
518 const char *getDescription() const;
519 void setTime(double val, int iteration, int order);
520 void setTimeUnit(const char *unit);
521 const char *getTimeUnit() const;
522 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
523 bool isStructured() const throw(INTERP_KERNEL::Exception);
524 virtual MEDCouplingMesh *deepCpy() const;
525 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
526 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
527 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
528 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
529 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
530 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
531 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
532 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
533 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
534 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
535 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
536 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
537 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
538 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
539 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
540 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
541 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
542 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
543 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
544 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
546 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
547 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
548 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
549 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
550 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
551 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
552 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
553 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
554 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
555 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
556 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
557 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
558 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
561 std::string __str__() const throw(INTERP_KERNEL::Exception)
563 return self->simpleRepr();
566 PyObject *getTime() throw(INTERP_KERNEL::Exception)
569 double tmp0=self->getTime(tmp1,tmp2);
570 PyObject *res = PyList_New(3);
571 PyList_SetItem(res,0,SWIG_From_double(tmp0));
572 PyList_SetItem(res,1,SWIG_From_int(tmp1));
573 PyList_SetItem(res,2,SWIG_From_int(tmp2));
577 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
581 DataArrayDoubleTuple *aa;
582 std::vector<double> bb;
584 int spaceDim=self->getSpaceDimension();
585 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
586 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
587 return self->getCellContainingPoint(pos,eps);
590 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
594 DataArrayDoubleTuple *aa;
595 std::vector<double> bb;
597 int spaceDim=self->getSpaceDimension();
598 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
599 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
600 std::vector<int> elts,eltsIndex;
601 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
602 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
603 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
604 d0->alloc(elts.size(),1);
605 d1->alloc(eltsIndex.size(),1);
606 std::copy(elts.begin(),elts.end(),d0->getPointer());
607 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
608 PyObject *ret=PyTuple_New(2);
609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
610 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
614 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
616 std::vector<int> elts,eltsIndex;
617 int spaceDim=self->getSpaceDimension();
619 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
620 if (!SWIG_IsOK(res1))
623 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
624 int nbOfPoints=size/spaceDim;
627 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
629 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
633 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
635 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
636 da2->checkAllocated();
637 int size=da2->getNumberOfTuples();
638 int nbOfCompo=da2->getNumberOfComponents();
639 if(nbOfCompo!=spaceDim)
641 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
643 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
645 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
646 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
647 d0->alloc(elts.size(),1);
648 d1->alloc(eltsIndex.size(),1);
649 std::copy(elts.begin(),elts.end(),d0->getPointer());
650 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
651 PyObject *ret=PyTuple_New(2);
652 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
653 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
657 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
661 DataArrayDoubleTuple *aa;
662 std::vector<double> bb;
664 int spaceDim=self->getSpaceDimension();
665 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
666 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
667 std::vector<int> elts;
668 self->getCellsContainingPoint(pos,eps,elts);
669 DataArrayInt *ret=DataArrayInt::New();
670 ret->alloc((int)elts.size(),1);
671 std::copy(elts.begin(),elts.end(),ret->getPointer());
672 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
675 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
678 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
679 if (!SWIG_IsOK(res1))
682 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
683 self->renumberCells(tmp,check);
687 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
689 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
690 da2->checkAllocated();
691 self->renumberCells(da2->getConstPointer(),check);
695 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
697 DataArrayInt *cellCor, *nodeCor;
698 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
699 PyObject *res = PyList_New(2);
700 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
701 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
705 PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
707 DataArrayInt *cellCor=0,*nodeCor=0;
708 self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
709 PyObject *res = PyList_New(2);
710 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
711 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
715 DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
717 DataArrayInt *cellCor=0;
718 self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
722 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
725 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
726 if (!SWIG_IsOK(res1))
729 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
730 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
734 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
736 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
737 da2->checkAllocated();
738 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
741 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
743 std::vector<int> conn;
744 self->getNodeIdsOfCell(cellId,conn);
745 return convertIntArrToPyList2(conn);
748 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
750 std::vector<double> coo;
751 self->getCoordinatesOfNode(nodeId,coo);
752 return convertDblArrToPyList2(coo);
755 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
759 DataArrayDoubleTuple *aa;
760 std::vector<double> bb;
762 int spaceDim=self->getSpaceDimension();
763 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
764 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
765 self->scale(pointPtr,factor);
768 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
770 int spaceDim=self->getSpaceDimension();
771 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
772 self->getBoundingBox(tmp);
773 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
777 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
780 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
781 PyObject *ret=PyTuple_New(2);
782 PyObject *ret0Py=ret0?Py_True:Py_False;
784 PyTuple_SetItem(ret,0,ret0Py);
785 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
789 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
791 int szArr,sw,iTypppArr;
792 std::vector<int> stdvecTyyppArr;
793 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
794 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
795 if(sw==3)//DataArrayInt
797 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
798 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
799 std::string name=argpt->getName();
801 ret->setName(name.c_str());
803 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
806 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
808 int szArr,sw,iTypppArr;
809 std::vector<int> stdvecTyyppArr;
811 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
812 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
813 if(sw==3)//DataArrayInt
815 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
816 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
817 std::string name=argpt->getName();
819 ret->setName(name.c_str());
822 PyObject *res = PyList_New(2);
823 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
824 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
825 PyList_SetItem(res,0,obj0);
826 PyList_SetItem(res,1,obj1);
830 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
832 std::vector<int> vals=self->getDistributionOfTypes();
833 PyObject *ret=PyList_New((int)vals.size()/3);
834 for(int j=0;j<(int)vals.size()/3;j++)
836 PyObject *ret1=PyList_New(3);
837 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
838 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
839 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
840 PyList_SetItem(ret,j,ret1);
845 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
847 std::vector<int> code;
848 std::vector<const DataArrayInt *> idsPerType;
849 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
850 convertPyToNewIntArr4(li,1,3,code);
851 return self->checkTypeConsistencyAndContig(code,idsPerType);
854 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
856 std::vector<int> code;
857 std::vector<DataArrayInt *> idsInPflPerType;
858 std::vector<DataArrayInt *> idsPerType;
859 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
860 PyObject *ret=PyTuple_New(3);
861 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
862 PyObject *ret1=PyList_New(idsInPflPerType.size());
863 for(std::size_t j=0;j<idsInPflPerType.size();j++)
864 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
865 PyTuple_SetItem(ret,1,ret1);
866 int n=idsPerType.size();
867 PyObject *ret2=PyList_New(n);
869 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
870 PyTuple_SetItem(ret,2,ret2);
874 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
878 DataArrayDoubleTuple *aa;
879 std::vector<double> bb;
881 int spaceDim=self->getSpaceDimension();
882 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
883 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
884 self->translate(vectorPtr);
887 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
889 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
892 DataArrayDoubleTuple *aa;
893 std::vector<double> bb;
895 int spaceDim=self->getSpaceDimension();
896 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
897 self->rotate(centerPtr,0,alpha);
900 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
902 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
905 DataArrayDoubleTuple *aa;
906 std::vector<double> bb;
908 int spaceDim=self->getSpaceDimension();
909 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
910 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
911 self->rotate(centerPtr,vectorPtr,alpha);
914 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
916 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
917 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
918 PyObject *res=PyList_New(result.size());
919 for(int i=0;iL!=result.end(); i++, iL++)
920 PyList_SetItem(res,i,PyInt_FromLong(*iL));
924 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
926 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
927 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
928 return MEDCouplingMesh::MergeMeshes(tmp);
934 %extend ParaMEDMEM::DataArray
936 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
938 const std::vector<std::string>& comps=self->getInfoOnComponents();
939 PyObject *ret=PyList_New((int)comps.size());
940 for(int i=0;i<(int)comps.size();i++)
941 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
945 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
947 std::vector<int> tmp;
948 convertPyToNewIntArr3(li,tmp);
949 self->copyPartOfStringInfoFrom(other,tmp);
952 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
954 std::vector<int> tmp;
955 convertPyToNewIntArr3(li,tmp);
956 self->copyPartOfStringInfoFrom2(tmp,other);
960 %extend ParaMEDMEM::DataArrayInt
962 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
964 int szArr,sw,iTypppArr;
965 std::vector<int> stdvecTyyppArr;
966 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
967 self->pushBackValsSilent(tmp,tmp+szArr);
970 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
972 std::vector<int> ret1;
973 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
974 std::size_t sz=ret0.size();
975 PyObject *pyRet=PyTuple_New(2);
976 PyObject *pyRet0=PyList_New((int)sz);
977 PyObject *pyRet1=PyList_New((int)sz);
978 for(std::size_t i=0;i<sz;i++)
980 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
981 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
983 PyTuple_SetItem(pyRet,0,pyRet0);
984 PyTuple_SetItem(pyRet,1,pyRet1);
989 %extend ParaMEDMEM::DataArrayChar
991 int __len__() const throw(INTERP_KERNEL::Exception)
993 if(self->isAllocated())
995 return self->getNumberOfTuples();
999 throw INTERP_KERNEL::Exception("DataArrayChar::__len__ : Instance is NOT allocated !");
1003 PyObject *isEqualIfNotWhy(const DataArrayChar& other) const throw(INTERP_KERNEL::Exception)
1006 bool ret0=self->isEqualIfNotWhy(other,ret1);
1007 PyObject *ret=PyTuple_New(2);
1008 PyObject *ret0Py=ret0?Py_True:Py_False;
1010 PyTuple_SetItem(ret,0,ret0Py);
1011 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
1015 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
1018 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1019 if (!SWIG_IsOK(res1))
1022 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1023 if(size!=self->getNumberOfTuples())
1025 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1027 self->renumberInPlace(tmp);
1031 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1033 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1034 da2->checkAllocated();
1035 int size=self->getNumberOfTuples();
1036 if(size!=self->getNumberOfTuples())
1038 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1040 self->renumberInPlace(da2->getConstPointer());
1044 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
1047 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1048 if (!SWIG_IsOK(res1))
1051 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1052 if(size!=self->getNumberOfTuples())
1054 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1056 self->renumberInPlaceR(tmp);
1060 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1062 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1063 da2->checkAllocated();
1064 int size=self->getNumberOfTuples();
1065 if(size!=self->getNumberOfTuples())
1067 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1069 self->renumberInPlaceR(da2->getConstPointer());
1073 DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
1076 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1077 if (!SWIG_IsOK(res1))
1080 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1081 if(size!=self->getNumberOfTuples())
1083 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1085 return self->renumber(tmp);
1089 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1091 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1092 da2->checkAllocated();
1093 int size=self->getNumberOfTuples();
1094 if(size!=self->getNumberOfTuples())
1096 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1098 return self->renumber(da2->getConstPointer());
1102 DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
1105 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1106 if (!SWIG_IsOK(res1))
1109 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1110 if(size!=self->getNumberOfTuples())
1112 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1114 return self->renumberR(tmp);
1118 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1120 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1121 da2->checkAllocated();
1122 int size=self->getNumberOfTuples();
1123 if(size!=self->getNumberOfTuples())
1125 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1127 return self->renumberR(da2->getConstPointer());
1131 DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
1134 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1135 if (!SWIG_IsOK(res1))
1138 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1139 if(size!=self->getNumberOfTuples())
1141 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1143 return self->renumberAndReduce(tmp,newNbOfTuple);
1147 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1149 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1150 da2->checkAllocated();
1151 int size=self->getNumberOfTuples();
1152 if(size!=self->getNumberOfTuples())
1154 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
1156 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
1160 DataArrayChar *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
1163 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1164 if (!SWIG_IsOK(res1))
1167 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1168 return self->selectByTupleIdSafe(tmp,tmp+size);
1172 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1174 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1175 da2->checkAllocated();
1176 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
1180 DataArrayChar *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
1182 std::vector<int> tmp;
1183 convertPyToNewIntArr3(li,tmp);
1184 return self->keepSelectedComponents(tmp);
1187 static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
1189 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
1190 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
1191 return DataArrayChar::Aggregate(tmp);
1194 static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
1196 std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
1197 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
1198 return DataArrayChar::Meld(tmp);
1202 %extend ParaMEDMEM::DataArrayByteTuple
1204 std::string __str__() const
1206 return self->repr();
1209 char __int__() const throw(INTERP_KERNEL::Exception)
1211 return self->byteValue();
1214 DataArrayByte *buildDAByte()
1216 return self->buildDAByte(1,self->getNumberOfCompo());
1220 %extend ParaMEDMEM::DataArrayByteIterator
1224 DataArrayByteTuple *ret=self->nextt();
1226 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayByteTuple,SWIG_POINTER_OWN | 0);
1229 PyErr_SetString(PyExc_StopIteration,"No more data.");
1235 %extend ParaMEDMEM::DataArrayByte
1237 DataArrayByte() throw(INTERP_KERNEL::Exception)
1239 return DataArrayByte::New();
1242 static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
1244 const char *msg="ParaMEDMEM::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
1245 if(PyList_Check(elt0) || PyTuple_Check(elt0))
1249 if(PyInt_Check(nbOfTuples))
1251 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
1253 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
1256 if(PyInt_Check(nbOfComp))
1257 {//DataArrayByte.New([1,3,4,5],2,2)
1258 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
1260 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
1261 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
1262 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
1263 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1267 throw INTERP_KERNEL::Exception(msg);
1270 {//DataArrayByte.New([1,3,4],3)
1271 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
1273 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
1274 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1279 throw INTERP_KERNEL::Exception(msg);
1282 {// DataArrayByte.New([1,3,4])
1283 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
1284 int tmpp1=-1,tmpp2=-1;
1285 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
1286 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1290 else if(PyInt_Check(elt0))
1292 int nbOfTuples1=PyInt_AS_LONG(elt0);
1294 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
1299 if(PyInt_Check(nbOfTuples))
1300 {//DataArrayByte.New(5,2)
1301 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
1303 throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
1304 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
1305 ret->alloc(nbOfTuples1,nbOfCompo);
1309 throw INTERP_KERNEL::Exception(msg);
1312 throw INTERP_KERNEL::Exception(msg);
1315 {//DataArrayByte.New(5)
1316 MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
1317 ret->alloc(nbOfTuples1,1);
1322 throw INTERP_KERNEL::Exception(msg);
1325 DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
1327 return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
1330 int __int__() const throw(INTERP_KERNEL::Exception)
1332 return (int) self->byteValue();
1335 DataArrayByteIterator *__iter__() throw(INTERP_KERNEL::Exception)
1337 return self->iterator();
1340 int getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
1342 return (int)self->getIJ(tupleId,compoId);
1345 int getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
1347 return (int)self->getIJSafe(tupleId,compoId);
1350 std::string __str__() const throw(INTERP_KERNEL::Exception)
1352 return self->repr();
1355 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
1357 const char *vals=self->getConstPointer();
1358 int nbOfComp=self->getNumberOfComponents();
1359 int nbOfTuples=self->getNumberOfTuples();
1360 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
1363 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
1366 int ival=-1; std::vector<int> ivval;
1367 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
1368 std::vector<char> vals(sz);
1369 std::copy(pt,pt+sz,vals.begin());
1370 return self->presenceOfTuple(vals);
1373 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
1376 int ival=-1; std::vector<int> ivval;
1377 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
1378 std::vector<char> vals2(sz);
1379 std::copy(pt,pt+sz,vals2.begin());
1380 return self->presenceOfValue(vals2);
1383 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
1386 int ival=-1; std::vector<int> ivval;
1387 const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
1388 std::vector<char> vals2(sz);
1389 std::copy(pt,pt+sz,vals2.begin());
1390 return self->locateValue(vals2);
1393 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
1396 int ival=-1; std::vector<int> ivval;
1397 const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
1398 std::vector<char> vals(sz);
1399 std::copy(pt,pt+sz,vals.begin());
1400 return self->locateTuple(vals);
1403 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
1406 int ival=-1; std::vector<int> ivval;
1407 const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
1408 std::vector<char> vals(sz);
1409 std::copy(pt,pt+sz,vals.begin());
1410 return self->search(vals);
1413 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
1415 int sz=self->getNumberOfComponents();
1416 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
1417 self->getTuple(tupleId,tmp);
1418 PyObject *ret=PyTuple_New(sz);
1419 for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
1423 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
1426 int r1=(int)self->getMaxValue(tmp);
1427 PyObject *ret=PyTuple_New(2);
1428 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
1429 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1433 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
1436 int r1=(int)self->getMinValue(tmp);
1437 PyObject *ret=PyTuple_New(2);
1438 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
1439 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1443 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
1445 int nbOfCompo=self->getNumberOfComponents();
1450 if(PyInt_Check(obj))
1452 int val=(int)PyInt_AS_LONG(obj);
1453 return self->locateValue(val);
1456 throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
1459 return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
1463 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
1465 int nbOfCompo=self->getNumberOfComponents();
1472 if(PyInt_Check(obj))
1474 int val=(int)PyInt_AS_LONG(obj);
1475 return self->presenceOfValue(val);
1478 throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
1481 return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
1486 %extend ParaMEDMEM::DataArrayAsciiCharTuple
1488 std::string __str__() const
1490 return self->repr();
1493 DataArrayAsciiChar *buildDAAsciiChar()
1495 return self->buildDAAsciiChar(1,self->getNumberOfCompo());
1499 %extend ParaMEDMEM::DataArrayAsciiCharIterator
1503 DataArrayAsciiCharTuple *ret=self->nextt();
1505 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
1508 PyErr_SetString(PyExc_StopIteration,"No more data.");
1514 %extend ParaMEDMEM::DataArrayAsciiChar
1516 DataArrayAsciiChar() throw(INTERP_KERNEL::Exception)
1518 return DataArrayAsciiChar::New();
1521 static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
1523 const char *msg="ParaMEDMEM::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
1524 if(PyList_Check(elt0) || PyTuple_Check(elt0))
1528 if(PyInt_Check(nbOfTuples))
1530 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
1532 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
1535 if(PyInt_Check(nbOfComp))
1536 {//DataArrayAsciiChar.New([1,3,4,5],2,2)
1537 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
1539 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
1540 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
1541 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
1542 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1546 throw INTERP_KERNEL::Exception(msg);
1549 {//DataArrayAsciiChar.New([1,3,4],3)
1550 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
1552 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
1553 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1557 else if(PyString_Check(nbOfTuples))
1559 if(PyString_Size(nbOfTuples)!=1)
1560 throw INTERP_KERNEL::Exception(msg);
1561 //DataArrayAsciiChar.New(["abc","de","fghi"],"t")
1562 std::vector<std::string> tmp;
1563 if(fillStringVector(elt0,tmp))
1564 return DataArrayAsciiChar::New(tmp,PyString_AsString(nbOfTuples)[0]);
1566 throw INTERP_KERNEL::Exception(msg);
1569 throw INTERP_KERNEL::Exception(msg);
1573 std::vector<std::string> tmmp;
1574 if(fillStringVector(elt0,tmmp))
1575 //DataArrayAsciiChar.New(["abc","de","fghi"])
1576 return DataArrayAsciiChar::New(tmmp,' ');
1579 // DataArrayAsciiChar.New([1,3,4])
1580 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
1581 int tmpp1=-1,tmpp2=-1;
1582 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
1583 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
1588 else if(PyInt_Check(elt0))
1590 int nbOfTuples1=PyInt_AS_LONG(elt0);
1592 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
1597 if(PyInt_Check(nbOfTuples))
1598 {//DataArrayAsciiChar.New(5,2)
1599 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
1601 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
1602 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
1603 ret->alloc(nbOfTuples1,nbOfCompo);
1607 throw INTERP_KERNEL::Exception(msg);
1610 throw INTERP_KERNEL::Exception(msg);
1613 {//DataArrayAsciiChar.New(5)
1614 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
1615 ret->alloc(nbOfTuples1,1);
1620 throw INTERP_KERNEL::Exception(msg);
1623 DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
1625 return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_3(elt0,nbOfTuples,nbOfComp);
1628 DataArrayAsciiCharIterator *__iter__() throw(INTERP_KERNEL::Exception)
1630 return self->iterator();
1633 std::string getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
1635 char tmp[2]; tmp[1]='\0';
1636 tmp[0]=self->getIJ(tupleId,compoId);
1637 return std::string(tmp);
1640 std::string getIJSafe(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception)
1642 char tmp[2]; tmp[1]='\0';
1643 tmp[0]=self->getIJSafe(tupleId,compoId);
1644 return std::string(tmp);
1647 std::string __str__() const throw(INTERP_KERNEL::Exception)
1649 return self->repr();
1652 PyObject *toStrList() const throw(INTERP_KERNEL::Exception)
1654 const char *vals=self->getConstPointer();
1655 int nbOfComp=self->getNumberOfComponents();
1656 int nbOfTuples=self->getNumberOfTuples();
1657 return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
1660 bool presenceOfTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
1662 if(PyString_Check(tupl))
1664 Py_ssize_t sz=PyString_Size(tupl);
1665 std::vector<char> vals(sz);
1666 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
1667 return self->presenceOfTuple(vals);
1670 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfTuple : only strings in input supported !");
1673 bool presenceOfValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
1675 if(PyString_Check(vals))
1677 Py_ssize_t sz=PyString_Size(vals);
1678 std::vector<char> vals2(sz);
1679 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
1680 return self->presenceOfValue(vals2);
1683 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
1686 int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
1688 if(PyString_Check(vals))
1690 Py_ssize_t sz=PyString_Size(vals);
1691 std::vector<char> vals2(sz);
1692 std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
1693 return self->locateValue(vals2);
1696 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
1699 int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
1701 if(PyString_Check(tupl))
1703 Py_ssize_t sz=PyString_Size(tupl);
1704 std::vector<char> vals(sz);
1705 std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
1706 return self->locateTuple(vals);
1709 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
1712 int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
1714 if(PyString_Check(strOrListOfInt))
1716 Py_ssize_t sz=PyString_Size(strOrListOfInt);
1717 std::vector<char> vals(sz);
1718 std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
1719 return self->search(vals);
1722 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
1725 PyObject *getTuple(int tupleId) const throw(INTERP_KERNEL::Exception)
1727 int sz=self->getNumberOfComponents();
1728 INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
1729 self->getTuple(tupleId,tmp);
1730 return PyString_FromString(tmp);
1733 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
1736 char tmp2[2]; tmp2[1]='\0';
1737 tmp2[0]=self->getMaxValue(tmp);
1738 PyObject *ret=PyTuple_New(2);
1739 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
1740 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1744 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
1747 char tmp2[2]; tmp2[1]='\0';
1748 tmp2[0]=self->getMinValue(tmp);
1749 PyObject *ret=PyTuple_New(2);
1750 PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
1751 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
1755 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
1757 int nbOfCompo=self->getNumberOfComponents();
1762 if(PyString_Check(obj))
1764 Py_ssize_t sz=PyString_Size(obj);
1765 char *pt=PyString_AsString(obj);
1767 return self->locateValue(pt[0]);
1769 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
1772 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
1775 return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
1779 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
1781 int nbOfCompo=self->getNumberOfComponents();
1788 if(PyString_Check(obj))
1790 Py_ssize_t sz=PyString_Size(obj);
1791 char *pt=PyString_AsString(obj);
1793 return self->presenceOfValue(pt[0]);
1795 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find a string with size different from 1 !");
1798 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
1801 return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
1805 PyObject *__getitem__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
1808 std::vector<int> stdvecTyyppArr;
1809 std::pair<int, std::pair<int,int> > sTyyppArr;
1810 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1811 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
1815 return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
1817 return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
1819 return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
1821 return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
1823 throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__getitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input !");
1827 DataArrayAsciiChar *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
1829 static const char msg[]="DataArrayAsciiChar::__setitem__ : supporting int, list of int, tuple of int, DataArrayInt and slice in input, and 4 types accepted in value : string, list or tuple of strings having same size, not null DataArrayChar instance.";
1831 std::vector<int> stdvecTyyppArr;
1832 std::pair<int, std::pair<int,int> > sTyyppArr;
1833 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1834 int nbOfCompo=self->getNumberOfTuples();
1835 convertObjToPossibleCpp2(obj,nbOfCompo,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
1837 char vc; std::string sc; std::vector<std::string> vsc; DataArrayChar *dacc=0;
1838 convertObjToPossibleCpp6(value,sw2,vc,sc,vsc,dacc);
1847 self->setPartOfValuesSimple3(vc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1);
1853 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
1854 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
1857 //value vector<string>
1860 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
1861 self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
1864 //value DataArrayChar
1867 self->setPartOfValues3(dacc,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
1871 throw INTERP_KERNEL::Exception(msg);
1875 {//obj list-tuple[int]
1881 self->setPartOfValuesSimple3(vc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1);
1887 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
1888 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
1891 //value vector<string>
1894 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
1895 self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
1898 //value DataArrayChar
1901 self->setPartOfValues3(dacc,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
1905 throw INTERP_KERNEL::Exception(msg);
1916 self->setPartOfValuesSimple1(vc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1);
1922 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
1923 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
1926 //value vector<string>
1929 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
1930 self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
1933 //value DataArrayChar
1936 self->setPartOfValues1(dacc,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
1940 throw INTERP_KERNEL::Exception(msg);
1951 self->setPartOfValuesSimple3(vc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1);
1957 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
1958 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
1961 //value vector<string>
1964 MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
1965 self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
1968 //value DataArrayChar
1971 self->setPartOfValues3(dacc,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
1975 throw INTERP_KERNEL::Exception(msg);
1980 throw INTERP_KERNEL::Exception(msg);
1985 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
1987 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
1989 int sz=0,sw=-1,val1=-1;
1990 std::vector<int> val2;
1991 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
1992 return self->clonePart(inp,inp+sz);
1996 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
1998 PyObject *getArrayOfDiscIds() const
2000 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
2003 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2007 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
2008 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
2009 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
2010 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
2011 %ignore ParaMEDMEM::DataArrayChar::getIJ;
2012 %ignore ParaMEDMEM::DataArrayChar::getIJSafe;
2013 %ignore ParaMEDMEM::DataArrayChar::search;
2014 %ignore ParaMEDMEM::DataArrayChar::locateValue;
2015 %ignore ParaMEDMEM::DataArrayChar::presenceOfValue;
2017 %include "MEDCouplingMemArray.hxx"
2018 %include "NormalizedUnstructuredMesh.hxx"
2019 %include "MEDCouplingNatureOfField.hxx"
2020 %include "MEDCouplingTimeDiscretization.hxx"
2021 %include "MEDCouplingGaussLocalization.hxx"
2022 %include "MEDCouplingFieldDiscretization.hxx"
2024 namespace ParaMEDMEM
2026 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
2029 void updateTime() const;
2030 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2031 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
2032 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
2033 void zipCoords() throw(INTERP_KERNEL::Exception);
2034 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
2035 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
2036 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
2037 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
2038 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
2039 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
2040 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
2041 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
2042 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
2043 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
2044 //! size of returned tinyInfo must be always the same.
2045 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
2046 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
2047 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
2048 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
2049 const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
2050 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
2051 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
2052 virtual DataArrayInt *findBoundaryNodes() const;
2055 std::string __str__() const throw(INTERP_KERNEL::Exception)
2057 return self->simpleRepr();
2060 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
2063 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
2064 PyObject *res = PyList_New(2);
2065 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2066 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
2070 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
2072 DataArrayInt *comm, *commIndex;
2073 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
2074 PyObject *res = PyList_New(2);
2075 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2076 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2080 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
2082 DataArrayDouble *ret1=self->getCoords();
2084 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
2087 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
2089 int szArr,sw,iTypppArr;
2090 std::vector<int> stdvecTyyppArr;
2091 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2092 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
2093 if(sw==3)//DataArrayInt
2095 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
2096 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
2097 std::string name=argpt->getName();
2099 ret->setName(name.c_str());
2101 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2104 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2106 int szArr,sw,iTypppArr;
2107 std::vector<int> stdvecTyyppArr;
2108 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2109 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
2110 if(sw==3)//DataArrayInt
2112 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
2113 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
2114 std::string name=argpt->getName();
2116 ret->setName(name.c_str());
2118 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2121 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2123 int szArr,sw,iTypppArr;
2124 std::vector<int> stdvecTyyppArr;
2125 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2126 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
2127 if(sw==3)//DataArrayInt
2129 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
2130 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
2131 std::string name=argpt->getName();
2133 ret->setName(name.c_str());
2135 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2138 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
2140 int szArr,sw,iTypppArr;
2141 std::vector<int> stdvecTyyppArr;
2142 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2143 self->renumberNodes(tmp,newNbOfNodes);
2146 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
2148 int szArr,sw,iTypppArr;
2149 std::vector<int> stdvecTyyppArr;
2150 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2151 self->renumberNodes2(tmp,newNbOfNodes);
2154 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2156 int spaceDim=self->getSpaceDimension();
2158 DataArrayDouble *a,*a2;
2159 DataArrayDoubleTuple *aa,*aa2;
2160 std::vector<double> bb,bb2;
2162 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
2163 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
2164 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
2165 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2166 std::vector<int> nodes;
2167 self->findNodesOnLine(p,v,eps,nodes);
2168 DataArrayInt *ret=DataArrayInt::New();
2169 ret->alloc((int)nodes.size(),1);
2170 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
2171 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2173 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2175 int spaceDim=self->getSpaceDimension();
2177 DataArrayDouble *a,*a2;
2178 DataArrayDoubleTuple *aa,*aa2;
2179 std::vector<double> bb,bb2;
2181 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
2182 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
2183 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
2184 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2185 std::vector<int> nodes;
2186 self->findNodesOnPlane(p,v,eps,nodes);
2187 DataArrayInt *ret=DataArrayInt::New();
2188 ret->alloc((int)nodes.size(),1);
2189 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
2190 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2193 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
2197 DataArrayDoubleTuple *aa;
2198 std::vector<double> bb;
2200 int spaceDim=self->getSpaceDimension();
2201 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
2202 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
2203 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
2204 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2207 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *c=0,*cI=0;
2213 DataArrayDoubleTuple *aa;
2214 std::vector<double> bb;
2216 int spaceDim=self->getSpaceDimension();
2217 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
2218 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
2219 self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
2220 PyObject *ret=PyTuple_New(2);
2221 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
2228 DataArrayInt *c=0,*cI=0;
2229 int spaceDim=self->getSpaceDimension();
2232 DataArrayDoubleTuple *aa;
2233 std::vector<double> bb;
2236 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
2237 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
2239 PyObject *ret=PyTuple_New(2);
2240 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2241 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
2249 DataArrayDoubleTuple *aa;
2250 std::vector<double> bb;
2252 int spaceDim=self->getSpaceDimension();
2253 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
2254 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
2256 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
2257 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2260 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2264 std::vector<int> multiVal;
2265 std::pair<int, std::pair<int,int> > slic;
2266 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2267 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2271 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
2273 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
2275 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
2277 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2281 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
2284 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
2285 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
2286 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
2287 for(int i=0;i<sz;i++)
2288 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
2291 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
2294 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
2296 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
2297 std::vector<double> val3;
2298 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
2299 "Rotate2DAlg",2,true,nbNodes);
2301 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
2302 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
2305 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
2308 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
2309 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
2310 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
2311 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
2312 for(int i=0;i<sz;i++)
2313 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
2316 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
2319 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
2321 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
2322 std::vector<double> val3;
2323 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
2324 "Rotate3DAlg",3,true,nbNodes);
2326 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
2327 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
2328 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
2333 class MEDCouplingUMeshCell
2336 INTERP_KERNEL::NormalizedCellType getType() const;
2339 std::string __str__() const throw(INTERP_KERNEL::Exception)
2341 return self->repr();
2344 PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
2347 const int *r=self->getAllConn(ret2);
2348 PyObject *ret=PyTuple_New(ret2);
2349 for(int i=0;i<ret2;i++)
2350 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
2356 class MEDCouplingUMeshCellIterator
2363 MEDCouplingUMeshCell *ret=self->nextt();
2365 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
2368 PyErr_SetString(PyExc_StopIteration,"No more data.");
2375 class MEDCouplingUMeshCellByTypeIterator
2378 ~MEDCouplingUMeshCellByTypeIterator();
2383 MEDCouplingUMeshCellEntry *ret=self->nextt();
2385 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2388 PyErr_SetString(PyExc_StopIteration,"No more data.");
2395 class MEDCouplingUMeshCellByTypeEntry
2398 ~MEDCouplingUMeshCellByTypeEntry();
2401 MEDCouplingUMeshCellByTypeIterator *__iter__()
2403 return self->iterator();
2408 class MEDCouplingUMeshCellEntry
2411 INTERP_KERNEL::NormalizedCellType getType() const;
2412 int getNumberOfElems() const;
2415 MEDCouplingUMeshCellIterator *__iter__()
2417 return self->iterator();
2422 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
2425 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
2426 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
2427 MEDCouplingUMesh *clone(bool recDeepCpy) const;
2428 void updateTime() const;
2429 void checkCoherency() const throw(INTERP_KERNEL::Exception);
2430 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2431 void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
2432 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
2433 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
2434 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
2435 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
2436 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
2437 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
2438 int getMeshLength() const throw(INTERP_KERNEL::Exception);
2439 void computeTypes() throw(INTERP_KERNEL::Exception);
2440 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
2441 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2443 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
2444 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
2445 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
2446 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
2447 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
2448 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
2449 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
2450 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
2451 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
2452 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
2453 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
2454 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
2455 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
2456 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
2457 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
2458 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
2459 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
2460 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
2461 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
2462 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
2463 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
2464 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
2465 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
2466 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
2467 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
2468 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
2469 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
2470 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
2471 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
2472 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
2473 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
2474 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
2475 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
2476 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2477 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2478 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
2479 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
2481 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
2483 return MEDCouplingUMesh::New();
2486 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
2488 return MEDCouplingUMesh::New(meshName,meshDim);
2491 std::string __str__() const throw(INTERP_KERNEL::Exception)
2493 return self->simpleRepr();
2496 MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
2498 return self->cellIterator();
2501 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
2505 std::vector<int> multiVal;
2506 std::pair<int, std::pair<int,int> > slic;
2507 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2508 int nbc=self->getNumberOfCells();
2509 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2516 std::ostringstream oss;
2517 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2518 throw INTERP_KERNEL::Exception(oss.str().c_str());
2521 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
2526 int tmp=nbc+singleVal;
2527 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
2531 std::ostringstream oss;
2532 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2533 throw INTERP_KERNEL::Exception(oss.str().c_str());
2539 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
2543 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
2548 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
2549 daIntTyypp->checkAllocated();
2550 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
2553 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2557 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2561 std::vector<int> multiVal;
2562 std::pair<int, std::pair<int,int> > slic;
2563 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2564 int nbc=self->getNumberOfCells();
2565 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2572 std::ostringstream oss;
2573 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2574 throw INTERP_KERNEL::Exception(oss.str().c_str());
2578 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2585 int tmp=nbc+singleVal;
2586 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2591 std::ostringstream oss;
2592 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2593 throw INTERP_KERNEL::Exception(oss.str().c_str());
2599 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2605 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2606 daIntTyypp->checkAllocated();
2607 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2611 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
2615 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
2619 std::vector<int> multiVal;
2620 std::pair<int, std::pair<int,int> > slic;
2621 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2622 int nbc=self->getNumberOfCells();
2623 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2630 std::ostringstream oss;
2631 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2632 throw INTERP_KERNEL::Exception(oss.str().c_str());
2636 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2643 int tmp=nbc+singleVal;
2644 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2649 std::ostringstream oss;
2650 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2651 throw INTERP_KERNEL::Exception(oss.str().c_str());
2657 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2662 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2668 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2669 daIntTyypp->checkAllocated();
2670 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2674 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
2678 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
2680 int szArr,sw,iTypppArr;
2681 std::vector<int> stdvecTyyppArr;
2682 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2685 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2686 throw INTERP_KERNEL::Exception(oss.str().c_str());
2688 self->insertNextCell(type,size,tmp);
2691 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
2693 int szArr,sw,iTypppArr;
2694 std::vector<int> stdvecTyyppArr;
2695 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2696 self->insertNextCell(type,szArr,tmp);
2699 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
2701 DataArrayInt *ret=self->getNodalConnectivity();
2706 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
2708 DataArrayInt *ret=self->getNodalConnectivityIndex();
2713 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
2715 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
2716 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2717 PyObject *res = PyList_New(result.size());
2718 for (int i=0;iL!=result.end(); i++, iL++)
2719 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2723 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
2725 int szArr,sw,iTypppArr;
2726 std::vector<int> stdvecTyyppArr;
2727 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2728 int nbOfDepthPeelingPerformed=0;
2729 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2730 PyObject *res=PyTuple_New(2);
2731 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2736 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
2738 DataArrayInt *v0=0,*v1=0;
2739 self->findCommonCells(compType,startCellId,v0,v1);
2740 PyObject *res = PyList_New(2);
2741 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2746 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
2748 DataArrayInt *v0=0,*v1=0;
2749 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2750 PyObject *res = PyList_New(2);
2751 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2756 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
2760 DataArrayDoubleTuple *aa;
2761 std::vector<double> bb;
2763 int nbOfCompo=self->getSpaceDimension();
2764 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2766 int cellId=-1,nodeId=-1;
2767 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
2768 PyObject *ret=PyTuple_New(3);
2769 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2770 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2771 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
2775 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
2779 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
2780 PyObject *res = PyList_New(3);
2781 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2782 PyList_SetItem(res,1,SWIG_From_bool(ret1));
2783 PyList_SetItem(res,2,SWIG_From_int(ret2));
2786 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
2790 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
2791 PyObject *res = PyList_New(3);
2792 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2793 PyList_SetItem(res,1,SWIG_From_bool(ret1));
2794 PyList_SetItem(res,2,SWIG_From_int(ret2));
2797 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2799 std::vector<int> cells;
2800 self->checkButterflyCells(cells,eps);
2801 DataArrayInt *ret=DataArrayInt::New();
2802 ret->alloc((int)cells.size(),1);
2803 std::copy(cells.begin(),cells.end(),ret->getPointer());
2804 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2807 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2809 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2811 PyObject *ret = PyList_New(sz);
2812 for(int i=0;i<sz;i++)
2813 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2817 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2819 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2820 int sz=retCpp.size();
2821 PyObject *ret=PyList_New(sz);
2822 for(int i=0;i<sz;i++)
2823 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2830 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2831 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2832 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2835 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2838 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2839 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2843 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2846 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2847 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2851 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2853 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2854 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2855 PyObject *ret=PyTuple_New(3);
2856 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2857 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2858 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2862 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2864 DataArrayInt *tmp0=0,*tmp1=0;
2865 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2866 PyObject *ret=PyTuple_New(2);
2867 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2868 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2872 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2876 std::vector<int> multiVal;
2877 std::pair<int, std::pair<int,int> > slic;
2878 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2879 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2883 return self->duplicateNodes(&singleVal,&singleVal+1);
2885 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2887 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2889 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2893 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2897 std::vector<int> multiVal;
2898 std::pair<int, std::pair<int,int> > slic;
2899 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2900 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2904 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2906 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2908 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2910 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2914 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
2917 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2918 if (!SWIG_IsOK(res1))
2921 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2922 self->renumberNodesInConn(tmp);
2926 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2928 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2929 da2->checkAllocated();
2930 self->renumberNodesInConn(da2->getConstPointer());
2934 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2937 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2938 DataArrayInt *tmp0,*tmp1=0;
2939 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2940 PyObject *ret=PyTuple_New(2);
2941 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2942 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2946 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2948 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2949 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2950 DataArrayInt *ret1=0,*ret2=0;
2951 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2952 PyObject *ret=PyTuple_New(3);
2953 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2954 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2955 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2959 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2961 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2962 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2963 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2964 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2967 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2970 std::vector<const MEDCouplingUMesh *> meshes;
2971 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2972 std::vector<DataArrayInt *> corr;
2973 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2975 PyObject *ret1=PyList_New(sz);
2976 for(int i=0;i<sz;i++)
2977 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2978 PyObject *ret=PyList_New(2);
2979 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2980 PyList_SetItem(ret,1,ret1);
2984 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2986 std::vector<MEDCouplingUMesh *> meshes;
2987 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2988 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2991 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2993 std::vector<MEDCouplingUMesh *> meshes;
2994 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2995 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2998 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
3002 std::vector<int> multiVal;
3003 std::pair<int, std::pair<int,int> > slic;
3004 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3006 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
3007 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
3011 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
3013 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
3015 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
3017 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3021 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
3023 DataArrayInt *arrOut=0,*arrIndexOut=0;
3026 std::vector<int> multiVal;
3027 std::pair<int, std::pair<int,int> > slic;
3028 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3030 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
3031 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
3036 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
3041 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
3046 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
3050 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3052 PyObject *ret=PyTuple_New(2);
3053 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3054 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3058 static PyObject *SetPartOfIndexedArrays(PyObject *li,
3059 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
3060 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
3062 DataArrayInt *arrOut=0,*arrIndexOut=0;
3065 std::vector<int> multiVal;
3066 std::pair<int, std::pair<int,int> > slic;
3067 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3069 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
3070 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
3075 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
3080 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
3085 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
3089 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3091 PyObject *ret=PyTuple_New(2);
3092 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3093 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3097 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
3098 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
3102 std::vector<int> multiVal;
3103 std::pair<int, std::pair<int,int> > slic;
3104 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3106 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
3107 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
3112 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
3117 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
3122 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
3126 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
3130 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
3134 DataArrayDoubleTuple *aa;
3135 std::vector<double> bb;
3137 int spaceDim=self->getSpaceDimension();
3138 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
3139 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
3141 std::vector<int> cells;
3142 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
3143 DataArrayInt *ret=DataArrayInt::New();
3144 ret->alloc((int)cells.size(),1);
3145 std::copy(cells.begin(),cells.end(),ret->getPointer());
3146 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3149 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
3153 DataArrayDoubleTuple *aa;
3154 std::vector<double> bb;
3156 int spaceDim=self->getSpaceDimension();
3157 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
3158 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
3159 self->orientCorrectly2DCells(v,polyOnly);
3162 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
3164 std::vector<int> cells;
3165 self->arePolyhedronsNotCorrectlyOriented(cells);
3166 DataArrayInt *ret=DataArrayInt::New();
3167 ret->alloc((int)cells.size(),1);
3168 std::copy(cells.begin(),cells.end(),ret->getPointer());
3169 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3172 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
3176 self->getFastAveragePlaneOfThis(vec,pos);
3178 std::copy(vec,vec+3,vals);
3179 std::copy(pos,pos+3,vals+3);
3180 return convertDblArrToPyListOfTuple(vals,3,2);
3183 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3185 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
3186 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
3187 return MEDCouplingUMesh::MergeUMeshes(tmp);
3190 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
3193 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
3194 PyObject *ret=PyTuple_New(2);
3195 PyObject *ret0Py=ret0?Py_True:Py_False;
3197 PyTuple_SetItem(ret,0,ret0Py);
3198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3202 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
3205 bool ret0=self->areCellsIncludedIn2(other,ret1);
3206 PyObject *ret=PyTuple_New(2);
3207 PyObject *ret0Py=ret0?Py_True:Py_False;
3209 PyTuple_SetItem(ret,0,ret0Py);
3210 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3214 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
3216 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
3217 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
3218 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
3219 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
3220 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
3221 PyObject *ret=PyTuple_New(5);
3222 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3223 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3224 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3225 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3226 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3230 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
3232 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
3233 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
3234 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
3235 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
3236 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
3237 PyObject *ret=PyTuple_New(5);
3238 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3239 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3240 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3241 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3242 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3246 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
3248 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
3249 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
3250 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
3251 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
3252 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
3253 PyObject *ret=PyTuple_New(5);
3254 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3255 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3256 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3257 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3258 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3262 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
3264 DataArrayInt *neighbors=0,*neighborsIdx=0;
3265 self->computeNeighborsOfCells(neighbors,neighborsIdx);
3266 PyObject *ret=PyTuple_New(2);
3267 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3268 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3272 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
3274 DataArrayInt *neighbors=0,*neighborsIdx=0;
3275 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
3276 PyObject *ret=PyTuple_New(2);
3277 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3278 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3282 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
3284 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
3285 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
3286 DataArrayInt *d2,*d3,*d4,*dd5;
3287 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
3288 PyObject *ret=PyTuple_New(7);
3289 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3290 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3291 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3292 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3293 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3294 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3295 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3299 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3301 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
3302 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
3303 self->getReverseNodalConnectivity(d0,d1);
3304 PyObject *ret=PyTuple_New(2);
3305 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3306 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3310 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
3313 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3314 da->checkAllocated();
3315 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
3318 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
3321 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3322 da->checkAllocated();
3323 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
3326 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
3329 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3330 da->checkAllocated();
3331 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
3334 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
3337 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3338 da->checkAllocated();
3339 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
3340 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
3341 PyObject *res = PyList_New(result.size());
3342 for (int i=0;iL!=result.end(); i++, iL++)
3343 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3347 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
3350 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3351 da->checkAllocated();
3352 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
3353 ret->setName(da->getName().c_str());
3357 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
3360 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3361 if (!SWIG_IsOK(res1))
3364 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3365 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
3369 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3371 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3372 da2->checkAllocated();
3373 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
3377 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
3380 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
3381 PyObject *ret=PyTuple_New(2);
3382 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3383 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3387 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
3389 DataArrayInt *cellNb1=0,*cellNb2=0;
3390 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
3391 PyObject *ret=PyTuple_New(3);
3392 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3393 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3394 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3398 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3400 int spaceDim=self->getSpaceDimension();
3402 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
3404 DataArrayDouble *a,*a2;
3405 DataArrayDoubleTuple *aa,*aa2;
3406 std::vector<double> bb,bb2;
3408 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
3409 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
3410 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3411 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3413 DataArrayInt *cellIds=0;
3414 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
3415 PyObject *ret=PyTuple_New(2);
3416 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3417 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3421 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3423 int spaceDim=self->getSpaceDimension();
3425 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
3427 DataArrayDouble *a,*a2;
3428 DataArrayDoubleTuple *aa,*aa2;
3429 std::vector<double> bb,bb2;
3431 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
3432 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
3433 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3434 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3436 DataArrayInt *cellIds=0;
3437 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
3438 PyObject *ret=PyTuple_New(2);
3439 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
3440 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3444 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3446 int spaceDim=self->getSpaceDimension();
3448 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
3450 DataArrayDouble *a,*a2;
3451 DataArrayDoubleTuple *aa,*aa2;
3452 std::vector<double> bb,bb2;
3454 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
3455 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
3456 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3457 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3458 return self->getCellIdsCrossingPlane(orig,vect,eps);
3461 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
3465 std::vector<int> pos2;
3466 DataArrayInt *pos3=0;
3467 DataArrayIntTuple *pos4=0;
3468 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3473 self->convertToPolyTypes(&pos1,&pos1+1);
3480 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3485 self->convertToPolyTypes(pos3->begin(),pos3->end());
3489 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3493 void convertAllToPoly();
3494 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
3495 bool unPolyze() throw(INTERP_KERNEL::Exception);
3496 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
3497 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
3498 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
3501 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
3504 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
3505 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
3506 void updateTime() const throw(INTERP_KERNEL::Exception);
3508 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
3510 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3513 std::string __str__() const throw(INTERP_KERNEL::Exception)
3515 return self->simpleRepr();
3517 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3519 MEDCouplingUMesh *ret=self->getMesh2D();
3521 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3523 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3525 MEDCouplingUMesh *ret=self->getMesh1D();
3527 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3529 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3531 DataArrayInt *ret=self->getMesh3DIds();
3533 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3538 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
3541 void updateTime() const throw(INTERP_KERNEL::Exception);
3542 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3543 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3546 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3549 static MEDCouplingCMesh *New();
3550 static MEDCouplingCMesh *New(const char *meshName);
3551 MEDCouplingCMesh *clone(bool recDeepCpy) const;
3552 void setCoords(const DataArrayDouble *coordsX,
3553 const DataArrayDouble *coordsY=0,
3554 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3555 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3559 return MEDCouplingCMesh::New();
3561 MEDCouplingCMesh(const char *meshName)
3563 return MEDCouplingCMesh::New(meshName);
3565 std::string __str__() const throw(INTERP_KERNEL::Exception)
3567 return self->simpleRepr();
3569 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3571 DataArrayDouble *ret=self->getCoordsAt(i);
3579 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3582 static MEDCouplingCurveLinearMesh *New();
3583 static MEDCouplingCurveLinearMesh *New(const char *meshName);
3584 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3585 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3586 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3588 MEDCouplingCurveLinearMesh()
3590 return MEDCouplingCurveLinearMesh::New();
3592 MEDCouplingCurveLinearMesh(const char *meshName)
3594 return MEDCouplingCurveLinearMesh::New(meshName);
3596 std::string __str__() const throw(INTERP_KERNEL::Exception)
3598 return self->simpleRepr();
3600 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3602 DataArrayDouble *ret=self->getCoords();
3607 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3609 int szArr,sw,iTypppArr;
3610 std::vector<int> stdvecTyyppArr;
3611 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3612 self->setNodeGridStructure(tmp,tmp+szArr);
3618 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3620 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3623 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3624 PyObject *ret=PyTuple_New(2);
3625 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3626 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3631 %extend ParaMEDMEM::DataArrayDoubleIterator
3635 DataArrayDoubleTuple *ret=self->nextt();
3637 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
3640 PyErr_SetString(PyExc_StopIteration,"No more data.");
3646 %extend ParaMEDMEM::DataArrayDoubleTuple
3648 std::string __str__() const throw(INTERP_KERNEL::Exception)
3650 return self->repr();
3653 double __float__() const throw(INTERP_KERNEL::Exception)
3655 return self->doubleValue();
3658 DataArrayDouble *buildDADouble()
3660 return self->buildDADouble(1,self->getNumberOfCompo());
3663 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3665 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
3666 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
3667 Py_XINCREF(trueSelf);
3671 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3673 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
3674 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
3675 Py_XINCREF(trueSelf);
3679 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3681 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
3682 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
3683 Py_XINCREF(trueSelf);
3687 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3689 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
3690 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
3691 Py_XINCREF(trueSelf);
3695 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3699 std::vector<int> multiVal;
3700 std::pair<int, std::pair<int,int> > slic;
3701 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3702 const double *pt=self->getConstPointer();
3703 int nbc=self->getNumberOfCompo();
3704 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3711 std::ostringstream oss;
3712 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
3713 throw INTERP_KERNEL::Exception(oss.str().c_str());
3716 return PyFloat_FromDouble(pt[singleVal]);
3720 return PyFloat_FromDouble(pt[nbc+singleVal]);
3723 std::ostringstream oss;
3724 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
3725 throw INTERP_KERNEL::Exception(oss.str().c_str());
3731 PyObject *t=PyTuple_New(multiVal.size());
3732 for(int j=0;j<(int)multiVal.size();j++)
3734 int cid=multiVal[j];
3737 std::ostringstream oss;
3738 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
3739 throw INTERP_KERNEL::Exception(oss.str().c_str());
3741 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
3747 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
3748 PyObject *t=PyTuple_New(sz);
3749 for(int j=0;j<sz;j++)
3750 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
3754 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
3758 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3760 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
3763 std::vector<double> multiValV;
3764 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
3765 int nbc=self->getNumberOfCompo();
3766 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
3768 std::vector<int> multiVal;
3769 std::pair<int, std::pair<int,int> > slic;
3770 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3771 double *pt=self->getPointer();
3772 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
3779 std::ostringstream oss;
3780 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
3781 throw INTERP_KERNEL::Exception(oss.str().c_str());
3787 pt[singleVal]=singleValV;
3792 if(multiValV.size()!=1)
3794 std::ostringstream oss;
3795 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
3796 throw INTERP_KERNEL::Exception(oss.str().c_str());
3798 pt[singleVal]=multiValV[0];
3803 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
3807 throw INTERP_KERNEL::Exception(msg);
3816 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
3820 std::ostringstream oss;
3821 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
3822 throw INTERP_KERNEL::Exception(oss.str().c_str());
3830 if(multiVal.size()!=multiValV.size())
3832 std::ostringstream oss;
3833 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
3834 throw INTERP_KERNEL::Exception(oss.str().c_str());
3836 for(int i=0;i<(int)multiVal.size();i++)
3838 int pos=multiVal[i];
3841 std::ostringstream oss;
3842 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
3843 throw INTERP_KERNEL::Exception(oss.str().c_str());
3845 pt[multiVal[i]]=multiValV[i];
3851 const double *ptV=daIntTyyppV->getConstPointer();
3852 if(nbc>daIntTyyppV->getNumberOfCompo())
3854 std::ostringstream oss;
3855 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
3856 throw INTERP_KERNEL::Exception(oss.str().c_str());
3858 std::copy(ptV,ptV+nbc,pt);
3862 throw INTERP_KERNEL::Exception(msg);
3867 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
3872 for(int j=0;j<sz;j++)
3873 pt[slic.first+j*slic.second.second]=singleValV;
3878 if(sz!=(int)multiValV.size())
3880 std::ostringstream oss;
3881 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
3882 throw INTERP_KERNEL::Exception(oss.str().c_str());
3884 for(int j=0;j<sz;j++)
3885 pt[slic.first+j*slic.second.second]=multiValV[j];
3890 const double *ptV=daIntTyyppV->getConstPointer();
3891 if(sz>daIntTyyppV->getNumberOfCompo())
3893 std::ostringstream oss;
3894 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
3895 throw INTERP_KERNEL::Exception(oss.str().c_str());
3897 for(int j=0;j<sz;j++)
3898 pt[slic.first+j*slic.second.second]=ptV[j];
3902 throw INTERP_KERNEL::Exception(msg);
3906 throw INTERP_KERNEL::Exception(msg);
3911 %extend ParaMEDMEM::DataArrayDouble
3913 DataArrayDouble() throw(INTERP_KERNEL::Exception)
3915 return DataArrayDouble::New();
3918 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
3920 const char *msg="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n--DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2) !";
3921 if(PyList_Check(elt0) || PyTuple_Check(elt0))
3925 if(PyInt_Check(nbOfTuples))
3927 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
3929 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
3932 if(PyInt_Check(elt2))
3933 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
3934 int nbOfCompo=PyInt_AS_LONG(elt2);
3936 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
3937 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
3938 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
3939 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3943 throw INTERP_KERNEL::Exception(msg);
3946 {//DataArrayDouble.New([1.,3.,4.],3)
3947 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
3949 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
3950 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3955 throw INTERP_KERNEL::Exception(msg);
3958 {// DataArrayDouble.New([1.,3.,4.])
3959 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
3960 int tmpp1=-1,tmpp2=-1;
3961 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
3962 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3966 else if(PyInt_Check(elt0))
3968 int nbOfTuples1=PyInt_AS_LONG(elt0);
3970 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
3975 if(PyInt_Check(nbOfTuples))
3976 {//DataArrayDouble.New(5,2)
3977 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
3979 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
3980 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
3981 ret->alloc(nbOfTuples1,nbOfCompo);
3985 throw INTERP_KERNEL::Exception(msg);
3988 throw INTERP_KERNEL::Exception(msg);
3991 {//DataArrayDouble.New(5)
3992 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
3993 ret->alloc(nbOfTuples1,1);
3998 throw INTERP_KERNEL::Exception(msg);
4001 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
4003 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
4006 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
4009 std::vector<double> bb;
4011 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
4012 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
4013 self->pushBackValsSilent(tmp,tmp+nbTuples);
4016 std::string __str__() const throw(INTERP_KERNEL::Exception)
4018 return self->repr();
4021 double __float__() const throw(INTERP_KERNEL::Exception)
4023 return self->doubleValue();
4026 int __len__() const throw(INTERP_KERNEL::Exception)
4028 if(self->isAllocated())
4030 return self->getNumberOfTuples();
4034 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
4038 DataArrayDoubleIterator *__iter__()
4040 return self->iterator();
4043 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4045 const char *msg="ParaMEDMEM::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
4046 if(PyList_Check(li) || PyTuple_Check(li))
4050 if(PyInt_Check(nbOfTuples))
4052 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4054 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
4057 if(PyInt_Check(nbOfComp))
4058 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
4059 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4061 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
4062 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
4063 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4066 throw INTERP_KERNEL::Exception(msg);
4069 {//DataArrayDouble.setValues([1.,3.,4.],3)
4071 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
4072 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4076 throw INTERP_KERNEL::Exception(msg);
4079 {// DataArrayDouble.setValues([1.,3.,4.])
4080 int tmpp1=-1,tmpp2=-1;
4081 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
4082 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4086 throw INTERP_KERNEL::Exception(msg);
4089 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
4091 const double *vals=self->getConstPointer();
4092 return convertDblArrToPyList(vals,self->getNbOfElems());
4095 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
4098 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
4099 PyObject *ret=PyTuple_New(2);
4100 PyObject *ret0Py=ret0?Py_True:Py_False;
4102 PyTuple_SetItem(ret,0,ret0Py);
4103 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4107 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
4109 const double *vals=self->getConstPointer();
4110 int nbOfComp=self->getNumberOfComponents();
4111 int nbOfTuples=self->getNumberOfTuples();
4112 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4115 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4118 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4119 if (!SWIG_IsOK(res1))
4122 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4123 if(size!=self->getNumberOfTuples())
4125 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4127 return self->renumber(tmp);
4131 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4133 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4134 da2->checkAllocated();
4135 int size=self->getNumberOfTuples();
4136 if(size!=self->getNumberOfTuples())
4138 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4140 return self->renumber(da2->getConstPointer());
4144 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4147 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4148 if (!SWIG_IsOK(res1))
4151 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4152 if(size!=self->getNumberOfTuples())
4154 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4156 return self->renumberR(tmp);
4160 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4162 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4163 da2->checkAllocated();
4164 int size=self->getNumberOfTuples();
4165 if(size!=self->getNumberOfTuples())
4167 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4169 return self->renumberR(da2->getConstPointer());
4173 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4176 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4177 if (!SWIG_IsOK(res1))
4180 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4181 if(size!=self->getNumberOfTuples())
4183 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4185 return self->renumberAndReduce(tmp,newNbOfTuple);
4189 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4191 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4192 da2->checkAllocated();
4193 int size=self->getNumberOfTuples();
4194 if(size!=self->getNumberOfTuples())
4196 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4198 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4202 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4205 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4206 if (!SWIG_IsOK(res1))
4209 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4210 if(size!=self->getNumberOfTuples())
4212 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4214 self->renumberInPlace(tmp);
4218 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4220 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4221 da2->checkAllocated();
4222 int size=self->getNumberOfTuples();
4223 if(size!=self->getNumberOfTuples())
4225 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4227 self->renumberInPlace(da2->getConstPointer());
4231 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4234 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4235 if (!SWIG_IsOK(res1))
4238 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4239 if(size!=self->getNumberOfTuples())
4241 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4243 self->renumberInPlaceR(tmp);
4247 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4249 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4250 da2->checkAllocated();
4251 int size=self->getNumberOfTuples();
4252 if(size!=self->getNumberOfTuples())
4254 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4256 self->renumberInPlaceR(da2->getConstPointer());
4260 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
4263 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4264 if (!SWIG_IsOK(res1))
4267 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4268 return self->selectByTupleId(tmp,tmp+size);
4272 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4274 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4275 da2->checkAllocated();
4276 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4280 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
4283 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4284 if (!SWIG_IsOK(res1))
4287 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4288 return self->selectByTupleIdSafe(tmp,tmp+size);
4292 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4294 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4295 da2->checkAllocated();
4296 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4300 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
4302 int thisTupleId,otherTupleId;
4303 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
4304 PyObject *ret=PyTuple_New(3);
4305 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
4306 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
4307 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
4311 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4314 double r1=self->getMaxValue(tmp);
4315 PyObject *ret=PyTuple_New(2);
4316 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4317 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4321 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4324 double r1=self->getMaxValue2(tmp);
4325 PyObject *ret=PyTuple_New(2);
4326 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4327 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4331 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4334 double r1=self->getMinValue(tmp);
4335 PyObject *ret=PyTuple_New(2);
4336 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4337 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4341 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4344 double r1=self->getMinValue2(tmp);
4345 PyObject *ret=PyTuple_New(2);
4346 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4347 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4351 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
4353 int nbOfCompo=self->getNumberOfComponents();
4354 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
4355 self->getMinMaxPerComponent(tmp);
4356 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
4360 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4362 int sz=self->getNumberOfComponents();
4363 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4364 self->accumulate(tmp);
4365 return convertDblArrToPyList(tmp,sz);
4368 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4370 std::vector<int> tmp;
4371 convertPyToNewIntArr3(li,tmp);
4372 return self->keepSelectedComponents(tmp);
4375 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
4377 DataArrayInt *comm, *commIndex;
4378 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
4379 PyObject *res = PyList_New(2);
4380 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4381 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4385 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
4389 DataArrayDoubleTuple *aa;
4390 std::vector<double> bb;
4392 int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
4393 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
4395 int cellId=-1,nodeId=-1;
4396 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
4397 PyObject *ret=PyTuple_New(2);
4398 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
4399 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
4403 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
4405 std::vector<int> tmp;
4406 convertPyToNewIntArr3(li,tmp);
4407 self->setSelectedComponents(a,tmp);
4410 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4412 int sz=self->getNumberOfComponents();
4413 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4414 self->getTuple(tupleId,tmp);
4415 return convertDblArrToPyList(tmp,sz);
4418 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
4420 std::vector<const DataArrayDouble *> tmp;
4421 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
4422 return DataArrayDouble::Aggregate(tmp);
4425 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
4427 std::vector<const DataArrayDouble *> tmp;
4428 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
4429 return DataArrayDouble::Meld(tmp);
4432 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
4434 std::vector<std::pair<int,int> > ranges;
4435 convertPyToVectorPairInt(li,ranges);
4436 return self->selectByTupleRanges(ranges);
4439 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
4443 DataArrayDoubleTuple *aa;
4444 std::vector<double> bb;
4446 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
4447 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
4448 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
4449 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
4450 DataArrayInt *c=0,*cI=0;
4451 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
4452 PyObject *ret=PyTuple_New(2);
4453 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4454 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4458 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4460 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
4461 self->checkAllocated();
4462 int nbOfTuples=self->getNumberOfTuples();
4463 int nbOfComponents=self->getNumberOfComponents();
4465 std::vector<int> vt1,vc1;
4466 std::pair<int, std::pair<int,int> > pt1,pc1;
4467 DataArrayInt *dt1=0,*dc1=0;
4469 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
4470 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
4474 if(nbOfComponents==1)
4475 return PyFloat_FromDouble(self->getIJSafe(it1,0));
4476 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4478 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4480 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4482 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4484 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
4487 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
4488 std::vector<int> v2(1,ic1);
4489 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4493 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
4494 std::vector<int> v2(1,ic1);
4495 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4499 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
4500 std::vector<int> v2(1,ic1);
4501 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4505 ret=self->selectByTupleIdSafe(&it1,&it1+1);
4506 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4510 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
4511 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4515 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
4516 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4520 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
4521 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4525 ret=self->selectByTupleIdSafe(&it1,&it1+1);
4526 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
4527 std::vector<int> v2(nbOfComp);
4528 for(int i=0;i<nbOfComp;i++)
4529 v2[i]=pc1.first+i*pc1.second.second;
4530 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4534 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
4535 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
4536 std::vector<int> v2(nbOfComp);
4537 for(int i=0;i<nbOfComp;i++)
4538 v2[i]=pc1.first+i*pc1.second.second;
4539 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4543 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
4544 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
4545 std::vector<int> v2(nbOfComp);
4546 for(int i=0;i<nbOfComp;i++)
4547 v2[i]=pc1.first+i*pc1.second.second;
4548 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4552 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
4553 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
4554 std::vector<int> v2(nbOfComp);
4555 for(int i=0;i<nbOfComp;i++)
4556 v2[i]=pc1.first+i*pc1.second.second;
4557 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
4560 throw INTERP_KERNEL::Exception(msg);
4564 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4566 self->checkAllocated();
4567 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
4568 int nbOfTuples=self->getNumberOfTuples();
4569 int nbOfComponents=self->getNumberOfComponents();
4572 std::vector<double> v1;
4573 DataArrayDouble *d1=0;
4574 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
4576 std::vector<int> vt1,vc1;
4577 std::pair<int, std::pair<int,int> > pt1,pc1;
4578 DataArrayInt *dt1=0,*dc1=0;
4579 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
4580 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
4588 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
4591 tmp=DataArrayDouble::New();
4592 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4593 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
4596 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
4599 throw INTERP_KERNEL::Exception(msg);
4608 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
4611 tmp=DataArrayDouble::New();
4612 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4613 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
4616 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
4619 throw INTERP_KERNEL::Exception(msg);
4628 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
4631 tmp=DataArrayDouble::New();
4632 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4633 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
4636 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
4639 throw INTERP_KERNEL::Exception(msg);
4648 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
4651 tmp=DataArrayDouble::New();
4652 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4653 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
4656 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
4659 throw INTERP_KERNEL::Exception(msg);
4668 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
4671 tmp=DataArrayDouble::New();
4672 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4673 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
4676 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
4679 throw INTERP_KERNEL::Exception(msg);
4688 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
4691 tmp=DataArrayDouble::New();
4692 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4693 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
4696 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
4699 throw INTERP_KERNEL::Exception(msg);
4708 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
4711 tmp=DataArrayDouble::New();
4712 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4713 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
4716 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
4719 throw INTERP_KERNEL::Exception(msg);
4728 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
4731 tmp=DataArrayDouble::New();
4732 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4733 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
4736 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
4739 throw INTERP_KERNEL::Exception(msg);
4748 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
4751 tmp=DataArrayDouble::New();
4752 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4753 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
4756 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
4759 throw INTERP_KERNEL::Exception(msg);
4768 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
4771 tmp=DataArrayDouble::New();
4772 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4773 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
4776 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
4779 throw INTERP_KERNEL::Exception(msg);
4788 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
4791 tmp=DataArrayDouble::New();
4792 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4793 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
4796 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
4799 throw INTERP_KERNEL::Exception(msg);
4808 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
4811 tmp=DataArrayDouble::New();
4812 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4813 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
4816 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
4819 throw INTERP_KERNEL::Exception(msg);
4828 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
4831 tmp=DataArrayDouble::New();
4832 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4833 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
4836 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
4839 throw INTERP_KERNEL::Exception(msg);
4848 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
4851 tmp=DataArrayDouble::New();
4852 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4853 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
4856 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
4859 throw INTERP_KERNEL::Exception(msg);
4868 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
4871 tmp=DataArrayDouble::New();
4872 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4873 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
4876 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
4879 throw INTERP_KERNEL::Exception(msg);
4888 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
4891 tmp=DataArrayDouble::New();
4892 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
4893 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
4896 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
4899 throw INTERP_KERNEL::Exception(msg);
4904 throw INTERP_KERNEL::Exception(msg);
4909 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4911 return self->negate();
4914 DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4916 const char msg[]="Unexpected situation in __add__ !";
4919 DataArrayDoubleTuple *aa;
4920 std::vector<double> bb;
4922 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4927 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4928 ret->applyLin(1.,val);
4933 return DataArrayDouble::Add(self,a);
4937 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4938 return DataArrayDouble::Add(self,aaa);
4942 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4943 return DataArrayDouble::Add(self,aaa);
4946 throw INTERP_KERNEL::Exception(msg);
4950 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4952 const char msg[]="Unexpected situation in __radd__ !";
4955 DataArrayDoubleTuple *aa;
4956 std::vector<double> bb;
4958 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4963 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4964 ret->applyLin(1.,val);
4969 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4970 return DataArrayDouble::Add(self,aaa);
4974 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4975 return DataArrayDouble::Add(self,aaa);
4978 throw INTERP_KERNEL::Exception(msg);
4982 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4984 const char msg[]="Unexpected situation in __iadd__ !";
4987 DataArrayDoubleTuple *aa;
4988 std::vector<double> bb;
4990 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4995 self->applyLin(1.,val);
4996 Py_XINCREF(trueSelf);
5002 Py_XINCREF(trueSelf);
5007 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5008 self->addEqual(aaa);
5009 Py_XINCREF(trueSelf);
5014 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5015 self->addEqual(aaa);
5016 Py_XINCREF(trueSelf);
5020 throw INTERP_KERNEL::Exception(msg);
5024 DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5026 const char msg[]="Unexpected situation in __sub__ !";
5029 DataArrayDoubleTuple *aa;
5030 std::vector<double> bb;
5032 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5037 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5038 ret->applyLin(1.,-val);
5043 return DataArrayDouble::Substract(self,a);
5047 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5048 return DataArrayDouble::Substract(self,aaa);
5052 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5053 return DataArrayDouble::Substract(self,aaa);
5056 throw INTERP_KERNEL::Exception(msg);
5060 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5062 const char msg[]="Unexpected situation in __rsub__ !";
5065 DataArrayDoubleTuple *aa;
5066 std::vector<double> bb;
5068 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5073 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5074 ret->applyLin(-1.,val);
5079 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5080 return DataArrayDouble::Substract(aaa,self);
5084 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5085 return DataArrayDouble::Substract(aaa,self);
5088 throw INTERP_KERNEL::Exception(msg);
5092 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5094 const char msg[]="Unexpected situation in __isub__ !";
5097 DataArrayDoubleTuple *aa;
5098 std::vector<double> bb;
5100 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5105 self->applyLin(1,-val);
5106 Py_XINCREF(trueSelf);
5111 self->substractEqual(a);
5112 Py_XINCREF(trueSelf);
5117 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5118 self->substractEqual(aaa);
5119 Py_XINCREF(trueSelf);
5124 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5125 self->substractEqual(aaa);
5126 Py_XINCREF(trueSelf);
5130 throw INTERP_KERNEL::Exception(msg);
5134 DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5136 const char msg[]="Unexpected situation in __mul__ !";
5139 DataArrayDoubleTuple *aa;
5140 std::vector<double> bb;
5142 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5147 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5148 ret->applyLin(val,0.);
5153 return DataArrayDouble::Multiply(self,a);
5157 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5158 return DataArrayDouble::Multiply(self,aaa);
5162 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5163 return DataArrayDouble::Multiply(self,aaa);
5166 throw INTERP_KERNEL::Exception(msg);
5170 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5172 const char msg[]="Unexpected situation in __rmul__ !";
5175 DataArrayDoubleTuple *aa;
5176 std::vector<double> bb;
5178 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5183 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5184 ret->applyLin(val,0.);
5189 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5190 return DataArrayDouble::Multiply(self,aaa);
5194 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5195 return DataArrayDouble::Multiply(self,aaa);
5198 throw INTERP_KERNEL::Exception(msg);
5202 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5204 const char msg[]="Unexpected situation in __imul__ !";
5207 DataArrayDoubleTuple *aa;
5208 std::vector<double> bb;
5210 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5215 self->applyLin(val,0.);
5216 Py_XINCREF(trueSelf);
5221 self->multiplyEqual(a);
5222 Py_XINCREF(trueSelf);
5227 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5228 self->multiplyEqual(aaa);
5229 Py_XINCREF(trueSelf);
5234 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5235 self->multiplyEqual(aaa);
5236 Py_XINCREF(trueSelf);
5240 throw INTERP_KERNEL::Exception(msg);
5244 DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5246 const char msg[]="Unexpected situation in __div__ !";
5249 DataArrayDoubleTuple *aa;
5250 std::vector<double> bb;
5252 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5258 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
5259 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5260 ret->applyLin(1/val,0.);
5265 return DataArrayDouble::Divide(self,a);
5269 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5270 return DataArrayDouble::Divide(self,aaa);
5274 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5275 return DataArrayDouble::Divide(self,aaa);
5278 throw INTERP_KERNEL::Exception(msg);
5282 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5284 const char msg[]="Unexpected situation in __rdiv__ !";
5287 DataArrayDoubleTuple *aa;
5288 std::vector<double> bb;
5290 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5295 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
5301 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5302 return DataArrayDouble::Divide(aaa,self);
5306 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5307 return DataArrayDouble::Divide(aaa,self);
5310 throw INTERP_KERNEL::Exception(msg);
5314 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5316 const char msg[]="Unexpected situation in __idiv__ !";
5319 DataArrayDoubleTuple *aa;
5320 std::vector<double> bb;
5322 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
5328 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
5329 self->applyLin(1./val,0.);
5330 Py_XINCREF(trueSelf);
5335 self->divideEqual(a);
5336 Py_XINCREF(trueSelf);
5341 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5342 self->divideEqual(aaa);
5343 Py_XINCREF(trueSelf);
5348 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5349 self->divideEqual(aaa);
5350 Py_XINCREF(trueSelf);
5354 throw INTERP_KERNEL::Exception(msg);
5358 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
5360 DataArrayInt *c=0,*cI=0;
5362 self->computeTupleIdsNearTuples(other,eps,c,cI);
5363 PyObject *ret=PyTuple_New(2);
5364 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5365 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5370 %extend ParaMEDMEM::DataArrayIntTuple
5372 std::string __str__() const throw(INTERP_KERNEL::Exception)
5374 return self->repr();
5377 int __int__() const throw(INTERP_KERNEL::Exception)
5379 return self->intValue();
5382 DataArrayInt *buildDAInt() throw(INTERP_KERNEL::Exception)
5384 return self->buildDAInt(1,self->getNumberOfCompo());
5387 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5389 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
5390 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
5391 Py_XINCREF(trueSelf);
5395 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5397 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
5398 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
5399 Py_XINCREF(trueSelf);
5403 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5405 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
5406 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
5407 Py_XINCREF(trueSelf);
5411 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5413 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
5414 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
5415 Py_XINCREF(trueSelf);
5419 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5421 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
5422 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
5423 Py_XINCREF(trueSelf);
5427 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5431 std::vector<int> multiVal;
5432 std::pair<int, std::pair<int,int> > slic;
5433 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5434 const int *pt=self->getConstPointer();
5435 int nbc=self->getNumberOfCompo();
5436 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
5443 std::ostringstream oss;
5444 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
5445 throw INTERP_KERNEL::Exception(oss.str().c_str());
5448 return PyInt_FromLong(pt[singleVal]);
5452 return PyInt_FromLong(pt[nbc+singleVal]);
5455 std::ostringstream oss;
5456 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
5457 throw INTERP_KERNEL::Exception(oss.str().c_str());
5463 PyObject *t=PyTuple_New(multiVal.size());
5464 for(int j=0;j<(int)multiVal.size();j++)
5466 int cid=multiVal[j];
5469 std::ostringstream oss;
5470 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
5471 throw INTERP_KERNEL::Exception(oss.str().c_str());
5473 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
5479 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
5480 PyObject *t=PyTuple_New(sz);
5481 for(int j=0;j<sz;j++)
5482 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
5486 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
5490 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5492 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
5495 std::vector<int> multiValV;
5496 std::pair<int, std::pair<int,int> > slicV;
5497 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
5498 int nbc=self->getNumberOfCompo();
5499 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
5501 std::vector<int> multiVal;
5502 std::pair<int, std::pair<int,int> > slic;
5503 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5504 int *pt=self->getPointer();
5505 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
5512 std::ostringstream oss;
5513 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
5514 throw INTERP_KERNEL::Exception(oss.str().c_str());
5520 pt[singleVal]=singleValV;
5525 if(multiValV.size()!=1)
5527 std::ostringstream oss;
5528 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
5529 throw INTERP_KERNEL::Exception(oss.str().c_str());
5531 pt[singleVal]=multiValV[0];
5536 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
5540 throw INTERP_KERNEL::Exception(msg);
5549 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
5553 std::ostringstream oss;
5554 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
5555 throw INTERP_KERNEL::Exception(oss.str().c_str());
5563 if(multiVal.size()!=multiValV.size())
5565 std::ostringstream oss;
5566 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
5567 throw INTERP_KERNEL::Exception(oss.str().c_str());
5569 for(int i=0;i<(int)multiVal.size();i++)
5571 int pos=multiVal[i];
5574 std::ostringstream oss;
5575 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
5576 throw INTERP_KERNEL::Exception(oss.str().c_str());
5578 pt[multiVal[i]]=multiValV[i];
5584 const int *ptV=daIntTyyppV->getConstPointer();
5585 if(nbc>daIntTyyppV->getNumberOfCompo())
5587 std::ostringstream oss;
5588 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
5589 throw INTERP_KERNEL::Exception(oss.str().c_str());
5591 std::copy(ptV,ptV+nbc,pt);
5595 throw INTERP_KERNEL::Exception(msg);
5600 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
5605 for(int j=0;j<sz;j++)
5606 pt[slic.first+j*slic.second.second]=singleValV;
5611 if(sz!=(int)multiValV.size())
5613 std::ostringstream oss;
5614 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
5615 throw INTERP_KERNEL::Exception(oss.str().c_str());
5617 for(int j=0;j<sz;j++)
5618 pt[slic.first+j*slic.second.second]=multiValV[j];
5623 const int *ptV=daIntTyyppV->getConstPointer();
5624 if(sz>daIntTyyppV->getNumberOfCompo())
5626 std::ostringstream oss;
5627 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
5628 throw INTERP_KERNEL::Exception(oss.str().c_str());
5630 for(int j=0;j<sz;j++)
5631 pt[slic.first+j*slic.second.second]=ptV[j];
5635 throw INTERP_KERNEL::Exception(msg);
5639 throw INTERP_KERNEL::Exception(msg);
5644 %extend ParaMEDMEM::DataArrayIntIterator
5648 DataArrayIntTuple *ret=self->nextt();
5650 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
5653 PyErr_SetString(PyExc_StopIteration,"No more data.");
5659 %extend ParaMEDMEM::DataArrayInt
5661 DataArrayInt() throw(INTERP_KERNEL::Exception)
5663 return DataArrayInt::New();
5666 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5668 const char *msg="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n--DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2) !";
5669 if(PyList_Check(elt0) || PyTuple_Check(elt0))
5673 if(PyInt_Check(nbOfTuples))
5675 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5677 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
5680 if(PyInt_Check(nbOfComp))
5681 {//DataArrayInt.New([1,3,4,5],2,2)
5682 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5684 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
5685 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
5686 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
5687 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5691 throw INTERP_KERNEL::Exception(msg);
5694 {//DataArrayInt.New([1,3,4],3)
5695 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
5697 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
5698 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5703 throw INTERP_KERNEL::Exception(msg);
5706 {// DataArrayInt.New([1,3,4])
5707 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
5708 int tmpp1=-1,tmpp2=-1;
5709 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
5710 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
5714 else if(PyInt_Check(elt0))
5716 int nbOfTuples1=PyInt_AS_LONG(elt0);
5718 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
5723 if(PyInt_Check(nbOfTuples))
5724 {//DataArrayInt.New(5,2)
5725 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
5727 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
5728 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
5729 ret->alloc(nbOfTuples1,nbOfCompo);
5733 throw INTERP_KERNEL::Exception(msg);
5736 throw INTERP_KERNEL::Exception(msg);
5739 {//DataArrayInt.New(5)
5740 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
5741 ret->alloc(nbOfTuples1,1);
5746 throw INTERP_KERNEL::Exception(msg);
5749 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5751 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
5754 std::string __str__() const throw(INTERP_KERNEL::Exception)
5756 return self->repr();
5759 int __len__() const throw(INTERP_KERNEL::Exception)
5761 if(self->isAllocated())
5763 return self->getNumberOfTuples();
5767 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
5771 int __int__() const throw(INTERP_KERNEL::Exception)
5773 return self->intValue();
5776 DataArrayIntIterator *__iter__()
5778 return self->iterator();
5781 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
5783 int sz=self->getNumberOfComponents();
5784 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5785 self->accumulate(tmp);
5786 return convertIntArrToPyList(tmp,sz);
5789 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
5791 int newNbOfTuples=-1;
5792 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
5793 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
5794 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
5795 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
5796 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
5797 PyObject *ret=PyTuple_New(2);
5798 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5799 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
5803 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
5805 const char *msg="ParaMEDMEM::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
5806 if(PyList_Check(li) || PyTuple_Check(li))
5810 if(PyInt_Check(nbOfTuples))
5812 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
5814 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
5817 if(PyInt_Check(nbOfComp))
5818 {//DataArrayInt.setValues([1,3,4,5],2,2)
5819 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
5821 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
5822 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
5823 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
5826 throw INTERP_KERNEL::Exception(msg);
5829 {//DataArrayInt.setValues([1,3,4],3)
5831 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
5832 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
5836 throw INTERP_KERNEL::Exception(msg);
5839 {// DataArrayInt.setValues([1,3,4])
5840 int tmpp1=-1,tmpp2=-1;
5841 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
5842 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
5846 throw INTERP_KERNEL::Exception(msg);
5849 PyObject *getValues() const throw(INTERP_KERNEL::Exception)
5851 const int *vals=self->getConstPointer();
5852 return convertIntArrToPyList(vals,self->getNbOfElems());
5855 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
5858 bool ret0=self->isEqualIfNotWhy(other,ret1);
5859 PyObject *ret=PyTuple_New(2);
5860 PyObject *ret0Py=ret0?Py_True:Py_False;
5862 PyTuple_SetItem(ret,0,ret0Py);
5863 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5867 PyObject *getValuesAsTuple() const throw(INTERP_KERNEL::Exception)
5869 const int *vals=self->getConstPointer();
5870 int nbOfComp=self->getNumberOfComponents();
5871 int nbOfTuples=self->getNumberOfTuples();
5872 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
5875 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
5877 std::vector<const DataArrayInt *> groups;
5878 std::vector< std::vector<int> > fidsOfGroups;
5879 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
5880 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
5881 PyObject *ret = PyList_New(2);
5882 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5883 int sz=fidsOfGroups.size();
5884 PyObject *ret1 = PyList_New(sz);
5885 for(int i=0;i<sz;i++)
5886 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
5887 PyList_SetItem(ret,1,ret1);
5891 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
5894 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5895 if (!SWIG_IsOK(res1))
5898 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5899 self->transformWithIndArr(tmp,tmp+size);
5903 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5904 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5908 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
5912 std::vector<int> multiVal;
5913 std::pair<int, std::pair<int,int> > slic;
5914 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5915 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
5919 return self->getIdsEqualList(&singleVal,&singleVal+1);
5921 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
5923 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
5925 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
5929 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
5933 std::vector<int> multiVal;
5934 std::pair<int, std::pair<int,int> > slic;
5935 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
5936 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
5940 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
5942 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
5944 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
5946 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
5950 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
5952 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
5954 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5955 if (!SWIG_IsOK(res1))
5958 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5959 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
5963 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5965 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5966 da2->checkAllocated();
5967 int size=self->getNumberOfTuples();
5968 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
5970 PyObject *ret = PyList_New(3);
5971 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5972 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5973 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5977 DataArrayInt *transformWithIndArrR(PyObject *li) const
5980 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5981 if (!SWIG_IsOK(res1))
5984 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5985 return self->transformWithIndArrR(tmp,tmp+size);
5989 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5990 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5994 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
5997 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5998 if (!SWIG_IsOK(res1))
6001 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6002 if(size!=self->getNumberOfTuples())
6004 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6006 self->renumberInPlace(tmp);
6010 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6012 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6013 da2->checkAllocated();
6014 int size=self->getNumberOfTuples();
6015 if(size!=self->getNumberOfTuples())
6017 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6019 self->renumberInPlace(da2->getConstPointer());
6023 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
6026 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6027 if (!SWIG_IsOK(res1))
6030 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6031 if(size!=self->getNumberOfTuples())
6033 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6035 self->renumberInPlaceR(tmp);
6039 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6041 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6042 da2->checkAllocated();
6043 int size=self->getNumberOfTuples();
6044 if(size!=self->getNumberOfTuples())
6046 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6048 self->renumberInPlaceR(da2->getConstPointer());
6052 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
6055 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6056 if (!SWIG_IsOK(res1))
6059 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6060 if(size!=self->getNumberOfTuples())
6062 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6064 return self->renumberAndReduce(tmp,newNbOfTuple);
6068 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6070 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6071 da2->checkAllocated();
6072 int size=self->getNumberOfTuples();
6073 if(size!=self->getNumberOfTuples())
6075 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6077 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
6081 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
6084 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6085 if (!SWIG_IsOK(res1))
6088 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6089 if(size!=self->getNumberOfTuples())
6091 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6093 return self->renumber(tmp);
6097 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6099 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6100 da2->checkAllocated();
6101 int size=self->getNumberOfTuples();
6102 if(size!=self->getNumberOfTuples())
6104 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6106 return self->renumber(da2->getConstPointer());
6110 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
6113 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6114 if (!SWIG_IsOK(res1))
6117 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6118 if(size!=self->getNumberOfTuples())
6120 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6122 return self->renumberR(tmp);
6126 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6128 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6129 da2->checkAllocated();
6130 int size=self->getNumberOfTuples();
6131 if(size!=self->getNumberOfTuples())
6133 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
6135 return self->renumberR(da2->getConstPointer());
6139 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
6142 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6143 if (!SWIG_IsOK(res1))
6146 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6147 return self->selectByTupleId(tmp,tmp+size);
6151 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6153 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6154 da2->checkAllocated();
6155 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
6159 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
6162 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6163 if (!SWIG_IsOK(res1))
6166 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6167 return self->selectByTupleIdSafe(tmp,tmp+size);
6171 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6173 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6174 da2->checkAllocated();
6175 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
6179 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6181 std::vector<int> tmp;
6182 convertPyToNewIntArr3(li,tmp);
6183 return self->keepSelectedComponents(tmp);
6186 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
6188 std::vector<int> tmp;
6189 convertPyToNewIntArr3(li,tmp);
6190 self->setSelectedComponents(a,tmp);
6193 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
6195 int sz=self->getNumberOfComponents();
6196 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
6197 self->getTuple(tupleId,tmp);
6198 return convertIntArrToPyList(tmp,sz);
6201 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
6203 DataArrayInt *arr=0;
6204 DataArrayInt *arrI=0;
6205 self->changeSurjectiveFormat(targetNb,arr,arrI);
6206 PyObject *res = PyList_New(2);
6207 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6208 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6212 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
6214 std::vector<std::pair<int,int> > ranges;
6215 convertPyToVectorPairInt(li,ranges);
6216 return self->selectByTupleRanges(ranges);
6219 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
6221 std::vector<const DataArrayInt *> tmp;
6222 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
6223 return DataArrayInt::Meld(tmp);
6226 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
6228 std::vector<const DataArrayInt *> tmp;
6229 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
6230 return DataArrayInt::Aggregate(tmp);
6233 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
6235 std::vector<const DataArrayInt *> tmp;
6236 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
6237 return DataArrayInt::BuildUnion(tmp);
6240 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
6242 std::vector<const DataArrayInt *> tmp;
6243 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
6244 return DataArrayInt::BuildIntersection(tmp);
6247 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
6250 int r1=self->getMaxValue(tmp);
6251 PyObject *ret=PyTuple_New(2);
6252 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
6253 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
6257 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
6260 int r1=self->getMinValue(tmp);
6261 PyObject *ret=PyTuple_New(2);
6262 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
6263 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
6267 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
6269 int nbOfCompo=self->getNumberOfComponents();
6274 if(PyInt_Check(obj))
6276 int val=(int)PyInt_AS_LONG(obj);
6277 return self->locateValue(val);
6280 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
6284 std::vector<int> arr;
6285 convertPyToNewIntArr3(obj,arr);
6286 return self->locateTuple(arr);
6291 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
6293 int nbOfCompo=self->getNumberOfComponents();
6300 if(PyInt_Check(obj))
6302 int val=(int)PyInt_AS_LONG(obj);
6303 return self->presenceOfValue(val);
6306 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
6310 std::vector<int> arr;
6311 convertPyToNewIntArr3(obj,arr);
6312 return self->presenceOfTuple(arr);
6317 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6319 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
6320 self->checkAllocated();
6321 int nbOfTuples=self->getNumberOfTuples();
6322 int nbOfComponents=self->getNumberOfComponents();
6324 std::vector<int> vt1,vc1;
6325 std::pair<int, std::pair<int,int> > pt1,pc1;
6326 DataArrayInt *dt1=0,*dc1=0;
6328 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
6329 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
6334 if(nbOfComponents==1)
6335 return PyInt_FromLong(self->getIJSafe(it1,0));
6336 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6339 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6341 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6343 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6345 return PyInt_FromLong(self->getIJSafe(it1,ic1));
6348 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
6349 std::vector<int> v2(1,ic1);
6350 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6354 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
6355 std::vector<int> v2(1,ic1);
6356 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6360 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
6361 std::vector<int> v2(1,ic1);
6362 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6366 ret=self->selectByTupleIdSafe(&it1,&it1+1);
6367 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6371 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
6372 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6376 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
6377 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6381 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
6382 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6386 ret=self->selectByTupleIdSafe(&it1,&it1+1);
6387 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
6388 std::vector<int> v2(nbOfComp);
6389 for(int i=0;i<nbOfComp;i++)
6390 v2[i]=pc1.first+i*pc1.second.second;
6391 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6395 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
6396 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
6397 std::vector<int> v2(nbOfComp);
6398 for(int i=0;i<nbOfComp;i++)
6399 v2[i]=pc1.first+i*pc1.second.second;
6400 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6404 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
6405 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
6406 std::vector<int> v2(nbOfComp);
6407 for(int i=0;i<nbOfComp;i++)
6408 v2[i]=pc1.first+i*pc1.second.second;
6409 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6413 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
6414 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
6415 std::vector<int> v2(nbOfComp);
6416 for(int i=0;i<nbOfComp;i++)
6417 v2[i]=pc1.first+i*pc1.second.second;
6418 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6421 throw INTERP_KERNEL::Exception(msg);
6425 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
6427 self->checkAllocated();
6428 const char msg[]="Unexpected situation in __setitem__ !";
6429 int nbOfTuples=self->getNumberOfTuples();
6430 int nbOfComponents=self->getNumberOfComponents();
6433 std::vector<int> v1;
6435 DataArrayIntTuple *dd1=0;
6436 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
6438 std::vector<int> vt1,vc1;
6439 std::pair<int, std::pair<int,int> > pt1,pc1;
6440 DataArrayInt *dt1=0,*dc1=0;
6441 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
6442 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
6450 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
6453 tmp=DataArrayInt::New();
6454 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6455 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
6458 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
6461 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6462 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
6465 throw INTERP_KERNEL::Exception(msg);
6474 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
6477 tmp=DataArrayInt::New();
6478 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6479 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
6482 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
6485 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6486 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
6489 throw INTERP_KERNEL::Exception(msg);
6498 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
6501 tmp=DataArrayInt::New();
6502 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6503 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
6506 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
6509 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6510 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
6513 throw INTERP_KERNEL::Exception(msg);
6522 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
6525 tmp=DataArrayInt::New();
6526 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6527 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
6530 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
6533 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6534 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
6537 throw INTERP_KERNEL::Exception(msg);
6546 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
6549 tmp=DataArrayInt::New();
6550 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6551 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
6554 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
6557 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6558 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
6561 throw INTERP_KERNEL::Exception(msg);
6570 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
6573 tmp=DataArrayInt::New();
6574 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6575 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
6578 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
6581 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6582 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
6585 throw INTERP_KERNEL::Exception(msg);
6594 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
6597 tmp=DataArrayInt::New();
6598 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6599 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
6602 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
6605 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6606 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
6609 throw INTERP_KERNEL::Exception(msg);
6618 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
6621 tmp=DataArrayInt::New();
6622 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6623 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
6626 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
6629 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6630 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
6633 throw INTERP_KERNEL::Exception(msg);
6642 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
6645 tmp=DataArrayInt::New();
6646 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6647 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
6650 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
6653 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6654 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
6657 throw INTERP_KERNEL::Exception(msg);
6666 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
6669 tmp=DataArrayInt::New();
6670 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6671 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
6674 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
6677 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6678 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
6681 throw INTERP_KERNEL::Exception(msg);
6690 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
6693 tmp=DataArrayInt::New();
6694 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6695 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
6698 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
6701 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6702 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
6705 throw INTERP_KERNEL::Exception(msg);
6714 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
6717 tmp=DataArrayInt::New();
6718 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6719 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
6722 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
6725 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6726 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
6729 throw INTERP_KERNEL::Exception(msg);
6738 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
6741 tmp=DataArrayInt::New();
6742 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6743 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
6746 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
6749 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6750 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
6753 throw INTERP_KERNEL::Exception(msg);
6762 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
6765 tmp=DataArrayInt::New();
6766 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6767 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
6770 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
6773 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6774 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
6777 throw INTERP_KERNEL::Exception(msg);
6786 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
6789 tmp=DataArrayInt::New();
6790 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6791 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
6794 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
6797 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6798 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
6801 throw INTERP_KERNEL::Exception(msg);
6810 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
6813 tmp=DataArrayInt::New();
6814 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
6815 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
6818 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
6821 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
6822 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
6825 throw INTERP_KERNEL::Exception(msg);
6830 throw INTERP_KERNEL::Exception(msg);
6835 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
6837 return self->negate();
6840 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6842 const char msg[]="Unexpected situation in __add__ !";
6845 std::vector<int> aa;
6846 DataArrayIntTuple *aaa;
6848 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6853 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6854 ret->applyLin(1,val);
6859 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6860 return DataArrayInt::Add(self,aaa);
6864 return DataArrayInt::Add(self,a);
6868 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6869 return DataArrayInt::Add(self,aaaa);
6872 throw INTERP_KERNEL::Exception(msg);
6876 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6878 const char msg[]="Unexpected situation in __radd__ !";
6881 std::vector<int> aa;
6882 DataArrayIntTuple *aaa;
6884 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6889 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6890 ret->applyLin(1,val);
6895 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6896 return DataArrayInt::Add(self,aaa);
6900 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6901 return DataArrayInt::Add(self,aaaa);
6904 throw INTERP_KERNEL::Exception(msg);
6908 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6910 const char msg[]="Unexpected situation in __iadd__ !";
6913 std::vector<int> aa;
6914 DataArrayIntTuple *aaa;
6916 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6921 self->applyLin(1,val);
6922 Py_XINCREF(trueSelf);
6927 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6929 Py_XINCREF(trueSelf);
6935 Py_XINCREF(trueSelf);
6940 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6941 self->addEqual(aaaa);
6942 Py_XINCREF(trueSelf);
6946 throw INTERP_KERNEL::Exception(msg);
6950 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6952 const char msg[]="Unexpected situation in __sub__ !";
6955 std::vector<int> aa;
6956 DataArrayIntTuple *aaa;
6958 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6963 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6964 ret->applyLin(1,-val);
6969 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6970 return DataArrayInt::Substract(self,aaa);
6974 return DataArrayInt::Substract(self,a);
6978 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6979 return DataArrayInt::Substract(self,aaaa);
6982 throw INTERP_KERNEL::Exception(msg);
6986 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6988 const char msg[]="Unexpected situation in __rsub__ !";
6991 std::vector<int> aa;
6992 DataArrayIntTuple *aaa;
6994 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6999 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7000 ret->applyLin(-1,val);
7005 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7006 return DataArrayInt::Substract(aaa,self);
7010 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7011 return DataArrayInt::Substract(aaaa,self);
7014 throw INTERP_KERNEL::Exception(msg);
7018 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
7020 const char msg[]="Unexpected situation in __isub__ !";
7023 std::vector<int> aa;
7024 DataArrayIntTuple *aaa;
7026 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7031 self->applyLin(1,-val);
7032 Py_XINCREF(trueSelf);
7037 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7038 self->substractEqual(bb);
7039 Py_XINCREF(trueSelf);
7044 self->substractEqual(a);
7045 Py_XINCREF(trueSelf);
7050 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7051 self->substractEqual(aaaa);
7052 Py_XINCREF(trueSelf);
7056 throw INTERP_KERNEL::Exception(msg);
7060 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7062 const char msg[]="Unexpected situation in __mul__ !";
7065 std::vector<int> aa;
7066 DataArrayIntTuple *aaa;
7068 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7073 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7074 ret->applyLin(val,0);
7079 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7080 return DataArrayInt::Multiply(self,aaa);
7084 return DataArrayInt::Multiply(self,a);
7088 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7089 return DataArrayInt::Multiply(self,aaaa);
7092 throw INTERP_KERNEL::Exception(msg);
7096 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7098 const char msg[]="Unexpected situation in __rmul__ !";
7101 std::vector<int> aa;
7102 DataArrayIntTuple *aaa;
7104 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7109 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7110 ret->applyLin(val,0);
7115 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7116 return DataArrayInt::Multiply(self,aaa);
7120 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7121 return DataArrayInt::Multiply(self,aaaa);
7124 throw INTERP_KERNEL::Exception(msg);
7128 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
7130 const char msg[]="Unexpected situation in __imul__ !";
7133 std::vector<int> aa;
7134 DataArrayIntTuple *aaa;
7136 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7141 self->applyLin(val,0);
7142 Py_XINCREF(trueSelf);
7147 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7148 self->multiplyEqual(bb);
7149 Py_XINCREF(trueSelf);
7154 self->multiplyEqual(a);
7155 Py_XINCREF(trueSelf);
7160 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7161 self->multiplyEqual(aaaa);
7162 Py_XINCREF(trueSelf);
7166 throw INTERP_KERNEL::Exception(msg);
7170 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7172 const char msg[]="Unexpected situation in __div__ !";
7175 std::vector<int> aa;
7176 DataArrayIntTuple *aaa;
7178 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7183 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7184 ret->applyDivideBy(val);
7189 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7190 return DataArrayInt::Divide(self,aaa);
7194 return DataArrayInt::Divide(self,a);
7198 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7199 return DataArrayInt::Divide(self,aaaa);
7202 throw INTERP_KERNEL::Exception(msg);
7206 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7208 const char msg[]="Unexpected situation in __rdiv__ !";
7211 std::vector<int> aa;
7212 DataArrayIntTuple *aaa;
7214 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7219 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7225 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7226 return DataArrayInt::Divide(aaa,self);
7230 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7231 return DataArrayInt::Divide(aaaa,self);
7234 throw INTERP_KERNEL::Exception(msg);
7238 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
7240 const char msg[]="Unexpected situation in __idiv__ !";
7243 std::vector<int> aa;
7244 DataArrayIntTuple *aaa;
7246 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7251 self->applyDivideBy(val);
7252 Py_XINCREF(trueSelf);
7257 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7258 self->divideEqual(bb);
7259 Py_XINCREF(trueSelf);
7264 self->divideEqual(a);
7265 Py_XINCREF(trueSelf);
7270 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7271 self->divideEqual(aaaa);
7272 Py_XINCREF(trueSelf);
7276 throw INTERP_KERNEL::Exception(msg);
7280 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7282 const char msg[]="Unexpected situation in __mod__ !";
7285 std::vector<int> aa;
7286 DataArrayIntTuple *aaa;
7288 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7293 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7294 ret->applyModulus(val);
7299 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7300 return DataArrayInt::Modulus(self,aaa);
7304 return DataArrayInt::Modulus(self,a);
7308 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7309 return DataArrayInt::Modulus(self,aaaa);
7312 throw INTERP_KERNEL::Exception(msg);
7316 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
7318 const char msg[]="Unexpected situation in __rmod__ !";
7321 std::vector<int> aa;
7322 DataArrayIntTuple *aaa;
7324 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7329 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
7330 ret->applyRModulus(val);
7335 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
7336 return DataArrayInt::Modulus(aaa,self);
7340 return DataArrayInt::Modulus(a,self);
7344 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7345 return DataArrayInt::Modulus(aaaa,self);
7348 throw INTERP_KERNEL::Exception(msg);
7352 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
7354 const char msg[]="Unexpected situation in __imod__ !";
7357 std::vector<int> aa;
7358 DataArrayIntTuple *aaa;
7360 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
7365 self->applyModulus(val);
7366 Py_XINCREF(trueSelf);
7371 self->modulusEqual(a);
7372 Py_XINCREF(trueSelf);
7377 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
7378 self->modulusEqual(aaaa);
7379 Py_XINCREF(trueSelf);
7383 throw INTERP_KERNEL::Exception(msg);
7388 namespace ParaMEDMEM
7390 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
7393 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7394 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
7395 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
7396 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
7397 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
7398 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
7399 void setName(const char *name) throw(INTERP_KERNEL::Exception);
7400 const char *getDescription() const throw(INTERP_KERNEL::Exception);
7401 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
7402 const char *getName() const throw(INTERP_KERNEL::Exception);
7403 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
7404 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
7405 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
7406 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
7407 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
7408 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
7409 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
7410 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
7411 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
7412 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
7413 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
7414 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
7415 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
7416 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
7417 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
7418 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
7420 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
7422 MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
7425 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
7428 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
7430 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
7433 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
7436 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
7438 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
7439 return convertIntArrToPyList3(ret);
7442 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
7445 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
7446 PyObject *ret=PyTuple_New(2);
7447 PyObject *ret0Py=ret0?Py_True:Py_False;
7449 PyTuple_SetItem(ret,0,ret0Py);
7450 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
7454 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
7456 DataArrayInt *ret1=0;
7457 MEDCouplingMesh *ret0=0;
7459 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
7460 if (!SWIG_IsOK(res1))
7463 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
7464 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
7468 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
7470 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
7471 da2->checkAllocated();
7472 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
7474 PyObject *res = PyList_New(2);
7475 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
7476 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
7480 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
7484 std::vector<int> pos2;
7485 DataArrayInt *pos3=0;
7486 DataArrayIntTuple *pos4=0;
7487 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
7492 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
7496 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
7500 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
7503 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
7507 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
7508 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
7511 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
7512 if (!SWIG_IsOK(res1))
7515 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
7516 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
7520 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
7522 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
7523 da2->checkAllocated();
7524 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
7528 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
7530 std::vector<int> tmp;
7531 self->getCellIdsHavingGaussLocalization(locId,tmp);
7532 DataArrayInt *ret=DataArrayInt::New();
7533 ret->alloc((int)tmp.size(),1);
7534 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
7535 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
7540 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
7543 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
7544 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
7545 void setTimeUnit(const char *unit);
7546 const char *getTimeUnit() const;
7547 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
7548 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
7549 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
7550 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7551 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7552 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
7553 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
7554 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
7555 MEDCouplingFieldDouble *deepCpy() const;
7556 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
7557 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
7558 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
7559 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
7560 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
7561 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
7562 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
7563 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
7564 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
7565 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
7566 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
7567 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
7568 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
7569 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
7570 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
7571 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7572 void setIteration(int it) throw(INTERP_KERNEL::Exception);
7573 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
7574 void setOrder(int order) throw(INTERP_KERNEL::Exception);
7575 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
7576 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
7577 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
7578 void updateTime() const throw(INTERP_KERNEL::Exception);
7579 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
7580 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
7581 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
7582 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
7583 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
7584 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
7585 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
7586 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
7587 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
7588 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
7589 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
7590 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
7591 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
7592 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
7593 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
7594 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
7595 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
7596 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
7597 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
7598 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
7599 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
7600 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
7601 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
7602 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
7603 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
7604 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
7605 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
7606 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
7607 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
7608 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
7609 double getMaxValue() const throw(INTERP_KERNEL::Exception);
7610 double getMinValue() const throw(INTERP_KERNEL::Exception);
7611 double getAverageValue() const throw(INTERP_KERNEL::Exception);
7612 double norm2() const throw(INTERP_KERNEL::Exception);
7613 double normMax() const throw(INTERP_KERNEL::Exception);
7614 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
7615 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
7616 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
7617 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
7618 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
7619 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
7620 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7621 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7622 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7623 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7624 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7625 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7626 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7627 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7628 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7629 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7630 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7631 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7632 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
7633 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7634 MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7635 MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7636 MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7637 MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
7639 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
7641 return MEDCouplingFieldDouble::New(type,td);
7644 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
7646 return MEDCouplingFieldDouble::New(ft,td);
7649 std::string __str__() const throw(INTERP_KERNEL::Exception)
7651 return self->simpleRepr();
7654 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
7656 DataArrayDouble *ret=self->getArray();
7662 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7664 std::vector<DataArrayDouble *> arrs=self->getArrays();
7665 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
7669 PyObject *ret=PyTuple_New(sz);
7670 for(int i=0;i<sz;i++)
7673 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7675 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
7680 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
7682 std::vector<const DataArrayDouble *> tmp;
7683 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
7685 std::vector<DataArrayDouble *> arrs(sz);
7686 for(int i=0;i<sz;i++)
7687 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
7688 self->setArrays(arrs);
7691 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
7693 DataArrayDouble *ret=self->getEndArray();
7699 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
7703 DataArrayDoubleTuple *aa;
7704 std::vector<double> bb;
7706 const MEDCouplingMesh *mesh=self->getMesh();
7708 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
7709 int spaceDim=mesh->getSpaceDimension();
7710 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
7711 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
7713 int sz=self->getNumberOfComponents();
7714 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
7715 self->getValueOn(spaceLoc,res);
7716 return convertDblArrToPyList(res,sz);
7719 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
7721 int sz=self->getNumberOfComponents();
7722 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
7723 self->getValueOnPos(i,j,k,res);
7724 return convertDblArrToPyList(res,sz);
7727 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
7730 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
7731 if (!SWIG_IsOK(res1))
7734 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
7735 const MEDCouplingMesh *mesh=self->getMesh();
7737 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
7738 int spaceDim=mesh->getSpaceDimension();
7739 int nbOfPoints=size/spaceDim;
7740 if(size%spaceDim!=0)
7742 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
7744 return self->getValueOnMulti(tmp,nbOfPoints);
7748 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
7750 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
7751 da2->checkAllocated();
7752 int size=da2->getNumberOfTuples();
7753 int nbOfCompo=da2->getNumberOfComponents();
7754 const MEDCouplingMesh *mesh=self->getMesh();
7756 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
7757 if(nbOfCompo!=mesh->getSpaceDimension())
7759 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
7761 return self->getValueOnMulti(da2->getConstPointer(),size);
7765 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
7769 DataArrayDoubleTuple *aa;
7770 std::vector<double> bb;
7772 const MEDCouplingMesh *mesh=self->getMesh();
7774 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
7775 int spaceDim=mesh->getSpaceDimension();
7776 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
7777 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
7780 int sz=self->getNumberOfComponents();
7781 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
7782 self->getValueOn(spaceLoc,time,res);
7783 return convertDblArrToPyList(res,sz);
7786 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
7788 if(self->getArray()!=0)
7791 double *tmp=convertPyToNewDblArr2(li,&sz);
7792 int nbTuples=self->getArray()->getNumberOfTuples();
7793 int nbOfCompo=self->getArray()->getNumberOfComponents();
7794 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
7797 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
7800 PyObject *getTime() throw(INTERP_KERNEL::Exception)
7803 double tmp0=self->getTime(tmp1,tmp2);
7804 PyObject *res = PyList_New(3);
7805 PyList_SetItem(res,0,SWIG_From_double(tmp0));
7806 PyList_SetItem(res,1,SWIG_From_int(tmp1));
7807 PyList_SetItem(res,2,SWIG_From_int(tmp2));
7811 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
7814 double tmp0=self->getStartTime(tmp1,tmp2);
7815 PyObject *res = PyList_New(3);
7816 PyList_SetItem(res,0,SWIG_From_double(tmp0));
7817 PyList_SetItem(res,1,SWIG_From_int(tmp1));
7818 PyList_SetItem(res,2,SWIG_From_int(tmp2));
7822 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
7825 double tmp0=self->getEndTime(tmp1,tmp2);
7826 PyObject *res = PyList_New(3);
7827 PyList_SetItem(res,0,SWIG_From_double(tmp0));
7828 PyList_SetItem(res,1,SWIG_From_int(tmp1));
7829 PyList_SetItem(res,2,SWIG_From_int(tmp2));
7832 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
7834 int sz=self->getNumberOfComponents();
7835 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
7836 self->accumulate(tmp);
7837 return convertDblArrToPyList(tmp,sz);
7839 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
7841 int sz=self->getNumberOfComponents();
7842 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
7843 self->integral(isWAbs,tmp);
7844 return convertDblArrToPyList(tmp,sz);
7846 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
7848 int sz=self->getNumberOfComponents();
7849 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
7850 self->getWeightedAverageValue(tmp,isWAbs);
7851 return convertDblArrToPyList(tmp,sz);
7853 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
7855 int sz=self->getNumberOfComponents();
7856 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
7858 return convertDblArrToPyList(tmp,sz);
7860 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
7862 int sz=self->getNumberOfComponents();
7863 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
7865 return convertDblArrToPyList(tmp,sz);
7867 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
7870 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
7871 if (!SWIG_IsOK(res1))
7874 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
7875 self->renumberCells(tmp,check);
7879 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
7881 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
7882 da2->checkAllocated();
7883 self->renumberCells(da2->getConstPointer(),check);
7886 void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
7889 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
7890 if (!SWIG_IsOK(res1))
7893 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
7894 self->renumberNodes(tmp);
7898 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
7900 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
7901 da2->checkAllocated();
7902 self->renumberNodes(da2->getConstPointer());
7906 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
7910 std::vector<int> multiVal;
7911 std::pair<int, std::pair<int,int> > slic;
7912 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
7913 const MEDCouplingMesh *mesh=self->getMesh();
7915 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
7916 int nbc=mesh->getNumberOfCells();
7917 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
7924 std::ostringstream oss;
7925 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
7926 throw INTERP_KERNEL::Exception(oss.str().c_str());
7929 return self->buildSubPart(&singleVal,&singleVal+1);
7934 int tmp=nbc+singleVal;
7935 return self->buildSubPart(&tmp,&tmp+1);
7939 std::ostringstream oss;
7940 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
7941 throw INTERP_KERNEL::Exception(oss.str().c_str());
7947 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
7951 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
7952 return self->buildSubPart(rg->begin(),rg->end());
7957 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
7958 daIntTyypp->checkAllocated();
7959 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
7962 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
7966 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
7968 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
7971 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
7974 double r1=self->getMaxValue2(tmp);
7975 PyObject *ret=PyTuple_New(2);
7976 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
7977 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
7981 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
7984 double r1=self->getMinValue2(tmp);
7985 PyObject *ret=PyTuple_New(2);
7986 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
7987 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
7991 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
7993 std::vector<int> tmp;
7994 convertPyToNewIntArr3(li,tmp);
7995 return self->keepSelectedComponents(tmp);
7998 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
8000 std::vector<int> tmp;
8001 convertPyToNewIntArr3(li,tmp);
8002 self->setSelectedComponents(f,tmp);
8005 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
8008 DataArrayDouble *a,*a2;
8009 DataArrayDoubleTuple *aa,*aa2;
8010 std::vector<double> bb,bb2;
8013 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
8014 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
8015 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
8016 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
8018 return self->extractSlice3D(orig,vect,eps);
8021 PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
8024 Py_XINCREF(trueSelf);
8028 PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
8031 Py_XINCREF(trueSelf);
8035 PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
8038 Py_XINCREF(trueSelf);
8042 PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
8045 Py_XINCREF(trueSelf);
8049 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
8051 std::vector<const MEDCouplingFieldDouble *> tmp;
8052 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8053 return MEDCouplingFieldDouble::MergeFields(tmp);
8056 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
8058 std::vector<const MEDCouplingFieldDouble *> tmp;
8059 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8060 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
8065 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
8068 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
8069 static MEDCouplingFieldTemplate *New(TypeOfField type);
8070 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
8071 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
8072 void updateTime() const;
8075 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
8077 return MEDCouplingFieldTemplate::New(f);
8080 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
8082 return MEDCouplingFieldTemplate::New(type);
8085 std::string __str__() const throw(INTERP_KERNEL::Exception)
8087 return self->simpleRepr();
8092 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
8095 int getNumberOfFields() const;
8096 MEDCouplingMultiFields *deepCpy() const;
8097 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
8098 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
8099 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
8100 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
8101 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
8102 void updateTime() const throw(INTERP_KERNEL::Exception);
8105 std::string __str__() const throw(INTERP_KERNEL::Exception)
8107 return self->simpleRepr();
8109 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
8111 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
8112 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8114 std::vector<MEDCouplingFieldDouble *> fs(sz);
8115 for(int i=0;i<sz;i++)
8116 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
8117 return MEDCouplingMultiFields::New(fs);
8119 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
8121 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
8122 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8124 std::vector<MEDCouplingFieldDouble *> fs(sz);
8125 for(int i=0;i<sz;i++)
8126 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
8127 return MEDCouplingMultiFields::New(fs);
8129 PyObject *getFields() const
8131 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
8132 int sz=fields.size();
8133 PyObject *res = PyList_New(sz);
8134 for(int i=0;i<sz;i++)
8138 fields[i]->incrRef();
8139 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
8143 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
8148 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
8150 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
8154 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
8157 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
8159 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
8161 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
8163 PyObject *res = PyList_New(sz);
8164 for(int i=0;i<sz;i++)
8169 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
8173 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
8178 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
8180 std::vector<int> refs;
8181 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
8183 PyObject *res = PyList_New(sz);
8184 for(int i=0;i<sz;i++)
8189 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
8193 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
8197 PyObject *ret=PyTuple_New(2);
8198 PyTuple_SetItem(ret,0,res);
8199 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
8202 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
8204 std::vector<DataArrayDouble *> ms=self->getArrays();
8206 PyObject *res = PyList_New(sz);
8207 for(int i=0;i<sz;i++)
8212 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
8216 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
8221 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
8223 std::vector< std::vector<int> > refs;
8224 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
8226 PyObject *res = PyList_New(sz);
8227 PyObject *res2 = PyList_New(sz);
8228 for(int i=0;i<sz;i++)
8233 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
8237 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
8239 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
8242 PyObject *ret=PyTuple_New(2);
8243 PyTuple_SetItem(ret,0,res);
8244 PyTuple_SetItem(ret,1,res2);
8250 class MEDCouplingDefinitionTime
8253 MEDCouplingDefinitionTime();
8254 void assign(const MEDCouplingDefinitionTime& other);
8255 bool isEqual(const MEDCouplingDefinitionTime& other) const;
8256 double getTimeResolution() const;
8257 std::vector<double> getHotSpotsTime() const;
8260 std::string __str__() const throw(INTERP_KERNEL::Exception)
8262 std::ostringstream oss;
8263 self->appendRepr(oss);
8267 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
8269 int meshId,arrId,arrIdInField,fieldId;
8270 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
8271 PyObject *res=PyList_New(4);
8272 PyList_SetItem(res,0,PyInt_FromLong(meshId));
8273 PyList_SetItem(res,1,PyInt_FromLong(arrId));
8274 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
8275 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
8279 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
8281 int meshId,arrId,arrIdInField,fieldId;
8282 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
8283 PyObject *res=PyList_New(4);
8284 PyList_SetItem(res,0,PyInt_FromLong(meshId));
8285 PyList_SetItem(res,1,PyInt_FromLong(arrId));
8286 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
8287 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
8293 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
8296 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
8297 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
8301 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
8303 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
8304 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8306 std::vector<MEDCouplingFieldDouble *> fs(sz);
8307 for(int i=0;i<sz;i++)
8308 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
8309 return MEDCouplingFieldOverTime::New(fs);
8311 std::string __str__() const throw(INTERP_KERNEL::Exception)
8313 return self->simpleRepr();
8315 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
8317 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
8318 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
8320 std::vector<MEDCouplingFieldDouble *> fs(sz);
8321 for(int i=0;i<sz;i++)
8322 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
8323 return MEDCouplingFieldOverTime::New(fs);
8331 __filename=os.environ.get('PYTHONSTARTUP')
8332 if __filename and os.path.isfile(__filename):
8333 execfile(__filename)