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::getCoordinatesAndOwner;
255 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
256 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
257 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
258 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
259 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
260 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
261 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
262 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
263 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
264 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
265 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
266 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
267 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
268 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
269 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
270 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
271 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
272 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::giveCellsWithType;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::computeNbOfNodesPerCell;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
316 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
317 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
318 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
319 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
320 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
321 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
322 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
323 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
324 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
325 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
326 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
327 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
328 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
330 %feature("unref") DataArrayDouble "$this->decrRef();"
331 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
332 %feature("unref") MEDCouplingMesh "$this->decrRef();"
333 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
334 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
335 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
336 %feature("unref") DataArrayInt "$this->decrRef();"
337 %feature("unref") MEDCouplingField "$this->decrRef();"
338 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
339 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
340 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
341 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
342 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
343 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
344 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
345 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
346 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
348 %rename(assign) *::operator=;
349 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
350 %ignore ParaMEDMEM::RefCountObject::decrRef;
351 %ignore ParaMEDMEM::MemArray::operator=;
352 %ignore ParaMEDMEM::MemArray::operator[];
353 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
354 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
355 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
356 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
357 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
358 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
359 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
360 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
361 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
362 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
363 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
364 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
365 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
366 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
370 %rename (InterpKernelException) INTERP_KERNEL::Exception;
372 namespace INTERP_KERNEL
377 Exception(const char* what);
378 ~Exception() throw ();
379 const char *what() const throw ();
382 std::string __str__() const
384 return std::string(self->what());
390 %include "MEDCouplingTimeLabel.hxx"
414 CONST_ON_TIME_INTERVAL = 7
415 } TypeOfTimeDiscretization;
417 const char *MEDCouplingVersionStr();
418 int MEDCouplingVersion();
419 PyObject *MEDCouplingVersionMajMinRel()
421 int tmp0=0,tmp1=0,tmp2=0;
422 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
423 PyObject *res = PyList_New(3);
424 PyList_SetItem(res,0,SWIG_From_int(tmp0));
425 PyList_SetItem(res,1,SWIG_From_int(tmp1));
426 PyList_SetItem(res,2,SWIG_From_int(tmp2));
430 class MEDCOUPLING_EXPORT RefCountObject
434 RefCountObject(const RefCountObject& other);
437 bool decrRef() const;
438 void incrRef() const;
439 virtual std::size_t getHeapMemorySize() const;
448 UNSTRUCTURED_DESC = 6,
452 } MEDCouplingMeshType;
455 class DataArrayDouble;
456 class MEDCouplingUMesh;
457 class MEDCouplingFieldDouble;
459 %extend RefCountObject
461 std::string getHiddenCppPointer() const
463 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
468 class MEDCouplingMesh : public RefCountObject, public TimeLabel
471 void setName(const char *name);
472 const char *getName() const;
473 void setDescription(const char *descr);
474 const char *getDescription() const;
475 void setTime(double val, int iteration, int order);
476 void setTimeUnit(const char *unit);
477 const char *getTimeUnit() const;
478 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
479 bool isStructured() const throw(INTERP_KERNEL::Exception);
480 virtual MEDCouplingMesh *deepCpy() const;
481 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
482 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
483 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
484 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
485 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
486 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
487 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
488 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
489 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
490 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
491 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
492 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
493 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
494 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
495 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
496 virtual std::string simpleRepr() const;
497 virtual std::string advancedRepr() const;
498 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
500 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
501 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
502 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
503 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
504 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
505 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
506 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
507 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
508 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
509 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
510 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
511 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
512 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
515 std::string __str__() const
517 return self->simpleRepr();
520 PyObject *getTime() throw(INTERP_KERNEL::Exception)
523 double tmp0=self->getTime(tmp1,tmp2);
524 PyObject *res = PyList_New(3);
525 PyList_SetItem(res,0,SWIG_From_double(tmp0));
526 PyList_SetItem(res,1,SWIG_From_int(tmp1));
527 PyList_SetItem(res,2,SWIG_From_int(tmp2));
531 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
535 DataArrayDoubleTuple *aa;
536 std::vector<double> bb;
538 int spaceDim=self->getSpaceDimension();
539 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
540 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
541 return self->getCellContainingPoint(pos,eps);
544 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
548 DataArrayDoubleTuple *aa;
549 std::vector<double> bb;
551 int spaceDim=self->getSpaceDimension();
552 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
553 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
554 std::vector<int> elts,eltsIndex;
555 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
556 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
557 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
558 d0->alloc(elts.size(),1);
559 d1->alloc(eltsIndex.size(),1);
560 std::copy(elts.begin(),elts.end(),d0->getPointer());
561 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
562 PyObject *ret=PyTuple_New(2);
563 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
564 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
570 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
572 std::vector<int> elts,eltsIndex;
573 int spaceDim=self->getSpaceDimension();
575 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
576 if (!SWIG_IsOK(res1))
579 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
580 int nbOfPoints=size/spaceDim;
583 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
585 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
589 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
591 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
592 da2->checkAllocated();
593 int size=da2->getNumberOfTuples();
594 int nbOfCompo=da2->getNumberOfComponents();
595 if(nbOfCompo!=spaceDim)
597 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
599 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
601 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
602 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
603 d0->alloc(elts.size(),1);
604 d1->alloc(eltsIndex.size(),1);
605 std::copy(elts.begin(),elts.end(),d0->getPointer());
606 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
607 PyObject *ret=PyTuple_New(2);
608 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
609 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
615 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
619 DataArrayDoubleTuple *aa;
620 std::vector<double> bb;
622 int spaceDim=self->getSpaceDimension();
623 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
624 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
625 std::vector<int> elts;
626 self->getCellsContainingPoint(pos,eps,elts);
627 DataArrayInt *ret=DataArrayInt::New();
628 ret->alloc((int)elts.size(),1);
629 std::copy(elts.begin(),elts.end(),ret->getPointer());
630 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
633 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
636 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
637 if (!SWIG_IsOK(res1))
640 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
641 self->renumberCells(tmp,check);
645 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
647 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
648 da2->checkAllocated();
649 self->renumberCells(da2->getConstPointer(),check);
653 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
655 DataArrayInt *cellCor, *nodeCor;
656 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
657 PyObject *res = PyList_New(2);
658 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
659 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
662 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
665 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
666 if (!SWIG_IsOK(res1))
669 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
670 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
674 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
676 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
677 da2->checkAllocated();
678 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
681 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
683 std::vector<int> conn;
684 self->getNodeIdsOfCell(cellId,conn);
685 return convertIntArrToPyList2(conn);
688 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
690 std::vector<double> coo;
691 self->getCoordinatesOfNode(nodeId,coo);
692 return convertDblArrToPyList2(coo);
695 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
699 DataArrayDoubleTuple *aa;
700 std::vector<double> bb;
702 int spaceDim=self->getSpaceDimension();
703 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
704 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
705 self->scale(pointPtr,factor);
708 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
710 int spaceDim=self->getSpaceDimension();
711 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
712 self->getBoundingBox(tmp);
713 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
717 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
720 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
721 PyObject *ret=PyTuple_New(2);
722 PyObject *ret0Py=ret0?Py_True:Py_False;
724 PyTuple_SetItem(ret,0,ret0Py);
725 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
729 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
731 int szArr,sw,iTypppArr;
732 std::vector<int> stdvecTyyppArr;
733 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
734 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
735 if(sw==3)//DataArrayInt
737 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
738 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
739 std::string name=argpt->getName();
741 ret->setName(name.c_str());
743 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
746 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
748 int szArr,sw,iTypppArr;
749 std::vector<int> stdvecTyyppArr;
751 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
752 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
753 if(sw==3)//DataArrayInt
755 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
756 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
757 std::string name=argpt->getName();
759 ret->setName(name.c_str());
762 PyObject *res = PyList_New(2);
763 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
764 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
765 PyList_SetItem(res,0,obj0);
766 PyList_SetItem(res,1,obj1);
770 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
772 std::vector<int> vals=self->getDistributionOfTypes();
773 PyObject *ret=PyList_New((int)vals.size()/3);
774 for(int j=0;j<(int)vals.size()/3;j++)
776 PyObject *ret1=PyList_New(3);
777 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
778 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
779 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
780 PyList_SetItem(ret,j,ret1);
785 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
787 std::vector<int> code;
788 std::vector<const DataArrayInt *> idsPerType;
789 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
790 convertPyToNewIntArr4(li,1,3,code);
791 return self->checkTypeConsistencyAndContig(code,idsPerType);
794 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
796 std::vector<int> code;
797 std::vector<DataArrayInt *> idsInPflPerType;
798 std::vector<DataArrayInt *> idsPerType;
799 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
800 PyObject *ret=PyTuple_New(3);
801 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
802 PyObject *ret1=PyList_New(idsInPflPerType.size());
803 for(std::size_t j=0;j<idsInPflPerType.size();j++)
804 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
805 PyTuple_SetItem(ret,1,ret1);
806 int n=idsPerType.size();
807 PyObject *ret2=PyList_New(n);
809 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
810 PyTuple_SetItem(ret,2,ret2);
814 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
818 DataArrayDoubleTuple *aa;
819 std::vector<double> bb;
821 int spaceDim=self->getSpaceDimension();
822 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
823 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
824 self->translate(vectorPtr);
827 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
829 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
832 DataArrayDoubleTuple *aa;
833 std::vector<double> bb;
835 int spaceDim=self->getSpaceDimension();
836 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
837 self->rotate(centerPtr,0,alpha);
840 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
842 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
845 DataArrayDoubleTuple *aa;
846 std::vector<double> bb;
848 int spaceDim=self->getSpaceDimension();
849 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
850 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
851 self->rotate(centerPtr,vectorPtr,alpha);
854 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
856 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
857 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
858 PyObject *res=PyList_New(result.size());
859 for(int i=0;iL!=result.end(); i++, iL++)
860 PyList_SetItem(res,i,PyInt_FromLong(*iL));
864 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
866 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
867 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
868 return MEDCouplingMesh::MergeMeshes(tmp);
874 %extend ParaMEDMEM::DataArray
876 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
878 const std::vector<std::string>& comps=self->getInfoOnComponents();
879 PyObject *ret=PyList_New((int)comps.size());
880 for(int i=0;i<(int)comps.size();i++)
881 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
885 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
887 std::vector<int> tmp;
888 convertPyToNewIntArr3(li,tmp);
889 self->copyPartOfStringInfoFrom(other,tmp);
892 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
894 std::vector<int> tmp;
895 convertPyToNewIntArr3(li,tmp);
896 self->copyPartOfStringInfoFrom2(tmp,other);
900 %extend ParaMEDMEM::DataArrayInt
902 PyObject *getDifferentValues() const throw(INTERP_KERNEL::Exception)
904 std::set<int> ret=self->getDifferentValues();
905 return convertIntArrToPyList3(ret);
908 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
910 std::vector<int> ret1;
911 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
912 std::size_t sz=ret0.size();
913 PyObject *pyRet=PyTuple_New(2);
914 PyObject *pyRet0=PyList_New((int)sz);
915 PyObject *pyRet1=PyList_New((int)sz);
916 for(std::size_t i=0;i<sz;i++)
918 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
919 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
921 PyTuple_SetItem(pyRet,0,pyRet0);
922 PyTuple_SetItem(pyRet,1,pyRet1);
927 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
929 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
931 int sz=0,sw=-1,val1=-1;
932 std::vector<int> val2;
933 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
934 return self->clonePart(inp,inp+sz);
938 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
940 PyObject *getArrayOfDiscIds() const
942 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
945 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
949 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
950 %ignore ParaMEDMEM::DataArrayInt::getDifferentValues;
951 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
952 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
953 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
955 %include "MEDCouplingMemArray.hxx"
956 %include "NormalizedUnstructuredMesh.hxx"
957 %include "MEDCouplingNatureOfField.hxx"
958 %include "MEDCouplingTimeDiscretization.hxx"
959 %include "MEDCouplingFieldDiscretization.hxx"
960 %include "MEDCouplingGaussLocalization.hxx"
964 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
967 void updateTime() const;
968 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
969 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
970 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
971 void zipCoords() throw(INTERP_KERNEL::Exception);
972 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
973 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
974 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
975 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
976 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
977 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
978 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
979 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
980 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
981 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
982 //! size of returned tinyInfo must be always the same.
983 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
984 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
985 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
986 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
987 const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
988 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
989 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
990 virtual DataArrayInt *findBoundaryNodes() const;
993 std::string __str__() const
995 return self->simpleRepr();
998 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1001 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1002 PyObject *res = PyList_New(2);
1003 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1004 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1008 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1010 DataArrayInt *comm, *commIndex;
1011 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1012 PyObject *res = PyList_New(2);
1013 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1014 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1018 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1020 DataArrayDouble *ret1=self->getCoords();
1022 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1025 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1027 int szArr,sw,iTypppArr;
1028 std::vector<int> stdvecTyyppArr;
1029 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1030 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1031 if(sw==3)//DataArrayInt
1033 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1034 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1035 std::string name=argpt->getName();
1037 ret->setName(name.c_str());
1039 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1042 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1044 int szArr,sw,iTypppArr;
1045 std::vector<int> stdvecTyyppArr;
1046 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1047 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1048 if(sw==3)//DataArrayInt
1050 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1051 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1052 std::string name=argpt->getName();
1054 ret->setName(name.c_str());
1056 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1059 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1061 int szArr,sw,iTypppArr;
1062 std::vector<int> stdvecTyyppArr;
1063 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1064 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1065 if(sw==3)//DataArrayInt
1067 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1068 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1069 std::string name=argpt->getName();
1071 ret->setName(name.c_str());
1073 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1076 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1078 int szArr,sw,iTypppArr;
1079 std::vector<int> stdvecTyyppArr;
1080 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1081 self->renumberNodes(tmp,newNbOfNodes);
1084 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1086 int szArr,sw,iTypppArr;
1087 std::vector<int> stdvecTyyppArr;
1088 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1089 self->renumberNodes2(tmp,newNbOfNodes);
1092 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1094 int spaceDim=self->getSpaceDimension();
1096 DataArrayDouble *a,*a2;
1097 DataArrayDoubleTuple *aa,*aa2;
1098 std::vector<double> bb,bb2;
1100 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1101 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1102 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1103 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1104 std::vector<int> nodes;
1105 self->findNodesOnLine(p,v,eps,nodes);
1106 DataArrayInt *ret=DataArrayInt::New();
1107 ret->alloc((int)nodes.size(),1);
1108 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1109 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1111 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1113 int spaceDim=self->getSpaceDimension();
1115 DataArrayDouble *a,*a2;
1116 DataArrayDoubleTuple *aa,*aa2;
1117 std::vector<double> bb,bb2;
1119 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1120 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1121 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1122 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1123 std::vector<int> nodes;
1124 self->findNodesOnPlane(p,v,eps,nodes);
1125 DataArrayInt *ret=DataArrayInt::New();
1126 ret->alloc((int)nodes.size(),1);
1127 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1128 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1131 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1135 DataArrayDoubleTuple *aa;
1136 std::vector<double> bb;
1138 int spaceDim=self->getSpaceDimension();
1139 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1140 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1141 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1142 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1145 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfNodes, double eps) const throw(INTERP_KERNEL::Exception)
1147 DataArrayInt *c=0,*cI=0;
1151 DataArrayDoubleTuple *aa;
1152 std::vector<double> bb;
1154 int spaceDim=self->getSpaceDimension();
1155 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1156 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfNodes,spaceDim,true);
1157 self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI);
1158 PyObject *ret=PyTuple_New(2);
1159 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1160 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1164 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1166 DataArrayInt *c=0,*cI=0;
1167 int spaceDim=self->getSpaceDimension();
1170 DataArrayDoubleTuple *aa;
1171 std::vector<double> bb;
1174 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1175 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1177 PyObject *ret=PyTuple_New(2);
1178 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1179 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1183 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1187 DataArrayDoubleTuple *aa;
1188 std::vector<double> bb;
1190 int spaceDim=self->getSpaceDimension();
1191 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1192 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1194 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1195 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1198 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1202 std::vector<int> multiVal;
1203 std::pair<int, std::pair<int,int> > slic;
1204 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1205 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1209 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1211 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1213 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1215 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1219 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1222 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1223 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1224 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1225 for(int i=0;i<sz;i++)
1226 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1229 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1232 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1234 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1235 std::vector<double> val3;
1236 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1237 "Rotate2DAlg",2,true,nbNodes);
1239 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1240 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1243 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1246 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1247 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1248 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1249 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1250 for(int i=0;i<sz;i++)
1251 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1254 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1257 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1259 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1260 std::vector<double> val3;
1261 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1262 "Rotate3DAlg",3,true,nbNodes);
1264 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1265 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1266 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1271 class MEDCouplingUMeshCell
1274 INTERP_KERNEL::NormalizedCellType getType() const;
1277 std::string __str__() const
1279 return self->repr();
1282 PyObject *getAllConn() const
1285 const int *r=self->getAllConn(ret2);
1286 PyObject *ret=PyTuple_New(ret2);
1287 for(int i=0;i<ret2;i++)
1288 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1294 class MEDCouplingUMeshCellIterator
1301 MEDCouplingUMeshCell *ret=self->nextt();
1303 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1306 PyErr_SetString(PyExc_StopIteration,"No more data.");
1313 class MEDCouplingUMeshCellByTypeIterator
1316 ~MEDCouplingUMeshCellByTypeIterator();
1321 MEDCouplingUMeshCellEntry *ret=self->nextt();
1323 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1326 PyErr_SetString(PyExc_StopIteration,"No more data.");
1333 class MEDCouplingUMeshCellByTypeEntry
1336 ~MEDCouplingUMeshCellByTypeEntry();
1339 MEDCouplingUMeshCellByTypeIterator *__iter__()
1341 return self->iterator();
1346 class MEDCouplingUMeshCellEntry
1349 INTERP_KERNEL::NormalizedCellType getType() const;
1350 int getNumberOfElems() const;
1353 MEDCouplingUMeshCellIterator *__iter__()
1355 return self->iterator();
1360 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1363 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1364 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1365 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1366 void updateTime() const;
1367 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1368 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1369 void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
1370 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1371 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1372 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1373 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1374 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1375 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1376 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1377 void computeTypes() throw(INTERP_KERNEL::Exception);
1378 DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
1379 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1380 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1382 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1383 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1384 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1385 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1386 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1387 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1388 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1389 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1390 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1392 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1393 DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
1394 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1395 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1396 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1397 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1398 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1399 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1400 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1401 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1402 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1403 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1404 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1405 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1406 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1407 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1408 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1409 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1410 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1411 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1412 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1413 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1414 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1415 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1416 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1417 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1419 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1421 return MEDCouplingUMesh::New();
1424 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1426 return MEDCouplingUMesh::New(meshName,meshDim);
1429 std::string __str__() const
1431 return self->simpleRepr();
1434 MEDCouplingUMeshCellIterator *__iter__()
1436 return self->cellIterator();
1439 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1443 std::vector<int> multiVal;
1444 std::pair<int, std::pair<int,int> > slic;
1445 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1446 int nbc=self->getNumberOfCells();
1447 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1454 std::ostringstream oss;
1455 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1456 throw INTERP_KERNEL::Exception(oss.str().c_str());
1459 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1464 int tmp=nbc+singleVal;
1465 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1469 std::ostringstream oss;
1470 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1471 throw INTERP_KERNEL::Exception(oss.str().c_str());
1477 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1481 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1486 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1487 daIntTyypp->checkAllocated();
1488 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1491 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1495 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1499 std::vector<int> multiVal;
1500 std::pair<int, std::pair<int,int> > slic;
1501 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1502 int nbc=self->getNumberOfCells();
1503 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1510 std::ostringstream oss;
1511 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1512 throw INTERP_KERNEL::Exception(oss.str().c_str());
1516 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1523 int tmp=nbc+singleVal;
1524 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1529 std::ostringstream oss;
1530 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1531 throw INTERP_KERNEL::Exception(oss.str().c_str());
1537 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1543 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1544 daIntTyypp->checkAllocated();
1545 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1549 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1553 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1557 std::vector<int> multiVal;
1558 std::pair<int, std::pair<int,int> > slic;
1559 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1560 int nbc=self->getNumberOfCells();
1561 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1568 std::ostringstream oss;
1569 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1570 throw INTERP_KERNEL::Exception(oss.str().c_str());
1574 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1581 int tmp=nbc+singleVal;
1582 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1587 std::ostringstream oss;
1588 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1589 throw INTERP_KERNEL::Exception(oss.str().c_str());
1595 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1600 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1606 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1607 daIntTyypp->checkAllocated();
1608 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1612 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1616 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1618 int szArr,sw,iTypppArr;
1619 std::vector<int> stdvecTyyppArr;
1620 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1623 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1624 throw INTERP_KERNEL::Exception(oss.str().c_str());
1626 self->insertNextCell(type,size,tmp);
1629 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1631 int szArr,sw,iTypppArr;
1632 std::vector<int> stdvecTyyppArr;
1633 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1634 self->insertNextCell(type,szArr,tmp);
1637 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1639 DataArrayInt *ret=self->getNodalConnectivity();
1644 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1646 DataArrayInt *ret=self->getNodalConnectivityIndex();
1651 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1653 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1654 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1655 PyObject *res = PyList_New(result.size());
1656 for (int i=0;iL!=result.end(); i++, iL++)
1657 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1661 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1663 int szArr,sw,iTypppArr;
1664 std::vector<int> stdvecTyyppArr;
1665 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1666 int nbOfDepthPeelingPerformed=0;
1667 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1668 PyObject *res=PyTuple_New(2);
1669 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1670 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1674 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1676 DataArrayInt *v0=0,*v1=0;
1677 self->findCommonCells(compType,startCellId,v0,v1);
1678 PyObject *res = PyList_New(2);
1679 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1680 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1684 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1686 DataArrayInt *v0=0,*v1=0;
1687 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1688 PyObject *res = PyList_New(2);
1689 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1690 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1694 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1698 DataArrayDoubleTuple *aa;
1699 std::vector<double> bb;
1701 int nbOfCompo=self->getSpaceDimension();
1702 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1704 int cellId=-1,nodeId=-1;
1705 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1706 PyObject *ret=PyTuple_New(3);
1707 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1708 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1709 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1713 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1717 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1718 PyObject *res = PyList_New(3);
1719 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1720 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1721 PyList_SetItem(res,2,SWIG_From_int(ret2));
1724 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1728 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1729 PyObject *res = PyList_New(3);
1730 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1731 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1732 PyList_SetItem(res,2,SWIG_From_int(ret2));
1735 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1737 std::vector<int> cells;
1738 self->checkButterflyCells(cells,eps);
1739 DataArrayInt *ret=DataArrayInt::New();
1740 ret->alloc((int)cells.size(),1);
1741 std::copy(cells.begin(),cells.end(),ret->getPointer());
1742 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1745 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1747 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1749 PyObject *ret = PyList_New(sz);
1750 for(int i=0;i<sz;i++)
1751 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1755 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1757 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1758 int sz=retCpp.size();
1759 PyObject *ret=PyList_New(sz);
1760 for(int i=0;i<sz;i++)
1761 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1765 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1768 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1769 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1770 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1773 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1776 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1777 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1781 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1784 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1785 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1789 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1791 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1792 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1793 PyObject *ret=PyTuple_New(3);
1794 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1795 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1796 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1800 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1802 DataArrayInt *tmp0=0,*tmp1=0;
1803 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1804 PyObject *ret=PyTuple_New(2);
1805 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1806 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1810 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1814 std::vector<int> multiVal;
1815 std::pair<int, std::pair<int,int> > slic;
1816 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1817 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1821 return self->duplicateNodes(&singleVal,&singleVal+1);
1823 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1825 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1827 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1831 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1835 std::vector<int> multiVal;
1836 std::pair<int, std::pair<int,int> > slic;
1837 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1838 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1842 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1844 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1846 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1848 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1852 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1855 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1856 if (!SWIG_IsOK(res1))
1859 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1860 self->renumberNodesInConn(tmp);
1864 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1866 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1867 da2->checkAllocated();
1868 self->renumberNodesInConn(da2->getConstPointer());
1872 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1875 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1876 DataArrayInt *tmp0,*tmp1=0;
1877 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1878 PyObject *ret=PyTuple_New(2);
1879 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1880 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1884 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1886 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1887 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1888 DataArrayInt *ret1=0,*ret2=0;
1889 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1890 PyObject *ret=PyTuple_New(3);
1891 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1892 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1893 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1897 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1899 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1900 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1901 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1902 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1905 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1908 std::vector<const MEDCouplingUMesh *> meshes;
1909 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1910 std::vector<DataArrayInt *> corr;
1911 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1913 PyObject *ret1=PyList_New(sz);
1914 for(int i=0;i<sz;i++)
1915 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1916 PyObject *ret=PyList_New(2);
1917 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1918 PyList_SetItem(ret,1,ret1);
1922 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1924 std::vector<MEDCouplingUMesh *> meshes;
1925 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1926 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1929 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1931 std::vector<MEDCouplingUMesh *> meshes;
1932 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1933 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1936 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1940 std::vector<int> multiVal;
1941 std::pair<int, std::pair<int,int> > slic;
1942 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1944 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1945 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1949 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1951 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1953 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1955 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1959 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1961 DataArrayInt *arrOut=0,*arrIndexOut=0;
1964 std::vector<int> multiVal;
1965 std::pair<int, std::pair<int,int> > slic;
1966 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1968 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1969 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1974 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
1979 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1984 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1988 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1990 PyObject *ret=PyTuple_New(2);
1991 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1992 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1996 static PyObject *SetPartOfIndexedArrays(PyObject *li,
1997 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
1998 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2000 DataArrayInt *arrOut=0,*arrIndexOut=0;
2003 std::vector<int> multiVal;
2004 std::pair<int, std::pair<int,int> > slic;
2005 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2007 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2008 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2013 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2018 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2023 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2027 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2029 PyObject *ret=PyTuple_New(2);
2030 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2031 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2035 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2036 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2040 std::vector<int> multiVal;
2041 std::pair<int, std::pair<int,int> > slic;
2042 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2044 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2045 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2050 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2055 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2060 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2064 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2068 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2072 DataArrayDoubleTuple *aa;
2073 std::vector<double> bb;
2075 int spaceDim=self->getSpaceDimension();
2076 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2077 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2079 std::vector<int> cells;
2080 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2081 DataArrayInt *ret=DataArrayInt::New();
2082 ret->alloc((int)cells.size(),1);
2083 std::copy(cells.begin(),cells.end(),ret->getPointer());
2084 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2087 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2091 DataArrayDoubleTuple *aa;
2092 std::vector<double> bb;
2094 int spaceDim=self->getSpaceDimension();
2095 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2096 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2097 self->orientCorrectly2DCells(v,polyOnly);
2100 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2102 std::vector<int> cells;
2103 self->arePolyhedronsNotCorrectlyOriented(cells);
2104 DataArrayInt *ret=DataArrayInt::New();
2105 ret->alloc((int)cells.size(),1);
2106 std::copy(cells.begin(),cells.end(),ret->getPointer());
2107 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2110 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2114 self->getFastAveragePlaneOfThis(vec,pos);
2116 std::copy(vec,vec+3,vals);
2117 std::copy(pos,pos+3,vals+3);
2118 return convertDblArrToPyListOfTuple(vals,3,2);
2121 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2123 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2124 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2125 return MEDCouplingUMesh::MergeUMeshes(tmp);
2128 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2131 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2132 PyObject *ret=PyTuple_New(2);
2133 PyObject *ret0Py=ret0?Py_True:Py_False;
2135 PyTuple_SetItem(ret,0,ret0Py);
2136 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2140 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2143 bool ret0=self->areCellsIncludedIn2(other,ret1);
2144 PyObject *ret=PyTuple_New(2);
2145 PyObject *ret0Py=ret0?Py_True:Py_False;
2147 PyTuple_SetItem(ret,0,ret0Py);
2148 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2154 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2155 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2156 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2157 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2158 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2159 PyObject *ret=PyTuple_New(5);
2160 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2161 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 PyObject *buildDescendingConnectivity2() 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->buildDescendingConnectivity2(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),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2182 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2194 DataArrayInt *neighbors=0,*neighborsIdx=0;
2195 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2196 PyObject *ret=PyTuple_New(2);
2197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *neighbors=0,*neighborsIdx=0;
2205 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2206 PyObject *ret=PyTuple_New(2);
2207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2214 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2215 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2216 DataArrayInt *d2,*d3,*d4,*dd5;
2217 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2218 PyObject *ret=PyTuple_New(7);
2219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2221 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2225 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2231 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2233 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2234 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2235 self->getReverseNodalConnectivity(d0,d1);
2236 PyObject *ret=PyTuple_New(2);
2237 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2247 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2248 da->checkAllocated();
2249 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2252 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2255 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2256 da->checkAllocated();
2257 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2260 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2263 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2264 da->checkAllocated();
2265 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2268 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2271 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2272 da->checkAllocated();
2273 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2274 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2275 PyObject *res = PyList_New(result.size());
2276 for (int i=0;iL!=result.end(); i++, iL++)
2277 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2281 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2284 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2285 da->checkAllocated();
2286 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2287 ret->setName(da->getName().c_str());
2291 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2294 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2295 if (!SWIG_IsOK(res1))
2298 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2299 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2303 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2305 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2306 da2->checkAllocated();
2307 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2311 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2314 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2315 PyObject *ret=PyTuple_New(2);
2316 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2321 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2323 DataArrayInt *cellNb1=0,*cellNb2=0;
2324 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2325 PyObject *ret=PyTuple_New(3);
2326 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2327 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2328 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2332 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2334 int spaceDim=self->getSpaceDimension();
2336 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2338 DataArrayDouble *a,*a2;
2339 DataArrayDoubleTuple *aa,*aa2;
2340 std::vector<double> bb,bb2;
2342 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2343 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2344 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2345 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2347 DataArrayInt *cellIds=0;
2348 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2349 PyObject *ret=PyTuple_New(2);
2350 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2351 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2355 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2357 int spaceDim=self->getSpaceDimension();
2359 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2361 DataArrayDouble *a,*a2;
2362 DataArrayDoubleTuple *aa,*aa2;
2363 std::vector<double> bb,bb2;
2365 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2366 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2367 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2368 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2370 DataArrayInt *cellIds=0;
2371 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2372 PyObject *ret=PyTuple_New(2);
2373 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2378 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2380 int spaceDim=self->getSpaceDimension();
2382 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2384 DataArrayDouble *a,*a2;
2385 DataArrayDoubleTuple *aa,*aa2;
2386 std::vector<double> bb,bb2;
2388 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2389 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2390 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2391 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2392 return self->getCellIdsCrossingPlane(orig,vect,eps);
2395 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2399 std::vector<int> pos2;
2400 DataArrayInt *pos3=0;
2401 DataArrayIntTuple *pos4=0;
2402 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2407 self->convertToPolyTypes(&pos1,&pos1+1);
2414 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2419 self->convertToPolyTypes(pos3->begin(),pos3->end());
2423 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2427 void convertAllToPoly();
2428 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2429 bool unPolyze() throw(INTERP_KERNEL::Exception);
2430 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2431 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2432 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2435 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2438 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2439 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2440 void updateTime() const throw(INTERP_KERNEL::Exception);
2442 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2444 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2447 std::string __str__() const
2449 return self->simpleRepr();
2451 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2453 MEDCouplingUMesh *ret=self->getMesh2D();
2455 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2457 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2459 MEDCouplingUMesh *ret=self->getMesh1D();
2461 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2463 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2465 DataArrayInt *ret=self->getMesh3DIds();
2467 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2472 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2475 void updateTime() const throw(INTERP_KERNEL::Exception);
2476 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2477 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2480 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2483 static MEDCouplingCMesh *New();
2484 static MEDCouplingCMesh *New(const char *meshName);
2485 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2486 void setCoords(const DataArrayDouble *coordsX,
2487 const DataArrayDouble *coordsY=0,
2488 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2489 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2493 return MEDCouplingCMesh::New();
2495 MEDCouplingCMesh(const char *meshName)
2497 return MEDCouplingCMesh::New(meshName);
2499 std::string __str__() const
2501 return self->simpleRepr();
2503 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2505 DataArrayDouble *ret=self->getCoordsAt(i);
2513 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2516 static MEDCouplingCurveLinearMesh *New();
2517 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2518 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2519 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2520 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2522 MEDCouplingCurveLinearMesh()
2524 return MEDCouplingCurveLinearMesh::New();
2526 MEDCouplingCurveLinearMesh(const char *meshName)
2528 return MEDCouplingCurveLinearMesh::New(meshName);
2530 std::string __str__() const
2532 return self->simpleRepr();
2534 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2536 DataArrayDouble *ret=self->getCoords();
2541 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2543 int szArr,sw,iTypppArr;
2544 std::vector<int> stdvecTyyppArr;
2545 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2546 self->setNodeGridStructure(tmp,tmp+szArr);
2552 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2554 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2557 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2558 PyObject *ret=PyTuple_New(2);
2559 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2560 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2565 %extend ParaMEDMEM::DataArrayDoubleIterator
2569 DataArrayDoubleTuple *ret=self->nextt();
2571 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2574 PyErr_SetString(PyExc_StopIteration,"No more data.");
2580 %extend ParaMEDMEM::DataArrayDoubleTuple
2582 std::string __str__() const
2584 return self->repr();
2587 double __float__() const throw(INTERP_KERNEL::Exception)
2589 return self->doubleValue();
2592 DataArrayDouble *buildDADouble()
2594 return self->buildDADouble(1,self->getNumberOfCompo());
2597 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2599 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2600 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2601 Py_XINCREF(trueSelf);
2605 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2607 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2608 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2609 Py_XINCREF(trueSelf);
2613 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2615 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2616 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2617 Py_XINCREF(trueSelf);
2621 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2623 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2624 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2625 Py_XINCREF(trueSelf);
2629 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2633 std::vector<int> multiVal;
2634 std::pair<int, std::pair<int,int> > slic;
2635 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2636 const double *pt=self->getConstPointer();
2637 int nbc=self->getNumberOfCompo();
2638 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2645 std::ostringstream oss;
2646 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2647 throw INTERP_KERNEL::Exception(oss.str().c_str());
2650 return PyFloat_FromDouble(pt[singleVal]);
2654 return PyFloat_FromDouble(pt[nbc+singleVal]);
2657 std::ostringstream oss;
2658 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2659 throw INTERP_KERNEL::Exception(oss.str().c_str());
2665 PyObject *t=PyTuple_New(multiVal.size());
2666 for(int j=0;j<(int)multiVal.size();j++)
2668 int cid=multiVal[j];
2671 std::ostringstream oss;
2672 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2673 throw INTERP_KERNEL::Exception(oss.str().c_str());
2675 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2681 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2682 PyObject *t=PyTuple_New(sz);
2683 for(int j=0;j<sz;j++)
2684 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2688 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2692 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2694 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2697 std::vector<double> multiValV;
2698 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2699 int nbc=self->getNumberOfCompo();
2700 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2702 std::vector<int> multiVal;
2703 std::pair<int, std::pair<int,int> > slic;
2704 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2705 double *pt=self->getPointer();
2706 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2713 std::ostringstream oss;
2714 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2715 throw INTERP_KERNEL::Exception(oss.str().c_str());
2721 pt[singleVal]=singleValV;
2726 if(multiValV.size()!=1)
2728 std::ostringstream oss;
2729 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2730 throw INTERP_KERNEL::Exception(oss.str().c_str());
2732 pt[singleVal]=multiValV[0];
2737 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2741 throw INTERP_KERNEL::Exception(msg);
2750 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2754 std::ostringstream oss;
2755 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2756 throw INTERP_KERNEL::Exception(oss.str().c_str());
2764 if(multiVal.size()!=multiValV.size())
2766 std::ostringstream oss;
2767 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2768 throw INTERP_KERNEL::Exception(oss.str().c_str());
2770 for(int i=0;i<(int)multiVal.size();i++)
2772 int pos=multiVal[i];
2775 std::ostringstream oss;
2776 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2777 throw INTERP_KERNEL::Exception(oss.str().c_str());
2779 pt[multiVal[i]]=multiValV[i];
2785 const double *ptV=daIntTyyppV->getConstPointer();
2786 if(nbc>daIntTyyppV->getNumberOfCompo())
2788 std::ostringstream oss;
2789 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2790 throw INTERP_KERNEL::Exception(oss.str().c_str());
2792 std::copy(ptV,ptV+nbc,pt);
2796 throw INTERP_KERNEL::Exception(msg);
2801 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2806 for(int j=0;j<sz;j++)
2807 pt[slic.first+j*slic.second.second]=singleValV;
2812 if(sz!=(int)multiValV.size())
2814 std::ostringstream oss;
2815 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2816 throw INTERP_KERNEL::Exception(oss.str().c_str());
2818 for(int j=0;j<sz;j++)
2819 pt[slic.first+j*slic.second.second]=multiValV[j];
2824 const double *ptV=daIntTyyppV->getConstPointer();
2825 if(sz>daIntTyyppV->getNumberOfCompo())
2827 std::ostringstream oss;
2828 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2829 throw INTERP_KERNEL::Exception(oss.str().c_str());
2831 for(int j=0;j<sz;j++)
2832 pt[slic.first+j*slic.second.second]=ptV[j];
2836 throw INTERP_KERNEL::Exception(msg);
2840 throw INTERP_KERNEL::Exception(msg);
2845 %extend ParaMEDMEM::DataArrayDouble
2847 DataArrayDouble() throw(INTERP_KERNEL::Exception)
2849 return DataArrayDouble::New();
2852 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2854 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) !";
2855 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2859 if(PyInt_Check(nbOfTuples))
2861 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2863 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2866 if(PyInt_Check(elt2))
2867 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2868 int nbOfCompo=PyInt_AS_LONG(elt2);
2870 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2871 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2872 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
2873 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2878 throw INTERP_KERNEL::Exception(msg);
2881 {//DataArrayDouble.New([1.,3.,4.],3)
2882 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2884 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
2885 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2891 throw INTERP_KERNEL::Exception(msg);
2894 {// DataArrayDouble.New([1.,3.,4.])
2895 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2896 int tmpp1=-1,tmpp2=-1;
2897 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
2898 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2903 else if(PyInt_Check(elt0))
2905 int nbOfTuples1=PyInt_AS_LONG(elt0);
2907 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2912 if(PyInt_Check(nbOfTuples))
2913 {//DataArrayDouble.New(5,2)
2914 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2916 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2917 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2918 ret->alloc(nbOfTuples1,nbOfCompo);
2923 throw INTERP_KERNEL::Exception(msg);
2926 throw INTERP_KERNEL::Exception(msg);
2929 {//DataArrayDouble.New(5)
2930 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2931 ret->alloc(nbOfTuples1,1);
2937 throw INTERP_KERNEL::Exception(msg);
2940 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2942 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
2945 std::string __str__() const
2947 return self->repr();
2950 double __float__() const throw(INTERP_KERNEL::Exception)
2952 return self->doubleValue();
2955 int __len__() const throw(INTERP_KERNEL::Exception)
2957 if(self->isAllocated())
2959 return self->getNumberOfTuples();
2963 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2967 DataArrayDoubleIterator *__iter__()
2969 return self->iterator();
2972 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2974 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 !";
2975 if(PyList_Check(li) || PyTuple_Check(li))
2979 if(PyInt_Check(nbOfTuples))
2981 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2983 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
2986 if(PyInt_Check(nbOfComp))
2987 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
2988 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2990 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
2991 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
2992 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2995 throw INTERP_KERNEL::Exception(msg);
2998 {//DataArrayDouble.setValues([1.,3.,4.],3)
3000 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
3001 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3005 throw INTERP_KERNEL::Exception(msg);
3008 {// DataArrayDouble.setValues([1.,3.,4.])
3009 int tmpp1=-1,tmpp2=-1;
3010 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
3011 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3015 throw INTERP_KERNEL::Exception(msg);
3018 PyObject *getValues() throw(INTERP_KERNEL::Exception)
3020 const double *vals=self->getPointer();
3021 return convertDblArrToPyList(vals,self->getNbOfElems());
3024 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
3027 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
3028 PyObject *ret=PyTuple_New(2);
3029 PyObject *ret0Py=ret0?Py_True:Py_False;
3031 PyTuple_SetItem(ret,0,ret0Py);
3032 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3036 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
3038 const double *vals=self->getPointer();
3039 int nbOfComp=self->getNumberOfComponents();
3040 int nbOfTuples=self->getNumberOfTuples();
3041 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3044 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3047 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3048 if (!SWIG_IsOK(res1))
3051 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3052 if(size!=self->getNumberOfTuples())
3054 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3056 return self->renumber(tmp);
3060 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3062 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3063 da2->checkAllocated();
3064 int size=self->getNumberOfTuples();
3065 if(size!=self->getNumberOfTuples())
3067 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3069 return self->renumber(da2->getConstPointer());
3073 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3076 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3077 if (!SWIG_IsOK(res1))
3080 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3081 if(size!=self->getNumberOfTuples())
3083 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3085 return self->renumberR(tmp);
3089 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3091 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3092 da2->checkAllocated();
3093 int size=self->getNumberOfTuples();
3094 if(size!=self->getNumberOfTuples())
3096 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3098 return self->renumberR(da2->getConstPointer());
3102 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3105 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3106 if (!SWIG_IsOK(res1))
3109 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3110 if(size!=self->getNumberOfTuples())
3112 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3114 return self->renumberAndReduce(tmp,newNbOfTuple);
3118 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3120 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3121 da2->checkAllocated();
3122 int size=self->getNumberOfTuples();
3123 if(size!=self->getNumberOfTuples())
3125 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3127 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3131 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
3134 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3135 if (!SWIG_IsOK(res1))
3138 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3139 if(size!=self->getNumberOfTuples())
3141 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3143 self->renumberInPlace(tmp);
3147 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3149 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3150 da2->checkAllocated();
3151 int size=self->getNumberOfTuples();
3152 if(size!=self->getNumberOfTuples())
3154 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3156 self->renumberInPlace(da2->getConstPointer());
3160 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
3163 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3164 if (!SWIG_IsOK(res1))
3167 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3168 if(size!=self->getNumberOfTuples())
3170 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3172 self->renumberInPlaceR(tmp);
3176 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3178 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3179 da2->checkAllocated();
3180 int size=self->getNumberOfTuples();
3181 if(size!=self->getNumberOfTuples())
3183 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3185 self->renumberInPlaceR(da2->getConstPointer());
3189 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3192 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3193 if (!SWIG_IsOK(res1))
3196 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3197 return self->selectByTupleId(tmp,tmp+size);
3201 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3203 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3204 da2->checkAllocated();
3205 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3209 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3212 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3213 if (!SWIG_IsOK(res1))
3216 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3217 return self->selectByTupleIdSafe(tmp,tmp+size);
3221 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3223 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3224 da2->checkAllocated();
3225 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3229 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3232 double r1=self->getMaxValue(tmp);
3233 PyObject *ret=PyTuple_New(2);
3234 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3235 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3239 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3242 double r1=self->getMaxValue2(tmp);
3243 PyObject *ret=PyTuple_New(2);
3244 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3245 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3249 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3252 double r1=self->getMinValue(tmp);
3253 PyObject *ret=PyTuple_New(2);
3254 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3255 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3259 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3262 double r1=self->getMinValue2(tmp);
3263 PyObject *ret=PyTuple_New(2);
3264 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3265 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3269 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3271 int nbOfCompo=self->getNumberOfComponents();
3272 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3273 self->getMinMaxPerComponent(tmp);
3274 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3278 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3280 int sz=self->getNumberOfComponents();
3281 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3282 self->accumulate(tmp);
3283 return convertDblArrToPyList(tmp,sz);
3286 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3288 std::vector<int> tmp;
3289 convertPyToNewIntArr3(li,tmp);
3290 return self->keepSelectedComponents(tmp);
3293 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3295 DataArrayInt *comm, *commIndex;
3296 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3297 PyObject *res = PyList_New(2);
3298 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3299 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3303 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
3307 DataArrayDoubleTuple *aa;
3308 std::vector<double> bb;
3310 int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
3311 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
3313 int cellId=-1,nodeId=-1;
3314 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
3315 PyObject *ret=PyTuple_New(2);
3316 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
3317 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
3321 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3323 std::vector<int> tmp;
3324 convertPyToNewIntArr3(li,tmp);
3325 self->setSelectedComponents(a,tmp);
3328 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3330 int sz=self->getNumberOfComponents();
3331 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3332 self->getTuple(tupleId,tmp);
3333 return convertDblArrToPyList(tmp,sz);
3336 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3338 std::vector<const DataArrayDouble *> tmp;
3339 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3340 return DataArrayDouble::Aggregate(tmp);
3343 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3345 std::vector<const DataArrayDouble *> tmp;
3346 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3347 return DataArrayDouble::Meld(tmp);
3350 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3352 std::vector<std::pair<int,int> > ranges;
3353 convertPyToVectorPairInt(li,ranges);
3354 return self->selectByTupleRanges(ranges);
3357 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3361 DataArrayDoubleTuple *aa;
3362 std::vector<double> bb;
3364 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3365 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3366 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3367 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3368 DataArrayInt *c=0,*cI=0;
3369 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3370 PyObject *ret=PyTuple_New(2);
3371 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3372 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3376 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3378 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3379 self->checkAllocated();
3380 int nbOfTuples=self->getNumberOfTuples();
3381 int nbOfComponents=self->getNumberOfComponents();
3383 std::vector<int> vt1,vc1;
3384 std::pair<int, std::pair<int,int> > pt1,pc1;
3385 DataArrayInt *dt1=0,*dc1=0;
3387 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3388 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3392 if(nbOfComponents==1)
3393 return PyFloat_FromDouble(self->getIJSafe(it1,0));
3394 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3396 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3398 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3400 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3402 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3405 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3406 std::vector<int> v2(1,ic1);
3407 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3411 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3412 std::vector<int> v2(1,ic1);
3413 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3417 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
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->selectByTupleIdSafe(&it1,&it1+1);
3424 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3428 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3429 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3433 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3434 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3438 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3439 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3443 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3444 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3445 std::vector<int> v2(nbOfComp);
3446 for(int i=0;i<nbOfComp;i++)
3447 v2[i]=pc1.first+i*pc1.second.second;
3448 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3452 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3453 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3454 std::vector<int> v2(nbOfComp);
3455 for(int i=0;i<nbOfComp;i++)
3456 v2[i]=pc1.first+i*pc1.second.second;
3457 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3461 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3462 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3463 std::vector<int> v2(nbOfComp);
3464 for(int i=0;i<nbOfComp;i++)
3465 v2[i]=pc1.first+i*pc1.second.second;
3466 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3470 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3471 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3472 std::vector<int> v2(nbOfComp);
3473 for(int i=0;i<nbOfComp;i++)
3474 v2[i]=pc1.first+i*pc1.second.second;
3475 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3478 throw INTERP_KERNEL::Exception(msg);
3482 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3484 self->checkAllocated();
3485 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3486 int nbOfTuples=self->getNumberOfTuples();
3487 int nbOfComponents=self->getNumberOfComponents();
3490 std::vector<double> v1;
3491 DataArrayDouble *d1=0;
3492 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3494 std::vector<int> vt1,vc1;
3495 std::pair<int, std::pair<int,int> > pt1,pc1;
3496 DataArrayInt *dt1=0,*dc1=0;
3497 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3498 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3506 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3509 tmp=DataArrayDouble::New();
3510 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3511 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3514 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3517 throw INTERP_KERNEL::Exception(msg);
3526 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3529 tmp=DataArrayDouble::New();
3530 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3531 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3534 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3537 throw INTERP_KERNEL::Exception(msg);
3546 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3549 tmp=DataArrayDouble::New();
3550 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3551 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3554 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3557 throw INTERP_KERNEL::Exception(msg);
3566 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3569 tmp=DataArrayDouble::New();
3570 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3571 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3574 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3577 throw INTERP_KERNEL::Exception(msg);
3586 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3589 tmp=DataArrayDouble::New();
3590 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3591 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3594 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3597 throw INTERP_KERNEL::Exception(msg);
3606 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3609 tmp=DataArrayDouble::New();
3610 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3611 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3614 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3617 throw INTERP_KERNEL::Exception(msg);
3626 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3629 tmp=DataArrayDouble::New();
3630 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3631 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3634 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3637 throw INTERP_KERNEL::Exception(msg);
3646 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3649 tmp=DataArrayDouble::New();
3650 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3651 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3654 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3657 throw INTERP_KERNEL::Exception(msg);
3666 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3669 tmp=DataArrayDouble::New();
3670 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3671 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3674 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3677 throw INTERP_KERNEL::Exception(msg);
3686 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3689 tmp=DataArrayDouble::New();
3690 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3691 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3694 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3697 throw INTERP_KERNEL::Exception(msg);
3704 int ee=pt1.second.first;
3705 int ss=pt1.second.second;
3707 throw INTERP_KERNEL::Exception("Invalid slice in tuple selection");
3708 int nbOfE=(ee-bb)/ss;
3709 std::vector<int> nv(nbOfE);
3710 for(int jj=0;jj<nbOfE;jj++)
3715 self->setPartOfValuesSimple2(i1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
3718 tmp=DataArrayDouble::New();
3719 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3720 self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3723 self->setPartOfValues2(d1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
3726 throw INTERP_KERNEL::Exception(msg);
3735 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3738 tmp=DataArrayDouble::New();
3739 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3740 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3743 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3746 throw INTERP_KERNEL::Exception(msg);
3755 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3758 tmp=DataArrayDouble::New();
3759 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3760 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3763 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3766 throw INTERP_KERNEL::Exception(msg);
3775 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3778 tmp=DataArrayDouble::New();
3779 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3780 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3783 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3786 throw INTERP_KERNEL::Exception(msg);
3795 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3798 tmp=DataArrayDouble::New();
3799 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3800 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3803 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3806 throw INTERP_KERNEL::Exception(msg);
3815 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3818 tmp=DataArrayDouble::New();
3819 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3820 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3823 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3826 throw INTERP_KERNEL::Exception(msg);
3831 throw INTERP_KERNEL::Exception(msg);
3836 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3838 return self->negate();
3841 DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3843 const char msg[]="Unexpected situation in __add__ !";
3846 DataArrayDoubleTuple *aa;
3847 std::vector<double> bb;
3849 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3854 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3855 ret->applyLin(1.,val);
3861 return DataArrayDouble::Add(self,a);
3865 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3866 return DataArrayDouble::Add(self,aaa);
3870 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3871 return DataArrayDouble::Add(self,aaa);
3874 throw INTERP_KERNEL::Exception(msg);
3878 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3880 const char msg[]="Unexpected situation in __radd__ !";
3883 DataArrayDoubleTuple *aa;
3884 std::vector<double> bb;
3886 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3891 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3892 ret->applyLin(1.,val);
3898 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3899 return DataArrayDouble::Add(self,aaa);
3903 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3904 return DataArrayDouble::Add(self,aaa);
3907 throw INTERP_KERNEL::Exception(msg);
3911 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3913 const char msg[]="Unexpected situation in __iadd__ !";
3916 DataArrayDoubleTuple *aa;
3917 std::vector<double> bb;
3919 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3924 self->applyLin(1.,val);
3925 Py_XINCREF(trueSelf);
3931 Py_XINCREF(trueSelf);
3936 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3937 self->addEqual(aaa);
3938 Py_XINCREF(trueSelf);
3943 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3944 self->addEqual(aaa);
3945 Py_XINCREF(trueSelf);
3949 throw INTERP_KERNEL::Exception(msg);
3953 DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3955 const char msg[]="Unexpected situation in __sub__ !";
3958 DataArrayDoubleTuple *aa;
3959 std::vector<double> bb;
3961 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3966 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3967 ret->applyLin(1.,-val);
3973 return DataArrayDouble::Substract(self,a);
3977 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3978 return DataArrayDouble::Substract(self,aaa);
3982 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3983 return DataArrayDouble::Substract(self,aaa);
3986 throw INTERP_KERNEL::Exception(msg);
3990 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3992 const char msg[]="Unexpected situation in __rsub__ !";
3995 DataArrayDoubleTuple *aa;
3996 std::vector<double> bb;
3998 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4003 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4004 ret->applyLin(-1.,val);
4010 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4011 return DataArrayDouble::Substract(aaa,self);
4015 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4016 return DataArrayDouble::Substract(aaa,self);
4019 throw INTERP_KERNEL::Exception(msg);
4023 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4025 const char msg[]="Unexpected situation in __isub__ !";
4028 DataArrayDoubleTuple *aa;
4029 std::vector<double> bb;
4031 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4036 self->applyLin(1,-val);
4037 Py_XINCREF(trueSelf);
4042 self->substractEqual(a);
4043 Py_XINCREF(trueSelf);
4048 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4049 self->substractEqual(aaa);
4050 Py_XINCREF(trueSelf);
4055 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4056 self->substractEqual(aaa);
4057 Py_XINCREF(trueSelf);
4061 throw INTERP_KERNEL::Exception(msg);
4065 DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4067 const char msg[]="Unexpected situation in __mul__ !";
4070 DataArrayDoubleTuple *aa;
4071 std::vector<double> bb;
4073 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4078 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4079 ret->applyLin(val,0.);
4085 return DataArrayDouble::Multiply(self,a);
4089 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4090 return DataArrayDouble::Multiply(self,aaa);
4094 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4095 return DataArrayDouble::Multiply(self,aaa);
4098 throw INTERP_KERNEL::Exception(msg);
4102 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4104 const char msg[]="Unexpected situation in __rmul__ !";
4107 DataArrayDoubleTuple *aa;
4108 std::vector<double> bb;
4110 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4115 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4116 ret->applyLin(val,0.);
4122 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4123 return DataArrayDouble::Multiply(self,aaa);
4127 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4128 return DataArrayDouble::Multiply(self,aaa);
4131 throw INTERP_KERNEL::Exception(msg);
4135 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4137 const char msg[]="Unexpected situation in __imul__ !";
4140 DataArrayDoubleTuple *aa;
4141 std::vector<double> bb;
4143 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4148 self->applyLin(val,0.);
4149 Py_XINCREF(trueSelf);
4154 self->multiplyEqual(a);
4155 Py_XINCREF(trueSelf);
4160 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4161 self->multiplyEqual(aaa);
4162 Py_XINCREF(trueSelf);
4167 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4168 self->multiplyEqual(aaa);
4169 Py_XINCREF(trueSelf);
4173 throw INTERP_KERNEL::Exception(msg);
4177 DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4179 const char msg[]="Unexpected situation in __div__ !";
4182 DataArrayDoubleTuple *aa;
4183 std::vector<double> bb;
4185 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4191 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4192 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4193 ret->applyLin(1/val,0.);
4199 return DataArrayDouble::Divide(self,a);
4203 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4204 return DataArrayDouble::Divide(self,aaa);
4208 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4209 return DataArrayDouble::Divide(self,aaa);
4212 throw INTERP_KERNEL::Exception(msg);
4216 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4218 const char msg[]="Unexpected situation in __rdiv__ !";
4221 DataArrayDoubleTuple *aa;
4222 std::vector<double> bb;
4224 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4229 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4236 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4237 return DataArrayDouble::Divide(aaa,self);
4241 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4242 return DataArrayDouble::Divide(aaa,self);
4245 throw INTERP_KERNEL::Exception(msg);
4249 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4251 const char msg[]="Unexpected situation in __idiv__ !";
4254 DataArrayDoubleTuple *aa;
4255 std::vector<double> bb;
4257 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4263 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4264 self->applyLin(1./val,0.);
4265 Py_XINCREF(trueSelf);
4270 self->divideEqual(a);
4271 Py_XINCREF(trueSelf);
4276 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4277 self->divideEqual(aaa);
4278 Py_XINCREF(trueSelf);
4283 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4284 self->divideEqual(aaa);
4285 Py_XINCREF(trueSelf);
4289 throw INTERP_KERNEL::Exception(msg);
4293 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4295 DataArrayInt *c=0,*cI=0;
4297 self->computeTupleIdsNearTuples(other,eps,c,cI);
4298 PyObject *ret=PyTuple_New(2);
4299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4300 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4305 %extend ParaMEDMEM::DataArrayIntTuple
4307 std::string __str__() const
4309 return self->repr();
4312 int __int__() const throw(INTERP_KERNEL::Exception)
4314 return self->intValue();
4317 DataArrayInt *buildDAInt()
4319 return self->buildDAInt(1,self->getNumberOfCompo());
4322 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4324 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4325 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4326 Py_XINCREF(trueSelf);
4330 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4332 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4333 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4334 Py_XINCREF(trueSelf);
4338 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4340 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4341 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4342 Py_XINCREF(trueSelf);
4346 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4348 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4349 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4350 Py_XINCREF(trueSelf);
4354 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4356 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4357 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4358 Py_XINCREF(trueSelf);
4362 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4366 std::vector<int> multiVal;
4367 std::pair<int, std::pair<int,int> > slic;
4368 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4369 const int *pt=self->getConstPointer();
4370 int nbc=self->getNumberOfCompo();
4371 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4378 std::ostringstream oss;
4379 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4380 throw INTERP_KERNEL::Exception(oss.str().c_str());
4383 return PyInt_FromLong(pt[singleVal]);
4387 return PyInt_FromLong(pt[nbc+singleVal]);
4390 std::ostringstream oss;
4391 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4392 throw INTERP_KERNEL::Exception(oss.str().c_str());
4398 PyObject *t=PyTuple_New(multiVal.size());
4399 for(int j=0;j<(int)multiVal.size();j++)
4401 int cid=multiVal[j];
4404 std::ostringstream oss;
4405 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4406 throw INTERP_KERNEL::Exception(oss.str().c_str());
4408 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4414 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4415 PyObject *t=PyTuple_New(sz);
4416 for(int j=0;j<sz;j++)
4417 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4421 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4425 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4427 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4430 std::vector<int> multiValV;
4431 std::pair<int, std::pair<int,int> > slicV;
4432 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4433 int nbc=self->getNumberOfCompo();
4434 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4436 std::vector<int> multiVal;
4437 std::pair<int, std::pair<int,int> > slic;
4438 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4439 int *pt=self->getPointer();
4440 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4447 std::ostringstream oss;
4448 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4449 throw INTERP_KERNEL::Exception(oss.str().c_str());
4455 pt[singleVal]=singleValV;
4460 if(multiValV.size()!=1)
4462 std::ostringstream oss;
4463 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4464 throw INTERP_KERNEL::Exception(oss.str().c_str());
4466 pt[singleVal]=multiValV[0];
4471 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4475 throw INTERP_KERNEL::Exception(msg);
4484 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4488 std::ostringstream oss;
4489 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4490 throw INTERP_KERNEL::Exception(oss.str().c_str());
4498 if(multiVal.size()!=multiValV.size())
4500 std::ostringstream oss;
4501 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4502 throw INTERP_KERNEL::Exception(oss.str().c_str());
4504 for(int i=0;i<(int)multiVal.size();i++)
4506 int pos=multiVal[i];
4509 std::ostringstream oss;
4510 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4511 throw INTERP_KERNEL::Exception(oss.str().c_str());
4513 pt[multiVal[i]]=multiValV[i];
4519 const int *ptV=daIntTyyppV->getConstPointer();
4520 if(nbc>daIntTyyppV->getNumberOfCompo())
4522 std::ostringstream oss;
4523 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4524 throw INTERP_KERNEL::Exception(oss.str().c_str());
4526 std::copy(ptV,ptV+nbc,pt);
4530 throw INTERP_KERNEL::Exception(msg);
4535 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4540 for(int j=0;j<sz;j++)
4541 pt[slic.first+j*slic.second.second]=singleValV;
4546 if(sz!=(int)multiValV.size())
4548 std::ostringstream oss;
4549 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4550 throw INTERP_KERNEL::Exception(oss.str().c_str());
4552 for(int j=0;j<sz;j++)
4553 pt[slic.first+j*slic.second.second]=multiValV[j];
4558 const int *ptV=daIntTyyppV->getConstPointer();
4559 if(sz>daIntTyyppV->getNumberOfCompo())
4561 std::ostringstream oss;
4562 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4563 throw INTERP_KERNEL::Exception(oss.str().c_str());
4565 for(int j=0;j<sz;j++)
4566 pt[slic.first+j*slic.second.second]=ptV[j];
4570 throw INTERP_KERNEL::Exception(msg);
4574 throw INTERP_KERNEL::Exception(msg);
4579 %extend ParaMEDMEM::DataArrayIntIterator
4583 DataArrayIntTuple *ret=self->nextt();
4585 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4588 PyErr_SetString(PyExc_StopIteration,"No more data.");
4594 %extend ParaMEDMEM::DataArrayInt
4596 DataArrayInt() throw(INTERP_KERNEL::Exception)
4598 return DataArrayInt::New();
4601 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4603 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) !";
4604 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4608 if(PyInt_Check(nbOfTuples))
4610 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4612 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4615 if(PyInt_Check(nbOfComp))
4616 {//DataArrayInt.New([1,3,4,5],2,2)
4617 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4619 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4620 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4621 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4622 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4627 throw INTERP_KERNEL::Exception(msg);
4630 {//DataArrayInt.New([1,3,4],3)
4631 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4633 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4634 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4640 throw INTERP_KERNEL::Exception(msg);
4643 {// DataArrayInt.New([1,3,4])
4644 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4645 int tmpp1=-1,tmpp2=-1;
4646 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4647 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4652 else if(PyInt_Check(elt0))
4654 int nbOfTuples1=PyInt_AS_LONG(elt0);
4656 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4661 if(PyInt_Check(nbOfTuples))
4662 {//DataArrayInt.New(5,2)
4663 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4665 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4666 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4667 ret->alloc(nbOfTuples1,nbOfCompo);
4672 throw INTERP_KERNEL::Exception(msg);
4675 throw INTERP_KERNEL::Exception(msg);
4678 {//DataArrayInt.New(5)
4679 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4680 ret->alloc(nbOfTuples1,1);
4686 throw INTERP_KERNEL::Exception(msg);
4689 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4691 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4694 std::string __str__() const
4696 return self->repr();
4699 int __len__() const throw(INTERP_KERNEL::Exception)
4701 if(self->isAllocated())
4703 return self->getNumberOfTuples();
4707 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4711 int __int__() const throw(INTERP_KERNEL::Exception)
4713 return self->intValue();
4716 DataArrayIntIterator *__iter__()
4718 return self->iterator();
4721 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4723 int sz=self->getNumberOfComponents();
4724 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4725 self->accumulate(tmp);
4726 return convertIntArrToPyList(tmp,sz);
4729 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
4731 int newNbOfTuples=-1;
4732 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
4733 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
4734 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
4735 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
4736 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
4737 PyObject *ret=PyTuple_New(2);
4738 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4739 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4743 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4745 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 !";
4746 if(PyList_Check(li) || PyTuple_Check(li))
4750 if(PyInt_Check(nbOfTuples))
4752 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4754 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
4757 if(PyInt_Check(nbOfComp))
4758 {//DataArrayInt.setValues([1,3,4,5],2,2)
4759 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4761 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
4762 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
4763 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4766 throw INTERP_KERNEL::Exception(msg);
4769 {//DataArrayInt.setValues([1,3,4],3)
4771 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
4772 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4776 throw INTERP_KERNEL::Exception(msg);
4779 {// DataArrayInt.setValues([1,3,4])
4780 int tmpp1=-1,tmpp2=-1;
4781 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
4782 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4786 throw INTERP_KERNEL::Exception(msg);
4789 PyObject *getValues() throw(INTERP_KERNEL::Exception)
4791 const int *vals=self->getPointer();
4792 return convertIntArrToPyList(vals,self->getNbOfElems());
4795 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4798 bool ret0=self->isEqualIfNotWhy(other,ret1);
4799 PyObject *ret=PyTuple_New(2);
4800 PyObject *ret0Py=ret0?Py_True:Py_False;
4802 PyTuple_SetItem(ret,0,ret0Py);
4803 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4807 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4809 const int *vals=self->getPointer();
4810 int nbOfComp=self->getNumberOfComponents();
4811 int nbOfTuples=self->getNumberOfTuples();
4812 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4815 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4817 std::vector<const DataArrayInt *> groups;
4818 std::vector< std::vector<int> > fidsOfGroups;
4819 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4820 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4821 PyObject *ret = PyList_New(2);
4822 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4823 int sz=fidsOfGroups.size();
4824 PyObject *ret1 = PyList_New(sz);
4825 for(int i=0;i<sz;i++)
4826 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4827 PyList_SetItem(ret,1,ret1);
4831 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
4834 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4835 if (!SWIG_IsOK(res1))
4838 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4839 self->transformWithIndArr(tmp,tmp+size);
4843 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4844 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4848 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4852 std::vector<int> multiVal;
4853 std::pair<int, std::pair<int,int> > slic;
4854 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4855 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4859 return self->getIdsEqualList(&singleVal,&singleVal+1);
4861 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4863 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4865 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4869 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4873 std::vector<int> multiVal;
4874 std::pair<int, std::pair<int,int> > slic;
4875 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4876 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4880 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4882 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4884 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4886 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4890 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4892 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
4894 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4895 if (!SWIG_IsOK(res1))
4898 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4899 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4903 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4905 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4906 da2->checkAllocated();
4907 int size=self->getNumberOfTuples();
4908 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4910 PyObject *ret = PyList_New(3);
4911 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4912 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4913 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4917 DataArrayInt *transformWithIndArrR(PyObject *li) const
4920 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4921 if (!SWIG_IsOK(res1))
4924 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4925 return self->transformWithIndArrR(tmp,tmp+size);
4929 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4930 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4934 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4937 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4938 if (!SWIG_IsOK(res1))
4941 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4942 if(size!=self->getNumberOfTuples())
4944 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4946 self->renumberInPlace(tmp);
4950 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4952 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4953 da2->checkAllocated();
4954 int size=self->getNumberOfTuples();
4955 if(size!=self->getNumberOfTuples())
4957 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4959 self->renumberInPlace(da2->getConstPointer());
4963 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4966 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4967 if (!SWIG_IsOK(res1))
4970 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4971 if(size!=self->getNumberOfTuples())
4973 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4975 self->renumberInPlaceR(tmp);
4979 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4981 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4982 da2->checkAllocated();
4983 int size=self->getNumberOfTuples();
4984 if(size!=self->getNumberOfTuples())
4986 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4988 self->renumberInPlaceR(da2->getConstPointer());
4992 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4995 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4996 if (!SWIG_IsOK(res1))
4999 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5000 if(size!=self->getNumberOfTuples())
5002 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5004 return self->renumberAndReduce(tmp,newNbOfTuple);
5008 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5010 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5011 da2->checkAllocated();
5012 int size=self->getNumberOfTuples();
5013 if(size!=self->getNumberOfTuples())
5015 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5017 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5021 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5024 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5025 if (!SWIG_IsOK(res1))
5028 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5029 if(size!=self->getNumberOfTuples())
5031 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5033 return self->renumber(tmp);
5037 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5039 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5040 da2->checkAllocated();
5041 int size=self->getNumberOfTuples();
5042 if(size!=self->getNumberOfTuples())
5044 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5046 return self->renumber(da2->getConstPointer());
5050 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5053 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5054 if (!SWIG_IsOK(res1))
5057 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5058 if(size!=self->getNumberOfTuples())
5060 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5062 return self->renumberR(tmp);
5066 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5068 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5069 da2->checkAllocated();
5070 int size=self->getNumberOfTuples();
5071 if(size!=self->getNumberOfTuples())
5073 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5075 return self->renumberR(da2->getConstPointer());
5079 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
5082 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5083 if (!SWIG_IsOK(res1))
5086 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5087 return self->selectByTupleId(tmp,tmp+size);
5091 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5093 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5094 da2->checkAllocated();
5095 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5099 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
5102 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5103 if (!SWIG_IsOK(res1))
5106 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5107 return self->selectByTupleIdSafe(tmp,tmp+size);
5111 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5113 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5114 da2->checkAllocated();
5115 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5119 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
5121 std::vector<int> tmp;
5122 convertPyToNewIntArr3(li,tmp);
5123 return self->keepSelectedComponents(tmp);
5126 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
5128 std::vector<int> tmp;
5129 convertPyToNewIntArr3(li,tmp);
5130 self->setSelectedComponents(a,tmp);
5133 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5135 int sz=self->getNumberOfComponents();
5136 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5137 self->getTuple(tupleId,tmp);
5138 return convertIntArrToPyList(tmp,sz);
5141 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
5143 DataArrayInt *arr=0;
5144 DataArrayInt *arrI=0;
5145 self->changeSurjectiveFormat(targetNb,arr,arrI);
5146 PyObject *res = PyList_New(2);
5147 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5148 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5152 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
5154 std::vector<std::pair<int,int> > ranges;
5155 convertPyToVectorPairInt(li,ranges);
5156 return self->selectByTupleRanges(ranges);
5159 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
5161 std::vector<const DataArrayInt *> tmp;
5162 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5163 return DataArrayInt::Meld(tmp);
5166 static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
5168 std::vector<const DataArrayInt *> tmp;
5169 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5170 return DataArrayInt::Aggregate(tmp);
5173 static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
5175 std::vector<const DataArrayInt *> tmp;
5176 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5177 return DataArrayInt::BuildUnion(tmp);
5180 static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
5182 std::vector<const DataArrayInt *> tmp;
5183 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5184 return DataArrayInt::BuildIntersection(tmp);
5187 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5190 int r1=self->getMaxValue(tmp);
5191 PyObject *ret=PyTuple_New(2);
5192 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5193 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5197 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5200 int r1=self->getMinValue(tmp);
5201 PyObject *ret=PyTuple_New(2);
5202 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5203 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5207 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5209 int nbOfCompo=self->getNumberOfComponents();
5214 if(PyInt_Check(obj))
5216 int val=(int)PyInt_AS_LONG(obj);
5217 return self->locateValue(val);
5220 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5224 std::vector<int> arr;
5225 convertPyToNewIntArr3(obj,arr);
5226 return self->locateTuple(arr);
5231 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5233 int nbOfCompo=self->getNumberOfComponents();
5240 if(PyInt_Check(obj))
5242 int val=(int)PyInt_AS_LONG(obj);
5243 return self->presenceOfValue(val);
5246 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5250 std::vector<int> arr;
5251 convertPyToNewIntArr3(obj,arr);
5252 return self->presenceOfTuple(arr);
5257 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5259 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5260 self->checkAllocated();
5261 int nbOfTuples=self->getNumberOfTuples();
5262 int nbOfComponents=self->getNumberOfComponents();
5264 std::vector<int> vt1,vc1;
5265 std::pair<int, std::pair<int,int> > pt1,pc1;
5266 DataArrayInt *dt1=0,*dc1=0;
5268 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5269 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5274 if(nbOfComponents==1)
5275 return PyInt_FromLong(self->getIJSafe(it1,0));
5276 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5279 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5281 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5283 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5285 return PyInt_FromLong(self->getIJSafe(it1,ic1));
5288 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5289 std::vector<int> v2(1,ic1);
5290 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5294 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5295 std::vector<int> v2(1,ic1);
5296 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5300 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5301 std::vector<int> v2(1,ic1);
5302 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5306 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5311 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5312 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5316 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5317 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5321 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5322 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5326 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5327 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5328 std::vector<int> v2(nbOfComp);
5329 for(int i=0;i<nbOfComp;i++)
5330 v2[i]=pc1.first+i*pc1.second.second;
5331 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5335 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5336 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5337 std::vector<int> v2(nbOfComp);
5338 for(int i=0;i<nbOfComp;i++)
5339 v2[i]=pc1.first+i*pc1.second.second;
5340 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5344 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5345 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5346 std::vector<int> v2(nbOfComp);
5347 for(int i=0;i<nbOfComp;i++)
5348 v2[i]=pc1.first+i*pc1.second.second;
5349 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5353 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5354 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5355 std::vector<int> v2(nbOfComp);
5356 for(int i=0;i<nbOfComp;i++)
5357 v2[i]=pc1.first+i*pc1.second.second;
5358 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5361 throw INTERP_KERNEL::Exception(msg);
5365 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5367 self->checkAllocated();
5368 const char msg[]="Unexpected situation in __setitem__ !";
5369 int nbOfTuples=self->getNumberOfTuples();
5370 int nbOfComponents=self->getNumberOfComponents();
5373 std::vector<int> v1;
5375 DataArrayIntTuple *dd1=0;
5376 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5378 std::vector<int> vt1,vc1;
5379 std::pair<int, std::pair<int,int> > pt1,pc1;
5380 DataArrayInt *dt1=0,*dc1=0;
5381 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5382 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5390 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5393 tmp=DataArrayInt::New();
5394 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5395 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5398 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5401 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5402 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5405 throw INTERP_KERNEL::Exception(msg);
5414 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5417 tmp=DataArrayInt::New();
5418 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5419 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5422 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5425 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5426 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5429 throw INTERP_KERNEL::Exception(msg);
5438 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5441 tmp=DataArrayInt::New();
5442 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5443 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5446 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5449 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5450 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5453 throw INTERP_KERNEL::Exception(msg);
5462 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5465 tmp=DataArrayInt::New();
5466 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5467 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5470 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5473 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5474 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5477 throw INTERP_KERNEL::Exception(msg);
5486 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5489 tmp=DataArrayInt::New();
5490 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5491 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5494 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5497 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5498 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5501 throw INTERP_KERNEL::Exception(msg);
5510 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5513 tmp=DataArrayInt::New();
5514 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5515 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5518 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5521 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5522 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5525 throw INTERP_KERNEL::Exception(msg);
5534 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5537 tmp=DataArrayInt::New();
5538 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5539 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5542 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5545 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5546 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5549 throw INTERP_KERNEL::Exception(msg);
5558 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5561 tmp=DataArrayInt::New();
5562 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5563 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5566 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5569 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5570 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5573 throw INTERP_KERNEL::Exception(msg);
5582 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5585 tmp=DataArrayInt::New();
5586 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5587 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5590 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5593 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5594 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5597 throw INTERP_KERNEL::Exception(msg);
5606 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5609 tmp=DataArrayInt::New();
5610 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5611 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5614 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5617 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5618 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5621 throw INTERP_KERNEL::Exception(msg);
5628 int ee=pt1.second.first;
5629 int ss=pt1.second.second;
5631 throw INTERP_KERNEL::Exception("Invalid slice in tuple selection");
5632 int nbOfE=(ee-bb)/ss;
5633 std::vector<int> nv(nbOfE);
5634 for(int jj=0;jj<nbOfE;jj++)
5639 self->setPartOfValuesSimple2(i1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5642 tmp=DataArrayInt::New();
5643 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5644 self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5647 self->setPartOfValues2(d1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5650 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5651 self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5654 throw INTERP_KERNEL::Exception(msg);
5663 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5666 tmp=DataArrayInt::New();
5667 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5668 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5671 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5674 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5675 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5678 throw INTERP_KERNEL::Exception(msg);
5687 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5690 tmp=DataArrayInt::New();
5691 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5692 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5695 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5698 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5699 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5702 throw INTERP_KERNEL::Exception(msg);
5711 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5714 tmp=DataArrayInt::New();
5715 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5716 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5719 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5722 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5723 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5726 throw INTERP_KERNEL::Exception(msg);
5735 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5738 tmp=DataArrayInt::New();
5739 tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5740 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5743 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5746 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5747 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5750 throw INTERP_KERNEL::Exception(msg);
5759 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5762 tmp=DataArrayInt::New();
5763 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5764 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5767 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5770 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5771 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5774 throw INTERP_KERNEL::Exception(msg);
5779 throw INTERP_KERNEL::Exception(msg);
5784 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5786 return self->negate();
5789 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5791 const char msg[]="Unexpected situation in __add__ !";
5794 std::vector<int> aa;
5795 DataArrayIntTuple *aaa;
5797 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5802 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5803 ret->applyLin(1,val);
5809 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5810 return DataArrayInt::Add(self,aaa);
5814 return DataArrayInt::Add(self,a);
5818 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5819 return DataArrayInt::Add(self,aaaa);
5822 throw INTERP_KERNEL::Exception(msg);
5826 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5828 const char msg[]="Unexpected situation in __radd__ !";
5831 std::vector<int> aa;
5832 DataArrayIntTuple *aaa;
5834 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5839 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5840 ret->applyLin(1,val);
5846 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5847 return DataArrayInt::Add(self,aaa);
5851 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5852 return DataArrayInt::Add(self,aaaa);
5855 throw INTERP_KERNEL::Exception(msg);
5859 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5861 const char msg[]="Unexpected situation in __iadd__ !";
5864 std::vector<int> aa;
5865 DataArrayIntTuple *aaa;
5867 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5872 self->applyLin(1,val);
5873 Py_XINCREF(trueSelf);
5878 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5880 Py_XINCREF(trueSelf);
5886 Py_XINCREF(trueSelf);
5891 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5892 self->addEqual(aaaa);
5893 Py_XINCREF(trueSelf);
5897 throw INTERP_KERNEL::Exception(msg);
5901 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5903 const char msg[]="Unexpected situation in __sub__ !";
5906 std::vector<int> aa;
5907 DataArrayIntTuple *aaa;
5909 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5914 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5915 ret->applyLin(1,-val);
5921 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5922 return DataArrayInt::Substract(self,aaa);
5926 return DataArrayInt::Substract(self,a);
5930 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5931 return DataArrayInt::Substract(self,aaaa);
5934 throw INTERP_KERNEL::Exception(msg);
5938 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5940 const char msg[]="Unexpected situation in __rsub__ !";
5943 std::vector<int> aa;
5944 DataArrayIntTuple *aaa;
5946 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5951 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5952 ret->applyLin(-1,val);
5958 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5959 return DataArrayInt::Substract(aaa,self);
5963 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5964 return DataArrayInt::Substract(aaaa,self);
5967 throw INTERP_KERNEL::Exception(msg);
5971 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5973 const char msg[]="Unexpected situation in __isub__ !";
5976 std::vector<int> aa;
5977 DataArrayIntTuple *aaa;
5979 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5984 self->applyLin(1,-val);
5985 Py_XINCREF(trueSelf);
5990 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5991 self->substractEqual(bb);
5992 Py_XINCREF(trueSelf);
5997 self->substractEqual(a);
5998 Py_XINCREF(trueSelf);
6003 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6004 self->substractEqual(aaaa);
6005 Py_XINCREF(trueSelf);
6009 throw INTERP_KERNEL::Exception(msg);
6013 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6015 const char msg[]="Unexpected situation in __mul__ !";
6018 std::vector<int> aa;
6019 DataArrayIntTuple *aaa;
6021 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6026 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6027 ret->applyLin(val,0);
6033 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6034 return DataArrayInt::Multiply(self,aaa);
6038 return DataArrayInt::Multiply(self,a);
6042 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6043 return DataArrayInt::Multiply(self,aaaa);
6046 throw INTERP_KERNEL::Exception(msg);
6050 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6052 const char msg[]="Unexpected situation in __rmul__ !";
6055 std::vector<int> aa;
6056 DataArrayIntTuple *aaa;
6058 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6063 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6064 ret->applyLin(val,0);
6070 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6071 return DataArrayInt::Multiply(self,aaa);
6075 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6076 return DataArrayInt::Multiply(self,aaaa);
6079 throw INTERP_KERNEL::Exception(msg);
6083 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6085 const char msg[]="Unexpected situation in __imul__ !";
6088 std::vector<int> aa;
6089 DataArrayIntTuple *aaa;
6091 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6096 self->applyLin(val,0);
6097 Py_XINCREF(trueSelf);
6102 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6103 self->multiplyEqual(bb);
6104 Py_XINCREF(trueSelf);
6109 self->multiplyEqual(a);
6110 Py_XINCREF(trueSelf);
6115 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6116 self->multiplyEqual(aaaa);
6117 Py_XINCREF(trueSelf);
6121 throw INTERP_KERNEL::Exception(msg);
6125 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6127 const char msg[]="Unexpected situation in __div__ !";
6130 std::vector<int> aa;
6131 DataArrayIntTuple *aaa;
6133 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6138 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6139 ret->applyDivideBy(val);
6145 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6146 return DataArrayInt::Divide(self,aaa);
6150 return DataArrayInt::Divide(self,a);
6154 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6155 return DataArrayInt::Divide(self,aaaa);
6158 throw INTERP_KERNEL::Exception(msg);
6162 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6164 const char msg[]="Unexpected situation in __rdiv__ !";
6167 std::vector<int> aa;
6168 DataArrayIntTuple *aaa;
6170 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6175 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6182 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6183 return DataArrayInt::Divide(aaa,self);
6187 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6188 return DataArrayInt::Divide(aaaa,self);
6191 throw INTERP_KERNEL::Exception(msg);
6195 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6197 const char msg[]="Unexpected situation in __idiv__ !";
6200 std::vector<int> aa;
6201 DataArrayIntTuple *aaa;
6203 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6208 self->applyDivideBy(val);
6209 Py_XINCREF(trueSelf);
6214 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6215 self->divideEqual(bb);
6216 Py_XINCREF(trueSelf);
6221 self->divideEqual(a);
6222 Py_XINCREF(trueSelf);
6227 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6228 self->divideEqual(aaaa);
6229 Py_XINCREF(trueSelf);
6233 throw INTERP_KERNEL::Exception(msg);
6237 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6239 const char msg[]="Unexpected situation in __mod__ !";
6242 std::vector<int> aa;
6243 DataArrayIntTuple *aaa;
6245 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6250 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6251 ret->applyModulus(val);
6257 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6258 return DataArrayInt::Modulus(self,aaa);
6262 return DataArrayInt::Modulus(self,a);
6266 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6267 return DataArrayInt::Modulus(self,aaaa);
6270 throw INTERP_KERNEL::Exception(msg);
6274 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6276 const char msg[]="Unexpected situation in __rmod__ !";
6279 std::vector<int> aa;
6280 DataArrayIntTuple *aaa;
6282 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6287 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6288 ret->applyRModulus(val);
6294 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6295 return DataArrayInt::Modulus(aaa,self);
6299 return DataArrayInt::Modulus(a,self);
6303 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6304 return DataArrayInt::Modulus(aaaa,self);
6307 throw INTERP_KERNEL::Exception(msg);
6311 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6313 const char msg[]="Unexpected situation in __imod__ !";
6316 std::vector<int> aa;
6317 DataArrayIntTuple *aaa;
6319 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6324 self->applyModulus(val);
6325 Py_XINCREF(trueSelf);
6330 self->modulusEqual(a);
6331 Py_XINCREF(trueSelf);
6336 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6337 self->modulusEqual(aaaa);
6338 Py_XINCREF(trueSelf);
6342 throw INTERP_KERNEL::Exception(msg);
6347 namespace ParaMEDMEM
6349 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6352 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6353 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6354 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6355 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6356 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6357 void setName(const char *name) throw(INTERP_KERNEL::Exception);
6358 const char *getDescription() const throw(INTERP_KERNEL::Exception);
6359 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6360 const char *getName() const throw(INTERP_KERNEL::Exception);
6361 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6362 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6363 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6364 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6365 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6366 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6367 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6368 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6369 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6370 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6371 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6372 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6373 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6374 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6375 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
6376 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
6378 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6380 MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6383 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6386 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6388 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6391 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6394 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
6396 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
6397 return convertIntArrToPyList3(ret);
6400 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6403 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6404 PyObject *ret=PyTuple_New(2);
6405 PyObject *ret0Py=ret0?Py_True:Py_False;
6407 PyTuple_SetItem(ret,0,ret0Py);
6408 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6412 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6414 DataArrayInt *ret1=0;
6415 MEDCouplingMesh *ret0=0;
6417 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6418 if (!SWIG_IsOK(res1))
6421 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6422 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6426 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6428 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6429 da2->checkAllocated();
6430 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6432 PyObject *res = PyList_New(2);
6433 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6434 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6438 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6442 std::vector<int> pos2;
6443 DataArrayInt *pos3=0;
6444 DataArrayIntTuple *pos4=0;
6445 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6450 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6454 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6458 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6461 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6465 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6466 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6469 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6470 if (!SWIG_IsOK(res1))
6473 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6474 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6478 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6480 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6481 da2->checkAllocated();
6482 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6486 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6488 std::vector<int> tmp;
6489 self->getCellIdsHavingGaussLocalization(locId,tmp);
6490 DataArrayInt *ret=DataArrayInt::New();
6491 ret->alloc((int)tmp.size(),1);
6492 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6493 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6498 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6501 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
6502 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME);
6503 void setTimeUnit(const char *unit);
6504 const char *getTimeUnit() const;
6505 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
6506 void copyTinyStringsFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6507 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6508 std::string simpleRepr() const;
6509 std::string advancedRepr() const;
6510 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
6511 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6512 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6513 MEDCouplingFieldDouble *deepCpy() const;
6514 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6515 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6516 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6517 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6518 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
6519 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6520 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6521 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6522 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6523 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6524 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6525 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6526 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6527 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6528 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6529 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6530 void setIteration(int it) throw(INTERP_KERNEL::Exception);
6531 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6532 void setOrder(int order) throw(INTERP_KERNEL::Exception);
6533 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6534 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6535 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6536 void updateTime() const throw(INTERP_KERNEL::Exception);
6537 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6538 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6539 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6540 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6541 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6542 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6543 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6544 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6545 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6546 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6547 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6548 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6549 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6550 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6551 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6552 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6553 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6554 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6555 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6556 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6557 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6558 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6559 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6560 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6561 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6562 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6563 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6564 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6565 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6566 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6567 double getMaxValue() const throw(INTERP_KERNEL::Exception);
6568 double getMinValue() const throw(INTERP_KERNEL::Exception);
6569 double getAverageValue() const throw(INTERP_KERNEL::Exception);
6570 double norm2() const throw(INTERP_KERNEL::Exception);
6571 double normMax() const throw(INTERP_KERNEL::Exception);
6572 double getWeightedAverageValue() const throw(INTERP_KERNEL::Exception);
6573 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6574 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6575 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6576 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6577 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6578 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6579 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6580 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6581 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6582 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6583 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6584 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6585 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6586 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6587 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6588 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6589 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6590 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6591 MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6592 MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6593 MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6594 MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6596 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
6598 return MEDCouplingFieldDouble::New(type,td);
6601 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME)
6603 return MEDCouplingFieldDouble::New(ft,td);
6606 std::string __str__() const
6608 return self->simpleRepr();
6611 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6613 DataArrayDouble *ret=self->getArray();
6619 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6621 std::vector<DataArrayDouble *> arrs=self->getArrays();
6622 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6626 PyObject *ret=PyTuple_New(sz);
6627 for(int i=0;i<sz;i++)
6630 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6632 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6637 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6639 std::vector<const DataArrayDouble *> tmp;
6640 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6642 std::vector<DataArrayDouble *> arrs(sz);
6643 for(int i=0;i<sz;i++)
6644 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6645 self->setArrays(arrs);
6648 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6650 DataArrayDouble *ret=self->getEndArray();
6656 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6660 DataArrayDoubleTuple *aa;
6661 std::vector<double> bb;
6663 const MEDCouplingMesh *mesh=self->getMesh();
6665 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6666 int spaceDim=mesh->getSpaceDimension();
6667 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6668 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6670 int sz=self->getNumberOfComponents();
6671 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6672 self->getValueOn(spaceLoc,res);
6673 return convertDblArrToPyList(res,sz);
6676 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6678 int sz=self->getNumberOfComponents();
6679 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6680 self->getValueOnPos(i,j,k,res);
6681 return convertDblArrToPyList(res,sz);
6684 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6687 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
6688 if (!SWIG_IsOK(res1))
6691 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6692 const MEDCouplingMesh *mesh=self->getMesh();
6694 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6695 int spaceDim=mesh->getSpaceDimension();
6696 int nbOfPoints=size/spaceDim;
6697 if(size%spaceDim!=0)
6699 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6701 return self->getValueOnMulti(tmp,nbOfPoints);
6705 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6707 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6708 da2->checkAllocated();
6709 int size=da2->getNumberOfTuples();
6710 int nbOfCompo=da2->getNumberOfComponents();
6711 const MEDCouplingMesh *mesh=self->getMesh();
6713 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6714 if(nbOfCompo!=mesh->getSpaceDimension())
6716 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6718 return self->getValueOnMulti(da2->getConstPointer(),size);
6722 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6726 DataArrayDoubleTuple *aa;
6727 std::vector<double> bb;
6729 const MEDCouplingMesh *mesh=self->getMesh();
6731 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6732 int spaceDim=mesh->getSpaceDimension();
6733 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6734 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6737 int sz=self->getNumberOfComponents();
6738 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6739 self->getValueOn(spaceLoc,time,res);
6740 return convertDblArrToPyList(res,sz);
6743 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6745 if(self->getArray()!=0)
6748 double *tmp=convertPyToNewDblArr2(li,&sz);
6749 int nbTuples=self->getArray()->getNumberOfTuples();
6750 int nbOfCompo=self->getArray()->getNumberOfComponents();
6751 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6754 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6757 PyObject *getTime() throw(INTERP_KERNEL::Exception)
6760 double tmp0=self->getTime(tmp1,tmp2);
6761 PyObject *res = PyList_New(3);
6762 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6763 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6764 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6768 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6771 double tmp0=self->getStartTime(tmp1,tmp2);
6772 PyObject *res = PyList_New(3);
6773 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6774 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6775 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6779 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6782 double tmp0=self->getEndTime(tmp1,tmp2);
6783 PyObject *res = PyList_New(3);
6784 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6785 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6786 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6789 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6791 int sz=self->getNumberOfComponents();
6792 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6793 self->accumulate(tmp);
6794 PyObject *ret=convertDblArrToPyList(tmp,sz);
6797 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6799 int sz=self->getNumberOfComponents();
6800 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6801 self->integral(isWAbs,tmp);
6802 PyObject *ret=convertDblArrToPyList(tmp,sz);
6805 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6807 int sz=self->getNumberOfComponents();
6808 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6810 PyObject *ret=convertDblArrToPyList(tmp,sz);
6813 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6815 int sz=self->getNumberOfComponents();
6816 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6818 PyObject *ret=convertDblArrToPyList(tmp,sz);
6821 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6824 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6825 if (!SWIG_IsOK(res1))
6828 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6829 self->renumberCells(tmp,check);
6833 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6835 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6836 da2->checkAllocated();
6837 self->renumberCells(da2->getConstPointer(),check);
6840 void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6843 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6844 if (!SWIG_IsOK(res1))
6847 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6848 self->renumberNodes(tmp);
6852 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6854 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6855 da2->checkAllocated();
6856 self->renumberNodes(da2->getConstPointer());
6860 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6864 std::vector<int> multiVal;
6865 std::pair<int, std::pair<int,int> > slic;
6866 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6867 const MEDCouplingMesh *mesh=self->getMesh();
6869 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6870 int nbc=mesh->getNumberOfCells();
6871 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6878 std::ostringstream oss;
6879 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6880 throw INTERP_KERNEL::Exception(oss.str().c_str());
6883 return self->buildSubPart(&singleVal,&singleVal+1);
6888 int tmp=nbc+singleVal;
6889 return self->buildSubPart(&tmp,&tmp+1);
6893 std::ostringstream oss;
6894 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6895 throw INTERP_KERNEL::Exception(oss.str().c_str());
6901 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6905 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6906 return self->buildSubPart(rg->begin(),rg->end());
6911 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6912 daIntTyypp->checkAllocated();
6913 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6916 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6920 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6922 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6925 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6928 double r1=self->getMaxValue2(tmp);
6929 PyObject *ret=PyTuple_New(2);
6930 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6931 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6935 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6938 double r1=self->getMinValue2(tmp);
6939 PyObject *ret=PyTuple_New(2);
6940 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6941 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6945 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6947 std::vector<int> tmp;
6948 convertPyToNewIntArr3(li,tmp);
6949 return self->keepSelectedComponents(tmp);
6952 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6954 std::vector<int> tmp;
6955 convertPyToNewIntArr3(li,tmp);
6956 self->setSelectedComponents(f,tmp);
6959 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6962 DataArrayDouble *a,*a2;
6963 DataArrayDoubleTuple *aa,*aa2;
6964 std::vector<double> bb,bb2;
6967 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6968 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6969 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6970 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
6972 return self->extractSlice3D(orig,vect,eps);
6975 PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6978 Py_XINCREF(trueSelf);
6982 PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6985 Py_XINCREF(trueSelf);
6989 PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6992 Py_XINCREF(trueSelf);
6996 PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6999 Py_XINCREF(trueSelf);
7003 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7005 std::vector<const MEDCouplingFieldDouble *> tmp;
7006 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7007 return MEDCouplingFieldDouble::MergeFields(tmp);
7010 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
7012 std::vector<const MEDCouplingFieldDouble *> tmp;
7013 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7014 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
7019 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
7022 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
7023 static MEDCouplingFieldTemplate *New(TypeOfField type);
7024 std::string simpleRepr() const;
7025 std::string advancedRepr() const;
7026 void updateTime() const;
7029 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception)
7031 return MEDCouplingFieldTemplate::New(f);
7034 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
7036 return MEDCouplingFieldTemplate::New(type);
7039 std::string __str__() const
7041 return self->simpleRepr();
7046 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
7049 int getNumberOfFields() const;
7050 MEDCouplingMultiFields *deepCpy() const;
7051 virtual std::string simpleRepr() const;
7052 virtual std::string advancedRepr() const;
7053 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7054 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7055 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7056 void updateTime() const throw(INTERP_KERNEL::Exception);
7059 std::string __str__() const
7061 return self->simpleRepr();
7063 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7065 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7066 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7068 std::vector<MEDCouplingFieldDouble *> fs(sz);
7069 for(int i=0;i<sz;i++)
7070 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7071 return MEDCouplingMultiFields::New(fs);
7073 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7075 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7076 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7078 std::vector<MEDCouplingFieldDouble *> fs(sz);
7079 for(int i=0;i<sz;i++)
7080 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7081 return MEDCouplingMultiFields::New(fs);
7083 PyObject *getFields() const
7085 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
7086 int sz=fields.size();
7087 PyObject *res = PyList_New(sz);
7088 for(int i=0;i<sz;i++)
7092 fields[i]->incrRef();
7093 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
7097 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
7102 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
7104 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
7108 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
7111 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
7113 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
7115 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
7117 PyObject *res = PyList_New(sz);
7118 for(int i=0;i<sz;i++)
7123 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7127 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7132 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
7134 std::vector<int> refs;
7135 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
7137 PyObject *res = PyList_New(sz);
7138 for(int i=0;i<sz;i++)
7143 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7147 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7151 PyObject *ret=PyTuple_New(2);
7152 PyTuple_SetItem(ret,0,res);
7153 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
7156 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7158 std::vector<DataArrayDouble *> ms=self->getArrays();
7160 PyObject *res = PyList_New(sz);
7161 for(int i=0;i<sz;i++)
7166 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7170 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7175 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
7177 std::vector< std::vector<int> > refs;
7178 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
7180 PyObject *res = PyList_New(sz);
7181 PyObject *res2 = PyList_New(sz);
7182 for(int i=0;i<sz;i++)
7187 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7191 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7193 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
7196 PyObject *ret=PyTuple_New(2);
7197 PyTuple_SetItem(ret,0,res);
7198 PyTuple_SetItem(ret,1,res2);
7204 class MEDCouplingDefinitionTime
7207 MEDCouplingDefinitionTime();
7208 void assign(const MEDCouplingDefinitionTime& other);
7209 bool isEqual(const MEDCouplingDefinitionTime& other) const;
7210 double getTimeResolution() const;
7211 std::vector<double> getHotSpotsTime() const;
7214 std::string __str__() const
7216 std::ostringstream oss;
7217 self->appendRepr(oss);
7221 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
7223 int meshId,arrId,arrIdInField,fieldId;
7224 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7225 PyObject *res=PyList_New(4);
7226 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7227 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7228 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7229 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7233 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7235 int meshId,arrId,arrIdInField,fieldId;
7236 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7237 PyObject *res=PyList_New(4);
7238 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7239 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7240 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7241 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7247 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7250 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7251 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7255 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7257 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7258 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7260 std::vector<MEDCouplingFieldDouble *> fs(sz);
7261 for(int i=0;i<sz;i++)
7262 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7263 return MEDCouplingFieldOverTime::New(fs);
7265 std::string __str__() const
7267 return self->simpleRepr();
7269 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7271 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7272 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7274 std::vector<MEDCouplingFieldDouble *> fs(sz);
7275 for(int i=0;i<sz;i++)
7276 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7277 return MEDCouplingFieldOverTime::New(fs);
7285 __filename=os.environ.get('PYTHONSTARTUP')
7286 if __filename and os.path.isfile(__filename):
7287 execfile(__filename)