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);
80 %init %{ import_array(); %}
83 %feature("autodoc", "1");
84 %feature("docstring");
86 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
87 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
88 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
89 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
90 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
91 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
92 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
93 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
94 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
95 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
96 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
97 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
98 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
99 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
100 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
101 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
102 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
103 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
104 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
105 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator+;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator-;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator*;
132 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
133 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
134 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
135 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
136 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
137 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
138 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
139 %newobject ParaMEDMEM::DataArrayInt::New;
140 %newobject ParaMEDMEM::DataArrayInt::__iter__;
141 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
142 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
143 %newobject ParaMEDMEM::DataArrayInt::performCpy;
144 %newobject ParaMEDMEM::DataArrayInt::substr;
145 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
146 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
147 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
148 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
149 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
150 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
151 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
152 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
153 %newobject ParaMEDMEM::DataArrayInt::renumber;
154 %newobject ParaMEDMEM::DataArrayInt::renumberR;
155 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
156 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
157 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
158 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
159 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
160 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
161 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
162 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
163 %newobject ParaMEDMEM::DataArrayInt::negate;
164 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
165 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
166 %newobject ParaMEDMEM::DataArrayInt::Meld;
167 %newobject ParaMEDMEM::DataArrayInt::Add;
168 %newobject ParaMEDMEM::DataArrayInt::Substract;
169 %newobject ParaMEDMEM::DataArrayInt::Multiply;
170 %newobject ParaMEDMEM::DataArrayInt::Divide;
171 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
172 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
173 %newobject ParaMEDMEM::DataArrayInt::Range;
174 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
175 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
176 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
177 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
178 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
179 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
180 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
181 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
182 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
183 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
184 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
185 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
186 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
187 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
188 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
189 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
190 %newobject ParaMEDMEM::DataArrayInt::__neg__;
191 %newobject ParaMEDMEM::DataArrayInt::__add__;
192 %newobject ParaMEDMEM::DataArrayInt::__radd__;
193 %newobject ParaMEDMEM::DataArrayInt::__sub__;
194 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
195 %newobject ParaMEDMEM::DataArrayInt::__mul__;
196 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
197 %newobject ParaMEDMEM::DataArrayInt::__div__;
198 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
199 %newobject ParaMEDMEM::DataArrayInt::__mod__;
200 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
201 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
202 %newobject ParaMEDMEM::DataArrayDouble::New;
203 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
204 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
205 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
206 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
207 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
208 %newobject ParaMEDMEM::DataArrayDouble::Meld;
209 %newobject ParaMEDMEM::DataArrayDouble::Dot;
210 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
211 %newobject ParaMEDMEM::DataArrayDouble::Add;
212 %newobject ParaMEDMEM::DataArrayDouble::Substract;
213 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
214 %newobject ParaMEDMEM::DataArrayDouble::Divide;
215 %newobject ParaMEDMEM::DataArrayDouble::substr;
216 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
217 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
218 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
219 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
220 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
221 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
222 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
223 %newobject ParaMEDMEM::DataArrayDouble::negate;
224 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
225 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
226 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
227 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
228 %newobject ParaMEDMEM::DataArrayDouble::determinant;
229 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
230 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
231 %newobject ParaMEDMEM::DataArrayDouble::inverse;
232 %newobject ParaMEDMEM::DataArrayDouble::trace;
233 %newobject ParaMEDMEM::DataArrayDouble::deviator;
234 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
235 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
236 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
237 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
238 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
239 %newobject ParaMEDMEM::DataArrayDouble::renumber;
240 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
241 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
242 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
243 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
244 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
245 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
246 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
247 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
248 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
249 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
250 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
251 %newobject ParaMEDMEM::DataArrayDouble::__add__;
252 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
253 %newobject ParaMEDMEM::DataArrayDouble::__sub__;
254 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
255 %newobject ParaMEDMEM::DataArrayDouble::__mul__;
256 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
257 %newobject ParaMEDMEM::DataArrayDouble::__div__;
258 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
259 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
260 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
261 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
262 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
263 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
264 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
265 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
266 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
267 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
268 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
269 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
270 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
271 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
272 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
273 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
274 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
275 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
276 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
277 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
278 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
279 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
280 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
281 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
282 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
317 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
318 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
319 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
320 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
321 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
322 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
323 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
324 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
325 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
326 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
327 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
328 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
329 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
330 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
331 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
332 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
333 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
334 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
335 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
336 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
337 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
338 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
340 %feature("unref") DataArrayDouble "$this->decrRef();"
341 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
342 %feature("unref") MEDCouplingMesh "$this->decrRef();"
343 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
344 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
345 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
346 %feature("unref") DataArrayInt "$this->decrRef();"
347 %feature("unref") MEDCouplingField "$this->decrRef();"
348 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
349 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
350 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
351 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
352 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
353 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
354 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
355 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
356 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
358 %rename(assign) *::operator=;
359 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
360 %ignore ParaMEDMEM::RefCountObject::decrRef;
361 %ignore ParaMEDMEM::MemArray::operator=;
362 %ignore ParaMEDMEM::MemArray::operator[];
363 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
364 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
365 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
366 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
367 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
368 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
369 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
370 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
371 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
372 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
373 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
374 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
375 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
376 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
380 %rename (InterpKernelException) INTERP_KERNEL::Exception;
382 namespace INTERP_KERNEL
387 Exception(const char* what);
388 ~Exception() throw ();
389 const char *what() const throw ();
392 std::string __str__() const
394 return std::string(self->what());
400 %include "MEDCouplingTimeLabel.hxx"
424 CONST_ON_TIME_INTERVAL = 7
425 } TypeOfTimeDiscretization;
427 const char *MEDCouplingVersionStr();
428 int MEDCouplingVersion();
429 PyObject *MEDCouplingVersionMajMinRel()
431 int tmp0=0,tmp1=0,tmp2=0;
432 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
433 PyObject *res = PyList_New(3);
434 PyList_SetItem(res,0,SWIG_From_int(tmp0));
435 PyList_SetItem(res,1,SWIG_From_int(tmp1));
436 PyList_SetItem(res,2,SWIG_From_int(tmp2));
440 class MEDCOUPLING_EXPORT RefCountObject
444 RefCountObject(const RefCountObject& other);
447 bool decrRef() const;
448 void incrRef() const;
449 virtual std::size_t getHeapMemorySize() const;
458 UNSTRUCTURED_DESC = 6,
462 } MEDCouplingMeshType;
465 class DataArrayDouble;
466 class MEDCouplingUMesh;
467 class MEDCouplingFieldDouble;
469 %extend RefCountObject
471 std::string getHiddenCppPointer() const
473 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
478 class MEDCouplingMesh : public RefCountObject, public TimeLabel
481 void setName(const char *name);
482 const char *getName() const;
483 void setDescription(const char *descr);
484 const char *getDescription() const;
485 void setTime(double val, int iteration, int order);
486 void setTimeUnit(const char *unit);
487 const char *getTimeUnit() const;
488 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
489 bool isStructured() const throw(INTERP_KERNEL::Exception);
490 virtual MEDCouplingMesh *deepCpy() const;
491 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
492 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
493 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
494 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
495 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
496 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
497 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
498 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
499 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
500 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
501 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
502 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
503 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
504 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
505 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
506 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
507 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
508 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
509 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
510 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
512 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
513 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
514 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
515 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
516 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
517 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
518 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
519 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
520 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
521 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
522 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
523 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
524 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
527 std::string __str__() const throw(INTERP_KERNEL::Exception)
529 return self->simpleRepr();
532 PyObject *getTime() throw(INTERP_KERNEL::Exception)
535 double tmp0=self->getTime(tmp1,tmp2);
536 PyObject *res = PyList_New(3);
537 PyList_SetItem(res,0,SWIG_From_double(tmp0));
538 PyList_SetItem(res,1,SWIG_From_int(tmp1));
539 PyList_SetItem(res,2,SWIG_From_int(tmp2));
543 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
547 DataArrayDoubleTuple *aa;
548 std::vector<double> bb;
550 int spaceDim=self->getSpaceDimension();
551 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
552 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
553 return self->getCellContainingPoint(pos,eps);
556 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
560 DataArrayDoubleTuple *aa;
561 std::vector<double> bb;
563 int spaceDim=self->getSpaceDimension();
564 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
565 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
566 std::vector<int> elts,eltsIndex;
567 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
568 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
569 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
570 d0->alloc(elts.size(),1);
571 d1->alloc(eltsIndex.size(),1);
572 std::copy(elts.begin(),elts.end(),d0->getPointer());
573 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
574 PyObject *ret=PyTuple_New(2);
575 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
576 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
582 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
584 std::vector<int> elts,eltsIndex;
585 int spaceDim=self->getSpaceDimension();
587 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
588 if (!SWIG_IsOK(res1))
591 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
592 int nbOfPoints=size/spaceDim;
595 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
597 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
601 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
603 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
604 da2->checkAllocated();
605 int size=da2->getNumberOfTuples();
606 int nbOfCompo=da2->getNumberOfComponents();
607 if(nbOfCompo!=spaceDim)
609 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
611 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
613 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
614 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
615 d0->alloc(elts.size(),1);
616 d1->alloc(eltsIndex.size(),1);
617 std::copy(elts.begin(),elts.end(),d0->getPointer());
618 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
619 PyObject *ret=PyTuple_New(2);
620 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
621 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
627 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
631 DataArrayDoubleTuple *aa;
632 std::vector<double> bb;
634 int spaceDim=self->getSpaceDimension();
635 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
636 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
637 std::vector<int> elts;
638 self->getCellsContainingPoint(pos,eps,elts);
639 DataArrayInt *ret=DataArrayInt::New();
640 ret->alloc((int)elts.size(),1);
641 std::copy(elts.begin(),elts.end(),ret->getPointer());
642 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
645 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
648 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
649 if (!SWIG_IsOK(res1))
652 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
653 self->renumberCells(tmp,check);
657 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
659 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
660 da2->checkAllocated();
661 self->renumberCells(da2->getConstPointer(),check);
665 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
667 DataArrayInt *cellCor, *nodeCor;
668 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
669 PyObject *res = PyList_New(2);
670 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
671 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
674 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
677 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
678 if (!SWIG_IsOK(res1))
681 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
682 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
686 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
688 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
689 da2->checkAllocated();
690 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
693 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
695 std::vector<int> conn;
696 self->getNodeIdsOfCell(cellId,conn);
697 return convertIntArrToPyList2(conn);
700 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
702 std::vector<double> coo;
703 self->getCoordinatesOfNode(nodeId,coo);
704 return convertDblArrToPyList2(coo);
707 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
711 DataArrayDoubleTuple *aa;
712 std::vector<double> bb;
714 int spaceDim=self->getSpaceDimension();
715 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
716 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
717 self->scale(pointPtr,factor);
720 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
722 int spaceDim=self->getSpaceDimension();
723 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
724 self->getBoundingBox(tmp);
725 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
729 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
732 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
733 PyObject *ret=PyTuple_New(2);
734 PyObject *ret0Py=ret0?Py_True:Py_False;
736 PyTuple_SetItem(ret,0,ret0Py);
737 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
741 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
743 int szArr,sw,iTypppArr;
744 std::vector<int> stdvecTyyppArr;
745 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
746 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
747 if(sw==3)//DataArrayInt
749 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
750 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
751 std::string name=argpt->getName();
753 ret->setName(name.c_str());
755 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
758 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
760 int szArr,sw,iTypppArr;
761 std::vector<int> stdvecTyyppArr;
763 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
764 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
765 if(sw==3)//DataArrayInt
767 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
768 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
769 std::string name=argpt->getName();
771 ret->setName(name.c_str());
774 PyObject *res = PyList_New(2);
775 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
776 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
777 PyList_SetItem(res,0,obj0);
778 PyList_SetItem(res,1,obj1);
782 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
784 std::vector<int> vals=self->getDistributionOfTypes();
785 PyObject *ret=PyList_New((int)vals.size()/3);
786 for(int j=0;j<(int)vals.size()/3;j++)
788 PyObject *ret1=PyList_New(3);
789 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
790 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
791 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
792 PyList_SetItem(ret,j,ret1);
797 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
799 std::vector<int> code;
800 std::vector<const DataArrayInt *> idsPerType;
801 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
802 convertPyToNewIntArr4(li,1,3,code);
803 return self->checkTypeConsistencyAndContig(code,idsPerType);
806 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
808 std::vector<int> code;
809 std::vector<DataArrayInt *> idsInPflPerType;
810 std::vector<DataArrayInt *> idsPerType;
811 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
812 PyObject *ret=PyTuple_New(3);
813 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
814 PyObject *ret1=PyList_New(idsInPflPerType.size());
815 for(std::size_t j=0;j<idsInPflPerType.size();j++)
816 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
817 PyTuple_SetItem(ret,1,ret1);
818 int n=idsPerType.size();
819 PyObject *ret2=PyList_New(n);
821 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
822 PyTuple_SetItem(ret,2,ret2);
826 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
830 DataArrayDoubleTuple *aa;
831 std::vector<double> bb;
833 int spaceDim=self->getSpaceDimension();
834 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
835 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
836 self->translate(vectorPtr);
839 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
841 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
844 DataArrayDoubleTuple *aa;
845 std::vector<double> bb;
847 int spaceDim=self->getSpaceDimension();
848 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
849 self->rotate(centerPtr,0,alpha);
852 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
854 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
857 DataArrayDoubleTuple *aa;
858 std::vector<double> bb;
860 int spaceDim=self->getSpaceDimension();
861 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
862 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
863 self->rotate(centerPtr,vectorPtr,alpha);
866 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
868 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
869 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
870 PyObject *res=PyList_New(result.size());
871 for(int i=0;iL!=result.end(); i++, iL++)
872 PyList_SetItem(res,i,PyInt_FromLong(*iL));
876 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
878 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
879 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
880 return MEDCouplingMesh::MergeMeshes(tmp);
886 %extend ParaMEDMEM::DataArray
888 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
890 const std::vector<std::string>& comps=self->getInfoOnComponents();
891 PyObject *ret=PyList_New((int)comps.size());
892 for(int i=0;i<(int)comps.size();i++)
893 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
897 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
899 std::vector<int> tmp;
900 convertPyToNewIntArr3(li,tmp);
901 self->copyPartOfStringInfoFrom(other,tmp);
904 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
906 std::vector<int> tmp;
907 convertPyToNewIntArr3(li,tmp);
908 self->copyPartOfStringInfoFrom2(tmp,other);
912 %extend ParaMEDMEM::DataArrayInt
914 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
916 int szArr,sw,iTypppArr;
917 std::vector<int> stdvecTyyppArr;
918 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
919 self->pushBackValsSilent(tmp,tmp+szArr);
922 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
924 std::vector<int> ret1;
925 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
926 std::size_t sz=ret0.size();
927 PyObject *pyRet=PyTuple_New(2);
928 PyObject *pyRet0=PyList_New((int)sz);
929 PyObject *pyRet1=PyList_New((int)sz);
930 for(std::size_t i=0;i<sz;i++)
932 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
933 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
935 PyTuple_SetItem(pyRet,0,pyRet0);
936 PyTuple_SetItem(pyRet,1,pyRet1);
941 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
943 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
945 int sz=0,sw=-1,val1=-1;
946 std::vector<int> val2;
947 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
948 return self->clonePart(inp,inp+sz);
952 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
954 PyObject *getArrayOfDiscIds() const
956 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
959 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
963 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
964 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
965 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
966 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
968 %include "MEDCouplingMemArray.hxx"
969 %include "NormalizedUnstructuredMesh.hxx"
970 %include "MEDCouplingNatureOfField.hxx"
971 %include "MEDCouplingTimeDiscretization.hxx"
972 %include "MEDCouplingGaussLocalization.hxx"
973 %include "MEDCouplingFieldDiscretization.hxx"
977 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
980 void updateTime() const;
981 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
982 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
983 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
984 void zipCoords() throw(INTERP_KERNEL::Exception);
985 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
986 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
987 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
988 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
989 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
990 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
991 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
992 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
993 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
994 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
995 //! size of returned tinyInfo must be always the same.
996 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
997 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
998 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
999 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
1000 const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
1001 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1002 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1003 virtual DataArrayInt *findBoundaryNodes() const;
1006 std::string __str__() const throw(INTERP_KERNEL::Exception)
1008 return self->simpleRepr();
1011 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1014 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1015 PyObject *res = PyList_New(2);
1016 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1017 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1021 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1023 DataArrayInt *comm, *commIndex;
1024 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1025 PyObject *res = PyList_New(2);
1026 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1027 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1031 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1033 DataArrayDouble *ret1=self->getCoords();
1035 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1038 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1040 int szArr,sw,iTypppArr;
1041 std::vector<int> stdvecTyyppArr;
1042 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1043 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1044 if(sw==3)//DataArrayInt
1046 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1047 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1048 std::string name=argpt->getName();
1050 ret->setName(name.c_str());
1052 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1055 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1057 int szArr,sw,iTypppArr;
1058 std::vector<int> stdvecTyyppArr;
1059 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1060 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1061 if(sw==3)//DataArrayInt
1063 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1064 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1065 std::string name=argpt->getName();
1067 ret->setName(name.c_str());
1069 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1072 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1074 int szArr,sw,iTypppArr;
1075 std::vector<int> stdvecTyyppArr;
1076 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1077 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1078 if(sw==3)//DataArrayInt
1080 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1081 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1082 std::string name=argpt->getName();
1084 ret->setName(name.c_str());
1086 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1089 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1091 int szArr,sw,iTypppArr;
1092 std::vector<int> stdvecTyyppArr;
1093 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1094 self->renumberNodes(tmp,newNbOfNodes);
1097 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1099 int szArr,sw,iTypppArr;
1100 std::vector<int> stdvecTyyppArr;
1101 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1102 self->renumberNodes2(tmp,newNbOfNodes);
1105 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1107 int spaceDim=self->getSpaceDimension();
1109 DataArrayDouble *a,*a2;
1110 DataArrayDoubleTuple *aa,*aa2;
1111 std::vector<double> bb,bb2;
1113 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1114 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1115 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1116 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1117 std::vector<int> nodes;
1118 self->findNodesOnLine(p,v,eps,nodes);
1119 DataArrayInt *ret=DataArrayInt::New();
1120 ret->alloc((int)nodes.size(),1);
1121 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1122 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1124 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1126 int spaceDim=self->getSpaceDimension();
1128 DataArrayDouble *a,*a2;
1129 DataArrayDoubleTuple *aa,*aa2;
1130 std::vector<double> bb,bb2;
1132 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1133 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1134 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1135 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1136 std::vector<int> nodes;
1137 self->findNodesOnPlane(p,v,eps,nodes);
1138 DataArrayInt *ret=DataArrayInt::New();
1139 ret->alloc((int)nodes.size(),1);
1140 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1141 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1144 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1148 DataArrayDoubleTuple *aa;
1149 std::vector<double> bb;
1151 int spaceDim=self->getSpaceDimension();
1152 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1153 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1154 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1155 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1158 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfNodes, double eps) const throw(INTERP_KERNEL::Exception)
1160 DataArrayInt *c=0,*cI=0;
1164 DataArrayDoubleTuple *aa;
1165 std::vector<double> bb;
1167 int spaceDim=self->getSpaceDimension();
1168 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1169 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfNodes,spaceDim,true);
1170 self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI);
1171 PyObject *ret=PyTuple_New(2);
1172 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1173 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1177 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1179 DataArrayInt *c=0,*cI=0;
1180 int spaceDim=self->getSpaceDimension();
1183 DataArrayDoubleTuple *aa;
1184 std::vector<double> bb;
1187 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1188 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1190 PyObject *ret=PyTuple_New(2);
1191 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1196 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1200 DataArrayDoubleTuple *aa;
1201 std::vector<double> bb;
1203 int spaceDim=self->getSpaceDimension();
1204 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1205 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1207 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1208 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1211 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1215 std::vector<int> multiVal;
1216 std::pair<int, std::pair<int,int> > slic;
1217 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1218 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1222 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1224 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1226 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1228 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1232 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1235 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1236 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1237 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1238 for(int i=0;i<sz;i++)
1239 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1242 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1245 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1247 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1248 std::vector<double> val3;
1249 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1250 "Rotate2DAlg",2,true,nbNodes);
1252 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1253 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1256 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1259 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1260 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1261 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1262 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1263 for(int i=0;i<sz;i++)
1264 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1267 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1270 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1272 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1273 std::vector<double> val3;
1274 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1275 "Rotate3DAlg",3,true,nbNodes);
1277 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1278 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1279 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1284 class MEDCouplingUMeshCell
1287 INTERP_KERNEL::NormalizedCellType getType() const;
1290 std::string __str__() const
1292 return self->repr();
1295 PyObject *getAllConn() const
1298 const int *r=self->getAllConn(ret2);
1299 PyObject *ret=PyTuple_New(ret2);
1300 for(int i=0;i<ret2;i++)
1301 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1307 class MEDCouplingUMeshCellIterator
1314 MEDCouplingUMeshCell *ret=self->nextt();
1316 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1319 PyErr_SetString(PyExc_StopIteration,"No more data.");
1326 class MEDCouplingUMeshCellByTypeIterator
1329 ~MEDCouplingUMeshCellByTypeIterator();
1334 MEDCouplingUMeshCellEntry *ret=self->nextt();
1336 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1339 PyErr_SetString(PyExc_StopIteration,"No more data.");
1346 class MEDCouplingUMeshCellByTypeEntry
1349 ~MEDCouplingUMeshCellByTypeEntry();
1352 MEDCouplingUMeshCellByTypeIterator *__iter__()
1354 return self->iterator();
1359 class MEDCouplingUMeshCellEntry
1362 INTERP_KERNEL::NormalizedCellType getType() const;
1363 int getNumberOfElems() const;
1366 MEDCouplingUMeshCellIterator *__iter__()
1368 return self->iterator();
1373 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1376 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1377 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1378 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1379 void updateTime() const;
1380 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1381 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1382 void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
1383 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1384 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1385 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1386 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1387 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1388 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1389 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1390 void computeTypes() throw(INTERP_KERNEL::Exception);
1391 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1392 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1394 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1395 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1396 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1398 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1399 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1400 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1401 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1402 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1403 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1404 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1405 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1406 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1407 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1408 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1409 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1410 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1411 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1412 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1413 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1414 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1415 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1416 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1417 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1418 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1419 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1420 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1421 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1422 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1423 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1424 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1425 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1426 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1427 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1428 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1429 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1430 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1432 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1434 return MEDCouplingUMesh::New();
1437 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1439 return MEDCouplingUMesh::New(meshName,meshDim);
1442 std::string __str__() const throw(INTERP_KERNEL::Exception)
1444 return self->simpleRepr();
1447 MEDCouplingUMeshCellIterator *__iter__()
1449 return self->cellIterator();
1452 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1456 std::vector<int> multiVal;
1457 std::pair<int, std::pair<int,int> > slic;
1458 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1459 int nbc=self->getNumberOfCells();
1460 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1467 std::ostringstream oss;
1468 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1469 throw INTERP_KERNEL::Exception(oss.str().c_str());
1472 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1477 int tmp=nbc+singleVal;
1478 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1482 std::ostringstream oss;
1483 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1484 throw INTERP_KERNEL::Exception(oss.str().c_str());
1490 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1494 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1499 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1500 daIntTyypp->checkAllocated();
1501 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1504 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1508 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1512 std::vector<int> multiVal;
1513 std::pair<int, std::pair<int,int> > slic;
1514 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1515 int nbc=self->getNumberOfCells();
1516 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1523 std::ostringstream oss;
1524 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1525 throw INTERP_KERNEL::Exception(oss.str().c_str());
1529 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1536 int tmp=nbc+singleVal;
1537 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1542 std::ostringstream oss;
1543 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1544 throw INTERP_KERNEL::Exception(oss.str().c_str());
1550 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1556 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1557 daIntTyypp->checkAllocated();
1558 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1562 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1566 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1570 std::vector<int> multiVal;
1571 std::pair<int, std::pair<int,int> > slic;
1572 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1573 int nbc=self->getNumberOfCells();
1574 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1581 std::ostringstream oss;
1582 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1583 throw INTERP_KERNEL::Exception(oss.str().c_str());
1587 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1594 int tmp=nbc+singleVal;
1595 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1600 std::ostringstream oss;
1601 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1602 throw INTERP_KERNEL::Exception(oss.str().c_str());
1608 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1613 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1619 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1620 daIntTyypp->checkAllocated();
1621 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1625 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1629 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1631 int szArr,sw,iTypppArr;
1632 std::vector<int> stdvecTyyppArr;
1633 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1636 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1637 throw INTERP_KERNEL::Exception(oss.str().c_str());
1639 self->insertNextCell(type,size,tmp);
1642 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1644 int szArr,sw,iTypppArr;
1645 std::vector<int> stdvecTyyppArr;
1646 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1647 self->insertNextCell(type,szArr,tmp);
1650 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1652 DataArrayInt *ret=self->getNodalConnectivity();
1657 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1659 DataArrayInt *ret=self->getNodalConnectivityIndex();
1664 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1666 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1667 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1668 PyObject *res = PyList_New(result.size());
1669 for (int i=0;iL!=result.end(); i++, iL++)
1670 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1674 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1676 int szArr,sw,iTypppArr;
1677 std::vector<int> stdvecTyyppArr;
1678 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1679 int nbOfDepthPeelingPerformed=0;
1680 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1681 PyObject *res=PyTuple_New(2);
1682 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1683 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1687 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1689 DataArrayInt *v0=0,*v1=0;
1690 self->findCommonCells(compType,startCellId,v0,v1);
1691 PyObject *res = PyList_New(2);
1692 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1693 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1697 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1699 DataArrayInt *v0=0,*v1=0;
1700 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1701 PyObject *res = PyList_New(2);
1702 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1703 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1707 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1711 DataArrayDoubleTuple *aa;
1712 std::vector<double> bb;
1714 int nbOfCompo=self->getSpaceDimension();
1715 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1717 int cellId=-1,nodeId=-1;
1718 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1719 PyObject *ret=PyTuple_New(3);
1720 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1721 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1722 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1726 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1730 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1731 PyObject *res = PyList_New(3);
1732 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1733 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1734 PyList_SetItem(res,2,SWIG_From_int(ret2));
1737 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1741 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1742 PyObject *res = PyList_New(3);
1743 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1744 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1745 PyList_SetItem(res,2,SWIG_From_int(ret2));
1748 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1750 std::vector<int> cells;
1751 self->checkButterflyCells(cells,eps);
1752 DataArrayInt *ret=DataArrayInt::New();
1753 ret->alloc((int)cells.size(),1);
1754 std::copy(cells.begin(),cells.end(),ret->getPointer());
1755 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1758 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1760 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1762 PyObject *ret = PyList_New(sz);
1763 for(int i=0;i<sz;i++)
1764 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1768 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1770 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1771 int sz=retCpp.size();
1772 PyObject *ret=PyList_New(sz);
1773 for(int i=0;i<sz;i++)
1774 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1778 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1781 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1782 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1783 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1786 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1789 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1790 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1794 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1797 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1798 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1802 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1804 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1805 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1806 PyObject *ret=PyTuple_New(3);
1807 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1808 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1809 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1813 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1815 DataArrayInt *tmp0=0,*tmp1=0;
1816 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1817 PyObject *ret=PyTuple_New(2);
1818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1823 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1827 std::vector<int> multiVal;
1828 std::pair<int, std::pair<int,int> > slic;
1829 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1830 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1834 return self->duplicateNodes(&singleVal,&singleVal+1);
1836 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1838 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1840 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1844 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1848 std::vector<int> multiVal;
1849 std::pair<int, std::pair<int,int> > slic;
1850 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1851 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1855 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1857 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1859 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1861 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1865 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1868 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1869 if (!SWIG_IsOK(res1))
1872 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1873 self->renumberNodesInConn(tmp);
1877 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1879 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1880 da2->checkAllocated();
1881 self->renumberNodesInConn(da2->getConstPointer());
1885 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1888 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1889 DataArrayInt *tmp0,*tmp1=0;
1890 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1891 PyObject *ret=PyTuple_New(2);
1892 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1893 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1897 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1899 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1900 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1901 DataArrayInt *ret1=0,*ret2=0;
1902 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1903 PyObject *ret=PyTuple_New(3);
1904 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1905 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1906 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1910 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1912 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1913 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1914 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1915 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1918 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1921 std::vector<const MEDCouplingUMesh *> meshes;
1922 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1923 std::vector<DataArrayInt *> corr;
1924 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1926 PyObject *ret1=PyList_New(sz);
1927 for(int i=0;i<sz;i++)
1928 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1929 PyObject *ret=PyList_New(2);
1930 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1931 PyList_SetItem(ret,1,ret1);
1935 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1937 std::vector<MEDCouplingUMesh *> meshes;
1938 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1939 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1942 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1944 std::vector<MEDCouplingUMesh *> meshes;
1945 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1946 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1949 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1953 std::vector<int> multiVal;
1954 std::pair<int, std::pair<int,int> > slic;
1955 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1957 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1958 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1962 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1964 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1966 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1968 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1972 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1974 DataArrayInt *arrOut=0,*arrIndexOut=0;
1977 std::vector<int> multiVal;
1978 std::pair<int, std::pair<int,int> > slic;
1979 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1981 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1982 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1987 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
1992 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1997 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2001 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2003 PyObject *ret=PyTuple_New(2);
2004 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2005 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2009 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2010 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2011 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2013 DataArrayInt *arrOut=0,*arrIndexOut=0;
2016 std::vector<int> multiVal;
2017 std::pair<int, std::pair<int,int> > slic;
2018 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2020 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2021 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2026 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2031 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2036 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2040 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2042 PyObject *ret=PyTuple_New(2);
2043 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2044 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2048 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2049 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2053 std::vector<int> multiVal;
2054 std::pair<int, std::pair<int,int> > slic;
2055 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2057 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2058 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2063 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2068 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2073 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2077 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2081 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2085 DataArrayDoubleTuple *aa;
2086 std::vector<double> bb;
2088 int spaceDim=self->getSpaceDimension();
2089 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2090 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2092 std::vector<int> cells;
2093 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2094 DataArrayInt *ret=DataArrayInt::New();
2095 ret->alloc((int)cells.size(),1);
2096 std::copy(cells.begin(),cells.end(),ret->getPointer());
2097 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2100 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2104 DataArrayDoubleTuple *aa;
2105 std::vector<double> bb;
2107 int spaceDim=self->getSpaceDimension();
2108 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2109 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2110 self->orientCorrectly2DCells(v,polyOnly);
2113 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2115 std::vector<int> cells;
2116 self->arePolyhedronsNotCorrectlyOriented(cells);
2117 DataArrayInt *ret=DataArrayInt::New();
2118 ret->alloc((int)cells.size(),1);
2119 std::copy(cells.begin(),cells.end(),ret->getPointer());
2120 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2123 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2127 self->getFastAveragePlaneOfThis(vec,pos);
2129 std::copy(vec,vec+3,vals);
2130 std::copy(pos,pos+3,vals+3);
2131 return convertDblArrToPyListOfTuple(vals,3,2);
2134 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2136 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2137 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2138 return MEDCouplingUMesh::MergeUMeshes(tmp);
2141 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2144 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2145 PyObject *ret=PyTuple_New(2);
2146 PyObject *ret0Py=ret0?Py_True:Py_False;
2148 PyTuple_SetItem(ret,0,ret0Py);
2149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2153 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2156 bool ret0=self->areCellsIncludedIn2(other,ret1);
2157 PyObject *ret=PyTuple_New(2);
2158 PyObject *ret0Py=ret0?Py_True:Py_False;
2160 PyTuple_SetItem(ret,0,ret0Py);
2161 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2167 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2168 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2169 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2170 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2171 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2172 PyObject *ret=PyTuple_New(5);
2173 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2174 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2181 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2183 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2184 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2185 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2186 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2187 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2188 PyObject *ret=PyTuple_New(5);
2189 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2190 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2191 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2197 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2199 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2200 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2201 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2202 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2203 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2204 PyObject *ret=PyTuple_New(5);
2205 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2215 DataArrayInt *neighbors=0,*neighborsIdx=0;
2216 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2217 PyObject *ret=PyTuple_New(2);
2218 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2219 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2225 DataArrayInt *neighbors=0,*neighborsIdx=0;
2226 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2227 PyObject *ret=PyTuple_New(2);
2228 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2235 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2236 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2237 DataArrayInt *d2,*d3,*d4,*dd5;
2238 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2239 PyObject *ret=PyTuple_New(7);
2240 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2241 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2242 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2243 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2246 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2252 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2254 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2255 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2256 self->getReverseNodalConnectivity(d0,d1);
2257 PyObject *ret=PyTuple_New(2);
2258 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2265 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2268 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2269 da->checkAllocated();
2270 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2273 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2276 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2277 da->checkAllocated();
2278 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2281 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2284 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2285 da->checkAllocated();
2286 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2289 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2292 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2293 da->checkAllocated();
2294 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2295 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2296 PyObject *res = PyList_New(result.size());
2297 for (int i=0;iL!=result.end(); i++, iL++)
2298 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2302 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2305 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2306 da->checkAllocated();
2307 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2308 ret->setName(da->getName().c_str());
2312 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2315 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2316 if (!SWIG_IsOK(res1))
2319 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2320 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2324 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2326 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2327 da2->checkAllocated();
2328 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2332 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2335 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2336 PyObject *ret=PyTuple_New(2);
2337 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2342 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2344 DataArrayInt *cellNb1=0,*cellNb2=0;
2345 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2346 PyObject *ret=PyTuple_New(3);
2347 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2348 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2349 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2355 int spaceDim=self->getSpaceDimension();
2357 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2359 DataArrayDouble *a,*a2;
2360 DataArrayDoubleTuple *aa,*aa2;
2361 std::vector<double> bb,bb2;
2363 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2364 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2365 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2366 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2368 DataArrayInt *cellIds=0;
2369 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2370 PyObject *ret=PyTuple_New(2);
2371 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2372 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2376 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2378 int spaceDim=self->getSpaceDimension();
2380 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2382 DataArrayDouble *a,*a2;
2383 DataArrayDoubleTuple *aa,*aa2;
2384 std::vector<double> bb,bb2;
2386 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2387 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2388 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2389 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2391 DataArrayInt *cellIds=0;
2392 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2393 PyObject *ret=PyTuple_New(2);
2394 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2395 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2399 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2401 int spaceDim=self->getSpaceDimension();
2403 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2405 DataArrayDouble *a,*a2;
2406 DataArrayDoubleTuple *aa,*aa2;
2407 std::vector<double> bb,bb2;
2409 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2410 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2411 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2412 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2413 return self->getCellIdsCrossingPlane(orig,vect,eps);
2416 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2420 std::vector<int> pos2;
2421 DataArrayInt *pos3=0;
2422 DataArrayIntTuple *pos4=0;
2423 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2428 self->convertToPolyTypes(&pos1,&pos1+1);
2435 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2440 self->convertToPolyTypes(pos3->begin(),pos3->end());
2444 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2448 void convertAllToPoly();
2449 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2450 bool unPolyze() throw(INTERP_KERNEL::Exception);
2451 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2452 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2453 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2456 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2459 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2460 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2461 void updateTime() const throw(INTERP_KERNEL::Exception);
2463 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2465 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2468 std::string __str__() const throw(INTERP_KERNEL::Exception)
2470 return self->simpleRepr();
2472 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2474 MEDCouplingUMesh *ret=self->getMesh2D();
2476 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2478 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2480 MEDCouplingUMesh *ret=self->getMesh1D();
2482 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2484 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2486 DataArrayInt *ret=self->getMesh3DIds();
2488 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2493 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2496 void updateTime() const throw(INTERP_KERNEL::Exception);
2497 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2498 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2501 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2504 static MEDCouplingCMesh *New();
2505 static MEDCouplingCMesh *New(const char *meshName);
2506 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2507 void setCoords(const DataArrayDouble *coordsX,
2508 const DataArrayDouble *coordsY=0,
2509 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2510 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2514 return MEDCouplingCMesh::New();
2516 MEDCouplingCMesh(const char *meshName)
2518 return MEDCouplingCMesh::New(meshName);
2520 std::string __str__() const throw(INTERP_KERNEL::Exception)
2522 return self->simpleRepr();
2524 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2526 DataArrayDouble *ret=self->getCoordsAt(i);
2534 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2537 static MEDCouplingCurveLinearMesh *New();
2538 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2539 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2540 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2541 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2543 MEDCouplingCurveLinearMesh()
2545 return MEDCouplingCurveLinearMesh::New();
2547 MEDCouplingCurveLinearMesh(const char *meshName)
2549 return MEDCouplingCurveLinearMesh::New(meshName);
2551 std::string __str__() const throw(INTERP_KERNEL::Exception)
2553 return self->simpleRepr();
2555 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2557 DataArrayDouble *ret=self->getCoords();
2562 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2564 int szArr,sw,iTypppArr;
2565 std::vector<int> stdvecTyyppArr;
2566 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2567 self->setNodeGridStructure(tmp,tmp+szArr);
2573 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2575 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2578 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2579 PyObject *ret=PyTuple_New(2);
2580 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2581 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2586 %extend ParaMEDMEM::DataArrayDoubleIterator
2590 DataArrayDoubleTuple *ret=self->nextt();
2592 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2595 PyErr_SetString(PyExc_StopIteration,"No more data.");
2601 %extend ParaMEDMEM::DataArrayDoubleTuple
2603 std::string __str__() const
2605 return self->repr();
2608 double __float__() const throw(INTERP_KERNEL::Exception)
2610 return self->doubleValue();
2613 DataArrayDouble *buildDADouble()
2615 return self->buildDADouble(1,self->getNumberOfCompo());
2618 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2620 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2621 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2622 Py_XINCREF(trueSelf);
2626 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2628 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2629 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2630 Py_XINCREF(trueSelf);
2634 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2636 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2637 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2638 Py_XINCREF(trueSelf);
2642 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2644 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2645 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2646 Py_XINCREF(trueSelf);
2650 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2654 std::vector<int> multiVal;
2655 std::pair<int, std::pair<int,int> > slic;
2656 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2657 const double *pt=self->getConstPointer();
2658 int nbc=self->getNumberOfCompo();
2659 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2666 std::ostringstream oss;
2667 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2668 throw INTERP_KERNEL::Exception(oss.str().c_str());
2671 return PyFloat_FromDouble(pt[singleVal]);
2675 return PyFloat_FromDouble(pt[nbc+singleVal]);
2678 std::ostringstream oss;
2679 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2680 throw INTERP_KERNEL::Exception(oss.str().c_str());
2686 PyObject *t=PyTuple_New(multiVal.size());
2687 for(int j=0;j<(int)multiVal.size();j++)
2689 int cid=multiVal[j];
2692 std::ostringstream oss;
2693 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2694 throw INTERP_KERNEL::Exception(oss.str().c_str());
2696 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2702 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2703 PyObject *t=PyTuple_New(sz);
2704 for(int j=0;j<sz;j++)
2705 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2709 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2713 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2715 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2718 std::vector<double> multiValV;
2719 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2720 int nbc=self->getNumberOfCompo();
2721 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2723 std::vector<int> multiVal;
2724 std::pair<int, std::pair<int,int> > slic;
2725 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2726 double *pt=self->getPointer();
2727 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2734 std::ostringstream oss;
2735 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2736 throw INTERP_KERNEL::Exception(oss.str().c_str());
2742 pt[singleVal]=singleValV;
2747 if(multiValV.size()!=1)
2749 std::ostringstream oss;
2750 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2751 throw INTERP_KERNEL::Exception(oss.str().c_str());
2753 pt[singleVal]=multiValV[0];
2758 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2762 throw INTERP_KERNEL::Exception(msg);
2771 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2775 std::ostringstream oss;
2776 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2777 throw INTERP_KERNEL::Exception(oss.str().c_str());
2785 if(multiVal.size()!=multiValV.size())
2787 std::ostringstream oss;
2788 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2789 throw INTERP_KERNEL::Exception(oss.str().c_str());
2791 for(int i=0;i<(int)multiVal.size();i++)
2793 int pos=multiVal[i];
2796 std::ostringstream oss;
2797 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2798 throw INTERP_KERNEL::Exception(oss.str().c_str());
2800 pt[multiVal[i]]=multiValV[i];
2806 const double *ptV=daIntTyyppV->getConstPointer();
2807 if(nbc>daIntTyyppV->getNumberOfCompo())
2809 std::ostringstream oss;
2810 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2811 throw INTERP_KERNEL::Exception(oss.str().c_str());
2813 std::copy(ptV,ptV+nbc,pt);
2817 throw INTERP_KERNEL::Exception(msg);
2822 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2827 for(int j=0;j<sz;j++)
2828 pt[slic.first+j*slic.second.second]=singleValV;
2833 if(sz!=(int)multiValV.size())
2835 std::ostringstream oss;
2836 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2837 throw INTERP_KERNEL::Exception(oss.str().c_str());
2839 for(int j=0;j<sz;j++)
2840 pt[slic.first+j*slic.second.second]=multiValV[j];
2845 const double *ptV=daIntTyyppV->getConstPointer();
2846 if(sz>daIntTyyppV->getNumberOfCompo())
2848 std::ostringstream oss;
2849 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2850 throw INTERP_KERNEL::Exception(oss.str().c_str());
2852 for(int j=0;j<sz;j++)
2853 pt[slic.first+j*slic.second.second]=ptV[j];
2857 throw INTERP_KERNEL::Exception(msg);
2861 throw INTERP_KERNEL::Exception(msg);
2866 %extend ParaMEDMEM::DataArrayDouble
2868 DataArrayDouble() throw(INTERP_KERNEL::Exception)
2870 return DataArrayDouble::New();
2873 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2875 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) !";
2876 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2880 if(PyInt_Check(nbOfTuples))
2882 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2884 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2887 if(PyInt_Check(elt2))
2888 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2889 int nbOfCompo=PyInt_AS_LONG(elt2);
2891 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2892 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2893 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
2894 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2899 throw INTERP_KERNEL::Exception(msg);
2902 {//DataArrayDouble.New([1.,3.,4.],3)
2903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2905 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
2906 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2912 throw INTERP_KERNEL::Exception(msg);
2915 {// DataArrayDouble.New([1.,3.,4.])
2916 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2917 int tmpp1=-1,tmpp2=-1;
2918 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
2919 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2924 else if(PyInt_Check(elt0))
2926 int nbOfTuples1=PyInt_AS_LONG(elt0);
2928 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2933 if(PyInt_Check(nbOfTuples))
2934 {//DataArrayDouble.New(5,2)
2935 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2937 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2938 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2939 ret->alloc(nbOfTuples1,nbOfCompo);
2944 throw INTERP_KERNEL::Exception(msg);
2947 throw INTERP_KERNEL::Exception(msg);
2950 {//DataArrayDouble.New(5)
2951 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2952 ret->alloc(nbOfTuples1,1);
2958 throw INTERP_KERNEL::Exception(msg);
2961 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2963 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
2966 void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
2969 std::vector<double> bb;
2971 const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
2972 const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
2973 self->pushBackValsSilent(tmp,tmp+nbTuples);
2976 std::string __str__() const
2978 return self->repr();
2981 double __float__() const throw(INTERP_KERNEL::Exception)
2983 return self->doubleValue();
2986 int __len__() const throw(INTERP_KERNEL::Exception)
2988 if(self->isAllocated())
2990 return self->getNumberOfTuples();
2994 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2998 DataArrayDoubleIterator *__iter__()
3000 return self->iterator();
3003 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3005 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 !";
3006 if(PyList_Check(li) || PyTuple_Check(li))
3010 if(PyInt_Check(nbOfTuples))
3012 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
3014 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
3017 if(PyInt_Check(nbOfComp))
3018 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
3019 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
3021 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
3022 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
3023 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3026 throw INTERP_KERNEL::Exception(msg);
3029 {//DataArrayDouble.setValues([1.,3.,4.],3)
3031 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
3032 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3036 throw INTERP_KERNEL::Exception(msg);
3039 {// DataArrayDouble.setValues([1.,3.,4.])
3040 int tmpp1=-1,tmpp2=-1;
3041 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
3042 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3046 throw INTERP_KERNEL::Exception(msg);
3049 PyObject *getValues() throw(INTERP_KERNEL::Exception)
3051 const double *vals=self->getPointer();
3052 return convertDblArrToPyList(vals,self->getNbOfElems());
3055 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
3058 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
3059 PyObject *ret=PyTuple_New(2);
3060 PyObject *ret0Py=ret0?Py_True:Py_False;
3062 PyTuple_SetItem(ret,0,ret0Py);
3063 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3067 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
3069 const double *vals=self->getPointer();
3070 int nbOfComp=self->getNumberOfComponents();
3071 int nbOfTuples=self->getNumberOfTuples();
3072 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3075 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3078 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3079 if (!SWIG_IsOK(res1))
3082 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3083 if(size!=self->getNumberOfTuples())
3085 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3087 return self->renumber(tmp);
3091 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3093 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3094 da2->checkAllocated();
3095 int size=self->getNumberOfTuples();
3096 if(size!=self->getNumberOfTuples())
3098 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3100 return self->renumber(da2->getConstPointer());
3104 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3107 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3108 if (!SWIG_IsOK(res1))
3111 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3112 if(size!=self->getNumberOfTuples())
3114 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3116 return self->renumberR(tmp);
3120 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3122 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3123 da2->checkAllocated();
3124 int size=self->getNumberOfTuples();
3125 if(size!=self->getNumberOfTuples())
3127 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3129 return self->renumberR(da2->getConstPointer());
3133 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3136 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3137 if (!SWIG_IsOK(res1))
3140 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3141 if(size!=self->getNumberOfTuples())
3143 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3145 return self->renumberAndReduce(tmp,newNbOfTuple);
3149 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3151 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3152 da2->checkAllocated();
3153 int size=self->getNumberOfTuples();
3154 if(size!=self->getNumberOfTuples())
3156 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3158 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3162 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
3165 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3166 if (!SWIG_IsOK(res1))
3169 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3170 if(size!=self->getNumberOfTuples())
3172 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3174 self->renumberInPlace(tmp);
3178 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3180 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3181 da2->checkAllocated();
3182 int size=self->getNumberOfTuples();
3183 if(size!=self->getNumberOfTuples())
3185 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3187 self->renumberInPlace(da2->getConstPointer());
3191 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
3194 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3195 if (!SWIG_IsOK(res1))
3198 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3199 if(size!=self->getNumberOfTuples())
3201 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3203 self->renumberInPlaceR(tmp);
3207 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3209 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3210 da2->checkAllocated();
3211 int size=self->getNumberOfTuples();
3212 if(size!=self->getNumberOfTuples())
3214 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3216 self->renumberInPlaceR(da2->getConstPointer());
3220 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3223 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3224 if (!SWIG_IsOK(res1))
3227 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3228 return self->selectByTupleId(tmp,tmp+size);
3232 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3234 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3235 da2->checkAllocated();
3236 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3240 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3243 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3244 if (!SWIG_IsOK(res1))
3247 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3248 return self->selectByTupleIdSafe(tmp,tmp+size);
3252 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3254 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3255 da2->checkAllocated();
3256 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3260 PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
3262 int thisTupleId,otherTupleId;
3263 double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
3264 PyObject *ret=PyTuple_New(3);
3265 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
3266 PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
3267 PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
3271 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3274 double r1=self->getMaxValue(tmp);
3275 PyObject *ret=PyTuple_New(2);
3276 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3277 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3281 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3284 double r1=self->getMaxValue2(tmp);
3285 PyObject *ret=PyTuple_New(2);
3286 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3287 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3291 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3294 double r1=self->getMinValue(tmp);
3295 PyObject *ret=PyTuple_New(2);
3296 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3297 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3301 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3304 double r1=self->getMinValue2(tmp);
3305 PyObject *ret=PyTuple_New(2);
3306 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3307 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3311 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3313 int nbOfCompo=self->getNumberOfComponents();
3314 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3315 self->getMinMaxPerComponent(tmp);
3316 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3320 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3322 int sz=self->getNumberOfComponents();
3323 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3324 self->accumulate(tmp);
3325 return convertDblArrToPyList(tmp,sz);
3328 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3330 std::vector<int> tmp;
3331 convertPyToNewIntArr3(li,tmp);
3332 return self->keepSelectedComponents(tmp);
3335 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3337 DataArrayInt *comm, *commIndex;
3338 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3339 PyObject *res = PyList_New(2);
3340 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3341 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3345 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
3349 DataArrayDoubleTuple *aa;
3350 std::vector<double> bb;
3352 int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
3353 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
3355 int cellId=-1,nodeId=-1;
3356 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
3357 PyObject *ret=PyTuple_New(2);
3358 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
3359 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
3363 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3365 std::vector<int> tmp;
3366 convertPyToNewIntArr3(li,tmp);
3367 self->setSelectedComponents(a,tmp);
3370 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3372 int sz=self->getNumberOfComponents();
3373 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3374 self->getTuple(tupleId,tmp);
3375 return convertDblArrToPyList(tmp,sz);
3378 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3380 std::vector<const DataArrayDouble *> tmp;
3381 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3382 return DataArrayDouble::Aggregate(tmp);
3385 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3387 std::vector<const DataArrayDouble *> tmp;
3388 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3389 return DataArrayDouble::Meld(tmp);
3392 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3394 std::vector<std::pair<int,int> > ranges;
3395 convertPyToVectorPairInt(li,ranges);
3396 return self->selectByTupleRanges(ranges);
3399 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3403 DataArrayDoubleTuple *aa;
3404 std::vector<double> bb;
3406 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3407 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3408 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3409 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3410 DataArrayInt *c=0,*cI=0;
3411 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3412 PyObject *ret=PyTuple_New(2);
3413 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3414 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3418 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3420 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3421 self->checkAllocated();
3422 int nbOfTuples=self->getNumberOfTuples();
3423 int nbOfComponents=self->getNumberOfComponents();
3425 std::vector<int> vt1,vc1;
3426 std::pair<int, std::pair<int,int> > pt1,pc1;
3427 DataArrayInt *dt1=0,*dc1=0;
3429 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3430 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3434 if(nbOfComponents==1)
3435 return PyFloat_FromDouble(self->getIJSafe(it1,0));
3436 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3438 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3440 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3442 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3444 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3447 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3448 std::vector<int> v2(1,ic1);
3449 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3453 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3454 std::vector<int> v2(1,ic1);
3455 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3459 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3460 std::vector<int> v2(1,ic1);
3461 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3465 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3466 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3470 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3471 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3475 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3476 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3480 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3481 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3485 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3486 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3487 std::vector<int> v2(nbOfComp);
3488 for(int i=0;i<nbOfComp;i++)
3489 v2[i]=pc1.first+i*pc1.second.second;
3490 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3494 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3495 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3496 std::vector<int> v2(nbOfComp);
3497 for(int i=0;i<nbOfComp;i++)
3498 v2[i]=pc1.first+i*pc1.second.second;
3499 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3503 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3504 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3505 std::vector<int> v2(nbOfComp);
3506 for(int i=0;i<nbOfComp;i++)
3507 v2[i]=pc1.first+i*pc1.second.second;
3508 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3512 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3513 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3514 std::vector<int> v2(nbOfComp);
3515 for(int i=0;i<nbOfComp;i++)
3516 v2[i]=pc1.first+i*pc1.second.second;
3517 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3520 throw INTERP_KERNEL::Exception(msg);
3524 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3526 self->checkAllocated();
3527 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3528 int nbOfTuples=self->getNumberOfTuples();
3529 int nbOfComponents=self->getNumberOfComponents();
3532 std::vector<double> v1;
3533 DataArrayDouble *d1=0;
3534 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3536 std::vector<int> vt1,vc1;
3537 std::pair<int, std::pair<int,int> > pt1,pc1;
3538 DataArrayInt *dt1=0,*dc1=0;
3539 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3540 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3548 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3551 tmp=DataArrayDouble::New();
3552 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3553 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3556 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3559 throw INTERP_KERNEL::Exception(msg);
3568 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3571 tmp=DataArrayDouble::New();
3572 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3573 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3576 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3579 throw INTERP_KERNEL::Exception(msg);
3588 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3591 tmp=DataArrayDouble::New();
3592 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3593 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3596 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3599 throw INTERP_KERNEL::Exception(msg);
3608 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3611 tmp=DataArrayDouble::New();
3612 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3613 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3616 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3619 throw INTERP_KERNEL::Exception(msg);
3628 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3631 tmp=DataArrayDouble::New();
3632 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3633 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3636 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3639 throw INTERP_KERNEL::Exception(msg);
3648 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3651 tmp=DataArrayDouble::New();
3652 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3653 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3656 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3659 throw INTERP_KERNEL::Exception(msg);
3668 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3671 tmp=DataArrayDouble::New();
3672 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3673 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3676 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3679 throw INTERP_KERNEL::Exception(msg);
3688 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3691 tmp=DataArrayDouble::New();
3692 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3693 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3696 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3699 throw INTERP_KERNEL::Exception(msg);
3708 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3711 tmp=DataArrayDouble::New();
3712 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3713 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3716 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3719 throw INTERP_KERNEL::Exception(msg);
3728 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3731 tmp=DataArrayDouble::New();
3732 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3733 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3736 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3739 throw INTERP_KERNEL::Exception(msg);
3748 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3751 tmp=DataArrayDouble::New();
3752 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3753 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3756 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3759 throw INTERP_KERNEL::Exception(msg);
3768 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3771 tmp=DataArrayDouble::New();
3772 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3773 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3776 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3779 throw INTERP_KERNEL::Exception(msg);
3788 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3791 tmp=DataArrayDouble::New();
3792 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3793 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3796 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3799 throw INTERP_KERNEL::Exception(msg);
3808 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3811 tmp=DataArrayDouble::New();
3812 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3813 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3816 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3819 throw INTERP_KERNEL::Exception(msg);
3828 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3831 tmp=DataArrayDouble::New();
3832 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3833 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3836 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3839 throw INTERP_KERNEL::Exception(msg);
3848 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3851 tmp=DataArrayDouble::New();
3852 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3853 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3856 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3859 throw INTERP_KERNEL::Exception(msg);
3864 throw INTERP_KERNEL::Exception(msg);
3869 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3871 return self->negate();
3874 DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3876 const char msg[]="Unexpected situation in __add__ !";
3879 DataArrayDoubleTuple *aa;
3880 std::vector<double> bb;
3882 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3887 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3888 ret->applyLin(1.,val);
3894 return DataArrayDouble::Add(self,a);
3898 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3899 return DataArrayDouble::Add(self,aaa);
3903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3904 return DataArrayDouble::Add(self,aaa);
3907 throw INTERP_KERNEL::Exception(msg);
3911 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3913 const char msg[]="Unexpected situation in __radd__ !";
3916 DataArrayDoubleTuple *aa;
3917 std::vector<double> bb;
3919 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3924 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3925 ret->applyLin(1.,val);
3931 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3932 return DataArrayDouble::Add(self,aaa);
3936 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3937 return DataArrayDouble::Add(self,aaa);
3940 throw INTERP_KERNEL::Exception(msg);
3944 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3946 const char msg[]="Unexpected situation in __iadd__ !";
3949 DataArrayDoubleTuple *aa;
3950 std::vector<double> bb;
3952 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3957 self->applyLin(1.,val);
3958 Py_XINCREF(trueSelf);
3964 Py_XINCREF(trueSelf);
3969 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3970 self->addEqual(aaa);
3971 Py_XINCREF(trueSelf);
3976 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3977 self->addEqual(aaa);
3978 Py_XINCREF(trueSelf);
3982 throw INTERP_KERNEL::Exception(msg);
3986 DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3988 const char msg[]="Unexpected situation in __sub__ !";
3991 DataArrayDoubleTuple *aa;
3992 std::vector<double> bb;
3994 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3999 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4000 ret->applyLin(1.,-val);
4006 return DataArrayDouble::Substract(self,a);
4010 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4011 return DataArrayDouble::Substract(self,aaa);
4015 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4016 return DataArrayDouble::Substract(self,aaa);
4019 throw INTERP_KERNEL::Exception(msg);
4023 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4025 const char msg[]="Unexpected situation in __rsub__ !";
4028 DataArrayDoubleTuple *aa;
4029 std::vector<double> bb;
4031 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4036 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4037 ret->applyLin(-1.,val);
4043 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4044 return DataArrayDouble::Substract(aaa,self);
4048 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4049 return DataArrayDouble::Substract(aaa,self);
4052 throw INTERP_KERNEL::Exception(msg);
4056 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4058 const char msg[]="Unexpected situation in __isub__ !";
4061 DataArrayDoubleTuple *aa;
4062 std::vector<double> bb;
4064 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4069 self->applyLin(1,-val);
4070 Py_XINCREF(trueSelf);
4075 self->substractEqual(a);
4076 Py_XINCREF(trueSelf);
4081 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4082 self->substractEqual(aaa);
4083 Py_XINCREF(trueSelf);
4088 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4089 self->substractEqual(aaa);
4090 Py_XINCREF(trueSelf);
4094 throw INTERP_KERNEL::Exception(msg);
4098 DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4100 const char msg[]="Unexpected situation in __mul__ !";
4103 DataArrayDoubleTuple *aa;
4104 std::vector<double> bb;
4106 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4111 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4112 ret->applyLin(val,0.);
4118 return DataArrayDouble::Multiply(self,a);
4122 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4123 return DataArrayDouble::Multiply(self,aaa);
4127 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4128 return DataArrayDouble::Multiply(self,aaa);
4131 throw INTERP_KERNEL::Exception(msg);
4135 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4137 const char msg[]="Unexpected situation in __rmul__ !";
4140 DataArrayDoubleTuple *aa;
4141 std::vector<double> bb;
4143 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4148 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4149 ret->applyLin(val,0.);
4155 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4156 return DataArrayDouble::Multiply(self,aaa);
4160 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4161 return DataArrayDouble::Multiply(self,aaa);
4164 throw INTERP_KERNEL::Exception(msg);
4168 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4170 const char msg[]="Unexpected situation in __imul__ !";
4173 DataArrayDoubleTuple *aa;
4174 std::vector<double> bb;
4176 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4181 self->applyLin(val,0.);
4182 Py_XINCREF(trueSelf);
4187 self->multiplyEqual(a);
4188 Py_XINCREF(trueSelf);
4193 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4194 self->multiplyEqual(aaa);
4195 Py_XINCREF(trueSelf);
4200 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4201 self->multiplyEqual(aaa);
4202 Py_XINCREF(trueSelf);
4206 throw INTERP_KERNEL::Exception(msg);
4210 DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4212 const char msg[]="Unexpected situation in __div__ !";
4215 DataArrayDoubleTuple *aa;
4216 std::vector<double> bb;
4218 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4224 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4225 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4226 ret->applyLin(1/val,0.);
4232 return DataArrayDouble::Divide(self,a);
4236 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4237 return DataArrayDouble::Divide(self,aaa);
4241 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4242 return DataArrayDouble::Divide(self,aaa);
4245 throw INTERP_KERNEL::Exception(msg);
4249 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4251 const char msg[]="Unexpected situation in __rdiv__ !";
4254 DataArrayDoubleTuple *aa;
4255 std::vector<double> bb;
4257 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4262 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4269 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4270 return DataArrayDouble::Divide(aaa,self);
4274 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4275 return DataArrayDouble::Divide(aaa,self);
4278 throw INTERP_KERNEL::Exception(msg);
4282 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4284 const char msg[]="Unexpected situation in __idiv__ !";
4287 DataArrayDoubleTuple *aa;
4288 std::vector<double> bb;
4290 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4296 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4297 self->applyLin(1./val,0.);
4298 Py_XINCREF(trueSelf);
4303 self->divideEqual(a);
4304 Py_XINCREF(trueSelf);
4309 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4310 self->divideEqual(aaa);
4311 Py_XINCREF(trueSelf);
4316 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4317 self->divideEqual(aaa);
4318 Py_XINCREF(trueSelf);
4322 throw INTERP_KERNEL::Exception(msg);
4326 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4328 DataArrayInt *c=0,*cI=0;
4330 self->computeTupleIdsNearTuples(other,eps,c,cI);
4331 PyObject *ret=PyTuple_New(2);
4332 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4333 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4338 %extend ParaMEDMEM::DataArrayIntTuple
4340 std::string __str__() const
4342 return self->repr();
4345 int __int__() const throw(INTERP_KERNEL::Exception)
4347 return self->intValue();
4350 DataArrayInt *buildDAInt()
4352 return self->buildDAInt(1,self->getNumberOfCompo());
4355 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4357 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4358 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4359 Py_XINCREF(trueSelf);
4363 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4365 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4366 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4367 Py_XINCREF(trueSelf);
4371 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4373 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4374 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4375 Py_XINCREF(trueSelf);
4379 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4381 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4382 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4383 Py_XINCREF(trueSelf);
4387 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4389 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4390 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4391 Py_XINCREF(trueSelf);
4395 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4399 std::vector<int> multiVal;
4400 std::pair<int, std::pair<int,int> > slic;
4401 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4402 const int *pt=self->getConstPointer();
4403 int nbc=self->getNumberOfCompo();
4404 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4411 std::ostringstream oss;
4412 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4413 throw INTERP_KERNEL::Exception(oss.str().c_str());
4416 return PyInt_FromLong(pt[singleVal]);
4420 return PyInt_FromLong(pt[nbc+singleVal]);
4423 std::ostringstream oss;
4424 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4425 throw INTERP_KERNEL::Exception(oss.str().c_str());
4431 PyObject *t=PyTuple_New(multiVal.size());
4432 for(int j=0;j<(int)multiVal.size();j++)
4434 int cid=multiVal[j];
4437 std::ostringstream oss;
4438 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4439 throw INTERP_KERNEL::Exception(oss.str().c_str());
4441 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4447 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4448 PyObject *t=PyTuple_New(sz);
4449 for(int j=0;j<sz;j++)
4450 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4454 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4458 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4460 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4463 std::vector<int> multiValV;
4464 std::pair<int, std::pair<int,int> > slicV;
4465 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4466 int nbc=self->getNumberOfCompo();
4467 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4469 std::vector<int> multiVal;
4470 std::pair<int, std::pair<int,int> > slic;
4471 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4472 int *pt=self->getPointer();
4473 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4480 std::ostringstream oss;
4481 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4482 throw INTERP_KERNEL::Exception(oss.str().c_str());
4488 pt[singleVal]=singleValV;
4493 if(multiValV.size()!=1)
4495 std::ostringstream oss;
4496 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4497 throw INTERP_KERNEL::Exception(oss.str().c_str());
4499 pt[singleVal]=multiValV[0];
4504 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4508 throw INTERP_KERNEL::Exception(msg);
4517 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4521 std::ostringstream oss;
4522 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4523 throw INTERP_KERNEL::Exception(oss.str().c_str());
4531 if(multiVal.size()!=multiValV.size())
4533 std::ostringstream oss;
4534 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4535 throw INTERP_KERNEL::Exception(oss.str().c_str());
4537 for(int i=0;i<(int)multiVal.size();i++)
4539 int pos=multiVal[i];
4542 std::ostringstream oss;
4543 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4544 throw INTERP_KERNEL::Exception(oss.str().c_str());
4546 pt[multiVal[i]]=multiValV[i];
4552 const int *ptV=daIntTyyppV->getConstPointer();
4553 if(nbc>daIntTyyppV->getNumberOfCompo())
4555 std::ostringstream oss;
4556 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4557 throw INTERP_KERNEL::Exception(oss.str().c_str());
4559 std::copy(ptV,ptV+nbc,pt);
4563 throw INTERP_KERNEL::Exception(msg);
4568 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4573 for(int j=0;j<sz;j++)
4574 pt[slic.first+j*slic.second.second]=singleValV;
4579 if(sz!=(int)multiValV.size())
4581 std::ostringstream oss;
4582 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4583 throw INTERP_KERNEL::Exception(oss.str().c_str());
4585 for(int j=0;j<sz;j++)
4586 pt[slic.first+j*slic.second.second]=multiValV[j];
4591 const int *ptV=daIntTyyppV->getConstPointer();
4592 if(sz>daIntTyyppV->getNumberOfCompo())
4594 std::ostringstream oss;
4595 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4596 throw INTERP_KERNEL::Exception(oss.str().c_str());
4598 for(int j=0;j<sz;j++)
4599 pt[slic.first+j*slic.second.second]=ptV[j];
4603 throw INTERP_KERNEL::Exception(msg);
4607 throw INTERP_KERNEL::Exception(msg);
4612 %extend ParaMEDMEM::DataArrayIntIterator
4616 DataArrayIntTuple *ret=self->nextt();
4618 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4621 PyErr_SetString(PyExc_StopIteration,"No more data.");
4627 %extend ParaMEDMEM::DataArrayInt
4629 DataArrayInt() throw(INTERP_KERNEL::Exception)
4631 return DataArrayInt::New();
4634 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4636 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) !";
4637 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4641 if(PyInt_Check(nbOfTuples))
4643 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4645 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4648 if(PyInt_Check(nbOfComp))
4649 {//DataArrayInt.New([1,3,4,5],2,2)
4650 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4652 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4653 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4654 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4655 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4660 throw INTERP_KERNEL::Exception(msg);
4663 {//DataArrayInt.New([1,3,4],3)
4664 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4666 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4667 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4673 throw INTERP_KERNEL::Exception(msg);
4676 {// DataArrayInt.New([1,3,4])
4677 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4678 int tmpp1=-1,tmpp2=-1;
4679 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4680 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4685 else if(PyInt_Check(elt0))
4687 int nbOfTuples1=PyInt_AS_LONG(elt0);
4689 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4694 if(PyInt_Check(nbOfTuples))
4695 {//DataArrayInt.New(5,2)
4696 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4698 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4699 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4700 ret->alloc(nbOfTuples1,nbOfCompo);
4705 throw INTERP_KERNEL::Exception(msg);
4708 throw INTERP_KERNEL::Exception(msg);
4711 {//DataArrayInt.New(5)
4712 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4713 ret->alloc(nbOfTuples1,1);
4719 throw INTERP_KERNEL::Exception(msg);
4722 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4724 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4727 std::string __str__() const
4729 return self->repr();
4732 int __len__() const throw(INTERP_KERNEL::Exception)
4734 if(self->isAllocated())
4736 return self->getNumberOfTuples();
4740 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4744 int __int__() const throw(INTERP_KERNEL::Exception)
4746 return self->intValue();
4749 DataArrayIntIterator *__iter__()
4751 return self->iterator();
4754 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4756 int sz=self->getNumberOfComponents();
4757 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4758 self->accumulate(tmp);
4759 return convertIntArrToPyList(tmp,sz);
4762 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
4764 int newNbOfTuples=-1;
4765 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
4766 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
4767 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
4768 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
4769 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
4770 PyObject *ret=PyTuple_New(2);
4771 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4772 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4776 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4778 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 !";
4779 if(PyList_Check(li) || PyTuple_Check(li))
4783 if(PyInt_Check(nbOfTuples))
4785 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4787 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
4790 if(PyInt_Check(nbOfComp))
4791 {//DataArrayInt.setValues([1,3,4,5],2,2)
4792 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4794 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
4795 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
4796 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4799 throw INTERP_KERNEL::Exception(msg);
4802 {//DataArrayInt.setValues([1,3,4],3)
4804 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
4805 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4809 throw INTERP_KERNEL::Exception(msg);
4812 {// DataArrayInt.setValues([1,3,4])
4813 int tmpp1=-1,tmpp2=-1;
4814 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
4815 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4819 throw INTERP_KERNEL::Exception(msg);
4822 PyObject *getValues() throw(INTERP_KERNEL::Exception)
4824 const int *vals=self->getPointer();
4825 return convertIntArrToPyList(vals,self->getNbOfElems());
4828 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4831 bool ret0=self->isEqualIfNotWhy(other,ret1);
4832 PyObject *ret=PyTuple_New(2);
4833 PyObject *ret0Py=ret0?Py_True:Py_False;
4835 PyTuple_SetItem(ret,0,ret0Py);
4836 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4840 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4842 const int *vals=self->getPointer();
4843 int nbOfComp=self->getNumberOfComponents();
4844 int nbOfTuples=self->getNumberOfTuples();
4845 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4848 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4850 std::vector<const DataArrayInt *> groups;
4851 std::vector< std::vector<int> > fidsOfGroups;
4852 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4853 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4854 PyObject *ret = PyList_New(2);
4855 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4856 int sz=fidsOfGroups.size();
4857 PyObject *ret1 = PyList_New(sz);
4858 for(int i=0;i<sz;i++)
4859 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4860 PyList_SetItem(ret,1,ret1);
4864 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
4867 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4868 if (!SWIG_IsOK(res1))
4871 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4872 self->transformWithIndArr(tmp,tmp+size);
4876 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4877 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4881 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4885 std::vector<int> multiVal;
4886 std::pair<int, std::pair<int,int> > slic;
4887 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4888 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4892 return self->getIdsEqualList(&singleVal,&singleVal+1);
4894 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4896 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4898 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4902 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4906 std::vector<int> multiVal;
4907 std::pair<int, std::pair<int,int> > slic;
4908 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4909 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4913 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4915 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4917 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4919 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4923 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4925 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
4927 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4928 if (!SWIG_IsOK(res1))
4931 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4932 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4936 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4938 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4939 da2->checkAllocated();
4940 int size=self->getNumberOfTuples();
4941 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4943 PyObject *ret = PyList_New(3);
4944 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4945 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4946 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4950 DataArrayInt *transformWithIndArrR(PyObject *li) const
4953 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4954 if (!SWIG_IsOK(res1))
4957 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4958 return self->transformWithIndArrR(tmp,tmp+size);
4962 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4963 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4967 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4970 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4971 if (!SWIG_IsOK(res1))
4974 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4975 if(size!=self->getNumberOfTuples())
4977 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4979 self->renumberInPlace(tmp);
4983 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4985 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4986 da2->checkAllocated();
4987 int size=self->getNumberOfTuples();
4988 if(size!=self->getNumberOfTuples())
4990 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4992 self->renumberInPlace(da2->getConstPointer());
4996 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4999 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5000 if (!SWIG_IsOK(res1))
5003 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5004 if(size!=self->getNumberOfTuples())
5006 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5008 self->renumberInPlaceR(tmp);
5012 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5014 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5015 da2->checkAllocated();
5016 int size=self->getNumberOfTuples();
5017 if(size!=self->getNumberOfTuples())
5019 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5021 self->renumberInPlaceR(da2->getConstPointer());
5025 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
5028 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5029 if (!SWIG_IsOK(res1))
5032 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5033 if(size!=self->getNumberOfTuples())
5035 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5037 return self->renumberAndReduce(tmp,newNbOfTuple);
5041 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5043 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5044 da2->checkAllocated();
5045 int size=self->getNumberOfTuples();
5046 if(size!=self->getNumberOfTuples())
5048 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5050 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5054 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5057 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5058 if (!SWIG_IsOK(res1))
5061 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5062 if(size!=self->getNumberOfTuples())
5064 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5066 return self->renumber(tmp);
5070 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5072 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5073 da2->checkAllocated();
5074 int size=self->getNumberOfTuples();
5075 if(size!=self->getNumberOfTuples())
5077 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5079 return self->renumber(da2->getConstPointer());
5083 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5086 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5087 if (!SWIG_IsOK(res1))
5090 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5091 if(size!=self->getNumberOfTuples())
5093 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5095 return self->renumberR(tmp);
5099 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5101 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5102 da2->checkAllocated();
5103 int size=self->getNumberOfTuples();
5104 if(size!=self->getNumberOfTuples())
5106 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5108 return self->renumberR(da2->getConstPointer());
5112 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
5115 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5116 if (!SWIG_IsOK(res1))
5119 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5120 return self->selectByTupleId(tmp,tmp+size);
5124 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5126 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5127 da2->checkAllocated();
5128 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5132 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
5135 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5136 if (!SWIG_IsOK(res1))
5139 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5140 return self->selectByTupleIdSafe(tmp,tmp+size);
5144 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5146 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5147 da2->checkAllocated();
5148 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5152 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
5154 std::vector<int> tmp;
5155 convertPyToNewIntArr3(li,tmp);
5156 return self->keepSelectedComponents(tmp);
5159 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
5161 std::vector<int> tmp;
5162 convertPyToNewIntArr3(li,tmp);
5163 self->setSelectedComponents(a,tmp);
5166 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5168 int sz=self->getNumberOfComponents();
5169 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5170 self->getTuple(tupleId,tmp);
5171 return convertIntArrToPyList(tmp,sz);
5174 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
5176 DataArrayInt *arr=0;
5177 DataArrayInt *arrI=0;
5178 self->changeSurjectiveFormat(targetNb,arr,arrI);
5179 PyObject *res = PyList_New(2);
5180 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5181 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5185 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
5187 std::vector<std::pair<int,int> > ranges;
5188 convertPyToVectorPairInt(li,ranges);
5189 return self->selectByTupleRanges(ranges);
5192 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
5194 std::vector<const DataArrayInt *> tmp;
5195 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5196 return DataArrayInt::Meld(tmp);
5199 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
5201 std::vector<const DataArrayInt *> tmp;
5202 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5203 return DataArrayInt::Aggregate(tmp);
5206 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
5208 std::vector<const DataArrayInt *> tmp;
5209 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5210 return DataArrayInt::BuildUnion(tmp);
5213 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
5215 std::vector<const DataArrayInt *> tmp;
5216 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5217 return DataArrayInt::BuildIntersection(tmp);
5220 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5223 int r1=self->getMaxValue(tmp);
5224 PyObject *ret=PyTuple_New(2);
5225 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5226 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5230 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5233 int r1=self->getMinValue(tmp);
5234 PyObject *ret=PyTuple_New(2);
5235 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5236 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5240 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5242 int nbOfCompo=self->getNumberOfComponents();
5247 if(PyInt_Check(obj))
5249 int val=(int)PyInt_AS_LONG(obj);
5250 return self->locateValue(val);
5253 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5257 std::vector<int> arr;
5258 convertPyToNewIntArr3(obj,arr);
5259 return self->locateTuple(arr);
5264 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5266 int nbOfCompo=self->getNumberOfComponents();
5273 if(PyInt_Check(obj))
5275 int val=(int)PyInt_AS_LONG(obj);
5276 return self->presenceOfValue(val);
5279 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5283 std::vector<int> arr;
5284 convertPyToNewIntArr3(obj,arr);
5285 return self->presenceOfTuple(arr);
5290 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5292 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5293 self->checkAllocated();
5294 int nbOfTuples=self->getNumberOfTuples();
5295 int nbOfComponents=self->getNumberOfComponents();
5297 std::vector<int> vt1,vc1;
5298 std::pair<int, std::pair<int,int> > pt1,pc1;
5299 DataArrayInt *dt1=0,*dc1=0;
5301 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5302 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5307 if(nbOfComponents==1)
5308 return PyInt_FromLong(self->getIJSafe(it1,0));
5309 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5312 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5314 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5316 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5318 return PyInt_FromLong(self->getIJSafe(it1,ic1));
5321 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5322 std::vector<int> v2(1,ic1);
5323 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5327 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5328 std::vector<int> v2(1,ic1);
5329 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5333 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5334 std::vector<int> v2(1,ic1);
5335 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5339 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5340 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5344 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5345 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5349 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5350 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5354 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5355 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5359 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5360 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5361 std::vector<int> v2(nbOfComp);
5362 for(int i=0;i<nbOfComp;i++)
5363 v2[i]=pc1.first+i*pc1.second.second;
5364 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5368 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5369 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5370 std::vector<int> v2(nbOfComp);
5371 for(int i=0;i<nbOfComp;i++)
5372 v2[i]=pc1.first+i*pc1.second.second;
5373 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5377 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5378 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5379 std::vector<int> v2(nbOfComp);
5380 for(int i=0;i<nbOfComp;i++)
5381 v2[i]=pc1.first+i*pc1.second.second;
5382 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5386 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5387 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5388 std::vector<int> v2(nbOfComp);
5389 for(int i=0;i<nbOfComp;i++)
5390 v2[i]=pc1.first+i*pc1.second.second;
5391 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5394 throw INTERP_KERNEL::Exception(msg);
5398 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5400 self->checkAllocated();
5401 const char msg[]="Unexpected situation in __setitem__ !";
5402 int nbOfTuples=self->getNumberOfTuples();
5403 int nbOfComponents=self->getNumberOfComponents();
5406 std::vector<int> v1;
5408 DataArrayIntTuple *dd1=0;
5409 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5411 std::vector<int> vt1,vc1;
5412 std::pair<int, std::pair<int,int> > pt1,pc1;
5413 DataArrayInt *dt1=0,*dc1=0;
5414 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5415 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5423 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5426 tmp=DataArrayInt::New();
5427 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5428 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5431 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5434 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5435 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5438 throw INTERP_KERNEL::Exception(msg);
5447 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5450 tmp=DataArrayInt::New();
5451 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5452 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5455 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5458 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5459 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5462 throw INTERP_KERNEL::Exception(msg);
5471 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5474 tmp=DataArrayInt::New();
5475 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5476 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5479 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5482 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5483 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5486 throw INTERP_KERNEL::Exception(msg);
5495 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5498 tmp=DataArrayInt::New();
5499 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5500 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5503 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5506 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5507 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5510 throw INTERP_KERNEL::Exception(msg);
5519 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5522 tmp=DataArrayInt::New();
5523 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5524 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5527 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5530 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5531 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5534 throw INTERP_KERNEL::Exception(msg);
5543 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5546 tmp=DataArrayInt::New();
5547 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5548 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5551 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5554 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5555 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5558 throw INTERP_KERNEL::Exception(msg);
5567 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5570 tmp=DataArrayInt::New();
5571 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5572 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5575 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5578 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5579 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5582 throw INTERP_KERNEL::Exception(msg);
5591 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5594 tmp=DataArrayInt::New();
5595 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5596 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5599 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5602 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5603 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5606 throw INTERP_KERNEL::Exception(msg);
5615 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5618 tmp=DataArrayInt::New();
5619 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5620 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5623 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5626 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5627 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5630 throw INTERP_KERNEL::Exception(msg);
5639 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5642 tmp=DataArrayInt::New();
5643 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5644 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5647 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5650 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5651 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5654 throw INTERP_KERNEL::Exception(msg);
5663 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5666 tmp=DataArrayInt::New();
5667 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5668 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
5671 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5674 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5675 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5678 throw INTERP_KERNEL::Exception(msg);
5687 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5690 tmp=DataArrayInt::New();
5691 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5692 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5695 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5698 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5699 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5702 throw INTERP_KERNEL::Exception(msg);
5711 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5714 tmp=DataArrayInt::New();
5715 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5716 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5719 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5722 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5723 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5726 throw INTERP_KERNEL::Exception(msg);
5735 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5738 tmp=DataArrayInt::New();
5739 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5740 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5743 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5746 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5747 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5750 throw INTERP_KERNEL::Exception(msg);
5759 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5762 tmp=DataArrayInt::New();
5763 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5764 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5767 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5770 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5771 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5774 throw INTERP_KERNEL::Exception(msg);
5783 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5786 tmp=DataArrayInt::New();
5787 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5788 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5791 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5794 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5795 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5798 throw INTERP_KERNEL::Exception(msg);
5803 throw INTERP_KERNEL::Exception(msg);
5808 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5810 return self->negate();
5813 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5815 const char msg[]="Unexpected situation in __add__ !";
5818 std::vector<int> aa;
5819 DataArrayIntTuple *aaa;
5821 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5826 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5827 ret->applyLin(1,val);
5833 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5834 return DataArrayInt::Add(self,aaa);
5838 return DataArrayInt::Add(self,a);
5842 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5843 return DataArrayInt::Add(self,aaaa);
5846 throw INTERP_KERNEL::Exception(msg);
5850 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5852 const char msg[]="Unexpected situation in __radd__ !";
5855 std::vector<int> aa;
5856 DataArrayIntTuple *aaa;
5858 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5863 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5864 ret->applyLin(1,val);
5870 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5871 return DataArrayInt::Add(self,aaa);
5875 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5876 return DataArrayInt::Add(self,aaaa);
5879 throw INTERP_KERNEL::Exception(msg);
5883 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5885 const char msg[]="Unexpected situation in __iadd__ !";
5888 std::vector<int> aa;
5889 DataArrayIntTuple *aaa;
5891 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5896 self->applyLin(1,val);
5897 Py_XINCREF(trueSelf);
5902 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5904 Py_XINCREF(trueSelf);
5910 Py_XINCREF(trueSelf);
5915 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5916 self->addEqual(aaaa);
5917 Py_XINCREF(trueSelf);
5921 throw INTERP_KERNEL::Exception(msg);
5925 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5927 const char msg[]="Unexpected situation in __sub__ !";
5930 std::vector<int> aa;
5931 DataArrayIntTuple *aaa;
5933 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5938 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5939 ret->applyLin(1,-val);
5945 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5946 return DataArrayInt::Substract(self,aaa);
5950 return DataArrayInt::Substract(self,a);
5954 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5955 return DataArrayInt::Substract(self,aaaa);
5958 throw INTERP_KERNEL::Exception(msg);
5962 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5964 const char msg[]="Unexpected situation in __rsub__ !";
5967 std::vector<int> aa;
5968 DataArrayIntTuple *aaa;
5970 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5975 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5976 ret->applyLin(-1,val);
5982 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5983 return DataArrayInt::Substract(aaa,self);
5987 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5988 return DataArrayInt::Substract(aaaa,self);
5991 throw INTERP_KERNEL::Exception(msg);
5995 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5997 const char msg[]="Unexpected situation in __isub__ !";
6000 std::vector<int> aa;
6001 DataArrayIntTuple *aaa;
6003 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6008 self->applyLin(1,-val);
6009 Py_XINCREF(trueSelf);
6014 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6015 self->substractEqual(bb);
6016 Py_XINCREF(trueSelf);
6021 self->substractEqual(a);
6022 Py_XINCREF(trueSelf);
6027 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6028 self->substractEqual(aaaa);
6029 Py_XINCREF(trueSelf);
6033 throw INTERP_KERNEL::Exception(msg);
6037 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6039 const char msg[]="Unexpected situation in __mul__ !";
6042 std::vector<int> aa;
6043 DataArrayIntTuple *aaa;
6045 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6050 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6051 ret->applyLin(val,0);
6057 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6058 return DataArrayInt::Multiply(self,aaa);
6062 return DataArrayInt::Multiply(self,a);
6066 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6067 return DataArrayInt::Multiply(self,aaaa);
6070 throw INTERP_KERNEL::Exception(msg);
6074 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6076 const char msg[]="Unexpected situation in __rmul__ !";
6079 std::vector<int> aa;
6080 DataArrayIntTuple *aaa;
6082 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6087 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6088 ret->applyLin(val,0);
6094 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6095 return DataArrayInt::Multiply(self,aaa);
6099 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6100 return DataArrayInt::Multiply(self,aaaa);
6103 throw INTERP_KERNEL::Exception(msg);
6107 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6109 const char msg[]="Unexpected situation in __imul__ !";
6112 std::vector<int> aa;
6113 DataArrayIntTuple *aaa;
6115 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6120 self->applyLin(val,0);
6121 Py_XINCREF(trueSelf);
6126 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6127 self->multiplyEqual(bb);
6128 Py_XINCREF(trueSelf);
6133 self->multiplyEqual(a);
6134 Py_XINCREF(trueSelf);
6139 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6140 self->multiplyEqual(aaaa);
6141 Py_XINCREF(trueSelf);
6145 throw INTERP_KERNEL::Exception(msg);
6149 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6151 const char msg[]="Unexpected situation in __div__ !";
6154 std::vector<int> aa;
6155 DataArrayIntTuple *aaa;
6157 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6162 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6163 ret->applyDivideBy(val);
6169 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6170 return DataArrayInt::Divide(self,aaa);
6174 return DataArrayInt::Divide(self,a);
6178 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6179 return DataArrayInt::Divide(self,aaaa);
6182 throw INTERP_KERNEL::Exception(msg);
6186 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6188 const char msg[]="Unexpected situation in __rdiv__ !";
6191 std::vector<int> aa;
6192 DataArrayIntTuple *aaa;
6194 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6199 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6206 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6207 return DataArrayInt::Divide(aaa,self);
6211 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6212 return DataArrayInt::Divide(aaaa,self);
6215 throw INTERP_KERNEL::Exception(msg);
6219 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6221 const char msg[]="Unexpected situation in __idiv__ !";
6224 std::vector<int> aa;
6225 DataArrayIntTuple *aaa;
6227 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6232 self->applyDivideBy(val);
6233 Py_XINCREF(trueSelf);
6238 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6239 self->divideEqual(bb);
6240 Py_XINCREF(trueSelf);
6245 self->divideEqual(a);
6246 Py_XINCREF(trueSelf);
6251 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6252 self->divideEqual(aaaa);
6253 Py_XINCREF(trueSelf);
6257 throw INTERP_KERNEL::Exception(msg);
6261 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6263 const char msg[]="Unexpected situation in __mod__ !";
6266 std::vector<int> aa;
6267 DataArrayIntTuple *aaa;
6269 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6274 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6275 ret->applyModulus(val);
6281 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6282 return DataArrayInt::Modulus(self,aaa);
6286 return DataArrayInt::Modulus(self,a);
6290 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6291 return DataArrayInt::Modulus(self,aaaa);
6294 throw INTERP_KERNEL::Exception(msg);
6298 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6300 const char msg[]="Unexpected situation in __rmod__ !";
6303 std::vector<int> aa;
6304 DataArrayIntTuple *aaa;
6306 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6311 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6312 ret->applyRModulus(val);
6318 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6319 return DataArrayInt::Modulus(aaa,self);
6323 return DataArrayInt::Modulus(a,self);
6327 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6328 return DataArrayInt::Modulus(aaaa,self);
6331 throw INTERP_KERNEL::Exception(msg);
6335 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6337 const char msg[]="Unexpected situation in __imod__ !";
6340 std::vector<int> aa;
6341 DataArrayIntTuple *aaa;
6343 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6348 self->applyModulus(val);
6349 Py_XINCREF(trueSelf);
6354 self->modulusEqual(a);
6355 Py_XINCREF(trueSelf);
6360 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6361 self->modulusEqual(aaaa);
6362 Py_XINCREF(trueSelf);
6366 throw INTERP_KERNEL::Exception(msg);
6371 namespace ParaMEDMEM
6373 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6376 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6377 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6378 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6379 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6380 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
6381 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6382 void setName(const char *name) throw(INTERP_KERNEL::Exception);
6383 const char *getDescription() const throw(INTERP_KERNEL::Exception);
6384 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6385 const char *getName() const throw(INTERP_KERNEL::Exception);
6386 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6387 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6388 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6389 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6390 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6391 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6392 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6393 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6394 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6395 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6396 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6397 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6398 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6399 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6400 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
6401 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
6403 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6405 MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6408 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6411 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6413 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6416 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6419 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
6421 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
6422 return convertIntArrToPyList3(ret);
6425 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6428 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6429 PyObject *ret=PyTuple_New(2);
6430 PyObject *ret0Py=ret0?Py_True:Py_False;
6432 PyTuple_SetItem(ret,0,ret0Py);
6433 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6437 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6439 DataArrayInt *ret1=0;
6440 MEDCouplingMesh *ret0=0;
6442 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6443 if (!SWIG_IsOK(res1))
6446 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6447 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6451 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6453 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6454 da2->checkAllocated();
6455 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6457 PyObject *res = PyList_New(2);
6458 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6459 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6463 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6467 std::vector<int> pos2;
6468 DataArrayInt *pos3=0;
6469 DataArrayIntTuple *pos4=0;
6470 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6475 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6479 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6483 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6486 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6490 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6491 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6494 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6495 if (!SWIG_IsOK(res1))
6498 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6499 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6503 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6505 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6506 da2->checkAllocated();
6507 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6511 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6513 std::vector<int> tmp;
6514 self->getCellIdsHavingGaussLocalization(locId,tmp);
6515 DataArrayInt *ret=DataArrayInt::New();
6516 ret->alloc((int)tmp.size(),1);
6517 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6518 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6523 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6526 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
6527 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
6528 void setTimeUnit(const char *unit);
6529 const char *getTimeUnit() const;
6530 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
6531 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6532 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6533 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
6534 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
6535 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
6536 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6537 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6538 MEDCouplingFieldDouble *deepCpy() const;
6539 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6540 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6541 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6542 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6543 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
6544 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6545 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6546 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6547 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6548 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6549 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6550 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6551 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6552 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6553 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6554 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6555 void setIteration(int it) throw(INTERP_KERNEL::Exception);
6556 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6557 void setOrder(int order) throw(INTERP_KERNEL::Exception);
6558 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6559 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6560 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6561 void updateTime() const throw(INTERP_KERNEL::Exception);
6562 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6563 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6564 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6565 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6566 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6567 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6568 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6569 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6570 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6571 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6572 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6573 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6574 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6575 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6576 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6577 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6578 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6579 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6580 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6581 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6582 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6583 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6584 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6585 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6586 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6587 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6588 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6589 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6590 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6591 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6592 double getMaxValue() const throw(INTERP_KERNEL::Exception);
6593 double getMinValue() const throw(INTERP_KERNEL::Exception);
6594 double getAverageValue() const throw(INTERP_KERNEL::Exception);
6595 double norm2() const throw(INTERP_KERNEL::Exception);
6596 double normMax() const throw(INTERP_KERNEL::Exception);
6597 //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
6598 double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6599 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6600 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6601 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6602 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6603 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6604 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6605 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6606 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6607 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6608 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6609 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6610 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6611 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6612 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6613 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6614 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6615 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6616 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6617 MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6618 MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6619 MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6620 MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6622 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
6624 return MEDCouplingFieldDouble::New(type,td);
6627 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
6629 return MEDCouplingFieldDouble::New(ft,td);
6632 std::string __str__() const throw(INTERP_KERNEL::Exception)
6634 return self->simpleRepr();
6637 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6639 DataArrayDouble *ret=self->getArray();
6645 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6647 std::vector<DataArrayDouble *> arrs=self->getArrays();
6648 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6652 PyObject *ret=PyTuple_New(sz);
6653 for(int i=0;i<sz;i++)
6656 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6658 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6663 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6665 std::vector<const DataArrayDouble *> tmp;
6666 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6668 std::vector<DataArrayDouble *> arrs(sz);
6669 for(int i=0;i<sz;i++)
6670 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6671 self->setArrays(arrs);
6674 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6676 DataArrayDouble *ret=self->getEndArray();
6682 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6686 DataArrayDoubleTuple *aa;
6687 std::vector<double> bb;
6689 const MEDCouplingMesh *mesh=self->getMesh();
6691 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6692 int spaceDim=mesh->getSpaceDimension();
6693 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6694 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6696 int sz=self->getNumberOfComponents();
6697 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6698 self->getValueOn(spaceLoc,res);
6699 return convertDblArrToPyList(res,sz);
6702 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6704 int sz=self->getNumberOfComponents();
6705 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6706 self->getValueOnPos(i,j,k,res);
6707 return convertDblArrToPyList(res,sz);
6710 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6713 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
6714 if (!SWIG_IsOK(res1))
6717 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6718 const MEDCouplingMesh *mesh=self->getMesh();
6720 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6721 int spaceDim=mesh->getSpaceDimension();
6722 int nbOfPoints=size/spaceDim;
6723 if(size%spaceDim!=0)
6725 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6727 return self->getValueOnMulti(tmp,nbOfPoints);
6731 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6733 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6734 da2->checkAllocated();
6735 int size=da2->getNumberOfTuples();
6736 int nbOfCompo=da2->getNumberOfComponents();
6737 const MEDCouplingMesh *mesh=self->getMesh();
6739 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6740 if(nbOfCompo!=mesh->getSpaceDimension())
6742 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6744 return self->getValueOnMulti(da2->getConstPointer(),size);
6748 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6752 DataArrayDoubleTuple *aa;
6753 std::vector<double> bb;
6755 const MEDCouplingMesh *mesh=self->getMesh();
6757 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6758 int spaceDim=mesh->getSpaceDimension();
6759 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6760 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6763 int sz=self->getNumberOfComponents();
6764 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6765 self->getValueOn(spaceLoc,time,res);
6766 return convertDblArrToPyList(res,sz);
6769 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6771 if(self->getArray()!=0)
6774 double *tmp=convertPyToNewDblArr2(li,&sz);
6775 int nbTuples=self->getArray()->getNumberOfTuples();
6776 int nbOfCompo=self->getArray()->getNumberOfComponents();
6777 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6780 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6783 PyObject *getTime() throw(INTERP_KERNEL::Exception)
6786 double tmp0=self->getTime(tmp1,tmp2);
6787 PyObject *res = PyList_New(3);
6788 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6789 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6790 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6794 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6797 double tmp0=self->getStartTime(tmp1,tmp2);
6798 PyObject *res = PyList_New(3);
6799 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6800 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6801 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6805 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6808 double tmp0=self->getEndTime(tmp1,tmp2);
6809 PyObject *res = PyList_New(3);
6810 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6811 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6812 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6815 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6817 int sz=self->getNumberOfComponents();
6818 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6819 self->accumulate(tmp);
6820 return convertDblArrToPyList(tmp,sz);
6822 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6824 int sz=self->getNumberOfComponents();
6825 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6826 self->integral(isWAbs,tmp);
6827 return convertDblArrToPyList(tmp,sz);
6829 PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
6831 int sz=self->getNumberOfComponents();
6832 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6833 self->getWeightedAverageValue(tmp,isWAbs);
6834 return convertDblArrToPyList(tmp,sz);
6836 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6838 int sz=self->getNumberOfComponents();
6839 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6841 return convertDblArrToPyList(tmp,sz);
6843 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6845 int sz=self->getNumberOfComponents();
6846 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6848 return convertDblArrToPyList(tmp,sz);
6850 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6853 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6854 if (!SWIG_IsOK(res1))
6857 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6858 self->renumberCells(tmp,check);
6862 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6864 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6865 da2->checkAllocated();
6866 self->renumberCells(da2->getConstPointer(),check);
6869 void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6872 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6873 if (!SWIG_IsOK(res1))
6876 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6877 self->renumberNodes(tmp);
6881 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6883 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6884 da2->checkAllocated();
6885 self->renumberNodes(da2->getConstPointer());
6889 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6893 std::vector<int> multiVal;
6894 std::pair<int, std::pair<int,int> > slic;
6895 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6896 const MEDCouplingMesh *mesh=self->getMesh();
6898 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6899 int nbc=mesh->getNumberOfCells();
6900 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6907 std::ostringstream oss;
6908 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6909 throw INTERP_KERNEL::Exception(oss.str().c_str());
6912 return self->buildSubPart(&singleVal,&singleVal+1);
6917 int tmp=nbc+singleVal;
6918 return self->buildSubPart(&tmp,&tmp+1);
6922 std::ostringstream oss;
6923 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6924 throw INTERP_KERNEL::Exception(oss.str().c_str());
6930 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6934 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6935 return self->buildSubPart(rg->begin(),rg->end());
6940 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6941 daIntTyypp->checkAllocated();
6942 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6945 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6949 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6951 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6954 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6957 double r1=self->getMaxValue2(tmp);
6958 PyObject *ret=PyTuple_New(2);
6959 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6960 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6964 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6967 double r1=self->getMinValue2(tmp);
6968 PyObject *ret=PyTuple_New(2);
6969 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6970 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6974 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6976 std::vector<int> tmp;
6977 convertPyToNewIntArr3(li,tmp);
6978 return self->keepSelectedComponents(tmp);
6981 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6983 std::vector<int> tmp;
6984 convertPyToNewIntArr3(li,tmp);
6985 self->setSelectedComponents(f,tmp);
6988 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6991 DataArrayDouble *a,*a2;
6992 DataArrayDoubleTuple *aa,*aa2;
6993 std::vector<double> bb,bb2;
6996 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6997 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6998 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6999 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
7001 return self->extractSlice3D(orig,vect,eps);
7004 PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7007 Py_XINCREF(trueSelf);
7011 PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7014 Py_XINCREF(trueSelf);
7018 PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7021 Py_XINCREF(trueSelf);
7025 PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7028 Py_XINCREF(trueSelf);
7032 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7034 std::vector<const MEDCouplingFieldDouble *> tmp;
7035 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7036 return MEDCouplingFieldDouble::MergeFields(tmp);
7039 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
7041 std::vector<const MEDCouplingFieldDouble *> tmp;
7042 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7043 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
7048 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
7051 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
7052 static MEDCouplingFieldTemplate *New(TypeOfField type);
7053 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7054 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7055 void updateTime() const;
7058 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
7060 return MEDCouplingFieldTemplate::New(f);
7063 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
7065 return MEDCouplingFieldTemplate::New(type);
7068 std::string __str__() const throw(INTERP_KERNEL::Exception)
7070 return self->simpleRepr();
7075 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
7078 int getNumberOfFields() const;
7079 MEDCouplingMultiFields *deepCpy() const;
7080 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7081 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7082 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7083 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7084 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7085 void updateTime() const throw(INTERP_KERNEL::Exception);
7088 std::string __str__() const throw(INTERP_KERNEL::Exception)
7090 return self->simpleRepr();
7092 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7094 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7095 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7097 std::vector<MEDCouplingFieldDouble *> fs(sz);
7098 for(int i=0;i<sz;i++)
7099 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7100 return MEDCouplingMultiFields::New(fs);
7102 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7104 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7105 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7107 std::vector<MEDCouplingFieldDouble *> fs(sz);
7108 for(int i=0;i<sz;i++)
7109 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7110 return MEDCouplingMultiFields::New(fs);
7112 PyObject *getFields() const
7114 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
7115 int sz=fields.size();
7116 PyObject *res = PyList_New(sz);
7117 for(int i=0;i<sz;i++)
7121 fields[i]->incrRef();
7122 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
7126 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
7131 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
7133 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
7137 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
7140 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
7142 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
7144 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
7146 PyObject *res = PyList_New(sz);
7147 for(int i=0;i<sz;i++)
7152 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7156 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7161 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
7163 std::vector<int> refs;
7164 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
7166 PyObject *res = PyList_New(sz);
7167 for(int i=0;i<sz;i++)
7172 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7176 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7180 PyObject *ret=PyTuple_New(2);
7181 PyTuple_SetItem(ret,0,res);
7182 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
7185 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7187 std::vector<DataArrayDouble *> ms=self->getArrays();
7189 PyObject *res = PyList_New(sz);
7190 for(int i=0;i<sz;i++)
7195 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7199 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7204 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
7206 std::vector< std::vector<int> > refs;
7207 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
7209 PyObject *res = PyList_New(sz);
7210 PyObject *res2 = PyList_New(sz);
7211 for(int i=0;i<sz;i++)
7216 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7220 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7222 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
7225 PyObject *ret=PyTuple_New(2);
7226 PyTuple_SetItem(ret,0,res);
7227 PyTuple_SetItem(ret,1,res2);
7233 class MEDCouplingDefinitionTime
7236 MEDCouplingDefinitionTime();
7237 void assign(const MEDCouplingDefinitionTime& other);
7238 bool isEqual(const MEDCouplingDefinitionTime& other) const;
7239 double getTimeResolution() const;
7240 std::vector<double> getHotSpotsTime() const;
7243 std::string __str__() const
7245 std::ostringstream oss;
7246 self->appendRepr(oss);
7250 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
7252 int meshId,arrId,arrIdInField,fieldId;
7253 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7254 PyObject *res=PyList_New(4);
7255 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7256 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7257 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7258 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7262 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7264 int meshId,arrId,arrIdInField,fieldId;
7265 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7266 PyObject *res=PyList_New(4);
7267 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7268 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7269 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7270 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7276 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7279 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7280 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7284 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7286 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7287 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7289 std::vector<MEDCouplingFieldDouble *> fs(sz);
7290 for(int i=0;i<sz;i++)
7291 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7292 return MEDCouplingFieldOverTime::New(fs);
7294 std::string __str__() const throw(INTERP_KERNEL::Exception)
7296 return self->simpleRepr();
7298 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7300 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7301 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7303 std::vector<MEDCouplingFieldDouble *> fs(sz);
7304 for(int i=0;i<sz;i++)
7305 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7306 return MEDCouplingFieldOverTime::New(fs);
7314 __filename=os.environ.get('PYTHONSTARTUP')
7315 if __filename and os.path.isfile(__filename):
7316 execfile(__filename)