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::MEDCouplingField::buildMeasureField;
90 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
91 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
92 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
93 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
94 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
95 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
96 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
97 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
98 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
99 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
100 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
101 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
102 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
103 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
104 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
105 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator+;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator-;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator*;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
132 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
133 %newobject ParaMEDMEM::DataArrayInt::New;
134 %newobject ParaMEDMEM::DataArrayInt::__iter__;
135 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
136 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
137 %newobject ParaMEDMEM::DataArrayInt::performCpy;
138 %newobject ParaMEDMEM::DataArrayInt::substr;
139 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
140 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
141 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
142 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
143 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
144 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
145 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
146 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
147 %newobject ParaMEDMEM::DataArrayInt::renumber;
148 %newobject ParaMEDMEM::DataArrayInt::renumberR;
149 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
150 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
151 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
152 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
153 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
154 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
155 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
156 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
157 %newobject ParaMEDMEM::DataArrayInt::negate;
158 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
159 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
160 %newobject ParaMEDMEM::DataArrayInt::Meld;
161 %newobject ParaMEDMEM::DataArrayInt::Add;
162 %newobject ParaMEDMEM::DataArrayInt::Substract;
163 %newobject ParaMEDMEM::DataArrayInt::Multiply;
164 %newobject ParaMEDMEM::DataArrayInt::Divide;
165 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
166 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
167 %newobject ParaMEDMEM::DataArrayInt::Range;
168 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
169 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
170 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
171 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
172 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
173 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
174 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
175 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
176 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
177 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
178 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
179 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
180 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
181 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
182 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
183 %newobject ParaMEDMEM::DataArrayInt::__neg__;
184 %newobject ParaMEDMEM::DataArrayInt::__add__;
185 %newobject ParaMEDMEM::DataArrayInt::__radd__;
186 %newobject ParaMEDMEM::DataArrayInt::__sub__;
187 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
188 %newobject ParaMEDMEM::DataArrayInt::__mul__;
189 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
190 %newobject ParaMEDMEM::DataArrayInt::__div__;
191 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
192 %newobject ParaMEDMEM::DataArrayInt::__mod__;
193 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
194 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
195 %newobject ParaMEDMEM::DataArrayDouble::New;
196 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
197 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
198 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
199 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
200 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
201 %newobject ParaMEDMEM::DataArrayDouble::Meld;
202 %newobject ParaMEDMEM::DataArrayDouble::Dot;
203 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
204 %newobject ParaMEDMEM::DataArrayDouble::Add;
205 %newobject ParaMEDMEM::DataArrayDouble::Substract;
206 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
207 %newobject ParaMEDMEM::DataArrayDouble::Divide;
208 %newobject ParaMEDMEM::DataArrayDouble::substr;
209 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
210 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
211 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
212 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
213 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
214 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
215 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
216 %newobject ParaMEDMEM::DataArrayDouble::negate;
217 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
218 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
219 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
220 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
221 %newobject ParaMEDMEM::DataArrayDouble::determinant;
222 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
223 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
224 %newobject ParaMEDMEM::DataArrayDouble::inverse;
225 %newobject ParaMEDMEM::DataArrayDouble::trace;
226 %newobject ParaMEDMEM::DataArrayDouble::deviator;
227 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
228 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
229 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
230 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
231 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
232 %newobject ParaMEDMEM::DataArrayDouble::renumber;
233 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
234 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
235 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
236 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
237 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
238 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
239 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
240 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
241 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
242 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
243 %newobject ParaMEDMEM::DataArrayDouble::__add__;
244 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
245 %newobject ParaMEDMEM::DataArrayDouble::__sub__;
246 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
247 %newobject ParaMEDMEM::DataArrayDouble::__mul__;
248 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
249 %newobject ParaMEDMEM::DataArrayDouble::__div__;
250 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
251 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
252 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
253 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
254 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
255 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
256 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
257 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
258 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
259 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
260 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
261 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
262 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
263 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
264 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
265 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
266 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
267 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
268 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
269 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
270 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
271 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
272 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
273 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
274 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
317 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
318 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
319 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
320 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
321 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
322 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
323 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
324 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
325 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
326 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
327 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
328 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
329 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
330 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
332 %feature("unref") DataArrayDouble "$this->decrRef();"
333 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
334 %feature("unref") MEDCouplingMesh "$this->decrRef();"
335 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
336 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
337 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
338 %feature("unref") DataArrayInt "$this->decrRef();"
339 %feature("unref") MEDCouplingField "$this->decrRef();"
340 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
341 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
342 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
343 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
344 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
345 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
346 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
347 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
348 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
350 %rename(assign) *::operator=;
351 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
352 %ignore ParaMEDMEM::RefCountObject::decrRef;
353 %ignore ParaMEDMEM::MemArray::operator=;
354 %ignore ParaMEDMEM::MemArray::operator[];
355 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
356 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
357 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
358 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
359 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
360 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
361 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
362 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
363 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
364 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
365 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
366 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
367 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
368 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
372 %rename (InterpKernelException) INTERP_KERNEL::Exception;
374 namespace INTERP_KERNEL
379 Exception(const char* what);
380 ~Exception() throw ();
381 const char *what() const throw ();
384 std::string __str__() const
386 return std::string(self->what());
392 %include "MEDCouplingTimeLabel.hxx"
416 CONST_ON_TIME_INTERVAL = 7
417 } TypeOfTimeDiscretization;
419 const char *MEDCouplingVersionStr();
420 int MEDCouplingVersion();
421 PyObject *MEDCouplingVersionMajMinRel()
423 int tmp0=0,tmp1=0,tmp2=0;
424 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
425 PyObject *res = PyList_New(3);
426 PyList_SetItem(res,0,SWIG_From_int(tmp0));
427 PyList_SetItem(res,1,SWIG_From_int(tmp1));
428 PyList_SetItem(res,2,SWIG_From_int(tmp2));
432 class MEDCOUPLING_EXPORT RefCountObject
436 RefCountObject(const RefCountObject& other);
439 bool decrRef() const;
440 void incrRef() const;
441 virtual std::size_t getHeapMemorySize() const;
450 UNSTRUCTURED_DESC = 6,
454 } MEDCouplingMeshType;
457 class DataArrayDouble;
458 class MEDCouplingUMesh;
459 class MEDCouplingFieldDouble;
461 %extend RefCountObject
463 std::string getHiddenCppPointer() const
465 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
470 class MEDCouplingMesh : public RefCountObject, public TimeLabel
473 void setName(const char *name);
474 const char *getName() const;
475 void setDescription(const char *descr);
476 const char *getDescription() const;
477 void setTime(double val, int iteration, int order);
478 void setTimeUnit(const char *unit);
479 const char *getTimeUnit() const;
480 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
481 bool isStructured() const throw(INTERP_KERNEL::Exception);
482 virtual MEDCouplingMesh *deepCpy() const;
483 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
484 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
485 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
486 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
487 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
488 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
489 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
490 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
491 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
492 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
493 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
494 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
495 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
496 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
497 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
498 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
499 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
500 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
501 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
502 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
504 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
505 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
506 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
507 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
508 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
509 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
510 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
511 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
512 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
513 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
514 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
515 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
516 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
519 std::string __str__() const throw(INTERP_KERNEL::Exception)
521 return self->simpleRepr();
524 PyObject *getTime() throw(INTERP_KERNEL::Exception)
527 double tmp0=self->getTime(tmp1,tmp2);
528 PyObject *res = PyList_New(3);
529 PyList_SetItem(res,0,SWIG_From_double(tmp0));
530 PyList_SetItem(res,1,SWIG_From_int(tmp1));
531 PyList_SetItem(res,2,SWIG_From_int(tmp2));
535 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
539 DataArrayDoubleTuple *aa;
540 std::vector<double> bb;
542 int spaceDim=self->getSpaceDimension();
543 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
544 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
545 return self->getCellContainingPoint(pos,eps);
548 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
552 DataArrayDoubleTuple *aa;
553 std::vector<double> bb;
555 int spaceDim=self->getSpaceDimension();
556 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
557 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
558 std::vector<int> elts,eltsIndex;
559 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
560 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
561 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
562 d0->alloc(elts.size(),1);
563 d1->alloc(eltsIndex.size(),1);
564 std::copy(elts.begin(),elts.end(),d0->getPointer());
565 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
566 PyObject *ret=PyTuple_New(2);
567 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
568 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
574 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
576 std::vector<int> elts,eltsIndex;
577 int spaceDim=self->getSpaceDimension();
579 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
580 if (!SWIG_IsOK(res1))
583 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
584 int nbOfPoints=size/spaceDim;
587 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
589 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
593 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
595 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
596 da2->checkAllocated();
597 int size=da2->getNumberOfTuples();
598 int nbOfCompo=da2->getNumberOfComponents();
599 if(nbOfCompo!=spaceDim)
601 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
603 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
605 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
606 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
607 d0->alloc(elts.size(),1);
608 d1->alloc(eltsIndex.size(),1);
609 std::copy(elts.begin(),elts.end(),d0->getPointer());
610 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
611 PyObject *ret=PyTuple_New(2);
612 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
613 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
619 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
623 DataArrayDoubleTuple *aa;
624 std::vector<double> bb;
626 int spaceDim=self->getSpaceDimension();
627 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
628 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
629 std::vector<int> elts;
630 self->getCellsContainingPoint(pos,eps,elts);
631 DataArrayInt *ret=DataArrayInt::New();
632 ret->alloc((int)elts.size(),1);
633 std::copy(elts.begin(),elts.end(),ret->getPointer());
634 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
637 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
640 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
641 if (!SWIG_IsOK(res1))
644 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
645 self->renumberCells(tmp,check);
649 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
651 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
652 da2->checkAllocated();
653 self->renumberCells(da2->getConstPointer(),check);
657 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
659 DataArrayInt *cellCor, *nodeCor;
660 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
661 PyObject *res = PyList_New(2);
662 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
663 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
666 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
669 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
670 if (!SWIG_IsOK(res1))
673 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
674 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
678 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
680 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
681 da2->checkAllocated();
682 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
685 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
687 std::vector<int> conn;
688 self->getNodeIdsOfCell(cellId,conn);
689 return convertIntArrToPyList2(conn);
692 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
694 std::vector<double> coo;
695 self->getCoordinatesOfNode(nodeId,coo);
696 return convertDblArrToPyList2(coo);
699 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
703 DataArrayDoubleTuple *aa;
704 std::vector<double> bb;
706 int spaceDim=self->getSpaceDimension();
707 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
708 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
709 self->scale(pointPtr,factor);
712 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
714 int spaceDim=self->getSpaceDimension();
715 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
716 self->getBoundingBox(tmp);
717 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
721 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
724 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
725 PyObject *ret=PyTuple_New(2);
726 PyObject *ret0Py=ret0?Py_True:Py_False;
728 PyTuple_SetItem(ret,0,ret0Py);
729 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
733 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
735 int szArr,sw,iTypppArr;
736 std::vector<int> stdvecTyyppArr;
737 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
738 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
739 if(sw==3)//DataArrayInt
741 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
742 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
743 std::string name=argpt->getName();
745 ret->setName(name.c_str());
747 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
750 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
752 int szArr,sw,iTypppArr;
753 std::vector<int> stdvecTyyppArr;
755 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
756 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
757 if(sw==3)//DataArrayInt
759 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
760 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
761 std::string name=argpt->getName();
763 ret->setName(name.c_str());
766 PyObject *res = PyList_New(2);
767 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
768 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
769 PyList_SetItem(res,0,obj0);
770 PyList_SetItem(res,1,obj1);
774 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
776 std::vector<int> vals=self->getDistributionOfTypes();
777 PyObject *ret=PyList_New((int)vals.size()/3);
778 for(int j=0;j<(int)vals.size()/3;j++)
780 PyObject *ret1=PyList_New(3);
781 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
782 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
783 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
784 PyList_SetItem(ret,j,ret1);
789 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
791 std::vector<int> code;
792 std::vector<const DataArrayInt *> idsPerType;
793 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
794 convertPyToNewIntArr4(li,1,3,code);
795 return self->checkTypeConsistencyAndContig(code,idsPerType);
798 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
800 std::vector<int> code;
801 std::vector<DataArrayInt *> idsInPflPerType;
802 std::vector<DataArrayInt *> idsPerType;
803 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
804 PyObject *ret=PyTuple_New(3);
805 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
806 PyObject *ret1=PyList_New(idsInPflPerType.size());
807 for(std::size_t j=0;j<idsInPflPerType.size();j++)
808 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
809 PyTuple_SetItem(ret,1,ret1);
810 int n=idsPerType.size();
811 PyObject *ret2=PyList_New(n);
813 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
814 PyTuple_SetItem(ret,2,ret2);
818 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
822 DataArrayDoubleTuple *aa;
823 std::vector<double> bb;
825 int spaceDim=self->getSpaceDimension();
826 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
827 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
828 self->translate(vectorPtr);
831 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
833 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
836 DataArrayDoubleTuple *aa;
837 std::vector<double> bb;
839 int spaceDim=self->getSpaceDimension();
840 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
841 self->rotate(centerPtr,0,alpha);
844 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
846 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
849 DataArrayDoubleTuple *aa;
850 std::vector<double> bb;
852 int spaceDim=self->getSpaceDimension();
853 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
854 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
855 self->rotate(centerPtr,vectorPtr,alpha);
858 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
860 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
861 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
862 PyObject *res=PyList_New(result.size());
863 for(int i=0;iL!=result.end(); i++, iL++)
864 PyList_SetItem(res,i,PyInt_FromLong(*iL));
868 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
870 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
871 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
872 return MEDCouplingMesh::MergeMeshes(tmp);
878 %extend ParaMEDMEM::DataArray
880 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
882 const std::vector<std::string>& comps=self->getInfoOnComponents();
883 PyObject *ret=PyList_New((int)comps.size());
884 for(int i=0;i<(int)comps.size();i++)
885 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
889 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
891 std::vector<int> tmp;
892 convertPyToNewIntArr3(li,tmp);
893 self->copyPartOfStringInfoFrom(other,tmp);
896 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
898 std::vector<int> tmp;
899 convertPyToNewIntArr3(li,tmp);
900 self->copyPartOfStringInfoFrom2(tmp,other);
904 %extend ParaMEDMEM::DataArrayInt
906 PyObject *getDifferentValues() const throw(INTERP_KERNEL::Exception)
908 std::set<int> ret=self->getDifferentValues();
909 return convertIntArrToPyList3(ret);
912 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
914 std::vector<int> ret1;
915 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
916 std::size_t sz=ret0.size();
917 PyObject *pyRet=PyTuple_New(2);
918 PyObject *pyRet0=PyList_New((int)sz);
919 PyObject *pyRet1=PyList_New((int)sz);
920 for(std::size_t i=0;i<sz;i++)
922 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
923 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
925 PyTuple_SetItem(pyRet,0,pyRet0);
926 PyTuple_SetItem(pyRet,1,pyRet1);
931 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
933 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
935 int sz=0,sw=-1,val1=-1;
936 std::vector<int> val2;
937 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
938 return self->clonePart(inp,inp+sz);
942 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
944 PyObject *getArrayOfDiscIds() const
946 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
949 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
953 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
954 %ignore ParaMEDMEM::DataArrayInt::getDifferentValues;
955 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
956 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
957 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
959 %include "MEDCouplingMemArray.hxx"
960 %include "NormalizedUnstructuredMesh.hxx"
961 %include "MEDCouplingNatureOfField.hxx"
962 %include "MEDCouplingTimeDiscretization.hxx"
963 %include "MEDCouplingFieldDiscretization.hxx"
964 %include "MEDCouplingGaussLocalization.hxx"
968 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
971 void updateTime() const;
972 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
973 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
974 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
975 void zipCoords() throw(INTERP_KERNEL::Exception);
976 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
977 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
978 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
979 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
980 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
981 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
982 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
983 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
984 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
985 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
986 //! size of returned tinyInfo must be always the same.
987 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
988 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
989 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
990 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
991 const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
992 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
993 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
994 virtual DataArrayInt *findBoundaryNodes() const;
997 std::string __str__() const throw(INTERP_KERNEL::Exception)
999 return self->simpleRepr();
1002 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1005 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1006 PyObject *res = PyList_New(2);
1007 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1008 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1012 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1014 DataArrayInt *comm, *commIndex;
1015 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1016 PyObject *res = PyList_New(2);
1017 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1018 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1022 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1024 DataArrayDouble *ret1=self->getCoords();
1026 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1029 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1031 int szArr,sw,iTypppArr;
1032 std::vector<int> stdvecTyyppArr;
1033 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1034 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1035 if(sw==3)//DataArrayInt
1037 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1038 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1039 std::string name=argpt->getName();
1041 ret->setName(name.c_str());
1043 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1046 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1048 int szArr,sw,iTypppArr;
1049 std::vector<int> stdvecTyyppArr;
1050 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1051 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1052 if(sw==3)//DataArrayInt
1054 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1055 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1056 std::string name=argpt->getName();
1058 ret->setName(name.c_str());
1060 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1063 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1065 int szArr,sw,iTypppArr;
1066 std::vector<int> stdvecTyyppArr;
1067 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1068 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1069 if(sw==3)//DataArrayInt
1071 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1072 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1073 std::string name=argpt->getName();
1075 ret->setName(name.c_str());
1077 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1080 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1082 int szArr,sw,iTypppArr;
1083 std::vector<int> stdvecTyyppArr;
1084 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1085 self->renumberNodes(tmp,newNbOfNodes);
1088 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1090 int szArr,sw,iTypppArr;
1091 std::vector<int> stdvecTyyppArr;
1092 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1093 self->renumberNodes2(tmp,newNbOfNodes);
1096 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1098 int spaceDim=self->getSpaceDimension();
1100 DataArrayDouble *a,*a2;
1101 DataArrayDoubleTuple *aa,*aa2;
1102 std::vector<double> bb,bb2;
1104 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1105 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1106 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1107 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1108 std::vector<int> nodes;
1109 self->findNodesOnLine(p,v,eps,nodes);
1110 DataArrayInt *ret=DataArrayInt::New();
1111 ret->alloc((int)nodes.size(),1);
1112 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1113 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1115 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1117 int spaceDim=self->getSpaceDimension();
1119 DataArrayDouble *a,*a2;
1120 DataArrayDoubleTuple *aa,*aa2;
1121 std::vector<double> bb,bb2;
1123 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1124 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1125 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1126 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1127 std::vector<int> nodes;
1128 self->findNodesOnPlane(p,v,eps,nodes);
1129 DataArrayInt *ret=DataArrayInt::New();
1130 ret->alloc((int)nodes.size(),1);
1131 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1132 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1135 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1139 DataArrayDoubleTuple *aa;
1140 std::vector<double> bb;
1142 int spaceDim=self->getSpaceDimension();
1143 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1144 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1145 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1146 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1149 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfNodes, double eps) const throw(INTERP_KERNEL::Exception)
1151 DataArrayInt *c=0,*cI=0;
1155 DataArrayDoubleTuple *aa;
1156 std::vector<double> bb;
1158 int spaceDim=self->getSpaceDimension();
1159 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1160 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfNodes,spaceDim,true);
1161 self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI);
1162 PyObject *ret=PyTuple_New(2);
1163 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1164 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1168 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1170 DataArrayInt *c=0,*cI=0;
1171 int spaceDim=self->getSpaceDimension();
1174 DataArrayDoubleTuple *aa;
1175 std::vector<double> bb;
1178 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1179 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1181 PyObject *ret=PyTuple_New(2);
1182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1187 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1191 DataArrayDoubleTuple *aa;
1192 std::vector<double> bb;
1194 int spaceDim=self->getSpaceDimension();
1195 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1196 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1198 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1199 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1202 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1206 std::vector<int> multiVal;
1207 std::pair<int, std::pair<int,int> > slic;
1208 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1209 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1213 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1215 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1217 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1219 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1223 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1226 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1227 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1228 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1229 for(int i=0;i<sz;i++)
1230 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1233 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1236 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1238 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1239 std::vector<double> val3;
1240 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1241 "Rotate2DAlg",2,true,nbNodes);
1243 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1244 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1247 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1250 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1251 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1252 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1253 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1254 for(int i=0;i<sz;i++)
1255 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1258 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1261 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1263 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1264 std::vector<double> val3;
1265 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1266 "Rotate3DAlg",3,true,nbNodes);
1268 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1269 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1270 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1275 class MEDCouplingUMeshCell
1278 INTERP_KERNEL::NormalizedCellType getType() const;
1281 std::string __str__() const
1283 return self->repr();
1286 PyObject *getAllConn() const
1289 const int *r=self->getAllConn(ret2);
1290 PyObject *ret=PyTuple_New(ret2);
1291 for(int i=0;i<ret2;i++)
1292 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1298 class MEDCouplingUMeshCellIterator
1305 MEDCouplingUMeshCell *ret=self->nextt();
1307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1310 PyErr_SetString(PyExc_StopIteration,"No more data.");
1317 class MEDCouplingUMeshCellByTypeIterator
1320 ~MEDCouplingUMeshCellByTypeIterator();
1325 MEDCouplingUMeshCellEntry *ret=self->nextt();
1327 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1330 PyErr_SetString(PyExc_StopIteration,"No more data.");
1337 class MEDCouplingUMeshCellByTypeEntry
1340 ~MEDCouplingUMeshCellByTypeEntry();
1343 MEDCouplingUMeshCellByTypeIterator *__iter__()
1345 return self->iterator();
1350 class MEDCouplingUMeshCellEntry
1353 INTERP_KERNEL::NormalizedCellType getType() const;
1354 int getNumberOfElems() const;
1357 MEDCouplingUMeshCellIterator *__iter__()
1359 return self->iterator();
1364 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1367 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1368 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1369 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1370 void updateTime() const;
1371 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1372 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1373 void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
1374 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1375 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1376 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1377 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1378 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1379 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1380 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1381 void computeTypes() throw(INTERP_KERNEL::Exception);
1382 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1383 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1385 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1386 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1387 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1388 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1389 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1390 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1392 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1393 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1394 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1395 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1396 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1398 MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1399 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1400 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1401 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1402 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1403 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1404 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1405 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1406 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1407 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1408 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1409 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1410 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1411 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1412 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1413 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1414 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1415 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1416 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1417 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1418 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1419 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1420 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1421 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1423 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1425 return MEDCouplingUMesh::New();
1428 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1430 return MEDCouplingUMesh::New(meshName,meshDim);
1433 std::string __str__() const throw(INTERP_KERNEL::Exception)
1435 return self->simpleRepr();
1438 MEDCouplingUMeshCellIterator *__iter__()
1440 return self->cellIterator();
1443 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1447 std::vector<int> multiVal;
1448 std::pair<int, std::pair<int,int> > slic;
1449 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1450 int nbc=self->getNumberOfCells();
1451 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1458 std::ostringstream oss;
1459 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1460 throw INTERP_KERNEL::Exception(oss.str().c_str());
1463 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1468 int tmp=nbc+singleVal;
1469 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1473 std::ostringstream oss;
1474 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1475 throw INTERP_KERNEL::Exception(oss.str().c_str());
1481 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1485 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1490 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1491 daIntTyypp->checkAllocated();
1492 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1495 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1499 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1503 std::vector<int> multiVal;
1504 std::pair<int, std::pair<int,int> > slic;
1505 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1506 int nbc=self->getNumberOfCells();
1507 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1514 std::ostringstream oss;
1515 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1516 throw INTERP_KERNEL::Exception(oss.str().c_str());
1520 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1527 int tmp=nbc+singleVal;
1528 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1533 std::ostringstream oss;
1534 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1535 throw INTERP_KERNEL::Exception(oss.str().c_str());
1541 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1547 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1548 daIntTyypp->checkAllocated();
1549 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1553 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1557 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1561 std::vector<int> multiVal;
1562 std::pair<int, std::pair<int,int> > slic;
1563 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1564 int nbc=self->getNumberOfCells();
1565 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1572 std::ostringstream oss;
1573 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1574 throw INTERP_KERNEL::Exception(oss.str().c_str());
1578 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1585 int tmp=nbc+singleVal;
1586 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1591 std::ostringstream oss;
1592 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1593 throw INTERP_KERNEL::Exception(oss.str().c_str());
1599 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1604 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1610 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1611 daIntTyypp->checkAllocated();
1612 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1616 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1620 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1622 int szArr,sw,iTypppArr;
1623 std::vector<int> stdvecTyyppArr;
1624 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1627 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1628 throw INTERP_KERNEL::Exception(oss.str().c_str());
1630 self->insertNextCell(type,size,tmp);
1633 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1635 int szArr,sw,iTypppArr;
1636 std::vector<int> stdvecTyyppArr;
1637 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1638 self->insertNextCell(type,szArr,tmp);
1641 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1643 DataArrayInt *ret=self->getNodalConnectivity();
1648 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1650 DataArrayInt *ret=self->getNodalConnectivityIndex();
1655 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1657 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1658 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1659 PyObject *res = PyList_New(result.size());
1660 for (int i=0;iL!=result.end(); i++, iL++)
1661 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1665 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1667 int szArr,sw,iTypppArr;
1668 std::vector<int> stdvecTyyppArr;
1669 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1670 int nbOfDepthPeelingPerformed=0;
1671 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1672 PyObject *res=PyTuple_New(2);
1673 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1674 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1678 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1680 DataArrayInt *v0=0,*v1=0;
1681 self->findCommonCells(compType,startCellId,v0,v1);
1682 PyObject *res = PyList_New(2);
1683 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1684 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1688 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1690 DataArrayInt *v0=0,*v1=0;
1691 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1692 PyObject *res = PyList_New(2);
1693 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1694 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1698 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1702 DataArrayDoubleTuple *aa;
1703 std::vector<double> bb;
1705 int nbOfCompo=self->getSpaceDimension();
1706 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1708 int cellId=-1,nodeId=-1;
1709 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1710 PyObject *ret=PyTuple_New(3);
1711 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1712 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1713 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1717 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1721 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1722 PyObject *res = PyList_New(3);
1723 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1724 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1725 PyList_SetItem(res,2,SWIG_From_int(ret2));
1728 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1732 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1733 PyObject *res = PyList_New(3);
1734 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1735 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1736 PyList_SetItem(res,2,SWIG_From_int(ret2));
1739 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1741 std::vector<int> cells;
1742 self->checkButterflyCells(cells,eps);
1743 DataArrayInt *ret=DataArrayInt::New();
1744 ret->alloc((int)cells.size(),1);
1745 std::copy(cells.begin(),cells.end(),ret->getPointer());
1746 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1749 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1751 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1753 PyObject *ret = PyList_New(sz);
1754 for(int i=0;i<sz;i++)
1755 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1759 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1761 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1762 int sz=retCpp.size();
1763 PyObject *ret=PyList_New(sz);
1764 for(int i=0;i<sz;i++)
1765 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1769 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1772 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1773 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1774 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1777 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1780 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1781 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1785 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1788 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1789 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1793 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1795 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1796 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1797 PyObject *ret=PyTuple_New(3);
1798 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1799 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1800 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1804 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1806 DataArrayInt *tmp0=0,*tmp1=0;
1807 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1808 PyObject *ret=PyTuple_New(2);
1809 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1810 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1814 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1818 std::vector<int> multiVal;
1819 std::pair<int, std::pair<int,int> > slic;
1820 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1821 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1825 return self->duplicateNodes(&singleVal,&singleVal+1);
1827 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1829 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1831 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1835 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1839 std::vector<int> multiVal;
1840 std::pair<int, std::pair<int,int> > slic;
1841 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1842 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1846 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1848 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1850 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1852 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1856 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1859 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1860 if (!SWIG_IsOK(res1))
1863 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1864 self->renumberNodesInConn(tmp);
1868 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1870 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1871 da2->checkAllocated();
1872 self->renumberNodesInConn(da2->getConstPointer());
1876 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1879 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1880 DataArrayInt *tmp0,*tmp1=0;
1881 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1882 PyObject *ret=PyTuple_New(2);
1883 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1884 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1888 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1890 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1891 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1892 DataArrayInt *ret1=0,*ret2=0;
1893 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1894 PyObject *ret=PyTuple_New(3);
1895 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1896 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1897 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1901 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1903 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1904 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1905 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1906 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1909 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1912 std::vector<const MEDCouplingUMesh *> meshes;
1913 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1914 std::vector<DataArrayInt *> corr;
1915 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1917 PyObject *ret1=PyList_New(sz);
1918 for(int i=0;i<sz;i++)
1919 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1920 PyObject *ret=PyList_New(2);
1921 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1922 PyList_SetItem(ret,1,ret1);
1926 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1928 std::vector<MEDCouplingUMesh *> meshes;
1929 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1930 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1933 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1935 std::vector<MEDCouplingUMesh *> meshes;
1936 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1937 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1940 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1944 std::vector<int> multiVal;
1945 std::pair<int, std::pair<int,int> > slic;
1946 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1948 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1949 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1953 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1955 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1957 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1959 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1963 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1965 DataArrayInt *arrOut=0,*arrIndexOut=0;
1968 std::vector<int> multiVal;
1969 std::pair<int, std::pair<int,int> > slic;
1970 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1972 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1973 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1978 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
1983 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1988 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1992 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1994 PyObject *ret=PyTuple_New(2);
1995 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1996 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2000 static PyObject *SetPartOfIndexedArrays(PyObject *li,
2001 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2002 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2004 DataArrayInt *arrOut=0,*arrIndexOut=0;
2007 std::vector<int> multiVal;
2008 std::pair<int, std::pair<int,int> > slic;
2009 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2011 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2012 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2017 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2022 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2027 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2031 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2033 PyObject *ret=PyTuple_New(2);
2034 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2035 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2039 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2040 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2044 std::vector<int> multiVal;
2045 std::pair<int, std::pair<int,int> > slic;
2046 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2048 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2049 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2054 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2059 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2064 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2068 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2072 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2076 DataArrayDoubleTuple *aa;
2077 std::vector<double> bb;
2079 int spaceDim=self->getSpaceDimension();
2080 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2081 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2083 std::vector<int> cells;
2084 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2085 DataArrayInt *ret=DataArrayInt::New();
2086 ret->alloc((int)cells.size(),1);
2087 std::copy(cells.begin(),cells.end(),ret->getPointer());
2088 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2091 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2095 DataArrayDoubleTuple *aa;
2096 std::vector<double> bb;
2098 int spaceDim=self->getSpaceDimension();
2099 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2100 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2101 self->orientCorrectly2DCells(v,polyOnly);
2104 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2106 std::vector<int> cells;
2107 self->arePolyhedronsNotCorrectlyOriented(cells);
2108 DataArrayInt *ret=DataArrayInt::New();
2109 ret->alloc((int)cells.size(),1);
2110 std::copy(cells.begin(),cells.end(),ret->getPointer());
2111 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2114 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2118 self->getFastAveragePlaneOfThis(vec,pos);
2120 std::copy(vec,vec+3,vals);
2121 std::copy(pos,pos+3,vals+3);
2122 return convertDblArrToPyListOfTuple(vals,3,2);
2125 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2127 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2128 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2129 return MEDCouplingUMesh::MergeUMeshes(tmp);
2132 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2135 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2136 PyObject *ret=PyTuple_New(2);
2137 PyObject *ret0Py=ret0?Py_True:Py_False;
2139 PyTuple_SetItem(ret,0,ret0Py);
2140 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2144 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2147 bool ret0=self->areCellsIncludedIn2(other,ret1);
2148 PyObject *ret=PyTuple_New(2);
2149 PyObject *ret0Py=ret0?Py_True:Py_False;
2151 PyTuple_SetItem(ret,0,ret0Py);
2152 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156 PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2158 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2159 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2160 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2161 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2162 MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2163 PyObject *ret=PyTuple_New(5);
2164 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2165 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2167 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2174 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2175 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2176 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2177 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2178 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2179 PyObject *ret=PyTuple_New(5);
2180 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2181 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2182 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2190 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2191 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2192 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2193 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2194 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2195 PyObject *ret=PyTuple_New(5);
2196 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2197 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2206 DataArrayInt *neighbors=0,*neighborsIdx=0;
2207 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2208 PyObject *ret=PyTuple_New(2);
2209 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2216 DataArrayInt *neighbors=0,*neighborsIdx=0;
2217 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2218 PyObject *ret=PyTuple_New(2);
2219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2226 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2227 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2228 DataArrayInt *d2,*d3,*d4,*dd5;
2229 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2230 PyObject *ret=PyTuple_New(7);
2231 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2232 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2234 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2235 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2236 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2237 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2243 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2245 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2246 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2247 self->getReverseNodalConnectivity(d0,d1);
2248 PyObject *ret=PyTuple_New(2);
2249 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2250 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2256 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2259 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2260 da->checkAllocated();
2261 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2264 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2267 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2268 da->checkAllocated();
2269 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2272 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2275 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2276 da->checkAllocated();
2277 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2280 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2283 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2284 da->checkAllocated();
2285 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2286 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2287 PyObject *res = PyList_New(result.size());
2288 for (int i=0;iL!=result.end(); i++, iL++)
2289 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2293 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2296 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2297 da->checkAllocated();
2298 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2299 ret->setName(da->getName().c_str());
2303 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2306 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2307 if (!SWIG_IsOK(res1))
2310 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2311 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2315 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2317 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2318 da2->checkAllocated();
2319 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2323 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2326 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2327 PyObject *ret=PyTuple_New(2);
2328 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2329 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2333 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2335 DataArrayInt *cellNb1=0,*cellNb2=0;
2336 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2337 PyObject *ret=PyTuple_New(3);
2338 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2339 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2340 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2346 int spaceDim=self->getSpaceDimension();
2348 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2350 DataArrayDouble *a,*a2;
2351 DataArrayDoubleTuple *aa,*aa2;
2352 std::vector<double> bb,bb2;
2354 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2355 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2356 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2357 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2359 DataArrayInt *cellIds=0;
2360 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2361 PyObject *ret=PyTuple_New(2);
2362 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2369 int spaceDim=self->getSpaceDimension();
2371 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2373 DataArrayDouble *a,*a2;
2374 DataArrayDoubleTuple *aa,*aa2;
2375 std::vector<double> bb,bb2;
2377 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2378 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2379 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2380 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2382 DataArrayInt *cellIds=0;
2383 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2384 PyObject *ret=PyTuple_New(2);
2385 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2386 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2392 int spaceDim=self->getSpaceDimension();
2394 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2396 DataArrayDouble *a,*a2;
2397 DataArrayDoubleTuple *aa,*aa2;
2398 std::vector<double> bb,bb2;
2400 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2401 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2402 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2403 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2404 return self->getCellIdsCrossingPlane(orig,vect,eps);
2407 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2411 std::vector<int> pos2;
2412 DataArrayInt *pos3=0;
2413 DataArrayIntTuple *pos4=0;
2414 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2419 self->convertToPolyTypes(&pos1,&pos1+1);
2426 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2431 self->convertToPolyTypes(pos3->begin(),pos3->end());
2435 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2439 void convertAllToPoly();
2440 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2441 bool unPolyze() throw(INTERP_KERNEL::Exception);
2442 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2443 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2444 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2447 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2450 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2451 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2452 void updateTime() const throw(INTERP_KERNEL::Exception);
2454 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2456 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2459 std::string __str__() const throw(INTERP_KERNEL::Exception)
2461 return self->simpleRepr();
2463 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2465 MEDCouplingUMesh *ret=self->getMesh2D();
2467 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2469 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2471 MEDCouplingUMesh *ret=self->getMesh1D();
2473 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2475 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2477 DataArrayInt *ret=self->getMesh3DIds();
2479 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2484 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2487 void updateTime() const throw(INTERP_KERNEL::Exception);
2488 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2489 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2492 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2495 static MEDCouplingCMesh *New();
2496 static MEDCouplingCMesh *New(const char *meshName);
2497 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2498 void setCoords(const DataArrayDouble *coordsX,
2499 const DataArrayDouble *coordsY=0,
2500 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2501 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2505 return MEDCouplingCMesh::New();
2507 MEDCouplingCMesh(const char *meshName)
2509 return MEDCouplingCMesh::New(meshName);
2511 std::string __str__() const throw(INTERP_KERNEL::Exception)
2513 return self->simpleRepr();
2515 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2517 DataArrayDouble *ret=self->getCoordsAt(i);
2525 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2528 static MEDCouplingCurveLinearMesh *New();
2529 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2530 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2531 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2532 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2534 MEDCouplingCurveLinearMesh()
2536 return MEDCouplingCurveLinearMesh::New();
2538 MEDCouplingCurveLinearMesh(const char *meshName)
2540 return MEDCouplingCurveLinearMesh::New(meshName);
2542 std::string __str__() const throw(INTERP_KERNEL::Exception)
2544 return self->simpleRepr();
2546 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2548 DataArrayDouble *ret=self->getCoords();
2553 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2555 int szArr,sw,iTypppArr;
2556 std::vector<int> stdvecTyyppArr;
2557 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2558 self->setNodeGridStructure(tmp,tmp+szArr);
2564 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2566 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2569 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2570 PyObject *ret=PyTuple_New(2);
2571 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2572 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2577 %extend ParaMEDMEM::DataArrayDoubleIterator
2581 DataArrayDoubleTuple *ret=self->nextt();
2583 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2586 PyErr_SetString(PyExc_StopIteration,"No more data.");
2592 %extend ParaMEDMEM::DataArrayDoubleTuple
2594 std::string __str__() const
2596 return self->repr();
2599 double __float__() const throw(INTERP_KERNEL::Exception)
2601 return self->doubleValue();
2604 DataArrayDouble *buildDADouble()
2606 return self->buildDADouble(1,self->getNumberOfCompo());
2609 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2611 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2612 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2613 Py_XINCREF(trueSelf);
2617 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2619 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2620 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2621 Py_XINCREF(trueSelf);
2625 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2627 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2628 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2629 Py_XINCREF(trueSelf);
2633 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2635 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2636 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2637 Py_XINCREF(trueSelf);
2641 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2645 std::vector<int> multiVal;
2646 std::pair<int, std::pair<int,int> > slic;
2647 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2648 const double *pt=self->getConstPointer();
2649 int nbc=self->getNumberOfCompo();
2650 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2657 std::ostringstream oss;
2658 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2659 throw INTERP_KERNEL::Exception(oss.str().c_str());
2662 return PyFloat_FromDouble(pt[singleVal]);
2666 return PyFloat_FromDouble(pt[nbc+singleVal]);
2669 std::ostringstream oss;
2670 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2671 throw INTERP_KERNEL::Exception(oss.str().c_str());
2677 PyObject *t=PyTuple_New(multiVal.size());
2678 for(int j=0;j<(int)multiVal.size();j++)
2680 int cid=multiVal[j];
2683 std::ostringstream oss;
2684 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2685 throw INTERP_KERNEL::Exception(oss.str().c_str());
2687 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2693 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2694 PyObject *t=PyTuple_New(sz);
2695 for(int j=0;j<sz;j++)
2696 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2700 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2704 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2706 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2709 std::vector<double> multiValV;
2710 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2711 int nbc=self->getNumberOfCompo();
2712 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2714 std::vector<int> multiVal;
2715 std::pair<int, std::pair<int,int> > slic;
2716 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2717 double *pt=self->getPointer();
2718 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2725 std::ostringstream oss;
2726 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2727 throw INTERP_KERNEL::Exception(oss.str().c_str());
2733 pt[singleVal]=singleValV;
2738 if(multiValV.size()!=1)
2740 std::ostringstream oss;
2741 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2742 throw INTERP_KERNEL::Exception(oss.str().c_str());
2744 pt[singleVal]=multiValV[0];
2749 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2753 throw INTERP_KERNEL::Exception(msg);
2762 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2766 std::ostringstream oss;
2767 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2768 throw INTERP_KERNEL::Exception(oss.str().c_str());
2776 if(multiVal.size()!=multiValV.size())
2778 std::ostringstream oss;
2779 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2780 throw INTERP_KERNEL::Exception(oss.str().c_str());
2782 for(int i=0;i<(int)multiVal.size();i++)
2784 int pos=multiVal[i];
2787 std::ostringstream oss;
2788 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2789 throw INTERP_KERNEL::Exception(oss.str().c_str());
2791 pt[multiVal[i]]=multiValV[i];
2797 const double *ptV=daIntTyyppV->getConstPointer();
2798 if(nbc>daIntTyyppV->getNumberOfCompo())
2800 std::ostringstream oss;
2801 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2802 throw INTERP_KERNEL::Exception(oss.str().c_str());
2804 std::copy(ptV,ptV+nbc,pt);
2808 throw INTERP_KERNEL::Exception(msg);
2813 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2818 for(int j=0;j<sz;j++)
2819 pt[slic.first+j*slic.second.second]=singleValV;
2824 if(sz!=(int)multiValV.size())
2826 std::ostringstream oss;
2827 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2828 throw INTERP_KERNEL::Exception(oss.str().c_str());
2830 for(int j=0;j<sz;j++)
2831 pt[slic.first+j*slic.second.second]=multiValV[j];
2836 const double *ptV=daIntTyyppV->getConstPointer();
2837 if(sz>daIntTyyppV->getNumberOfCompo())
2839 std::ostringstream oss;
2840 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2841 throw INTERP_KERNEL::Exception(oss.str().c_str());
2843 for(int j=0;j<sz;j++)
2844 pt[slic.first+j*slic.second.second]=ptV[j];
2848 throw INTERP_KERNEL::Exception(msg);
2852 throw INTERP_KERNEL::Exception(msg);
2857 %extend ParaMEDMEM::DataArrayDouble
2859 DataArrayDouble() throw(INTERP_KERNEL::Exception)
2861 return DataArrayDouble::New();
2864 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2866 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) !";
2867 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2871 if(PyInt_Check(nbOfTuples))
2873 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2875 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2878 if(PyInt_Check(elt2))
2879 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2880 int nbOfCompo=PyInt_AS_LONG(elt2);
2882 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2883 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2884 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
2885 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2890 throw INTERP_KERNEL::Exception(msg);
2893 {//DataArrayDouble.New([1.,3.,4.],3)
2894 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2896 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
2897 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2903 throw INTERP_KERNEL::Exception(msg);
2906 {// DataArrayDouble.New([1.,3.,4.])
2907 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2908 int tmpp1=-1,tmpp2=-1;
2909 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
2910 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2915 else if(PyInt_Check(elt0))
2917 int nbOfTuples1=PyInt_AS_LONG(elt0);
2919 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2924 if(PyInt_Check(nbOfTuples))
2925 {//DataArrayDouble.New(5,2)
2926 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2928 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2929 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2930 ret->alloc(nbOfTuples1,nbOfCompo);
2935 throw INTERP_KERNEL::Exception(msg);
2938 throw INTERP_KERNEL::Exception(msg);
2941 {//DataArrayDouble.New(5)
2942 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2943 ret->alloc(nbOfTuples1,1);
2949 throw INTERP_KERNEL::Exception(msg);
2952 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2954 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
2957 std::string __str__() const
2959 return self->repr();
2962 double __float__() const throw(INTERP_KERNEL::Exception)
2964 return self->doubleValue();
2967 int __len__() const throw(INTERP_KERNEL::Exception)
2969 if(self->isAllocated())
2971 return self->getNumberOfTuples();
2975 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2979 DataArrayDoubleIterator *__iter__()
2981 return self->iterator();
2984 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2986 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 !";
2987 if(PyList_Check(li) || PyTuple_Check(li))
2991 if(PyInt_Check(nbOfTuples))
2993 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2995 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
2998 if(PyInt_Check(nbOfComp))
2999 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
3000 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
3002 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
3003 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
3004 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3007 throw INTERP_KERNEL::Exception(msg);
3010 {//DataArrayDouble.setValues([1.,3.,4.],3)
3012 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
3013 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3017 throw INTERP_KERNEL::Exception(msg);
3020 {// DataArrayDouble.setValues([1.,3.,4.])
3021 int tmpp1=-1,tmpp2=-1;
3022 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
3023 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3027 throw INTERP_KERNEL::Exception(msg);
3030 PyObject *getValues() throw(INTERP_KERNEL::Exception)
3032 const double *vals=self->getPointer();
3033 return convertDblArrToPyList(vals,self->getNbOfElems());
3036 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
3039 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
3040 PyObject *ret=PyTuple_New(2);
3041 PyObject *ret0Py=ret0?Py_True:Py_False;
3043 PyTuple_SetItem(ret,0,ret0Py);
3044 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3048 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
3050 const double *vals=self->getPointer();
3051 int nbOfComp=self->getNumberOfComponents();
3052 int nbOfTuples=self->getNumberOfTuples();
3053 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3056 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3059 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3060 if (!SWIG_IsOK(res1))
3063 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3064 if(size!=self->getNumberOfTuples())
3066 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3068 return self->renumber(tmp);
3072 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3074 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3075 da2->checkAllocated();
3076 int size=self->getNumberOfTuples();
3077 if(size!=self->getNumberOfTuples())
3079 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3081 return self->renumber(da2->getConstPointer());
3085 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3088 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3089 if (!SWIG_IsOK(res1))
3092 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3093 if(size!=self->getNumberOfTuples())
3095 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3097 return self->renumberR(tmp);
3101 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3103 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3104 da2->checkAllocated();
3105 int size=self->getNumberOfTuples();
3106 if(size!=self->getNumberOfTuples())
3108 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3110 return self->renumberR(da2->getConstPointer());
3114 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3117 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3118 if (!SWIG_IsOK(res1))
3121 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3122 if(size!=self->getNumberOfTuples())
3124 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3126 return self->renumberAndReduce(tmp,newNbOfTuple);
3130 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3132 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3133 da2->checkAllocated();
3134 int size=self->getNumberOfTuples();
3135 if(size!=self->getNumberOfTuples())
3137 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3139 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3143 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
3146 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3147 if (!SWIG_IsOK(res1))
3150 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3151 if(size!=self->getNumberOfTuples())
3153 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3155 self->renumberInPlace(tmp);
3159 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3161 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3162 da2->checkAllocated();
3163 int size=self->getNumberOfTuples();
3164 if(size!=self->getNumberOfTuples())
3166 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3168 self->renumberInPlace(da2->getConstPointer());
3172 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
3175 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3176 if (!SWIG_IsOK(res1))
3179 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3180 if(size!=self->getNumberOfTuples())
3182 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3184 self->renumberInPlaceR(tmp);
3188 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3190 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3191 da2->checkAllocated();
3192 int size=self->getNumberOfTuples();
3193 if(size!=self->getNumberOfTuples())
3195 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3197 self->renumberInPlaceR(da2->getConstPointer());
3201 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3204 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3205 if (!SWIG_IsOK(res1))
3208 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3209 return self->selectByTupleId(tmp,tmp+size);
3213 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3215 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3216 da2->checkAllocated();
3217 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3221 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3224 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3225 if (!SWIG_IsOK(res1))
3228 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3229 return self->selectByTupleIdSafe(tmp,tmp+size);
3233 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3235 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3236 da2->checkAllocated();
3237 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3241 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3244 double r1=self->getMaxValue(tmp);
3245 PyObject *ret=PyTuple_New(2);
3246 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3247 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3251 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3254 double r1=self->getMaxValue2(tmp);
3255 PyObject *ret=PyTuple_New(2);
3256 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3257 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3261 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3264 double r1=self->getMinValue(tmp);
3265 PyObject *ret=PyTuple_New(2);
3266 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3267 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3271 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3274 double r1=self->getMinValue2(tmp);
3275 PyObject *ret=PyTuple_New(2);
3276 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3277 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3281 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3283 int nbOfCompo=self->getNumberOfComponents();
3284 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3285 self->getMinMaxPerComponent(tmp);
3286 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3290 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3292 int sz=self->getNumberOfComponents();
3293 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3294 self->accumulate(tmp);
3295 return convertDblArrToPyList(tmp,sz);
3298 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3300 std::vector<int> tmp;
3301 convertPyToNewIntArr3(li,tmp);
3302 return self->keepSelectedComponents(tmp);
3305 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3307 DataArrayInt *comm, *commIndex;
3308 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3309 PyObject *res = PyList_New(2);
3310 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3311 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3315 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
3319 DataArrayDoubleTuple *aa;
3320 std::vector<double> bb;
3322 int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
3323 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
3325 int cellId=-1,nodeId=-1;
3326 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
3327 PyObject *ret=PyTuple_New(2);
3328 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
3329 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
3333 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3335 std::vector<int> tmp;
3336 convertPyToNewIntArr3(li,tmp);
3337 self->setSelectedComponents(a,tmp);
3340 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3342 int sz=self->getNumberOfComponents();
3343 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3344 self->getTuple(tupleId,tmp);
3345 return convertDblArrToPyList(tmp,sz);
3348 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3350 std::vector<const DataArrayDouble *> tmp;
3351 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3352 return DataArrayDouble::Aggregate(tmp);
3355 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3357 std::vector<const DataArrayDouble *> tmp;
3358 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3359 return DataArrayDouble::Meld(tmp);
3362 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3364 std::vector<std::pair<int,int> > ranges;
3365 convertPyToVectorPairInt(li,ranges);
3366 return self->selectByTupleRanges(ranges);
3369 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3373 DataArrayDoubleTuple *aa;
3374 std::vector<double> bb;
3376 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3377 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3378 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3379 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3380 DataArrayInt *c=0,*cI=0;
3381 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3382 PyObject *ret=PyTuple_New(2);
3383 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3384 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3388 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3390 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3391 self->checkAllocated();
3392 int nbOfTuples=self->getNumberOfTuples();
3393 int nbOfComponents=self->getNumberOfComponents();
3395 std::vector<int> vt1,vc1;
3396 std::pair<int, std::pair<int,int> > pt1,pc1;
3397 DataArrayInt *dt1=0,*dc1=0;
3399 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3400 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3404 if(nbOfComponents==1)
3405 return PyFloat_FromDouble(self->getIJSafe(it1,0));
3406 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3408 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3410 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3412 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3414 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3417 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3418 std::vector<int> v2(1,ic1);
3419 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3423 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3424 std::vector<int> v2(1,ic1);
3425 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3429 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3430 std::vector<int> v2(1,ic1);
3431 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3435 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3436 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3440 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3441 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3445 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3446 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3450 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3451 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3455 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3456 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3457 std::vector<int> v2(nbOfComp);
3458 for(int i=0;i<nbOfComp;i++)
3459 v2[i]=pc1.first+i*pc1.second.second;
3460 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3464 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3465 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3466 std::vector<int> v2(nbOfComp);
3467 for(int i=0;i<nbOfComp;i++)
3468 v2[i]=pc1.first+i*pc1.second.second;
3469 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3473 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3474 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3475 std::vector<int> v2(nbOfComp);
3476 for(int i=0;i<nbOfComp;i++)
3477 v2[i]=pc1.first+i*pc1.second.second;
3478 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3482 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3483 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3484 std::vector<int> v2(nbOfComp);
3485 for(int i=0;i<nbOfComp;i++)
3486 v2[i]=pc1.first+i*pc1.second.second;
3487 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3490 throw INTERP_KERNEL::Exception(msg);
3494 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3496 self->checkAllocated();
3497 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3498 int nbOfTuples=self->getNumberOfTuples();
3499 int nbOfComponents=self->getNumberOfComponents();
3502 std::vector<double> v1;
3503 DataArrayDouble *d1=0;
3504 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3506 std::vector<int> vt1,vc1;
3507 std::pair<int, std::pair<int,int> > pt1,pc1;
3508 DataArrayInt *dt1=0,*dc1=0;
3509 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3510 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3518 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3521 tmp=DataArrayDouble::New();
3522 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3523 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3526 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3529 throw INTERP_KERNEL::Exception(msg);
3538 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3541 tmp=DataArrayDouble::New();
3542 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3543 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3546 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3549 throw INTERP_KERNEL::Exception(msg);
3558 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3561 tmp=DataArrayDouble::New();
3562 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3563 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3566 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3569 throw INTERP_KERNEL::Exception(msg);
3578 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3581 tmp=DataArrayDouble::New();
3582 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3583 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3586 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3589 throw INTERP_KERNEL::Exception(msg);
3598 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3601 tmp=DataArrayDouble::New();
3602 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3603 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3606 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3609 throw INTERP_KERNEL::Exception(msg);
3618 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3621 tmp=DataArrayDouble::New();
3622 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3623 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3626 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3629 throw INTERP_KERNEL::Exception(msg);
3638 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3641 tmp=DataArrayDouble::New();
3642 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3643 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3646 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3649 throw INTERP_KERNEL::Exception(msg);
3658 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3661 tmp=DataArrayDouble::New();
3662 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3663 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3666 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3669 throw INTERP_KERNEL::Exception(msg);
3678 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3681 tmp=DataArrayDouble::New();
3682 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3683 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3686 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3689 throw INTERP_KERNEL::Exception(msg);
3698 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3701 tmp=DataArrayDouble::New();
3702 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3703 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3706 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3709 throw INTERP_KERNEL::Exception(msg);
3718 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3721 tmp=DataArrayDouble::New();
3722 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3723 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3726 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3729 throw INTERP_KERNEL::Exception(msg);
3738 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3741 tmp=DataArrayDouble::New();
3742 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3743 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3746 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3749 throw INTERP_KERNEL::Exception(msg);
3758 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3761 tmp=DataArrayDouble::New();
3762 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3763 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3766 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3769 throw INTERP_KERNEL::Exception(msg);
3778 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3781 tmp=DataArrayDouble::New();
3782 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3783 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3786 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3789 throw INTERP_KERNEL::Exception(msg);
3798 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3801 tmp=DataArrayDouble::New();
3802 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3803 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3806 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3809 throw INTERP_KERNEL::Exception(msg);
3818 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3821 tmp=DataArrayDouble::New();
3822 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3823 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3826 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3829 throw INTERP_KERNEL::Exception(msg);
3834 throw INTERP_KERNEL::Exception(msg);
3839 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3841 return self->negate();
3844 DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3846 const char msg[]="Unexpected situation in __add__ !";
3849 DataArrayDoubleTuple *aa;
3850 std::vector<double> bb;
3852 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3857 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3858 ret->applyLin(1.,val);
3864 return DataArrayDouble::Add(self,a);
3868 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3869 return DataArrayDouble::Add(self,aaa);
3873 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3874 return DataArrayDouble::Add(self,aaa);
3877 throw INTERP_KERNEL::Exception(msg);
3881 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3883 const char msg[]="Unexpected situation in __radd__ !";
3886 DataArrayDoubleTuple *aa;
3887 std::vector<double> bb;
3889 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3894 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3895 ret->applyLin(1.,val);
3901 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3902 return DataArrayDouble::Add(self,aaa);
3906 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3907 return DataArrayDouble::Add(self,aaa);
3910 throw INTERP_KERNEL::Exception(msg);
3914 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3916 const char msg[]="Unexpected situation in __iadd__ !";
3919 DataArrayDoubleTuple *aa;
3920 std::vector<double> bb;
3922 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3927 self->applyLin(1.,val);
3928 Py_XINCREF(trueSelf);
3934 Py_XINCREF(trueSelf);
3939 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3940 self->addEqual(aaa);
3941 Py_XINCREF(trueSelf);
3946 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3947 self->addEqual(aaa);
3948 Py_XINCREF(trueSelf);
3952 throw INTERP_KERNEL::Exception(msg);
3956 DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3958 const char msg[]="Unexpected situation in __sub__ !";
3961 DataArrayDoubleTuple *aa;
3962 std::vector<double> bb;
3964 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3969 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3970 ret->applyLin(1.,-val);
3976 return DataArrayDouble::Substract(self,a);
3980 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3981 return DataArrayDouble::Substract(self,aaa);
3985 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3986 return DataArrayDouble::Substract(self,aaa);
3989 throw INTERP_KERNEL::Exception(msg);
3993 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3995 const char msg[]="Unexpected situation in __rsub__ !";
3998 DataArrayDoubleTuple *aa;
3999 std::vector<double> bb;
4001 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4006 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4007 ret->applyLin(-1.,val);
4013 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4014 return DataArrayDouble::Substract(aaa,self);
4018 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4019 return DataArrayDouble::Substract(aaa,self);
4022 throw INTERP_KERNEL::Exception(msg);
4026 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4028 const char msg[]="Unexpected situation in __isub__ !";
4031 DataArrayDoubleTuple *aa;
4032 std::vector<double> bb;
4034 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4039 self->applyLin(1,-val);
4040 Py_XINCREF(trueSelf);
4045 self->substractEqual(a);
4046 Py_XINCREF(trueSelf);
4051 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4052 self->substractEqual(aaa);
4053 Py_XINCREF(trueSelf);
4058 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4059 self->substractEqual(aaa);
4060 Py_XINCREF(trueSelf);
4064 throw INTERP_KERNEL::Exception(msg);
4068 DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4070 const char msg[]="Unexpected situation in __mul__ !";
4073 DataArrayDoubleTuple *aa;
4074 std::vector<double> bb;
4076 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4081 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4082 ret->applyLin(val,0.);
4088 return DataArrayDouble::Multiply(self,a);
4092 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4093 return DataArrayDouble::Multiply(self,aaa);
4097 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4098 return DataArrayDouble::Multiply(self,aaa);
4101 throw INTERP_KERNEL::Exception(msg);
4105 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4107 const char msg[]="Unexpected situation in __rmul__ !";
4110 DataArrayDoubleTuple *aa;
4111 std::vector<double> bb;
4113 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4118 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4119 ret->applyLin(val,0.);
4125 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4126 return DataArrayDouble::Multiply(self,aaa);
4130 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4131 return DataArrayDouble::Multiply(self,aaa);
4134 throw INTERP_KERNEL::Exception(msg);
4138 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4140 const char msg[]="Unexpected situation in __imul__ !";
4143 DataArrayDoubleTuple *aa;
4144 std::vector<double> bb;
4146 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4151 self->applyLin(val,0.);
4152 Py_XINCREF(trueSelf);
4157 self->multiplyEqual(a);
4158 Py_XINCREF(trueSelf);
4163 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4164 self->multiplyEqual(aaa);
4165 Py_XINCREF(trueSelf);
4170 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4171 self->multiplyEqual(aaa);
4172 Py_XINCREF(trueSelf);
4176 throw INTERP_KERNEL::Exception(msg);
4180 DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4182 const char msg[]="Unexpected situation in __div__ !";
4185 DataArrayDoubleTuple *aa;
4186 std::vector<double> bb;
4188 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4194 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4195 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4196 ret->applyLin(1/val,0.);
4202 return DataArrayDouble::Divide(self,a);
4206 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4207 return DataArrayDouble::Divide(self,aaa);
4211 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4212 return DataArrayDouble::Divide(self,aaa);
4215 throw INTERP_KERNEL::Exception(msg);
4219 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4221 const char msg[]="Unexpected situation in __rdiv__ !";
4224 DataArrayDoubleTuple *aa;
4225 std::vector<double> bb;
4227 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4232 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4239 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4240 return DataArrayDouble::Divide(aaa,self);
4244 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4245 return DataArrayDouble::Divide(aaa,self);
4248 throw INTERP_KERNEL::Exception(msg);
4252 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4254 const char msg[]="Unexpected situation in __idiv__ !";
4257 DataArrayDoubleTuple *aa;
4258 std::vector<double> bb;
4260 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4266 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4267 self->applyLin(1./val,0.);
4268 Py_XINCREF(trueSelf);
4273 self->divideEqual(a);
4274 Py_XINCREF(trueSelf);
4279 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4280 self->divideEqual(aaa);
4281 Py_XINCREF(trueSelf);
4286 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4287 self->divideEqual(aaa);
4288 Py_XINCREF(trueSelf);
4292 throw INTERP_KERNEL::Exception(msg);
4296 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4298 DataArrayInt *c=0,*cI=0;
4300 self->computeTupleIdsNearTuples(other,eps,c,cI);
4301 PyObject *ret=PyTuple_New(2);
4302 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4303 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4308 %extend ParaMEDMEM::DataArrayIntTuple
4310 std::string __str__() const
4312 return self->repr();
4315 int __int__() const throw(INTERP_KERNEL::Exception)
4317 return self->intValue();
4320 DataArrayInt *buildDAInt()
4322 return self->buildDAInt(1,self->getNumberOfCompo());
4325 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4327 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4328 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4329 Py_XINCREF(trueSelf);
4333 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4335 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4336 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4337 Py_XINCREF(trueSelf);
4341 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4343 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4344 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4345 Py_XINCREF(trueSelf);
4349 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4351 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4352 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4353 Py_XINCREF(trueSelf);
4357 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4359 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4360 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4361 Py_XINCREF(trueSelf);
4365 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4369 std::vector<int> multiVal;
4370 std::pair<int, std::pair<int,int> > slic;
4371 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4372 const int *pt=self->getConstPointer();
4373 int nbc=self->getNumberOfCompo();
4374 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4381 std::ostringstream oss;
4382 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4383 throw INTERP_KERNEL::Exception(oss.str().c_str());
4386 return PyInt_FromLong(pt[singleVal]);
4390 return PyInt_FromLong(pt[nbc+singleVal]);
4393 std::ostringstream oss;
4394 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4395 throw INTERP_KERNEL::Exception(oss.str().c_str());
4401 PyObject *t=PyTuple_New(multiVal.size());
4402 for(int j=0;j<(int)multiVal.size();j++)
4404 int cid=multiVal[j];
4407 std::ostringstream oss;
4408 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4409 throw INTERP_KERNEL::Exception(oss.str().c_str());
4411 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4417 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4418 PyObject *t=PyTuple_New(sz);
4419 for(int j=0;j<sz;j++)
4420 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4424 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4428 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4430 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4433 std::vector<int> multiValV;
4434 std::pair<int, std::pair<int,int> > slicV;
4435 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4436 int nbc=self->getNumberOfCompo();
4437 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4439 std::vector<int> multiVal;
4440 std::pair<int, std::pair<int,int> > slic;
4441 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4442 int *pt=self->getPointer();
4443 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4450 std::ostringstream oss;
4451 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4452 throw INTERP_KERNEL::Exception(oss.str().c_str());
4458 pt[singleVal]=singleValV;
4463 if(multiValV.size()!=1)
4465 std::ostringstream oss;
4466 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4467 throw INTERP_KERNEL::Exception(oss.str().c_str());
4469 pt[singleVal]=multiValV[0];
4474 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4478 throw INTERP_KERNEL::Exception(msg);
4487 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4491 std::ostringstream oss;
4492 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4493 throw INTERP_KERNEL::Exception(oss.str().c_str());
4501 if(multiVal.size()!=multiValV.size())
4503 std::ostringstream oss;
4504 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4505 throw INTERP_KERNEL::Exception(oss.str().c_str());
4507 for(int i=0;i<(int)multiVal.size();i++)
4509 int pos=multiVal[i];
4512 std::ostringstream oss;
4513 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4514 throw INTERP_KERNEL::Exception(oss.str().c_str());
4516 pt[multiVal[i]]=multiValV[i];
4522 const int *ptV=daIntTyyppV->getConstPointer();
4523 if(nbc>daIntTyyppV->getNumberOfCompo())
4525 std::ostringstream oss;
4526 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4527 throw INTERP_KERNEL::Exception(oss.str().c_str());
4529 std::copy(ptV,ptV+nbc,pt);
4533 throw INTERP_KERNEL::Exception(msg);
4538 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4543 for(int j=0;j<sz;j++)
4544 pt[slic.first+j*slic.second.second]=singleValV;
4549 if(sz!=(int)multiValV.size())
4551 std::ostringstream oss;
4552 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4553 throw INTERP_KERNEL::Exception(oss.str().c_str());
4555 for(int j=0;j<sz;j++)
4556 pt[slic.first+j*slic.second.second]=multiValV[j];
4561 const int *ptV=daIntTyyppV->getConstPointer();
4562 if(sz>daIntTyyppV->getNumberOfCompo())
4564 std::ostringstream oss;
4565 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4566 throw INTERP_KERNEL::Exception(oss.str().c_str());
4568 for(int j=0;j<sz;j++)
4569 pt[slic.first+j*slic.second.second]=ptV[j];
4573 throw INTERP_KERNEL::Exception(msg);
4577 throw INTERP_KERNEL::Exception(msg);
4582 %extend ParaMEDMEM::DataArrayIntIterator
4586 DataArrayIntTuple *ret=self->nextt();
4588 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4591 PyErr_SetString(PyExc_StopIteration,"No more data.");
4597 %extend ParaMEDMEM::DataArrayInt
4599 DataArrayInt() throw(INTERP_KERNEL::Exception)
4601 return DataArrayInt::New();
4604 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4606 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) !";
4607 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4611 if(PyInt_Check(nbOfTuples))
4613 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4615 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4618 if(PyInt_Check(nbOfComp))
4619 {//DataArrayInt.New([1,3,4,5],2,2)
4620 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4622 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4623 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4624 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4625 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4630 throw INTERP_KERNEL::Exception(msg);
4633 {//DataArrayInt.New([1,3,4],3)
4634 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4636 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4637 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4643 throw INTERP_KERNEL::Exception(msg);
4646 {// DataArrayInt.New([1,3,4])
4647 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4648 int tmpp1=-1,tmpp2=-1;
4649 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4650 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4655 else if(PyInt_Check(elt0))
4657 int nbOfTuples1=PyInt_AS_LONG(elt0);
4659 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4664 if(PyInt_Check(nbOfTuples))
4665 {//DataArrayInt.New(5,2)
4666 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4668 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4669 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4670 ret->alloc(nbOfTuples1,nbOfCompo);
4675 throw INTERP_KERNEL::Exception(msg);
4678 throw INTERP_KERNEL::Exception(msg);
4681 {//DataArrayInt.New(5)
4682 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4683 ret->alloc(nbOfTuples1,1);
4689 throw INTERP_KERNEL::Exception(msg);
4692 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4694 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4697 std::string __str__() const
4699 return self->repr();
4702 int __len__() const throw(INTERP_KERNEL::Exception)
4704 if(self->isAllocated())
4706 return self->getNumberOfTuples();
4710 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4714 int __int__() const throw(INTERP_KERNEL::Exception)
4716 return self->intValue();
4719 DataArrayIntIterator *__iter__()
4721 return self->iterator();
4724 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4726 int sz=self->getNumberOfComponents();
4727 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4728 self->accumulate(tmp);
4729 return convertIntArrToPyList(tmp,sz);
4732 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
4734 int newNbOfTuples=-1;
4735 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
4736 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
4737 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
4738 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
4739 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
4740 PyObject *ret=PyTuple_New(2);
4741 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4742 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4746 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4748 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 !";
4749 if(PyList_Check(li) || PyTuple_Check(li))
4753 if(PyInt_Check(nbOfTuples))
4755 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4757 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
4760 if(PyInt_Check(nbOfComp))
4761 {//DataArrayInt.setValues([1,3,4,5],2,2)
4762 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4764 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
4765 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
4766 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4769 throw INTERP_KERNEL::Exception(msg);
4772 {//DataArrayInt.setValues([1,3,4],3)
4774 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
4775 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4779 throw INTERP_KERNEL::Exception(msg);
4782 {// DataArrayInt.setValues([1,3,4])
4783 int tmpp1=-1,tmpp2=-1;
4784 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
4785 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4789 throw INTERP_KERNEL::Exception(msg);
4792 PyObject *getValues() throw(INTERP_KERNEL::Exception)
4794 const int *vals=self->getPointer();
4795 return convertIntArrToPyList(vals,self->getNbOfElems());
4798 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4801 bool ret0=self->isEqualIfNotWhy(other,ret1);
4802 PyObject *ret=PyTuple_New(2);
4803 PyObject *ret0Py=ret0?Py_True:Py_False;
4805 PyTuple_SetItem(ret,0,ret0Py);
4806 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4810 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4812 const int *vals=self->getPointer();
4813 int nbOfComp=self->getNumberOfComponents();
4814 int nbOfTuples=self->getNumberOfTuples();
4815 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4818 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4820 std::vector<const DataArrayInt *> groups;
4821 std::vector< std::vector<int> > fidsOfGroups;
4822 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4823 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4824 PyObject *ret = PyList_New(2);
4825 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4826 int sz=fidsOfGroups.size();
4827 PyObject *ret1 = PyList_New(sz);
4828 for(int i=0;i<sz;i++)
4829 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4830 PyList_SetItem(ret,1,ret1);
4834 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
4837 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4838 if (!SWIG_IsOK(res1))
4841 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4842 self->transformWithIndArr(tmp,tmp+size);
4846 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4847 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4851 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4855 std::vector<int> multiVal;
4856 std::pair<int, std::pair<int,int> > slic;
4857 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4858 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4862 return self->getIdsEqualList(&singleVal,&singleVal+1);
4864 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4866 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4868 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4872 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4876 std::vector<int> multiVal;
4877 std::pair<int, std::pair<int,int> > slic;
4878 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4879 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4883 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4885 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4887 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4889 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4893 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4895 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
4897 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4898 if (!SWIG_IsOK(res1))
4901 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4902 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4906 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4908 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4909 da2->checkAllocated();
4910 int size=self->getNumberOfTuples();
4911 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4913 PyObject *ret = PyList_New(3);
4914 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4915 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4916 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4920 DataArrayInt *transformWithIndArrR(PyObject *li) const
4923 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4924 if (!SWIG_IsOK(res1))
4927 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4928 return self->transformWithIndArrR(tmp,tmp+size);
4932 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4933 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4937 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4940 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4941 if (!SWIG_IsOK(res1))
4944 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4945 if(size!=self->getNumberOfTuples())
4947 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4949 self->renumberInPlace(tmp);
4953 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4955 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4956 da2->checkAllocated();
4957 int size=self->getNumberOfTuples();
4958 if(size!=self->getNumberOfTuples())
4960 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4962 self->renumberInPlace(da2->getConstPointer());
4966 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4969 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4970 if (!SWIG_IsOK(res1))
4973 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4974 if(size!=self->getNumberOfTuples())
4976 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4978 self->renumberInPlaceR(tmp);
4982 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4984 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4985 da2->checkAllocated();
4986 int size=self->getNumberOfTuples();
4987 if(size!=self->getNumberOfTuples())
4989 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4991 self->renumberInPlaceR(da2->getConstPointer());
4995 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4998 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4999 if (!SWIG_IsOK(res1))
5002 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5003 if(size!=self->getNumberOfTuples())
5005 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5007 return self->renumberAndReduce(tmp,newNbOfTuple);
5011 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5013 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5014 da2->checkAllocated();
5015 int size=self->getNumberOfTuples();
5016 if(size!=self->getNumberOfTuples())
5018 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5020 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5024 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5027 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5028 if (!SWIG_IsOK(res1))
5031 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5032 if(size!=self->getNumberOfTuples())
5034 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5036 return self->renumber(tmp);
5040 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5042 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5043 da2->checkAllocated();
5044 int size=self->getNumberOfTuples();
5045 if(size!=self->getNumberOfTuples())
5047 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5049 return self->renumber(da2->getConstPointer());
5053 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5056 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5057 if (!SWIG_IsOK(res1))
5060 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5061 if(size!=self->getNumberOfTuples())
5063 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5065 return self->renumberR(tmp);
5069 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5071 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5072 da2->checkAllocated();
5073 int size=self->getNumberOfTuples();
5074 if(size!=self->getNumberOfTuples())
5076 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5078 return self->renumberR(da2->getConstPointer());
5082 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
5085 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5086 if (!SWIG_IsOK(res1))
5089 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5090 return self->selectByTupleId(tmp,tmp+size);
5094 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5096 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5097 da2->checkAllocated();
5098 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5102 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
5105 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5106 if (!SWIG_IsOK(res1))
5109 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5110 return self->selectByTupleIdSafe(tmp,tmp+size);
5114 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5116 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5117 da2->checkAllocated();
5118 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5122 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
5124 std::vector<int> tmp;
5125 convertPyToNewIntArr3(li,tmp);
5126 return self->keepSelectedComponents(tmp);
5129 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
5131 std::vector<int> tmp;
5132 convertPyToNewIntArr3(li,tmp);
5133 self->setSelectedComponents(a,tmp);
5136 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5138 int sz=self->getNumberOfComponents();
5139 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5140 self->getTuple(tupleId,tmp);
5141 return convertIntArrToPyList(tmp,sz);
5144 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
5146 DataArrayInt *arr=0;
5147 DataArrayInt *arrI=0;
5148 self->changeSurjectiveFormat(targetNb,arr,arrI);
5149 PyObject *res = PyList_New(2);
5150 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5151 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5155 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
5157 std::vector<std::pair<int,int> > ranges;
5158 convertPyToVectorPairInt(li,ranges);
5159 return self->selectByTupleRanges(ranges);
5162 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
5164 std::vector<const DataArrayInt *> tmp;
5165 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5166 return DataArrayInt::Meld(tmp);
5169 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
5171 std::vector<const DataArrayInt *> tmp;
5172 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5173 return DataArrayInt::Aggregate(tmp);
5176 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
5178 std::vector<const DataArrayInt *> tmp;
5179 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5180 return DataArrayInt::BuildUnion(tmp);
5183 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
5185 std::vector<const DataArrayInt *> tmp;
5186 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5187 return DataArrayInt::BuildIntersection(tmp);
5190 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5193 int r1=self->getMaxValue(tmp);
5194 PyObject *ret=PyTuple_New(2);
5195 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5196 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5200 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5203 int r1=self->getMinValue(tmp);
5204 PyObject *ret=PyTuple_New(2);
5205 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5206 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5210 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5212 int nbOfCompo=self->getNumberOfComponents();
5217 if(PyInt_Check(obj))
5219 int val=(int)PyInt_AS_LONG(obj);
5220 return self->locateValue(val);
5223 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5227 std::vector<int> arr;
5228 convertPyToNewIntArr3(obj,arr);
5229 return self->locateTuple(arr);
5234 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5236 int nbOfCompo=self->getNumberOfComponents();
5243 if(PyInt_Check(obj))
5245 int val=(int)PyInt_AS_LONG(obj);
5246 return self->presenceOfValue(val);
5249 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5253 std::vector<int> arr;
5254 convertPyToNewIntArr3(obj,arr);
5255 return self->presenceOfTuple(arr);
5260 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5262 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5263 self->checkAllocated();
5264 int nbOfTuples=self->getNumberOfTuples();
5265 int nbOfComponents=self->getNumberOfComponents();
5267 std::vector<int> vt1,vc1;
5268 std::pair<int, std::pair<int,int> > pt1,pc1;
5269 DataArrayInt *dt1=0,*dc1=0;
5271 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5272 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5277 if(nbOfComponents==1)
5278 return PyInt_FromLong(self->getIJSafe(it1,0));
5279 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5282 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5284 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5286 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5288 return PyInt_FromLong(self->getIJSafe(it1,ic1));
5291 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5292 std::vector<int> v2(1,ic1);
5293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5297 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5298 std::vector<int> v2(1,ic1);
5299 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5303 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5304 std::vector<int> v2(1,ic1);
5305 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5309 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5310 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5314 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5315 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5319 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5320 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5324 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5325 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5329 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5330 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5331 std::vector<int> v2(nbOfComp);
5332 for(int i=0;i<nbOfComp;i++)
5333 v2[i]=pc1.first+i*pc1.second.second;
5334 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5338 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5339 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5340 std::vector<int> v2(nbOfComp);
5341 for(int i=0;i<nbOfComp;i++)
5342 v2[i]=pc1.first+i*pc1.second.second;
5343 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5347 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5348 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5349 std::vector<int> v2(nbOfComp);
5350 for(int i=0;i<nbOfComp;i++)
5351 v2[i]=pc1.first+i*pc1.second.second;
5352 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5356 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5357 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5358 std::vector<int> v2(nbOfComp);
5359 for(int i=0;i<nbOfComp;i++)
5360 v2[i]=pc1.first+i*pc1.second.second;
5361 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5364 throw INTERP_KERNEL::Exception(msg);
5368 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5370 self->checkAllocated();
5371 const char msg[]="Unexpected situation in __setitem__ !";
5372 int nbOfTuples=self->getNumberOfTuples();
5373 int nbOfComponents=self->getNumberOfComponents();
5376 std::vector<int> v1;
5378 DataArrayIntTuple *dd1=0;
5379 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5381 std::vector<int> vt1,vc1;
5382 std::pair<int, std::pair<int,int> > pt1,pc1;
5383 DataArrayInt *dt1=0,*dc1=0;
5384 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5385 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5393 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5396 tmp=DataArrayInt::New();
5397 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5398 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5401 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5404 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5405 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5408 throw INTERP_KERNEL::Exception(msg);
5417 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5420 tmp=DataArrayInt::New();
5421 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5422 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5425 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5428 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5429 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5432 throw INTERP_KERNEL::Exception(msg);
5441 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5444 tmp=DataArrayInt::New();
5445 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5446 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5449 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5452 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5453 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5456 throw INTERP_KERNEL::Exception(msg);
5465 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5468 tmp=DataArrayInt::New();
5469 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5470 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5473 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5476 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5477 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5480 throw INTERP_KERNEL::Exception(msg);
5489 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5492 tmp=DataArrayInt::New();
5493 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5494 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5497 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5500 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5501 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5504 throw INTERP_KERNEL::Exception(msg);
5513 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5516 tmp=DataArrayInt::New();
5517 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5518 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5521 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5524 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5525 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5528 throw INTERP_KERNEL::Exception(msg);
5537 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5540 tmp=DataArrayInt::New();
5541 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5542 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5545 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5548 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5549 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5552 throw INTERP_KERNEL::Exception(msg);
5561 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5564 tmp=DataArrayInt::New();
5565 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5566 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5569 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5572 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5573 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5576 throw INTERP_KERNEL::Exception(msg);
5585 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5588 tmp=DataArrayInt::New();
5589 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5590 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5593 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5596 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5597 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5600 throw INTERP_KERNEL::Exception(msg);
5609 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5612 tmp=DataArrayInt::New();
5613 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5614 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5617 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5620 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5621 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5624 throw INTERP_KERNEL::Exception(msg);
5633 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5636 tmp=DataArrayInt::New();
5637 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5638 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
5641 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5644 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5645 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5648 throw INTERP_KERNEL::Exception(msg);
5657 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5660 tmp=DataArrayInt::New();
5661 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5662 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5665 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5668 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5669 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5672 throw INTERP_KERNEL::Exception(msg);
5681 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5684 tmp=DataArrayInt::New();
5685 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5686 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5689 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5692 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5693 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5696 throw INTERP_KERNEL::Exception(msg);
5705 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5708 tmp=DataArrayInt::New();
5709 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5710 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5713 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5716 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5717 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5720 throw INTERP_KERNEL::Exception(msg);
5729 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5732 tmp=DataArrayInt::New();
5733 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5734 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5737 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5740 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5741 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5744 throw INTERP_KERNEL::Exception(msg);
5753 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5756 tmp=DataArrayInt::New();
5757 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5758 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5761 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5764 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5765 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5768 throw INTERP_KERNEL::Exception(msg);
5773 throw INTERP_KERNEL::Exception(msg);
5778 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5780 return self->negate();
5783 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5785 const char msg[]="Unexpected situation in __add__ !";
5788 std::vector<int> aa;
5789 DataArrayIntTuple *aaa;
5791 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5796 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5797 ret->applyLin(1,val);
5803 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5804 return DataArrayInt::Add(self,aaa);
5808 return DataArrayInt::Add(self,a);
5812 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5813 return DataArrayInt::Add(self,aaaa);
5816 throw INTERP_KERNEL::Exception(msg);
5820 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5822 const char msg[]="Unexpected situation in __radd__ !";
5825 std::vector<int> aa;
5826 DataArrayIntTuple *aaa;
5828 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5833 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5834 ret->applyLin(1,val);
5840 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5841 return DataArrayInt::Add(self,aaa);
5845 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5846 return DataArrayInt::Add(self,aaaa);
5849 throw INTERP_KERNEL::Exception(msg);
5853 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5855 const char msg[]="Unexpected situation in __iadd__ !";
5858 std::vector<int> aa;
5859 DataArrayIntTuple *aaa;
5861 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5866 self->applyLin(1,val);
5867 Py_XINCREF(trueSelf);
5872 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5874 Py_XINCREF(trueSelf);
5880 Py_XINCREF(trueSelf);
5885 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5886 self->addEqual(aaaa);
5887 Py_XINCREF(trueSelf);
5891 throw INTERP_KERNEL::Exception(msg);
5895 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5897 const char msg[]="Unexpected situation in __sub__ !";
5900 std::vector<int> aa;
5901 DataArrayIntTuple *aaa;
5903 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5908 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5909 ret->applyLin(1,-val);
5915 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5916 return DataArrayInt::Substract(self,aaa);
5920 return DataArrayInt::Substract(self,a);
5924 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5925 return DataArrayInt::Substract(self,aaaa);
5928 throw INTERP_KERNEL::Exception(msg);
5932 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5934 const char msg[]="Unexpected situation in __rsub__ !";
5937 std::vector<int> aa;
5938 DataArrayIntTuple *aaa;
5940 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5945 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5946 ret->applyLin(-1,val);
5952 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5953 return DataArrayInt::Substract(aaa,self);
5957 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5958 return DataArrayInt::Substract(aaaa,self);
5961 throw INTERP_KERNEL::Exception(msg);
5965 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5967 const char msg[]="Unexpected situation in __isub__ !";
5970 std::vector<int> aa;
5971 DataArrayIntTuple *aaa;
5973 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5978 self->applyLin(1,-val);
5979 Py_XINCREF(trueSelf);
5984 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5985 self->substractEqual(bb);
5986 Py_XINCREF(trueSelf);
5991 self->substractEqual(a);
5992 Py_XINCREF(trueSelf);
5997 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5998 self->substractEqual(aaaa);
5999 Py_XINCREF(trueSelf);
6003 throw INTERP_KERNEL::Exception(msg);
6007 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6009 const char msg[]="Unexpected situation in __mul__ !";
6012 std::vector<int> aa;
6013 DataArrayIntTuple *aaa;
6015 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6020 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6021 ret->applyLin(val,0);
6027 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6028 return DataArrayInt::Multiply(self,aaa);
6032 return DataArrayInt::Multiply(self,a);
6036 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6037 return DataArrayInt::Multiply(self,aaaa);
6040 throw INTERP_KERNEL::Exception(msg);
6044 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6046 const char msg[]="Unexpected situation in __rmul__ !";
6049 std::vector<int> aa;
6050 DataArrayIntTuple *aaa;
6052 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6057 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6058 ret->applyLin(val,0);
6064 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6065 return DataArrayInt::Multiply(self,aaa);
6069 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6070 return DataArrayInt::Multiply(self,aaaa);
6073 throw INTERP_KERNEL::Exception(msg);
6077 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6079 const char msg[]="Unexpected situation in __imul__ !";
6082 std::vector<int> aa;
6083 DataArrayIntTuple *aaa;
6085 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6090 self->applyLin(val,0);
6091 Py_XINCREF(trueSelf);
6096 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6097 self->multiplyEqual(bb);
6098 Py_XINCREF(trueSelf);
6103 self->multiplyEqual(a);
6104 Py_XINCREF(trueSelf);
6109 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6110 self->multiplyEqual(aaaa);
6111 Py_XINCREF(trueSelf);
6115 throw INTERP_KERNEL::Exception(msg);
6119 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6121 const char msg[]="Unexpected situation in __div__ !";
6124 std::vector<int> aa;
6125 DataArrayIntTuple *aaa;
6127 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6132 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6133 ret->applyDivideBy(val);
6139 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6140 return DataArrayInt::Divide(self,aaa);
6144 return DataArrayInt::Divide(self,a);
6148 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6149 return DataArrayInt::Divide(self,aaaa);
6152 throw INTERP_KERNEL::Exception(msg);
6156 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6158 const char msg[]="Unexpected situation in __rdiv__ !";
6161 std::vector<int> aa;
6162 DataArrayIntTuple *aaa;
6164 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6169 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6176 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6177 return DataArrayInt::Divide(aaa,self);
6181 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6182 return DataArrayInt::Divide(aaaa,self);
6185 throw INTERP_KERNEL::Exception(msg);
6189 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6191 const char msg[]="Unexpected situation in __idiv__ !";
6194 std::vector<int> aa;
6195 DataArrayIntTuple *aaa;
6197 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6202 self->applyDivideBy(val);
6203 Py_XINCREF(trueSelf);
6208 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6209 self->divideEqual(bb);
6210 Py_XINCREF(trueSelf);
6215 self->divideEqual(a);
6216 Py_XINCREF(trueSelf);
6221 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6222 self->divideEqual(aaaa);
6223 Py_XINCREF(trueSelf);
6227 throw INTERP_KERNEL::Exception(msg);
6231 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6233 const char msg[]="Unexpected situation in __mod__ !";
6236 std::vector<int> aa;
6237 DataArrayIntTuple *aaa;
6239 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6244 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6245 ret->applyModulus(val);
6251 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6252 return DataArrayInt::Modulus(self,aaa);
6256 return DataArrayInt::Modulus(self,a);
6260 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6261 return DataArrayInt::Modulus(self,aaaa);
6264 throw INTERP_KERNEL::Exception(msg);
6268 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6270 const char msg[]="Unexpected situation in __rmod__ !";
6273 std::vector<int> aa;
6274 DataArrayIntTuple *aaa;
6276 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6281 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6282 ret->applyRModulus(val);
6288 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6289 return DataArrayInt::Modulus(aaa,self);
6293 return DataArrayInt::Modulus(a,self);
6297 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6298 return DataArrayInt::Modulus(aaaa,self);
6301 throw INTERP_KERNEL::Exception(msg);
6305 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6307 const char msg[]="Unexpected situation in __imod__ !";
6310 std::vector<int> aa;
6311 DataArrayIntTuple *aaa;
6313 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6318 self->applyModulus(val);
6319 Py_XINCREF(trueSelf);
6324 self->modulusEqual(a);
6325 Py_XINCREF(trueSelf);
6330 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6331 self->modulusEqual(aaaa);
6332 Py_XINCREF(trueSelf);
6336 throw INTERP_KERNEL::Exception(msg);
6341 namespace ParaMEDMEM
6343 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6346 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6347 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6348 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6349 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6350 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
6351 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6352 void setName(const char *name) throw(INTERP_KERNEL::Exception);
6353 const char *getDescription() const throw(INTERP_KERNEL::Exception);
6354 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6355 const char *getName() const throw(INTERP_KERNEL::Exception);
6356 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6357 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6358 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6359 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6360 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6361 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6362 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6363 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6364 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6365 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6366 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6367 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6368 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6369 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6370 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
6371 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
6373 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6375 MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6378 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6381 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6383 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6386 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6389 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
6391 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
6392 return convertIntArrToPyList3(ret);
6395 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6398 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6399 PyObject *ret=PyTuple_New(2);
6400 PyObject *ret0Py=ret0?Py_True:Py_False;
6402 PyTuple_SetItem(ret,0,ret0Py);
6403 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6407 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6409 DataArrayInt *ret1=0;
6410 MEDCouplingMesh *ret0=0;
6412 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6413 if (!SWIG_IsOK(res1))
6416 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6417 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6421 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6423 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6424 da2->checkAllocated();
6425 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6427 PyObject *res = PyList_New(2);
6428 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6429 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6433 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6437 std::vector<int> pos2;
6438 DataArrayInt *pos3=0;
6439 DataArrayIntTuple *pos4=0;
6440 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6445 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6449 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6453 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6456 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6460 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6461 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6464 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6465 if (!SWIG_IsOK(res1))
6468 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6469 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6473 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6475 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6476 da2->checkAllocated();
6477 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6481 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6483 std::vector<int> tmp;
6484 self->getCellIdsHavingGaussLocalization(locId,tmp);
6485 DataArrayInt *ret=DataArrayInt::New();
6486 ret->alloc((int)tmp.size(),1);
6487 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6488 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6493 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6496 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
6497 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME);
6498 void setTimeUnit(const char *unit);
6499 const char *getTimeUnit() const;
6500 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
6501 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6502 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6503 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
6504 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
6505 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
6506 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6507 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6508 MEDCouplingFieldDouble *deepCpy() const;
6509 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6510 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6511 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6512 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6513 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
6514 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6515 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6516 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6517 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6518 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6519 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6520 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6521 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6522 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6523 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6524 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6525 void setIteration(int it) throw(INTERP_KERNEL::Exception);
6526 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6527 void setOrder(int order) throw(INTERP_KERNEL::Exception);
6528 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6529 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6530 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6531 void updateTime() const throw(INTERP_KERNEL::Exception);
6532 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6533 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6534 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6535 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6536 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6537 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6538 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6539 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6540 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6541 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6542 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6543 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6544 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6545 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6546 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6547 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6548 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6549 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6550 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6551 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6552 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6553 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6554 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6555 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6556 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6557 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6558 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6559 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6560 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6561 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6562 double getMaxValue() const throw(INTERP_KERNEL::Exception);
6563 double getMinValue() const throw(INTERP_KERNEL::Exception);
6564 double getAverageValue() const throw(INTERP_KERNEL::Exception);
6565 double norm2() const throw(INTERP_KERNEL::Exception);
6566 double normMax() const throw(INTERP_KERNEL::Exception);
6567 double getWeightedAverageValue() const throw(INTERP_KERNEL::Exception);
6568 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6569 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6570 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6571 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6572 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6573 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6574 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6575 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6576 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6577 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6578 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6579 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6580 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6581 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6582 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6583 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6584 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6585 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6586 MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6587 MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6588 MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6589 MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6591 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
6593 return MEDCouplingFieldDouble::New(type,td);
6596 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME)
6598 return MEDCouplingFieldDouble::New(ft,td);
6601 std::string __str__() const throw(INTERP_KERNEL::Exception)
6603 return self->simpleRepr();
6606 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6608 DataArrayDouble *ret=self->getArray();
6614 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6616 std::vector<DataArrayDouble *> arrs=self->getArrays();
6617 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6621 PyObject *ret=PyTuple_New(sz);
6622 for(int i=0;i<sz;i++)
6625 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6627 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6632 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6634 std::vector<const DataArrayDouble *> tmp;
6635 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6637 std::vector<DataArrayDouble *> arrs(sz);
6638 for(int i=0;i<sz;i++)
6639 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6640 self->setArrays(arrs);
6643 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6645 DataArrayDouble *ret=self->getEndArray();
6651 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6655 DataArrayDoubleTuple *aa;
6656 std::vector<double> bb;
6658 const MEDCouplingMesh *mesh=self->getMesh();
6660 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6661 int spaceDim=mesh->getSpaceDimension();
6662 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6663 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6665 int sz=self->getNumberOfComponents();
6666 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6667 self->getValueOn(spaceLoc,res);
6668 return convertDblArrToPyList(res,sz);
6671 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6673 int sz=self->getNumberOfComponents();
6674 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6675 self->getValueOnPos(i,j,k,res);
6676 return convertDblArrToPyList(res,sz);
6679 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6682 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
6683 if (!SWIG_IsOK(res1))
6686 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6687 const MEDCouplingMesh *mesh=self->getMesh();
6689 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6690 int spaceDim=mesh->getSpaceDimension();
6691 int nbOfPoints=size/spaceDim;
6692 if(size%spaceDim!=0)
6694 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6696 return self->getValueOnMulti(tmp,nbOfPoints);
6700 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6702 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6703 da2->checkAllocated();
6704 int size=da2->getNumberOfTuples();
6705 int nbOfCompo=da2->getNumberOfComponents();
6706 const MEDCouplingMesh *mesh=self->getMesh();
6708 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6709 if(nbOfCompo!=mesh->getSpaceDimension())
6711 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6713 return self->getValueOnMulti(da2->getConstPointer(),size);
6717 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6721 DataArrayDoubleTuple *aa;
6722 std::vector<double> bb;
6724 const MEDCouplingMesh *mesh=self->getMesh();
6726 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6727 int spaceDim=mesh->getSpaceDimension();
6728 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6729 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6732 int sz=self->getNumberOfComponents();
6733 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6734 self->getValueOn(spaceLoc,time,res);
6735 return convertDblArrToPyList(res,sz);
6738 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6740 if(self->getArray()!=0)
6743 double *tmp=convertPyToNewDblArr2(li,&sz);
6744 int nbTuples=self->getArray()->getNumberOfTuples();
6745 int nbOfCompo=self->getArray()->getNumberOfComponents();
6746 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6749 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6752 PyObject *getTime() throw(INTERP_KERNEL::Exception)
6755 double tmp0=self->getTime(tmp1,tmp2);
6756 PyObject *res = PyList_New(3);
6757 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6758 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6759 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6763 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6766 double tmp0=self->getStartTime(tmp1,tmp2);
6767 PyObject *res = PyList_New(3);
6768 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6769 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6770 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6774 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6777 double tmp0=self->getEndTime(tmp1,tmp2);
6778 PyObject *res = PyList_New(3);
6779 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6780 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6781 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6784 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6786 int sz=self->getNumberOfComponents();
6787 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6788 self->accumulate(tmp);
6789 PyObject *ret=convertDblArrToPyList(tmp,sz);
6792 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6794 int sz=self->getNumberOfComponents();
6795 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6796 self->integral(isWAbs,tmp);
6797 PyObject *ret=convertDblArrToPyList(tmp,sz);
6800 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6802 int sz=self->getNumberOfComponents();
6803 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6805 PyObject *ret=convertDblArrToPyList(tmp,sz);
6808 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6810 int sz=self->getNumberOfComponents();
6811 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6813 PyObject *ret=convertDblArrToPyList(tmp,sz);
6816 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6819 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6820 if (!SWIG_IsOK(res1))
6823 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6824 self->renumberCells(tmp,check);
6828 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6830 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6831 da2->checkAllocated();
6832 self->renumberCells(da2->getConstPointer(),check);
6835 void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6838 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6839 if (!SWIG_IsOK(res1))
6842 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6843 self->renumberNodes(tmp);
6847 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6849 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6850 da2->checkAllocated();
6851 self->renumberNodes(da2->getConstPointer());
6855 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6859 std::vector<int> multiVal;
6860 std::pair<int, std::pair<int,int> > slic;
6861 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6862 const MEDCouplingMesh *mesh=self->getMesh();
6864 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6865 int nbc=mesh->getNumberOfCells();
6866 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6873 std::ostringstream oss;
6874 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6875 throw INTERP_KERNEL::Exception(oss.str().c_str());
6878 return self->buildSubPart(&singleVal,&singleVal+1);
6883 int tmp=nbc+singleVal;
6884 return self->buildSubPart(&tmp,&tmp+1);
6888 std::ostringstream oss;
6889 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6890 throw INTERP_KERNEL::Exception(oss.str().c_str());
6896 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6900 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6901 return self->buildSubPart(rg->begin(),rg->end());
6906 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6907 daIntTyypp->checkAllocated();
6908 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6911 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6915 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6917 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6920 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6923 double r1=self->getMaxValue2(tmp);
6924 PyObject *ret=PyTuple_New(2);
6925 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6926 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6930 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6933 double r1=self->getMinValue2(tmp);
6934 PyObject *ret=PyTuple_New(2);
6935 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6936 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6940 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6942 std::vector<int> tmp;
6943 convertPyToNewIntArr3(li,tmp);
6944 return self->keepSelectedComponents(tmp);
6947 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6949 std::vector<int> tmp;
6950 convertPyToNewIntArr3(li,tmp);
6951 self->setSelectedComponents(f,tmp);
6954 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6957 DataArrayDouble *a,*a2;
6958 DataArrayDoubleTuple *aa,*aa2;
6959 std::vector<double> bb,bb2;
6962 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6963 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6964 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6965 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
6967 return self->extractSlice3D(orig,vect,eps);
6970 PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6973 Py_XINCREF(trueSelf);
6977 PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6980 Py_XINCREF(trueSelf);
6984 PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6987 Py_XINCREF(trueSelf);
6991 PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6994 Py_XINCREF(trueSelf);
6998 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7000 std::vector<const MEDCouplingFieldDouble *> tmp;
7001 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7002 return MEDCouplingFieldDouble::MergeFields(tmp);
7005 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
7007 std::vector<const MEDCouplingFieldDouble *> tmp;
7008 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7009 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
7014 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
7017 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
7018 static MEDCouplingFieldTemplate *New(TypeOfField type);
7019 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7020 std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7021 void updateTime() const;
7024 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception)
7026 return MEDCouplingFieldTemplate::New(f);
7029 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
7031 return MEDCouplingFieldTemplate::New(type);
7034 std::string __str__() const throw(INTERP_KERNEL::Exception)
7036 return self->simpleRepr();
7041 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
7044 int getNumberOfFields() const;
7045 MEDCouplingMultiFields *deepCpy() const;
7046 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7047 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7048 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7049 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7050 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7051 void updateTime() const throw(INTERP_KERNEL::Exception);
7054 std::string __str__() const throw(INTERP_KERNEL::Exception)
7056 return self->simpleRepr();
7058 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7060 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7061 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7063 std::vector<MEDCouplingFieldDouble *> fs(sz);
7064 for(int i=0;i<sz;i++)
7065 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7066 return MEDCouplingMultiFields::New(fs);
7068 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7070 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7071 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7073 std::vector<MEDCouplingFieldDouble *> fs(sz);
7074 for(int i=0;i<sz;i++)
7075 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7076 return MEDCouplingMultiFields::New(fs);
7078 PyObject *getFields() const
7080 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
7081 int sz=fields.size();
7082 PyObject *res = PyList_New(sz);
7083 for(int i=0;i<sz;i++)
7087 fields[i]->incrRef();
7088 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
7092 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
7097 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
7099 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
7103 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
7106 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
7108 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
7110 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
7112 PyObject *res = PyList_New(sz);
7113 for(int i=0;i<sz;i++)
7118 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7122 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7127 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
7129 std::vector<int> refs;
7130 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
7132 PyObject *res = PyList_New(sz);
7133 for(int i=0;i<sz;i++)
7138 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7142 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7146 PyObject *ret=PyTuple_New(2);
7147 PyTuple_SetItem(ret,0,res);
7148 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
7151 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7153 std::vector<DataArrayDouble *> ms=self->getArrays();
7155 PyObject *res = PyList_New(sz);
7156 for(int i=0;i<sz;i++)
7161 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7165 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7170 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
7172 std::vector< std::vector<int> > refs;
7173 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
7175 PyObject *res = PyList_New(sz);
7176 PyObject *res2 = PyList_New(sz);
7177 for(int i=0;i<sz;i++)
7182 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7186 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7188 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
7191 PyObject *ret=PyTuple_New(2);
7192 PyTuple_SetItem(ret,0,res);
7193 PyTuple_SetItem(ret,1,res2);
7199 class MEDCouplingDefinitionTime
7202 MEDCouplingDefinitionTime();
7203 void assign(const MEDCouplingDefinitionTime& other);
7204 bool isEqual(const MEDCouplingDefinitionTime& other) const;
7205 double getTimeResolution() const;
7206 std::vector<double> getHotSpotsTime() const;
7209 std::string __str__() const
7211 std::ostringstream oss;
7212 self->appendRepr(oss);
7216 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
7218 int meshId,arrId,arrIdInField,fieldId;
7219 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7220 PyObject *res=PyList_New(4);
7221 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7222 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7223 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7224 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7228 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7230 int meshId,arrId,arrIdInField,fieldId;
7231 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7232 PyObject *res=PyList_New(4);
7233 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7234 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7235 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7236 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7242 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7245 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7246 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7250 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7252 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7253 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7255 std::vector<MEDCouplingFieldDouble *> fs(sz);
7256 for(int i=0;i<sz;i++)
7257 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7258 return MEDCouplingFieldOverTime::New(fs);
7260 std::string __str__() const throw(INTERP_KERNEL::Exception)
7262 return self->simpleRepr();
7264 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7266 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7267 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7269 std::vector<MEDCouplingFieldDouble *> fs(sz);
7270 for(int i=0;i<sz;i++)
7271 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7272 return MEDCouplingFieldOverTime::New(fs);
7280 __filename=os.environ.get('PYTHONSTARTUP')
7281 if __filename and os.path.isfile(__filename):
7282 execfile(__filename)