1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #define MEDCOUPLING_EXPORT
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCouplingField.hxx"
34 #include "MEDCouplingFieldDouble.hxx"
35 #include "MEDCouplingFieldTemplate.hxx"
36 #include "MEDCouplingGaussLocalization.hxx"
37 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
38 #include "MEDCouplingMultiFields.hxx"
39 #include "MEDCouplingFieldOverTime.hxx"
40 #include "MEDCouplingDefinitionTime.hxx"
41 #include "MEDCouplingFieldDiscretization.hxx"
42 #include "MEDCouplingTypemaps.i"
44 #include "InterpKernelAutoPtr.hxx"
46 using namespace ParaMEDMEM;
47 using namespace INTERP_KERNEL;
50 %template(ivec) std::vector<int>;
51 %template(dvec) std::vector<double>;
52 %template(svec) std::vector<std::string>;
54 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
56 $result=convertMesh($1,$owner);
59 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
61 $result=convertMesh($1,$owner);
64 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
66 $result=convertMesh($1,$owner);
69 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
71 $result=convertFieldDiscretization($1,$owner);
74 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
76 $result=convertMultiFields($1,$owner);
80 %init %{ import_array(); %}
83 %feature("autodoc", "1");
84 %feature("docstring");
86 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
87 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
88 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
89 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
90 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
91 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
92 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
93 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
94 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
95 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
96 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
97 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
98 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
99 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
100 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
101 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
102 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
103 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
104 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
105 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator+;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator-;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator*;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
132 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
133 %newobject ParaMEDMEM::DataArrayInt::New;
134 %newobject ParaMEDMEM::DataArrayInt::__iter__;
135 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
136 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
137 %newobject ParaMEDMEM::DataArrayInt::performCpy;
138 %newobject ParaMEDMEM::DataArrayInt::substr;
139 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
140 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
141 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
142 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
143 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
144 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
145 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
146 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
147 %newobject ParaMEDMEM::DataArrayInt::renumber;
148 %newobject ParaMEDMEM::DataArrayInt::renumberR;
149 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
150 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
151 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
152 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
153 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
154 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
155 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
156 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
157 %newobject ParaMEDMEM::DataArrayInt::negate;
158 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
159 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
160 %newobject ParaMEDMEM::DataArrayInt::Meld;
161 %newobject ParaMEDMEM::DataArrayInt::Add;
162 %newobject ParaMEDMEM::DataArrayInt::Substract;
163 %newobject ParaMEDMEM::DataArrayInt::Multiply;
164 %newobject ParaMEDMEM::DataArrayInt::Divide;
165 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
166 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
167 %newobject ParaMEDMEM::DataArrayInt::Range;
168 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
169 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
170 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
171 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
172 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
173 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
174 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
175 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
176 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
177 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
178 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
179 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
180 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
181 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
182 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
183 %newobject ParaMEDMEM::DataArrayInt::__neg__;
184 %newobject ParaMEDMEM::DataArrayInt::__add__;
185 %newobject ParaMEDMEM::DataArrayInt::__radd__;
186 %newobject ParaMEDMEM::DataArrayInt::__sub__;
187 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
188 %newobject ParaMEDMEM::DataArrayInt::__mul__;
189 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
190 %newobject ParaMEDMEM::DataArrayInt::__div__;
191 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
192 %newobject ParaMEDMEM::DataArrayInt::__mod__;
193 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
194 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
195 %newobject ParaMEDMEM::DataArrayDouble::New;
196 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
197 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
198 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
199 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
200 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
201 %newobject ParaMEDMEM::DataArrayDouble::Meld;
202 %newobject ParaMEDMEM::DataArrayDouble::Dot;
203 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
204 %newobject ParaMEDMEM::DataArrayDouble::Add;
205 %newobject ParaMEDMEM::DataArrayDouble::Substract;
206 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
207 %newobject ParaMEDMEM::DataArrayDouble::Divide;
208 %newobject ParaMEDMEM::DataArrayDouble::substr;
209 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
210 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
211 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
212 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
213 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
214 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
215 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
216 %newobject ParaMEDMEM::DataArrayDouble::negate;
217 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
218 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
219 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
220 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
221 %newobject ParaMEDMEM::DataArrayDouble::determinant;
222 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
223 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
224 %newobject ParaMEDMEM::DataArrayDouble::inverse;
225 %newobject ParaMEDMEM::DataArrayDouble::trace;
226 %newobject ParaMEDMEM::DataArrayDouble::deviator;
227 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
228 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
229 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
230 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
231 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
232 %newobject ParaMEDMEM::DataArrayDouble::renumber;
233 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
234 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
235 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
236 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
237 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
238 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
239 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
240 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
241 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
242 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
243 %newobject ParaMEDMEM::DataArrayDouble::__add__;
244 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
245 %newobject ParaMEDMEM::DataArrayDouble::__sub__;
246 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
247 %newobject ParaMEDMEM::DataArrayDouble::__mul__;
248 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
249 %newobject ParaMEDMEM::DataArrayDouble::__div__;
250 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
251 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
252 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
253 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
254 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
255 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
256 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
257 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
258 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
259 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
260 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
261 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
262 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
263 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
264 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
265 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
266 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
267 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
268 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
269 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
270 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
271 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
272 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
273 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
274 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
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::convertLinearCellsToQuadratic;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
317 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
318 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
319 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
320 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
321 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
322 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
323 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
324 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
325 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
326 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
327 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
328 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
329 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
331 %feature("unref") DataArrayDouble "$this->decrRef();"
332 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
333 %feature("unref") MEDCouplingMesh "$this->decrRef();"
334 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
335 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
336 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
337 %feature("unref") DataArrayInt "$this->decrRef();"
338 %feature("unref") MEDCouplingField "$this->decrRef();"
339 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
340 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
341 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
342 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
343 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
344 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
345 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
346 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
347 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
349 %rename(assign) *::operator=;
350 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
351 %ignore ParaMEDMEM::RefCountObject::decrRef;
352 %ignore ParaMEDMEM::MemArray::operator=;
353 %ignore ParaMEDMEM::MemArray::operator[];
354 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
355 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
356 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
357 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
358 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
359 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
360 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
361 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
362 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
363 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
364 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
365 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
366 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
367 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
371 %rename (InterpKernelException) INTERP_KERNEL::Exception;
373 namespace INTERP_KERNEL
378 Exception(const char* what);
379 ~Exception() throw ();
380 const char *what() const throw ();
383 std::string __str__() const
385 return std::string(self->what());
391 %include "MEDCouplingTimeLabel.hxx"
415 CONST_ON_TIME_INTERVAL = 7
416 } TypeOfTimeDiscretization;
418 const char *MEDCouplingVersionStr();
419 int MEDCouplingVersion();
420 PyObject *MEDCouplingVersionMajMinRel()
422 int tmp0=0,tmp1=0,tmp2=0;
423 MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
424 PyObject *res = PyList_New(3);
425 PyList_SetItem(res,0,SWIG_From_int(tmp0));
426 PyList_SetItem(res,1,SWIG_From_int(tmp1));
427 PyList_SetItem(res,2,SWIG_From_int(tmp2));
431 class MEDCOUPLING_EXPORT RefCountObject
435 RefCountObject(const RefCountObject& other);
438 bool decrRef() const;
439 void incrRef() const;
440 virtual std::size_t getHeapMemorySize() const;
449 UNSTRUCTURED_DESC = 6,
453 } MEDCouplingMeshType;
456 class DataArrayDouble;
457 class MEDCouplingUMesh;
458 class MEDCouplingFieldDouble;
460 %extend RefCountObject
462 std::string getHiddenCppPointer() const
464 std::ostringstream oss; oss << "C++ Pointer address is : " << self;
469 class MEDCouplingMesh : public RefCountObject, public TimeLabel
472 void setName(const char *name);
473 const char *getName() const;
474 void setDescription(const char *descr);
475 const char *getDescription() const;
476 void setTime(double val, int iteration, int order);
477 void setTimeUnit(const char *unit);
478 const char *getTimeUnit() const;
479 virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
480 bool isStructured() const throw(INTERP_KERNEL::Exception);
481 virtual MEDCouplingMesh *deepCpy() const;
482 virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
483 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
484 virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
485 virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
486 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
487 virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
488 virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
489 virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
490 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
491 virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
492 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
493 virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
494 virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
495 virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
496 virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
497 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
498 virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
499 virtual std::string simpleRepr() const;
500 virtual std::string advancedRepr() const;
501 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
503 virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
504 virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
505 virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
506 virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
507 virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
508 virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
509 virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
510 virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
511 virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
512 virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
513 static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
514 static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
515 static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
518 std::string __str__() const
520 return self->simpleRepr();
523 PyObject *getTime() throw(INTERP_KERNEL::Exception)
526 double tmp0=self->getTime(tmp1,tmp2);
527 PyObject *res = PyList_New(3);
528 PyList_SetItem(res,0,SWIG_From_double(tmp0));
529 PyList_SetItem(res,1,SWIG_From_int(tmp1));
530 PyList_SetItem(res,2,SWIG_From_int(tmp2));
534 int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
538 DataArrayDoubleTuple *aa;
539 std::vector<double> bb;
541 int spaceDim=self->getSpaceDimension();
542 const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
543 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
544 return self->getCellContainingPoint(pos,eps);
547 PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
551 DataArrayDoubleTuple *aa;
552 std::vector<double> bb;
554 int spaceDim=self->getSpaceDimension();
555 const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
556 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
557 std::vector<int> elts,eltsIndex;
558 self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
559 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
560 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
561 d0->alloc(elts.size(),1);
562 d1->alloc(eltsIndex.size(),1);
563 std::copy(elts.begin(),elts.end(),d0->getPointer());
564 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
565 PyObject *ret=PyTuple_New(2);
566 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
567 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
573 PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
575 std::vector<int> elts,eltsIndex;
576 int spaceDim=self->getSpaceDimension();
578 int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
579 if (!SWIG_IsOK(res1))
582 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
583 int nbOfPoints=size/spaceDim;
586 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
588 self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
592 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
594 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
595 da2->checkAllocated();
596 int size=da2->getNumberOfTuples();
597 int nbOfCompo=da2->getNumberOfComponents();
598 if(nbOfCompo!=spaceDim)
600 throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
602 self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
604 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
605 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
606 d0->alloc(elts.size(),1);
607 d1->alloc(eltsIndex.size(),1);
608 std::copy(elts.begin(),elts.end(),d0->getPointer());
609 std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
610 PyObject *ret=PyTuple_New(2);
611 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
612 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
618 PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
622 DataArrayDoubleTuple *aa;
623 std::vector<double> bb;
625 int spaceDim=self->getSpaceDimension();
626 const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
627 const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
628 std::vector<int> elts;
629 self->getCellsContainingPoint(pos,eps,elts);
630 DataArrayInt *ret=DataArrayInt::New();
631 ret->alloc((int)elts.size(),1);
632 std::copy(elts.begin(),elts.end(),ret->getPointer());
633 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
636 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
639 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
640 if (!SWIG_IsOK(res1))
643 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
644 self->renumberCells(tmp,check);
648 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
650 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
651 da2->checkAllocated();
652 self->renumberCells(da2->getConstPointer(),check);
656 PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
658 DataArrayInt *cellCor, *nodeCor;
659 self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
660 PyObject *res = PyList_New(2);
661 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
662 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
665 DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
668 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
669 if (!SWIG_IsOK(res1))
672 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
673 return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
677 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
679 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
680 da2->checkAllocated();
681 return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
684 PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
686 std::vector<int> conn;
687 self->getNodeIdsOfCell(cellId,conn);
688 return convertIntArrToPyList2(conn);
691 PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
693 std::vector<double> coo;
694 self->getCoordinatesOfNode(nodeId,coo);
695 return convertDblArrToPyList2(coo);
698 void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
702 DataArrayDoubleTuple *aa;
703 std::vector<double> bb;
705 int spaceDim=self->getSpaceDimension();
706 const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
707 const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
708 self->scale(pointPtr,factor);
711 PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
713 int spaceDim=self->getSpaceDimension();
714 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
715 self->getBoundingBox(tmp);
716 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
720 PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
723 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
724 PyObject *ret=PyTuple_New(2);
725 PyObject *ret0Py=ret0?Py_True:Py_False;
727 PyTuple_SetItem(ret,0,ret0Py);
728 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
732 PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
734 int szArr,sw,iTypppArr;
735 std::vector<int> stdvecTyyppArr;
736 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
737 MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
738 if(sw==3)//DataArrayInt
740 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
741 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
742 std::string name=argpt->getName();
744 ret->setName(name.c_str());
746 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
749 PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
751 int szArr,sw,iTypppArr;
752 std::vector<int> stdvecTyyppArr;
754 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
755 MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
756 if(sw==3)//DataArrayInt
758 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
759 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
760 std::string name=argpt->getName();
762 ret->setName(name.c_str());
765 PyObject *res = PyList_New(2);
766 PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
767 PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
768 PyList_SetItem(res,0,obj0);
769 PyList_SetItem(res,1,obj1);
773 PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
775 std::vector<int> vals=self->getDistributionOfTypes();
776 PyObject *ret=PyList_New((int)vals.size()/3);
777 for(int j=0;j<(int)vals.size()/3;j++)
779 PyObject *ret1=PyList_New(3);
780 PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
781 PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
782 PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
783 PyList_SetItem(ret,j,ret1);
788 DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
790 std::vector<int> code;
791 std::vector<const DataArrayInt *> idsPerType;
792 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
793 convertPyToNewIntArr4(li,1,3,code);
794 return self->checkTypeConsistencyAndContig(code,idsPerType);
797 PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
799 std::vector<int> code;
800 std::vector<DataArrayInt *> idsInPflPerType;
801 std::vector<DataArrayInt *> idsPerType;
802 self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
803 PyObject *ret=PyTuple_New(3);
804 PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
805 PyObject *ret1=PyList_New(idsInPflPerType.size());
806 for(std::size_t j=0;j<idsInPflPerType.size();j++)
807 PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
808 PyTuple_SetItem(ret,1,ret1);
809 int n=idsPerType.size();
810 PyObject *ret2=PyList_New(n);
812 PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
813 PyTuple_SetItem(ret,2,ret2);
817 void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
821 DataArrayDoubleTuple *aa;
822 std::vector<double> bb;
824 int spaceDim=self->getSpaceDimension();
825 const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
826 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
827 self->translate(vectorPtr);
830 void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
832 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
835 DataArrayDoubleTuple *aa;
836 std::vector<double> bb;
838 int spaceDim=self->getSpaceDimension();
839 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
840 self->rotate(centerPtr,0,alpha);
843 void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
845 const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
848 DataArrayDoubleTuple *aa;
849 std::vector<double> bb;
851 int spaceDim=self->getSpaceDimension();
852 const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
853 const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
854 self->rotate(centerPtr,vectorPtr,alpha);
857 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
859 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
860 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
861 PyObject *res=PyList_New(result.size());
862 for(int i=0;iL!=result.end(); i++, iL++)
863 PyList_SetItem(res,i,PyInt_FromLong(*iL));
867 static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
869 std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
870 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
871 return MEDCouplingMesh::MergeMeshes(tmp);
877 %extend ParaMEDMEM::DataArray
879 PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
881 const std::vector<std::string>& comps=self->getInfoOnComponents();
882 PyObject *ret=PyList_New((int)comps.size());
883 for(int i=0;i<(int)comps.size();i++)
884 PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
888 void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
890 std::vector<int> tmp;
891 convertPyToNewIntArr3(li,tmp);
892 self->copyPartOfStringInfoFrom(other,tmp);
895 void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
897 std::vector<int> tmp;
898 convertPyToNewIntArr3(li,tmp);
899 self->copyPartOfStringInfoFrom2(tmp,other);
903 %extend ParaMEDMEM::DataArrayInt
905 PyObject *getDifferentValues() const throw(INTERP_KERNEL::Exception)
907 std::set<int> ret=self->getDifferentValues();
908 return convertIntArrToPyList3(ret);
911 PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
913 std::vector<int> ret1;
914 std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
915 std::size_t sz=ret0.size();
916 PyObject *pyRet=PyTuple_New(2);
917 PyObject *pyRet0=PyList_New((int)sz);
918 PyObject *pyRet1=PyList_New((int)sz);
919 for(std::size_t i=0;i<sz;i++)
921 PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
922 PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
924 PyTuple_SetItem(pyRet,0,pyRet0);
925 PyTuple_SetItem(pyRet,1,pyRet1);
930 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
932 MEDCouplingFieldDiscretization *clonePart(PyObject *li)
934 int sz=0,sw=-1,val1=-1;
935 std::vector<int> val2;
936 const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
937 return self->clonePart(inp,inp+sz);
941 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
943 PyObject *getArrayOfDiscIds() const
945 DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
948 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
952 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
953 %ignore ParaMEDMEM::DataArrayInt::getDifferentValues;
954 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
955 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
956 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
958 %include "MEDCouplingMemArray.hxx"
959 %include "NormalizedUnstructuredMesh.hxx"
960 %include "MEDCouplingNatureOfField.hxx"
961 %include "MEDCouplingTimeDiscretization.hxx"
962 %include "MEDCouplingFieldDiscretization.hxx"
963 %include "MEDCouplingGaussLocalization.hxx"
967 class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
970 void updateTime() const;
971 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
972 DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
973 bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
974 void zipCoords() throw(INTERP_KERNEL::Exception);
975 double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
976 void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
977 void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
978 void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
979 virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
980 virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
981 static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
982 static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
983 virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
984 virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
985 //! size of returned tinyInfo must be always the same.
986 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
987 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
988 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
989 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
990 const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
991 virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
992 virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
993 virtual DataArrayInt *findBoundaryNodes() const;
996 std::string __str__() const
998 return self->simpleRepr();
1001 PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1004 DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1005 PyObject *res = PyList_New(2);
1006 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1007 PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1011 PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1013 DataArrayInt *comm, *commIndex;
1014 self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1015 PyObject *res = PyList_New(2);
1016 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1017 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1021 PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1023 DataArrayDouble *ret1=self->getCoords();
1025 return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1028 PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1030 int szArr,sw,iTypppArr;
1031 std::vector<int> stdvecTyyppArr;
1032 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1033 MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1034 if(sw==3)//DataArrayInt
1036 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1037 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1038 std::string name=argpt->getName();
1040 ret->setName(name.c_str());
1042 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1045 PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1047 int szArr,sw,iTypppArr;
1048 std::vector<int> stdvecTyyppArr;
1049 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1050 MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1051 if(sw==3)//DataArrayInt
1053 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1054 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1055 std::string name=argpt->getName();
1057 ret->setName(name.c_str());
1059 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1062 PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1064 int szArr,sw,iTypppArr;
1065 std::vector<int> stdvecTyyppArr;
1066 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1067 MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1068 if(sw==3)//DataArrayInt
1070 void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1071 DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1072 std::string name=argpt->getName();
1074 ret->setName(name.c_str());
1076 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1079 void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1081 int szArr,sw,iTypppArr;
1082 std::vector<int> stdvecTyyppArr;
1083 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1084 self->renumberNodes(tmp,newNbOfNodes);
1087 void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1089 int szArr,sw,iTypppArr;
1090 std::vector<int> stdvecTyyppArr;
1091 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1092 self->renumberNodes2(tmp,newNbOfNodes);
1095 PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1097 int spaceDim=self->getSpaceDimension();
1099 DataArrayDouble *a,*a2;
1100 DataArrayDoubleTuple *aa,*aa2;
1101 std::vector<double> bb,bb2;
1103 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1104 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1105 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1106 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1107 std::vector<int> nodes;
1108 self->findNodesOnLine(p,v,eps,nodes);
1109 DataArrayInt *ret=DataArrayInt::New();
1110 ret->alloc((int)nodes.size(),1);
1111 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1112 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1114 PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1116 int spaceDim=self->getSpaceDimension();
1118 DataArrayDouble *a,*a2;
1119 DataArrayDoubleTuple *aa,*aa2;
1120 std::vector<double> bb,bb2;
1122 const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1123 const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1124 const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1125 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1126 std::vector<int> nodes;
1127 self->findNodesOnPlane(p,v,eps,nodes);
1128 DataArrayInt *ret=DataArrayInt::New();
1129 ret->alloc((int)nodes.size(),1);
1130 std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1131 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1134 PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1138 DataArrayDoubleTuple *aa;
1139 std::vector<double> bb;
1141 int spaceDim=self->getSpaceDimension();
1142 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1143 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1144 DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1145 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1148 PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfNodes, double eps) const throw(INTERP_KERNEL::Exception)
1150 DataArrayInt *c=0,*cI=0;
1154 DataArrayDoubleTuple *aa;
1155 std::vector<double> bb;
1157 int spaceDim=self->getSpaceDimension();
1158 const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1159 const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfNodes,spaceDim,true);
1160 self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI);
1161 PyObject *ret=PyTuple_New(2);
1162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1163 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1167 PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1169 DataArrayInt *c=0,*cI=0;
1170 int spaceDim=self->getSpaceDimension();
1173 DataArrayDoubleTuple *aa;
1174 std::vector<double> bb;
1177 const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1178 self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1180 PyObject *ret=PyTuple_New(2);
1181 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1186 PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1190 DataArrayDoubleTuple *aa;
1191 std::vector<double> bb;
1193 int spaceDim=self->getSpaceDimension();
1194 const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1195 const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1197 DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1198 return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1201 void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1205 std::vector<int> multiVal;
1206 std::pair<int, std::pair<int,int> > slic;
1207 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1208 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1212 return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1214 return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1216 return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1218 throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1222 static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1225 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1226 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1227 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1228 for(int i=0;i<sz;i++)
1229 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1232 static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1235 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1237 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1238 std::vector<double> val3;
1239 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1240 "Rotate2DAlg",2,true,nbNodes);
1242 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1243 ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1246 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1249 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1250 INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1251 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1252 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1253 for(int i=0;i<sz;i++)
1254 PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1257 static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1260 INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1262 double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1263 std::vector<double> val3;
1264 const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1265 "Rotate3DAlg",3,true,nbNodes);
1267 throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1268 INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1269 ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1274 class MEDCouplingUMeshCell
1277 INTERP_KERNEL::NormalizedCellType getType() const;
1280 std::string __str__() const
1282 return self->repr();
1285 PyObject *getAllConn() const
1288 const int *r=self->getAllConn(ret2);
1289 PyObject *ret=PyTuple_New(ret2);
1290 for(int i=0;i<ret2;i++)
1291 PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1297 class MEDCouplingUMeshCellIterator
1304 MEDCouplingUMeshCell *ret=self->nextt();
1306 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1309 PyErr_SetString(PyExc_StopIteration,"No more data.");
1316 class MEDCouplingUMeshCellByTypeIterator
1319 ~MEDCouplingUMeshCellByTypeIterator();
1324 MEDCouplingUMeshCellEntry *ret=self->nextt();
1326 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1329 PyErr_SetString(PyExc_StopIteration,"No more data.");
1336 class MEDCouplingUMeshCellByTypeEntry
1339 ~MEDCouplingUMeshCellByTypeEntry();
1342 MEDCouplingUMeshCellByTypeIterator *__iter__()
1344 return self->iterator();
1349 class MEDCouplingUMeshCellEntry
1352 INTERP_KERNEL::NormalizedCellType getType() const;
1353 int getNumberOfElems() const;
1356 MEDCouplingUMeshCellIterator *__iter__()
1358 return self->iterator();
1363 class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1366 static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1367 static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1368 MEDCouplingUMesh *clone(bool recDeepCpy) const;
1369 void updateTime() const;
1370 void checkCoherency() const throw(INTERP_KERNEL::Exception);
1371 void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1372 void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
1373 void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1374 MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1375 void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1376 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1377 void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1378 int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1379 int getMeshLength() const throw(INTERP_KERNEL::Exception);
1380 void computeTypes() throw(INTERP_KERNEL::Exception);
1381 std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1382 MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1384 void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1385 std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1386 DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1387 MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1388 bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1389 bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1390 DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1392 DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1393 DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1394 DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1395 MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1396 MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1397 void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1398 bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1399 MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1400 bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1401 void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1402 void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1403 void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1404 DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1405 void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1406 bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1407 MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1408 MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1409 MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1410 MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1411 DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1412 std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1413 DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1414 DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1415 static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1416 static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1417 static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1418 static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1419 static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1421 MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1423 return MEDCouplingUMesh::New();
1426 MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1428 return MEDCouplingUMesh::New(meshName,meshDim);
1431 std::string __str__() const
1433 return self->simpleRepr();
1436 MEDCouplingUMeshCellIterator *__iter__()
1438 return self->cellIterator();
1441 MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1445 std::vector<int> multiVal;
1446 std::pair<int, std::pair<int,int> > slic;
1447 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1448 int nbc=self->getNumberOfCells();
1449 convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1456 std::ostringstream oss;
1457 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1458 throw INTERP_KERNEL::Exception(oss.str().c_str());
1461 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1466 int tmp=nbc+singleVal;
1467 return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1471 std::ostringstream oss;
1472 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1473 throw INTERP_KERNEL::Exception(oss.str().c_str());
1479 return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1483 return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1488 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1489 daIntTyypp->checkAllocated();
1490 return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1493 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1497 void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1501 std::vector<int> multiVal;
1502 std::pair<int, std::pair<int,int> > slic;
1503 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1504 int nbc=self->getNumberOfCells();
1505 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1512 std::ostringstream oss;
1513 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1514 throw INTERP_KERNEL::Exception(oss.str().c_str());
1518 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1525 int tmp=nbc+singleVal;
1526 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1531 std::ostringstream oss;
1532 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1533 throw INTERP_KERNEL::Exception(oss.str().c_str());
1539 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1545 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1546 daIntTyypp->checkAllocated();
1547 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1551 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1555 void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1559 std::vector<int> multiVal;
1560 std::pair<int, std::pair<int,int> > slic;
1561 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1562 int nbc=self->getNumberOfCells();
1563 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1570 std::ostringstream oss;
1571 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1572 throw INTERP_KERNEL::Exception(oss.str().c_str());
1576 self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1583 int tmp=nbc+singleVal;
1584 self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1589 std::ostringstream oss;
1590 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1591 throw INTERP_KERNEL::Exception(oss.str().c_str());
1597 self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1602 self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1608 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1609 daIntTyypp->checkAllocated();
1610 self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1614 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1618 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1620 int szArr,sw,iTypppArr;
1621 std::vector<int> stdvecTyyppArr;
1622 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1625 std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1626 throw INTERP_KERNEL::Exception(oss.str().c_str());
1628 self->insertNextCell(type,size,tmp);
1631 void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1633 int szArr,sw,iTypppArr;
1634 std::vector<int> stdvecTyyppArr;
1635 const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1636 self->insertNextCell(type,szArr,tmp);
1639 DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1641 DataArrayInt *ret=self->getNodalConnectivity();
1646 DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1648 DataArrayInt *ret=self->getNodalConnectivityIndex();
1653 PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1655 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1656 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1657 PyObject *res = PyList_New(result.size());
1658 for (int i=0;iL!=result.end(); i++, iL++)
1659 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1663 static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1665 int szArr,sw,iTypppArr;
1666 std::vector<int> stdvecTyyppArr;
1667 const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1668 int nbOfDepthPeelingPerformed=0;
1669 DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1670 PyObject *res=PyTuple_New(2);
1671 PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1672 PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1676 PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1678 DataArrayInt *v0=0,*v1=0;
1679 self->findCommonCells(compType,startCellId,v0,v1);
1680 PyObject *res = PyList_New(2);
1681 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1682 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1686 static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1688 DataArrayInt *v0=0,*v1=0;
1689 MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1690 PyObject *res = PyList_New(2);
1691 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1692 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1696 PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1700 DataArrayDoubleTuple *aa;
1701 std::vector<double> bb;
1703 int nbOfCompo=self->getSpaceDimension();
1704 const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1706 int cellId=-1,nodeId=-1;
1707 double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1708 PyObject *ret=PyTuple_New(3);
1709 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1710 PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1711 PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1715 PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1719 DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1720 PyObject *res = PyList_New(3);
1721 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1722 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1723 PyList_SetItem(res,2,SWIG_From_int(ret2));
1726 PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1730 DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1731 PyObject *res = PyList_New(3);
1732 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1733 PyList_SetItem(res,1,SWIG_From_bool(ret1));
1734 PyList_SetItem(res,2,SWIG_From_int(ret2));
1737 PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1739 std::vector<int> cells;
1740 self->checkButterflyCells(cells,eps);
1741 DataArrayInt *ret=DataArrayInt::New();
1742 ret->alloc((int)cells.size(),1);
1743 std::copy(cells.begin(),cells.end(),ret->getPointer());
1744 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1747 PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1749 std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1751 PyObject *ret = PyList_New(sz);
1752 for(int i=0;i<sz;i++)
1753 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1757 PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1759 std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1760 int sz=retCpp.size();
1761 PyObject *ret=PyList_New(sz);
1762 for(int i=0;i<sz;i++)
1763 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1767 PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1770 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1771 MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1772 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1775 bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1778 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1779 bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1783 DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1786 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1787 DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1791 PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1793 DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1794 self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1795 PyObject *ret=PyTuple_New(3);
1796 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1797 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1798 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1802 PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1804 DataArrayInt *tmp0=0,*tmp1=0;
1805 self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1806 PyObject *ret=PyTuple_New(2);
1807 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1808 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1812 void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1816 std::vector<int> multiVal;
1817 std::pair<int, std::pair<int,int> > slic;
1818 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1819 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1823 return self->duplicateNodes(&singleVal,&singleVal+1);
1825 return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1827 return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1829 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1833 void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1837 std::vector<int> multiVal;
1838 std::pair<int, std::pair<int,int> > slic;
1839 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1840 convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1844 return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1846 return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1848 return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1850 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1854 void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1857 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1858 if (!SWIG_IsOK(res1))
1861 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1862 self->renumberNodesInConn(tmp);
1866 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1868 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1869 da2->checkAllocated();
1870 self->renumberNodesInConn(da2->getConstPointer());
1874 PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1877 INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1878 DataArrayInt *tmp0,*tmp1=0;
1879 tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1880 PyObject *ret=PyTuple_New(2);
1881 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1882 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1886 static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1888 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1889 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1890 DataArrayInt *ret1=0,*ret2=0;
1891 MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1892 PyObject *ret=PyTuple_New(3);
1893 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1894 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1895 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1899 static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1901 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1902 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1903 MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1904 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1907 static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1910 std::vector<const MEDCouplingUMesh *> meshes;
1911 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1912 std::vector<DataArrayInt *> corr;
1913 MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1915 PyObject *ret1=PyList_New(sz);
1916 for(int i=0;i<sz;i++)
1917 PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1918 PyObject *ret=PyList_New(2);
1919 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1920 PyList_SetItem(ret,1,ret1);
1924 static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1926 std::vector<MEDCouplingUMesh *> meshes;
1927 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1928 MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1931 static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1933 std::vector<MEDCouplingUMesh *> meshes;
1934 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1935 MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1938 static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1942 std::vector<int> multiVal;
1943 std::pair<int, std::pair<int,int> > slic;
1944 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1946 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1947 convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1951 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1953 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1955 return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1957 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1961 static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1963 DataArrayInt *arrOut=0,*arrIndexOut=0;
1966 std::vector<int> multiVal;
1967 std::pair<int, std::pair<int,int> > slic;
1968 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1970 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1971 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1976 MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
1981 MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1986 MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1990 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1992 PyObject *ret=PyTuple_New(2);
1993 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1994 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1998 static PyObject *SetPartOfIndexedArrays(PyObject *li,
1999 const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2000 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2002 DataArrayInt *arrOut=0,*arrIndexOut=0;
2005 std::vector<int> multiVal;
2006 std::pair<int, std::pair<int,int> > slic;
2007 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2009 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2010 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2015 MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2020 MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2025 MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2029 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2031 PyObject *ret=PyTuple_New(2);
2032 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2033 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2037 static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2038 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2042 std::vector<int> multiVal;
2043 std::pair<int, std::pair<int,int> > slic;
2044 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2046 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2047 convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2052 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2057 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2062 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2066 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2070 PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2074 DataArrayDoubleTuple *aa;
2075 std::vector<double> bb;
2077 int spaceDim=self->getSpaceDimension();
2078 const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2079 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2081 std::vector<int> cells;
2082 self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2083 DataArrayInt *ret=DataArrayInt::New();
2084 ret->alloc((int)cells.size(),1);
2085 std::copy(cells.begin(),cells.end(),ret->getPointer());
2086 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2089 void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2093 DataArrayDoubleTuple *aa;
2094 std::vector<double> bb;
2096 int spaceDim=self->getSpaceDimension();
2097 const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2098 const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2099 self->orientCorrectly2DCells(v,polyOnly);
2102 PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2104 std::vector<int> cells;
2105 self->arePolyhedronsNotCorrectlyOriented(cells);
2106 DataArrayInt *ret=DataArrayInt::New();
2107 ret->alloc((int)cells.size(),1);
2108 std::copy(cells.begin(),cells.end(),ret->getPointer());
2109 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2112 PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2116 self->getFastAveragePlaneOfThis(vec,pos);
2118 std::copy(vec,vec+3,vals);
2119 std::copy(pos,pos+3,vals+3);
2120 return convertDblArrToPyListOfTuple(vals,3,2);
2123 static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2125 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2126 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2127 return MEDCouplingUMesh::MergeUMeshes(tmp);
2130 PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2133 bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2134 PyObject *ret=PyTuple_New(2);
2135 PyObject *ret0Py=ret0?Py_True:Py_False;
2137 PyTuple_SetItem(ret,0,ret0Py);
2138 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2142 PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2145 bool ret0=self->areCellsIncludedIn2(other,ret1);
2146 PyObject *ret=PyTuple_New(2);
2147 PyObject *ret0Py=ret0?Py_True:Py_False;
2149 PyTuple_SetItem(ret,0,ret0Py);
2150 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2154 PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2156 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2157 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2158 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2159 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2160 MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2161 PyObject *ret=PyTuple_New(5);
2162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2163 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2164 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2165 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2174 PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2176 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2177 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2178 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2179 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2180 MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2181 PyObject *ret=PyTuple_New(5);
2182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2185 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2194 PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2196 DataArrayInt *neighbors=0,*neighborsIdx=0;
2197 self->computeNeighborsOfCells(neighbors,neighborsIdx);
2198 PyObject *ret=PyTuple_New(2);
2199 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2204 static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2206 DataArrayInt *neighbors=0,*neighborsIdx=0;
2207 MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2208 PyObject *ret=PyTuple_New(2);
2209 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2216 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2217 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2218 DataArrayInt *d2,*d3,*d4,*dd5;
2219 MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2220 PyObject *ret=PyTuple_New(7);
2221 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2223 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2225 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2227 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2233 PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2235 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2236 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2237 self->getReverseNodalConnectivity(d0,d1);
2238 PyObject *ret=PyTuple_New(2);
2239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2246 DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2249 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2250 da->checkAllocated();
2251 return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2254 DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2257 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2258 da->checkAllocated();
2259 return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2262 MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2265 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2266 da->checkAllocated();
2267 return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2270 PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2273 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2274 da->checkAllocated();
2275 std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2276 std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2277 PyObject *res = PyList_New(result.size());
2278 for (int i=0;iL!=result.end(); i++, iL++)
2279 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2283 DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2286 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2287 da->checkAllocated();
2288 DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2289 ret->setName(da->getName().c_str());
2293 DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2296 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
2297 if (!SWIG_IsOK(res1))
2300 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2301 return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2305 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2307 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2308 da2->checkAllocated();
2309 return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2313 PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2316 DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2317 PyObject *ret=PyTuple_New(2);
2318 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2319 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2323 static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2325 DataArrayInt *cellNb1=0,*cellNb2=0;
2326 MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2327 PyObject *ret=PyTuple_New(3);
2328 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2329 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2330 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2334 PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2336 int spaceDim=self->getSpaceDimension();
2338 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2340 DataArrayDouble *a,*a2;
2341 DataArrayDoubleTuple *aa,*aa2;
2342 std::vector<double> bb,bb2;
2344 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2345 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2346 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2347 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2349 DataArrayInt *cellIds=0;
2350 MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2359 int spaceDim=self->getSpaceDimension();
2361 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2363 DataArrayDouble *a,*a2;
2364 DataArrayDoubleTuple *aa,*aa2;
2365 std::vector<double> bb,bb2;
2367 const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2368 const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2369 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2370 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2372 DataArrayInt *cellIds=0;
2373 MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2374 PyObject *ret=PyTuple_New(2);
2375 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380 DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2382 int spaceDim=self->getSpaceDimension();
2384 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2386 DataArrayDouble *a,*a2;
2387 DataArrayDoubleTuple *aa,*aa2;
2388 std::vector<double> bb,bb2;
2390 const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2391 const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2392 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2393 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2394 return self->getCellIdsCrossingPlane(orig,vect,eps);
2397 void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2401 std::vector<int> pos2;
2402 DataArrayInt *pos3=0;
2403 DataArrayIntTuple *pos4=0;
2404 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2409 self->convertToPolyTypes(&pos1,&pos1+1);
2416 self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2421 self->convertToPolyTypes(pos3->begin(),pos3->end());
2425 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2429 void convertAllToPoly();
2430 void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2431 bool unPolyze() throw(INTERP_KERNEL::Exception);
2432 void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2433 MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2434 MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2437 class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2440 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2441 MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2442 void updateTime() const throw(INTERP_KERNEL::Exception);
2444 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2446 return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2449 std::string __str__() const
2451 return self->simpleRepr();
2453 PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2455 MEDCouplingUMesh *ret=self->getMesh2D();
2457 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2459 PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2461 MEDCouplingUMesh *ret=self->getMesh1D();
2463 return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2465 PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2467 DataArrayInt *ret=self->getMesh3DIds();
2469 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2474 class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2477 void updateTime() const throw(INTERP_KERNEL::Exception);
2478 int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2479 int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2482 class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2485 static MEDCouplingCMesh *New();
2486 static MEDCouplingCMesh *New(const char *meshName);
2487 MEDCouplingCMesh *clone(bool recDeepCpy) const;
2488 void setCoords(const DataArrayDouble *coordsX,
2489 const DataArrayDouble *coordsY=0,
2490 const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2491 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2495 return MEDCouplingCMesh::New();
2497 MEDCouplingCMesh(const char *meshName)
2499 return MEDCouplingCMesh::New(meshName);
2501 std::string __str__() const
2503 return self->simpleRepr();
2505 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2507 DataArrayDouble *ret=self->getCoordsAt(i);
2515 class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2518 static MEDCouplingCurveLinearMesh *New();
2519 static MEDCouplingCurveLinearMesh *New(const char *meshName);
2520 MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2521 void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2522 std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2524 MEDCouplingCurveLinearMesh()
2526 return MEDCouplingCurveLinearMesh::New();
2528 MEDCouplingCurveLinearMesh(const char *meshName)
2530 return MEDCouplingCurveLinearMesh::New(meshName);
2532 std::string __str__() const
2534 return self->simpleRepr();
2536 DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2538 DataArrayDouble *ret=self->getCoords();
2543 void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2545 int szArr,sw,iTypppArr;
2546 std::vector<int> stdvecTyyppArr;
2547 const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2548 self->setNodeGridStructure(tmp,tmp+szArr);
2554 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2556 PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2559 DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2560 PyObject *ret=PyTuple_New(2);
2561 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2562 PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2567 %extend ParaMEDMEM::DataArrayDoubleIterator
2571 DataArrayDoubleTuple *ret=self->nextt();
2573 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2576 PyErr_SetString(PyExc_StopIteration,"No more data.");
2582 %extend ParaMEDMEM::DataArrayDoubleTuple
2584 std::string __str__() const
2586 return self->repr();
2589 double __float__() const throw(INTERP_KERNEL::Exception)
2591 return self->doubleValue();
2594 DataArrayDouble *buildDADouble()
2596 return self->buildDADouble(1,self->getNumberOfCompo());
2599 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2601 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2602 ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2603 Py_XINCREF(trueSelf);
2607 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2609 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2610 ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2611 Py_XINCREF(trueSelf);
2615 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2617 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2618 ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2619 Py_XINCREF(trueSelf);
2623 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2625 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2626 ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2627 Py_XINCREF(trueSelf);
2631 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2635 std::vector<int> multiVal;
2636 std::pair<int, std::pair<int,int> > slic;
2637 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2638 const double *pt=self->getConstPointer();
2639 int nbc=self->getNumberOfCompo();
2640 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2647 std::ostringstream oss;
2648 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2649 throw INTERP_KERNEL::Exception(oss.str().c_str());
2652 return PyFloat_FromDouble(pt[singleVal]);
2656 return PyFloat_FromDouble(pt[nbc+singleVal]);
2659 std::ostringstream oss;
2660 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2661 throw INTERP_KERNEL::Exception(oss.str().c_str());
2667 PyObject *t=PyTuple_New(multiVal.size());
2668 for(int j=0;j<(int)multiVal.size();j++)
2670 int cid=multiVal[j];
2673 std::ostringstream oss;
2674 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2675 throw INTERP_KERNEL::Exception(oss.str().c_str());
2677 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2683 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2684 PyObject *t=PyTuple_New(sz);
2685 for(int j=0;j<sz;j++)
2686 PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2690 throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2694 DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2696 const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2699 std::vector<double> multiValV;
2700 ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2701 int nbc=self->getNumberOfCompo();
2702 convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2704 std::vector<int> multiVal;
2705 std::pair<int, std::pair<int,int> > slic;
2706 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2707 double *pt=self->getPointer();
2708 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2715 std::ostringstream oss;
2716 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2717 throw INTERP_KERNEL::Exception(oss.str().c_str());
2723 pt[singleVal]=singleValV;
2728 if(multiValV.size()!=1)
2730 std::ostringstream oss;
2731 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2732 throw INTERP_KERNEL::Exception(oss.str().c_str());
2734 pt[singleVal]=multiValV[0];
2739 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2743 throw INTERP_KERNEL::Exception(msg);
2752 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2756 std::ostringstream oss;
2757 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2758 throw INTERP_KERNEL::Exception(oss.str().c_str());
2766 if(multiVal.size()!=multiValV.size())
2768 std::ostringstream oss;
2769 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2770 throw INTERP_KERNEL::Exception(oss.str().c_str());
2772 for(int i=0;i<(int)multiVal.size();i++)
2774 int pos=multiVal[i];
2777 std::ostringstream oss;
2778 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2779 throw INTERP_KERNEL::Exception(oss.str().c_str());
2781 pt[multiVal[i]]=multiValV[i];
2787 const double *ptV=daIntTyyppV->getConstPointer();
2788 if(nbc>daIntTyyppV->getNumberOfCompo())
2790 std::ostringstream oss;
2791 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2792 throw INTERP_KERNEL::Exception(oss.str().c_str());
2794 std::copy(ptV,ptV+nbc,pt);
2798 throw INTERP_KERNEL::Exception(msg);
2803 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2808 for(int j=0;j<sz;j++)
2809 pt[slic.first+j*slic.second.second]=singleValV;
2814 if(sz!=(int)multiValV.size())
2816 std::ostringstream oss;
2817 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2818 throw INTERP_KERNEL::Exception(oss.str().c_str());
2820 for(int j=0;j<sz;j++)
2821 pt[slic.first+j*slic.second.second]=multiValV[j];
2826 const double *ptV=daIntTyyppV->getConstPointer();
2827 if(sz>daIntTyyppV->getNumberOfCompo())
2829 std::ostringstream oss;
2830 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2831 throw INTERP_KERNEL::Exception(oss.str().c_str());
2833 for(int j=0;j<sz;j++)
2834 pt[slic.first+j*slic.second.second]=ptV[j];
2838 throw INTERP_KERNEL::Exception(msg);
2842 throw INTERP_KERNEL::Exception(msg);
2847 %extend ParaMEDMEM::DataArrayDouble
2849 DataArrayDouble() throw(INTERP_KERNEL::Exception)
2851 return DataArrayDouble::New();
2854 static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2856 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) !";
2857 if(PyList_Check(elt0) || PyTuple_Check(elt0))
2861 if(PyInt_Check(nbOfTuples))
2863 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2865 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2868 if(PyInt_Check(elt2))
2869 {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2870 int nbOfCompo=PyInt_AS_LONG(elt2);
2872 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2873 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2874 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
2875 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2880 throw INTERP_KERNEL::Exception(msg);
2883 {//DataArrayDouble.New([1.,3.,4.],3)
2884 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2886 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
2887 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2893 throw INTERP_KERNEL::Exception(msg);
2896 {// DataArrayDouble.New([1.,3.,4.])
2897 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2898 int tmpp1=-1,tmpp2=-1;
2899 std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
2900 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2905 else if(PyInt_Check(elt0))
2907 int nbOfTuples1=PyInt_AS_LONG(elt0);
2909 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2914 if(PyInt_Check(nbOfTuples))
2915 {//DataArrayDouble.New(5,2)
2916 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2918 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2919 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2920 ret->alloc(nbOfTuples1,nbOfCompo);
2925 throw INTERP_KERNEL::Exception(msg);
2928 throw INTERP_KERNEL::Exception(msg);
2931 {//DataArrayDouble.New(5)
2932 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2933 ret->alloc(nbOfTuples1,1);
2939 throw INTERP_KERNEL::Exception(msg);
2942 DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2944 return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
2947 std::string __str__() const
2949 return self->repr();
2952 double __float__() const throw(INTERP_KERNEL::Exception)
2954 return self->doubleValue();
2957 int __len__() const throw(INTERP_KERNEL::Exception)
2959 if(self->isAllocated())
2961 return self->getNumberOfTuples();
2965 throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2969 DataArrayDoubleIterator *__iter__()
2971 return self->iterator();
2974 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
2976 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 !";
2977 if(PyList_Check(li) || PyTuple_Check(li))
2981 if(PyInt_Check(nbOfTuples))
2983 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2985 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
2988 if(PyInt_Check(nbOfComp))
2989 {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
2990 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
2992 throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
2993 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
2994 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
2997 throw INTERP_KERNEL::Exception(msg);
3000 {//DataArrayDouble.setValues([1.,3.,4.],3)
3002 std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
3003 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3007 throw INTERP_KERNEL::Exception(msg);
3010 {// DataArrayDouble.setValues([1.,3.,4.])
3011 int tmpp1=-1,tmpp2=-1;
3012 std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
3013 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3017 throw INTERP_KERNEL::Exception(msg);
3020 PyObject *getValues() throw(INTERP_KERNEL::Exception)
3022 const double *vals=self->getPointer();
3023 return convertDblArrToPyList(vals,self->getNbOfElems());
3026 PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
3029 bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
3030 PyObject *ret=PyTuple_New(2);
3031 PyObject *ret0Py=ret0?Py_True:Py_False;
3033 PyTuple_SetItem(ret,0,ret0Py);
3034 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3038 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
3040 const double *vals=self->getPointer();
3041 int nbOfComp=self->getNumberOfComponents();
3042 int nbOfTuples=self->getNumberOfTuples();
3043 return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3046 DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3049 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3050 if (!SWIG_IsOK(res1))
3053 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3054 if(size!=self->getNumberOfTuples())
3056 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3058 return self->renumber(tmp);
3062 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3064 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3065 da2->checkAllocated();
3066 int size=self->getNumberOfTuples();
3067 if(size!=self->getNumberOfTuples())
3069 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3071 return self->renumber(da2->getConstPointer());
3075 DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3078 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3079 if (!SWIG_IsOK(res1))
3082 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3083 if(size!=self->getNumberOfTuples())
3085 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3087 return self->renumberR(tmp);
3091 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3093 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3094 da2->checkAllocated();
3095 int size=self->getNumberOfTuples();
3096 if(size!=self->getNumberOfTuples())
3098 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3100 return self->renumberR(da2->getConstPointer());
3104 DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3107 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3108 if (!SWIG_IsOK(res1))
3111 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3112 if(size!=self->getNumberOfTuples())
3114 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3116 return self->renumberAndReduce(tmp,newNbOfTuple);
3120 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3122 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3123 da2->checkAllocated();
3124 int size=self->getNumberOfTuples();
3125 if(size!=self->getNumberOfTuples())
3127 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3129 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3133 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
3136 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3137 if (!SWIG_IsOK(res1))
3140 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3141 if(size!=self->getNumberOfTuples())
3143 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3145 self->renumberInPlace(tmp);
3149 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3151 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3152 da2->checkAllocated();
3153 int size=self->getNumberOfTuples();
3154 if(size!=self->getNumberOfTuples())
3156 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3158 self->renumberInPlace(da2->getConstPointer());
3162 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
3165 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3166 if (!SWIG_IsOK(res1))
3169 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3170 if(size!=self->getNumberOfTuples())
3172 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3174 self->renumberInPlaceR(tmp);
3178 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3180 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3181 da2->checkAllocated();
3182 int size=self->getNumberOfTuples();
3183 if(size!=self->getNumberOfTuples())
3185 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3187 self->renumberInPlaceR(da2->getConstPointer());
3191 DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3194 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3195 if (!SWIG_IsOK(res1))
3198 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3199 return self->selectByTupleId(tmp,tmp+size);
3203 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3205 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3206 da2->checkAllocated();
3207 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3211 DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3214 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
3215 if (!SWIG_IsOK(res1))
3218 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3219 return self->selectByTupleIdSafe(tmp,tmp+size);
3223 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3225 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3226 da2->checkAllocated();
3227 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3231 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3234 double r1=self->getMaxValue(tmp);
3235 PyObject *ret=PyTuple_New(2);
3236 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3237 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3241 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3244 double r1=self->getMaxValue2(tmp);
3245 PyObject *ret=PyTuple_New(2);
3246 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3247 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3251 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3254 double r1=self->getMinValue(tmp);
3255 PyObject *ret=PyTuple_New(2);
3256 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3257 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3261 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3264 double r1=self->getMinValue2(tmp);
3265 PyObject *ret=PyTuple_New(2);
3266 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3267 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3271 PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3273 int nbOfCompo=self->getNumberOfComponents();
3274 INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3275 self->getMinMaxPerComponent(tmp);
3276 PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3280 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3282 int sz=self->getNumberOfComponents();
3283 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3284 self->accumulate(tmp);
3285 return convertDblArrToPyList(tmp,sz);
3288 DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3290 std::vector<int> tmp;
3291 convertPyToNewIntArr3(li,tmp);
3292 return self->keepSelectedComponents(tmp);
3295 PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3297 DataArrayInt *comm, *commIndex;
3298 self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3299 PyObject *res = PyList_New(2);
3300 PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3301 PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3305 PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
3309 DataArrayDoubleTuple *aa;
3310 std::vector<double> bb;
3312 int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
3313 const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
3315 int cellId=-1,nodeId=-1;
3316 double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
3317 PyObject *ret=PyTuple_New(2);
3318 PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
3319 PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
3323 void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3325 std::vector<int> tmp;
3326 convertPyToNewIntArr3(li,tmp);
3327 self->setSelectedComponents(a,tmp);
3330 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3332 int sz=self->getNumberOfComponents();
3333 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3334 self->getTuple(tupleId,tmp);
3335 return convertDblArrToPyList(tmp,sz);
3338 static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3340 std::vector<const DataArrayDouble *> tmp;
3341 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3342 return DataArrayDouble::Aggregate(tmp);
3345 static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3347 std::vector<const DataArrayDouble *> tmp;
3348 convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3349 return DataArrayDouble::Meld(tmp);
3352 DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3354 std::vector<std::pair<int,int> > ranges;
3355 convertPyToVectorPairInt(li,ranges);
3356 return self->selectByTupleRanges(ranges);
3359 PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3363 DataArrayDoubleTuple *aa;
3364 std::vector<double> bb;
3366 int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3367 const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3368 const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3369 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3370 DataArrayInt *c=0,*cI=0;
3371 self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3372 PyObject *ret=PyTuple_New(2);
3373 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3374 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3378 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3380 const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3381 self->checkAllocated();
3382 int nbOfTuples=self->getNumberOfTuples();
3383 int nbOfComponents=self->getNumberOfComponents();
3385 std::vector<int> vt1,vc1;
3386 std::pair<int, std::pair<int,int> > pt1,pc1;
3387 DataArrayInt *dt1=0,*dc1=0;
3389 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3390 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3394 if(nbOfComponents==1)
3395 return PyFloat_FromDouble(self->getIJSafe(it1,0));
3396 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3398 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3400 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3402 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3404 return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3407 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3408 std::vector<int> v2(1,ic1);
3409 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3413 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3414 std::vector<int> v2(1,ic1);
3415 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3419 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3420 std::vector<int> v2(1,ic1);
3421 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3425 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3426 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3430 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3431 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3435 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3436 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3440 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3441 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3445 ret=self->selectByTupleIdSafe(&it1,&it1+1);
3446 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3447 std::vector<int> v2(nbOfComp);
3448 for(int i=0;i<nbOfComp;i++)
3449 v2[i]=pc1.first+i*pc1.second.second;
3450 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3454 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3455 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3456 std::vector<int> v2(nbOfComp);
3457 for(int i=0;i<nbOfComp;i++)
3458 v2[i]=pc1.first+i*pc1.second.second;
3459 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3463 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3464 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3465 std::vector<int> v2(nbOfComp);
3466 for(int i=0;i<nbOfComp;i++)
3467 v2[i]=pc1.first+i*pc1.second.second;
3468 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3472 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3473 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3474 std::vector<int> v2(nbOfComp);
3475 for(int i=0;i<nbOfComp;i++)
3476 v2[i]=pc1.first+i*pc1.second.second;
3477 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3480 throw INTERP_KERNEL::Exception(msg);
3484 DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3486 self->checkAllocated();
3487 const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3488 int nbOfTuples=self->getNumberOfTuples();
3489 int nbOfComponents=self->getNumberOfComponents();
3492 std::vector<double> v1;
3493 DataArrayDouble *d1=0;
3494 convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3496 std::vector<int> vt1,vc1;
3497 std::pair<int, std::pair<int,int> > pt1,pc1;
3498 DataArrayInt *dt1=0,*dc1=0;
3499 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3500 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3508 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3511 tmp=DataArrayDouble::New();
3512 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3513 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3516 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3519 throw INTERP_KERNEL::Exception(msg);
3528 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3531 tmp=DataArrayDouble::New();
3532 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3533 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3536 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3539 throw INTERP_KERNEL::Exception(msg);
3548 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3551 tmp=DataArrayDouble::New();
3552 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3553 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3556 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3559 throw INTERP_KERNEL::Exception(msg);
3568 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3571 tmp=DataArrayDouble::New();
3572 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3573 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3576 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3579 throw INTERP_KERNEL::Exception(msg);
3588 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3591 tmp=DataArrayDouble::New();
3592 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3593 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3596 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3599 throw INTERP_KERNEL::Exception(msg);
3608 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3611 tmp=DataArrayDouble::New();
3612 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3613 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3616 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3619 throw INTERP_KERNEL::Exception(msg);
3628 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3631 tmp=DataArrayDouble::New();
3632 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3633 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3636 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3639 throw INTERP_KERNEL::Exception(msg);
3648 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3651 tmp=DataArrayDouble::New();
3652 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3653 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3656 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3659 throw INTERP_KERNEL::Exception(msg);
3668 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3671 tmp=DataArrayDouble::New();
3672 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3673 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3676 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3679 throw INTERP_KERNEL::Exception(msg);
3688 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3691 tmp=DataArrayDouble::New();
3692 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3693 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3696 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3699 throw INTERP_KERNEL::Exception(msg);
3708 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3711 tmp=DataArrayDouble::New();
3712 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3713 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3716 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3719 throw INTERP_KERNEL::Exception(msg);
3728 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3731 tmp=DataArrayDouble::New();
3732 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3733 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3736 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3739 throw INTERP_KERNEL::Exception(msg);
3748 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3751 tmp=DataArrayDouble::New();
3752 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3753 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3756 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3759 throw INTERP_KERNEL::Exception(msg);
3768 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3771 tmp=DataArrayDouble::New();
3772 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3773 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3776 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3779 throw INTERP_KERNEL::Exception(msg);
3788 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3791 tmp=DataArrayDouble::New();
3792 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3793 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3796 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3799 throw INTERP_KERNEL::Exception(msg);
3808 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3811 tmp=DataArrayDouble::New();
3812 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3813 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3816 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3819 throw INTERP_KERNEL::Exception(msg);
3824 throw INTERP_KERNEL::Exception(msg);
3829 DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3831 return self->negate();
3834 DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3836 const char msg[]="Unexpected situation in __add__ !";
3839 DataArrayDoubleTuple *aa;
3840 std::vector<double> bb;
3842 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3847 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3848 ret->applyLin(1.,val);
3854 return DataArrayDouble::Add(self,a);
3858 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3859 return DataArrayDouble::Add(self,aaa);
3863 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3864 return DataArrayDouble::Add(self,aaa);
3867 throw INTERP_KERNEL::Exception(msg);
3871 DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3873 const char msg[]="Unexpected situation in __radd__ !";
3876 DataArrayDoubleTuple *aa;
3877 std::vector<double> bb;
3879 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3884 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3885 ret->applyLin(1.,val);
3891 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3892 return DataArrayDouble::Add(self,aaa);
3896 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3897 return DataArrayDouble::Add(self,aaa);
3900 throw INTERP_KERNEL::Exception(msg);
3904 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3906 const char msg[]="Unexpected situation in __iadd__ !";
3909 DataArrayDoubleTuple *aa;
3910 std::vector<double> bb;
3912 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3917 self->applyLin(1.,val);
3918 Py_XINCREF(trueSelf);
3924 Py_XINCREF(trueSelf);
3929 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3930 self->addEqual(aaa);
3931 Py_XINCREF(trueSelf);
3936 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3937 self->addEqual(aaa);
3938 Py_XINCREF(trueSelf);
3942 throw INTERP_KERNEL::Exception(msg);
3946 DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3948 const char msg[]="Unexpected situation in __sub__ !";
3951 DataArrayDoubleTuple *aa;
3952 std::vector<double> bb;
3954 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3959 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3960 ret->applyLin(1.,-val);
3966 return DataArrayDouble::Substract(self,a);
3970 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3971 return DataArrayDouble::Substract(self,aaa);
3975 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3976 return DataArrayDouble::Substract(self,aaa);
3979 throw INTERP_KERNEL::Exception(msg);
3983 DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3985 const char msg[]="Unexpected situation in __rsub__ !";
3988 DataArrayDoubleTuple *aa;
3989 std::vector<double> bb;
3991 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3996 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3997 ret->applyLin(-1.,val);
4003 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4004 return DataArrayDouble::Substract(aaa,self);
4008 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4009 return DataArrayDouble::Substract(aaa,self);
4012 throw INTERP_KERNEL::Exception(msg);
4016 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4018 const char msg[]="Unexpected situation in __isub__ !";
4021 DataArrayDoubleTuple *aa;
4022 std::vector<double> bb;
4024 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4029 self->applyLin(1,-val);
4030 Py_XINCREF(trueSelf);
4035 self->substractEqual(a);
4036 Py_XINCREF(trueSelf);
4041 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4042 self->substractEqual(aaa);
4043 Py_XINCREF(trueSelf);
4048 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4049 self->substractEqual(aaa);
4050 Py_XINCREF(trueSelf);
4054 throw INTERP_KERNEL::Exception(msg);
4058 DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4060 const char msg[]="Unexpected situation in __mul__ !";
4063 DataArrayDoubleTuple *aa;
4064 std::vector<double> bb;
4066 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4071 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4072 ret->applyLin(val,0.);
4078 return DataArrayDouble::Multiply(self,a);
4082 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4083 return DataArrayDouble::Multiply(self,aaa);
4087 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4088 return DataArrayDouble::Multiply(self,aaa);
4091 throw INTERP_KERNEL::Exception(msg);
4095 DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4097 const char msg[]="Unexpected situation in __rmul__ !";
4100 DataArrayDoubleTuple *aa;
4101 std::vector<double> bb;
4103 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4108 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4109 ret->applyLin(val,0.);
4115 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4116 return DataArrayDouble::Multiply(self,aaa);
4120 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4121 return DataArrayDouble::Multiply(self,aaa);
4124 throw INTERP_KERNEL::Exception(msg);
4128 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4130 const char msg[]="Unexpected situation in __imul__ !";
4133 DataArrayDoubleTuple *aa;
4134 std::vector<double> bb;
4136 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4141 self->applyLin(val,0.);
4142 Py_XINCREF(trueSelf);
4147 self->multiplyEqual(a);
4148 Py_XINCREF(trueSelf);
4153 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4154 self->multiplyEqual(aaa);
4155 Py_XINCREF(trueSelf);
4160 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4161 self->multiplyEqual(aaa);
4162 Py_XINCREF(trueSelf);
4166 throw INTERP_KERNEL::Exception(msg);
4170 DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4172 const char msg[]="Unexpected situation in __div__ !";
4175 DataArrayDoubleTuple *aa;
4176 std::vector<double> bb;
4178 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4184 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4185 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4186 ret->applyLin(1/val,0.);
4192 return DataArrayDouble::Divide(self,a);
4196 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4197 return DataArrayDouble::Divide(self,aaa);
4201 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4202 return DataArrayDouble::Divide(self,aaa);
4205 throw INTERP_KERNEL::Exception(msg);
4209 DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4211 const char msg[]="Unexpected situation in __rdiv__ !";
4214 DataArrayDoubleTuple *aa;
4215 std::vector<double> bb;
4217 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4222 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4229 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4230 return DataArrayDouble::Divide(aaa,self);
4234 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4235 return DataArrayDouble::Divide(aaa,self);
4238 throw INTERP_KERNEL::Exception(msg);
4242 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4244 const char msg[]="Unexpected situation in __idiv__ !";
4247 DataArrayDoubleTuple *aa;
4248 std::vector<double> bb;
4250 convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4256 throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4257 self->applyLin(1./val,0.);
4258 Py_XINCREF(trueSelf);
4263 self->divideEqual(a);
4264 Py_XINCREF(trueSelf);
4269 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4270 self->divideEqual(aaa);
4271 Py_XINCREF(trueSelf);
4276 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4277 self->divideEqual(aaa);
4278 Py_XINCREF(trueSelf);
4282 throw INTERP_KERNEL::Exception(msg);
4286 PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4288 DataArrayInt *c=0,*cI=0;
4290 self->computeTupleIdsNearTuples(other,eps,c,cI);
4291 PyObject *ret=PyTuple_New(2);
4292 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4293 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4298 %extend ParaMEDMEM::DataArrayIntTuple
4300 std::string __str__() const
4302 return self->repr();
4305 int __int__() const throw(INTERP_KERNEL::Exception)
4307 return self->intValue();
4310 DataArrayInt *buildDAInt()
4312 return self->buildDAInt(1,self->getNumberOfCompo());
4315 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4317 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4318 ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4319 Py_XINCREF(trueSelf);
4323 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4325 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4326 ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4327 Py_XINCREF(trueSelf);
4331 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4333 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4334 ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4335 Py_XINCREF(trueSelf);
4339 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4341 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4342 ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4343 Py_XINCREF(trueSelf);
4347 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4349 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4350 ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4351 Py_XINCREF(trueSelf);
4355 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4359 std::vector<int> multiVal;
4360 std::pair<int, std::pair<int,int> > slic;
4361 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4362 const int *pt=self->getConstPointer();
4363 int nbc=self->getNumberOfCompo();
4364 convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4371 std::ostringstream oss;
4372 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4373 throw INTERP_KERNEL::Exception(oss.str().c_str());
4376 return PyInt_FromLong(pt[singleVal]);
4380 return PyInt_FromLong(pt[nbc+singleVal]);
4383 std::ostringstream oss;
4384 oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4385 throw INTERP_KERNEL::Exception(oss.str().c_str());
4391 PyObject *t=PyTuple_New(multiVal.size());
4392 for(int j=0;j<(int)multiVal.size();j++)
4394 int cid=multiVal[j];
4397 std::ostringstream oss;
4398 oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4399 throw INTERP_KERNEL::Exception(oss.str().c_str());
4401 PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4407 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4408 PyObject *t=PyTuple_New(sz);
4409 for(int j=0;j<sz;j++)
4410 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4414 throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4418 DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4420 const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4423 std::vector<int> multiValV;
4424 std::pair<int, std::pair<int,int> > slicV;
4425 ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4426 int nbc=self->getNumberOfCompo();
4427 convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4429 std::vector<int> multiVal;
4430 std::pair<int, std::pair<int,int> > slic;
4431 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4432 int *pt=self->getPointer();
4433 convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4440 std::ostringstream oss;
4441 oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4442 throw INTERP_KERNEL::Exception(oss.str().c_str());
4448 pt[singleVal]=singleValV;
4453 if(multiValV.size()!=1)
4455 std::ostringstream oss;
4456 oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4457 throw INTERP_KERNEL::Exception(oss.str().c_str());
4459 pt[singleVal]=multiValV[0];
4464 pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4468 throw INTERP_KERNEL::Exception(msg);
4477 for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4481 std::ostringstream oss;
4482 oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4483 throw INTERP_KERNEL::Exception(oss.str().c_str());
4491 if(multiVal.size()!=multiValV.size())
4493 std::ostringstream oss;
4494 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4495 throw INTERP_KERNEL::Exception(oss.str().c_str());
4497 for(int i=0;i<(int)multiVal.size();i++)
4499 int pos=multiVal[i];
4502 std::ostringstream oss;
4503 oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4504 throw INTERP_KERNEL::Exception(oss.str().c_str());
4506 pt[multiVal[i]]=multiValV[i];
4512 const int *ptV=daIntTyyppV->getConstPointer();
4513 if(nbc>daIntTyyppV->getNumberOfCompo())
4515 std::ostringstream oss;
4516 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4517 throw INTERP_KERNEL::Exception(oss.str().c_str());
4519 std::copy(ptV,ptV+nbc,pt);
4523 throw INTERP_KERNEL::Exception(msg);
4528 int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4533 for(int j=0;j<sz;j++)
4534 pt[slic.first+j*slic.second.second]=singleValV;
4539 if(sz!=(int)multiValV.size())
4541 std::ostringstream oss;
4542 oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4543 throw INTERP_KERNEL::Exception(oss.str().c_str());
4545 for(int j=0;j<sz;j++)
4546 pt[slic.first+j*slic.second.second]=multiValV[j];
4551 const int *ptV=daIntTyyppV->getConstPointer();
4552 if(sz>daIntTyyppV->getNumberOfCompo())
4554 std::ostringstream oss;
4555 oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4556 throw INTERP_KERNEL::Exception(oss.str().c_str());
4558 for(int j=0;j<sz;j++)
4559 pt[slic.first+j*slic.second.second]=ptV[j];
4563 throw INTERP_KERNEL::Exception(msg);
4567 throw INTERP_KERNEL::Exception(msg);
4572 %extend ParaMEDMEM::DataArrayIntIterator
4576 DataArrayIntTuple *ret=self->nextt();
4578 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4581 PyErr_SetString(PyExc_StopIteration,"No more data.");
4587 %extend ParaMEDMEM::DataArrayInt
4589 DataArrayInt() throw(INTERP_KERNEL::Exception)
4591 return DataArrayInt::New();
4594 static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4596 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) !";
4597 if(PyList_Check(elt0) || PyTuple_Check(elt0))
4601 if(PyInt_Check(nbOfTuples))
4603 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4605 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4608 if(PyInt_Check(nbOfComp))
4609 {//DataArrayInt.New([1,3,4,5],2,2)
4610 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4612 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4613 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4614 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4615 ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4620 throw INTERP_KERNEL::Exception(msg);
4623 {//DataArrayInt.New([1,3,4],3)
4624 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4626 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4627 ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4633 throw INTERP_KERNEL::Exception(msg);
4636 {// DataArrayInt.New([1,3,4])
4637 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4638 int tmpp1=-1,tmpp2=-1;
4639 std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4640 ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4645 else if(PyInt_Check(elt0))
4647 int nbOfTuples1=PyInt_AS_LONG(elt0);
4649 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4654 if(PyInt_Check(nbOfTuples))
4655 {//DataArrayInt.New(5,2)
4656 int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4658 throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4659 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4660 ret->alloc(nbOfTuples1,nbOfCompo);
4665 throw INTERP_KERNEL::Exception(msg);
4668 throw INTERP_KERNEL::Exception(msg);
4671 {//DataArrayInt.New(5)
4672 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4673 ret->alloc(nbOfTuples1,1);
4679 throw INTERP_KERNEL::Exception(msg);
4682 DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4684 return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4687 std::string __str__() const
4689 return self->repr();
4692 int __len__() const throw(INTERP_KERNEL::Exception)
4694 if(self->isAllocated())
4696 return self->getNumberOfTuples();
4700 throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4704 int __int__() const throw(INTERP_KERNEL::Exception)
4706 return self->intValue();
4709 DataArrayIntIterator *__iter__()
4711 return self->iterator();
4714 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4716 int sz=self->getNumberOfComponents();
4717 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4718 self->accumulate(tmp);
4719 return convertIntArrToPyList(tmp,sz);
4722 static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
4724 int newNbOfTuples=-1;
4725 int szArr,szArrI,sw,iTypppArr,iTypppArrI;
4726 std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
4727 const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
4728 const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
4729 DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
4730 PyObject *ret=PyTuple_New(2);
4731 PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4732 PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4736 void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4738 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 !";
4739 if(PyList_Check(li) || PyTuple_Check(li))
4743 if(PyInt_Check(nbOfTuples))
4745 int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4747 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
4750 if(PyInt_Check(nbOfComp))
4751 {//DataArrayInt.setValues([1,3,4,5],2,2)
4752 int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4754 throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
4755 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
4756 self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4759 throw INTERP_KERNEL::Exception(msg);
4762 {//DataArrayInt.setValues([1,3,4],3)
4764 std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
4765 self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4769 throw INTERP_KERNEL::Exception(msg);
4772 {// DataArrayInt.setValues([1,3,4])
4773 int tmpp1=-1,tmpp2=-1;
4774 std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
4775 self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4779 throw INTERP_KERNEL::Exception(msg);
4782 PyObject *getValues() throw(INTERP_KERNEL::Exception)
4784 const int *vals=self->getPointer();
4785 return convertIntArrToPyList(vals,self->getNbOfElems());
4788 PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4791 bool ret0=self->isEqualIfNotWhy(other,ret1);
4792 PyObject *ret=PyTuple_New(2);
4793 PyObject *ret0Py=ret0?Py_True:Py_False;
4795 PyTuple_SetItem(ret,0,ret0Py);
4796 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4800 PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4802 const int *vals=self->getPointer();
4803 int nbOfComp=self->getNumberOfComponents();
4804 int nbOfTuples=self->getNumberOfTuples();
4805 return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4808 static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4810 std::vector<const DataArrayInt *> groups;
4811 std::vector< std::vector<int> > fidsOfGroups;
4812 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4813 ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4814 PyObject *ret = PyList_New(2);
4815 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4816 int sz=fidsOfGroups.size();
4817 PyObject *ret1 = PyList_New(sz);
4818 for(int i=0;i<sz;i++)
4819 PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4820 PyList_SetItem(ret,1,ret1);
4824 void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
4827 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4828 if (!SWIG_IsOK(res1))
4831 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4832 self->transformWithIndArr(tmp,tmp+size);
4836 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4837 self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4841 DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4845 std::vector<int> multiVal;
4846 std::pair<int, std::pair<int,int> > slic;
4847 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4848 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4852 return self->getIdsEqualList(&singleVal,&singleVal+1);
4854 return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4856 return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4858 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4862 DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4866 std::vector<int> multiVal;
4867 std::pair<int, std::pair<int,int> > slic;
4868 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4869 convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4873 return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4875 return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4877 return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4879 throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4883 PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4885 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
4887 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4888 if (!SWIG_IsOK(res1))
4891 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4892 self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4896 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4898 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4899 da2->checkAllocated();
4900 int size=self->getNumberOfTuples();
4901 self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4903 PyObject *ret = PyList_New(3);
4904 PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4905 PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4906 PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4910 DataArrayInt *transformWithIndArrR(PyObject *li) const
4913 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4914 if (!SWIG_IsOK(res1))
4917 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4918 return self->transformWithIndArrR(tmp,tmp+size);
4922 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4923 return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4927 void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4930 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4931 if (!SWIG_IsOK(res1))
4934 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4935 if(size!=self->getNumberOfTuples())
4937 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4939 self->renumberInPlace(tmp);
4943 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4945 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4946 da2->checkAllocated();
4947 int size=self->getNumberOfTuples();
4948 if(size!=self->getNumberOfTuples())
4950 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4952 self->renumberInPlace(da2->getConstPointer());
4956 void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4959 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4960 if (!SWIG_IsOK(res1))
4963 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4964 if(size!=self->getNumberOfTuples())
4966 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4968 self->renumberInPlaceR(tmp);
4972 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4974 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4975 da2->checkAllocated();
4976 int size=self->getNumberOfTuples();
4977 if(size!=self->getNumberOfTuples())
4979 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4981 self->renumberInPlaceR(da2->getConstPointer());
4985 DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4988 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
4989 if (!SWIG_IsOK(res1))
4992 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4993 if(size!=self->getNumberOfTuples())
4995 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4997 return self->renumberAndReduce(tmp,newNbOfTuple);
5001 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5003 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5004 da2->checkAllocated();
5005 int size=self->getNumberOfTuples();
5006 if(size!=self->getNumberOfTuples())
5008 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5010 return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5014 DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5017 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5018 if (!SWIG_IsOK(res1))
5021 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5022 if(size!=self->getNumberOfTuples())
5024 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5026 return self->renumber(tmp);
5030 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5032 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5033 da2->checkAllocated();
5034 int size=self->getNumberOfTuples();
5035 if(size!=self->getNumberOfTuples())
5037 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5039 return self->renumber(da2->getConstPointer());
5043 DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5046 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5047 if (!SWIG_IsOK(res1))
5050 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5051 if(size!=self->getNumberOfTuples())
5053 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5055 return self->renumberR(tmp);
5059 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5061 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5062 da2->checkAllocated();
5063 int size=self->getNumberOfTuples();
5064 if(size!=self->getNumberOfTuples())
5066 throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5068 return self->renumberR(da2->getConstPointer());
5072 DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
5075 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5076 if (!SWIG_IsOK(res1))
5079 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5080 return self->selectByTupleId(tmp,tmp+size);
5084 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5086 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5087 da2->checkAllocated();
5088 return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5092 DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
5095 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
5096 if (!SWIG_IsOK(res1))
5099 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5100 return self->selectByTupleIdSafe(tmp,tmp+size);
5104 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5106 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5107 da2->checkAllocated();
5108 return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5112 DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
5114 std::vector<int> tmp;
5115 convertPyToNewIntArr3(li,tmp);
5116 return self->keepSelectedComponents(tmp);
5119 void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
5121 std::vector<int> tmp;
5122 convertPyToNewIntArr3(li,tmp);
5123 self->setSelectedComponents(a,tmp);
5126 PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5128 int sz=self->getNumberOfComponents();
5129 INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5130 self->getTuple(tupleId,tmp);
5131 return convertIntArrToPyList(tmp,sz);
5134 PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
5136 DataArrayInt *arr=0;
5137 DataArrayInt *arrI=0;
5138 self->changeSurjectiveFormat(targetNb,arr,arrI);
5139 PyObject *res = PyList_New(2);
5140 PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5141 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5145 DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
5147 std::vector<std::pair<int,int> > ranges;
5148 convertPyToVectorPairInt(li,ranges);
5149 return self->selectByTupleRanges(ranges);
5152 static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
5154 std::vector<const DataArrayInt *> tmp;
5155 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5156 return DataArrayInt::Meld(tmp);
5159 static DataArrayInt *Aggregate(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::Aggregate(tmp);
5166 static DataArrayInt *BuildUnion(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::BuildUnion(tmp);
5173 static DataArrayInt *BuildIntersection(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::BuildIntersection(tmp);
5180 PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5183 int r1=self->getMaxValue(tmp);
5184 PyObject *ret=PyTuple_New(2);
5185 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5186 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5190 PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5193 int r1=self->getMinValue(tmp);
5194 PyObject *ret=PyTuple_New(2);
5195 PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5196 PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5200 int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5202 int nbOfCompo=self->getNumberOfComponents();
5207 if(PyInt_Check(obj))
5209 int val=(int)PyInt_AS_LONG(obj);
5210 return self->locateValue(val);
5213 throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5217 std::vector<int> arr;
5218 convertPyToNewIntArr3(obj,arr);
5219 return self->locateTuple(arr);
5224 bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5226 int nbOfCompo=self->getNumberOfComponents();
5233 if(PyInt_Check(obj))
5235 int val=(int)PyInt_AS_LONG(obj);
5236 return self->presenceOfValue(val);
5239 throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5243 std::vector<int> arr;
5244 convertPyToNewIntArr3(obj,arr);
5245 return self->presenceOfTuple(arr);
5250 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5252 const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5253 self->checkAllocated();
5254 int nbOfTuples=self->getNumberOfTuples();
5255 int nbOfComponents=self->getNumberOfComponents();
5257 std::vector<int> vt1,vc1;
5258 std::pair<int, std::pair<int,int> > pt1,pc1;
5259 DataArrayInt *dt1=0,*dc1=0;
5261 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5262 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5267 if(nbOfComponents==1)
5268 return PyInt_FromLong(self->getIJSafe(it1,0));
5269 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5272 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5274 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5276 return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5278 return PyInt_FromLong(self->getIJSafe(it1,ic1));
5281 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5282 std::vector<int> v2(1,ic1);
5283 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5287 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5288 std::vector<int> v2(1,ic1);
5289 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5293 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5294 std::vector<int> v2(1,ic1);
5295 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5299 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5300 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5304 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5305 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5309 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5310 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5314 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5315 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5319 ret=self->selectByTupleIdSafe(&it1,&it1+1);
5320 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5321 std::vector<int> v2(nbOfComp);
5322 for(int i=0;i<nbOfComp;i++)
5323 v2[i]=pc1.first+i*pc1.second.second;
5324 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5328 ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5329 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5330 std::vector<int> v2(nbOfComp);
5331 for(int i=0;i<nbOfComp;i++)
5332 v2[i]=pc1.first+i*pc1.second.second;
5333 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5337 ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5338 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5339 std::vector<int> v2(nbOfComp);
5340 for(int i=0;i<nbOfComp;i++)
5341 v2[i]=pc1.first+i*pc1.second.second;
5342 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5346 ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5347 int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5348 std::vector<int> v2(nbOfComp);
5349 for(int i=0;i<nbOfComp;i++)
5350 v2[i]=pc1.first+i*pc1.second.second;
5351 return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5354 throw INTERP_KERNEL::Exception(msg);
5358 DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5360 self->checkAllocated();
5361 const char msg[]="Unexpected situation in __setitem__ !";
5362 int nbOfTuples=self->getNumberOfTuples();
5363 int nbOfComponents=self->getNumberOfComponents();
5366 std::vector<int> v1;
5368 DataArrayIntTuple *dd1=0;
5369 convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5371 std::vector<int> vt1,vc1;
5372 std::pair<int, std::pair<int,int> > pt1,pc1;
5373 DataArrayInt *dt1=0,*dc1=0;
5374 convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5375 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5383 self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5386 tmp=DataArrayInt::New();
5387 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5388 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5391 self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5394 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5395 self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5398 throw INTERP_KERNEL::Exception(msg);
5407 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5410 tmp=DataArrayInt::New();
5411 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5412 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5415 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5418 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5419 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5422 throw INTERP_KERNEL::Exception(msg);
5431 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5434 tmp=DataArrayInt::New();
5435 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5436 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5439 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5442 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5443 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5446 throw INTERP_KERNEL::Exception(msg);
5455 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5458 tmp=DataArrayInt::New();
5459 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5460 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5463 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5466 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5467 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5470 throw INTERP_KERNEL::Exception(msg);
5479 self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5482 tmp=DataArrayInt::New();
5483 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5484 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5487 self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5490 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5491 self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5494 throw INTERP_KERNEL::Exception(msg);
5503 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5506 tmp=DataArrayInt::New();
5507 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5508 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5511 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5514 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5515 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5518 throw INTERP_KERNEL::Exception(msg);
5527 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5530 tmp=DataArrayInt::New();
5531 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5532 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5535 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5538 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5539 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5542 throw INTERP_KERNEL::Exception(msg);
5551 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5554 tmp=DataArrayInt::New();
5555 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5556 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5559 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5562 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5563 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5566 throw INTERP_KERNEL::Exception(msg);
5575 self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5578 tmp=DataArrayInt::New();
5579 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5580 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5583 self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5586 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5587 self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5590 throw INTERP_KERNEL::Exception(msg);
5599 self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5602 tmp=DataArrayInt::New();
5603 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5604 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5607 self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5610 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5611 self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5614 throw INTERP_KERNEL::Exception(msg);
5623 self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5626 tmp=DataArrayInt::New();
5627 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5628 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
5631 self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5634 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5635 self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5638 throw INTERP_KERNEL::Exception(msg);
5647 self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5650 tmp=DataArrayInt::New();
5651 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5652 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5655 self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5658 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5659 self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5662 throw INTERP_KERNEL::Exception(msg);
5671 self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5674 tmp=DataArrayInt::New();
5675 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5676 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5679 self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5682 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5683 self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5686 throw INTERP_KERNEL::Exception(msg);
5695 self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5698 tmp=DataArrayInt::New();
5699 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5700 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5703 self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5706 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5707 self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5710 throw INTERP_KERNEL::Exception(msg);
5719 self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5722 tmp=DataArrayInt::New();
5723 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5724 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5727 self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5730 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5731 self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5734 throw INTERP_KERNEL::Exception(msg);
5743 self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5746 tmp=DataArrayInt::New();
5747 tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5748 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5751 self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5754 tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5755 self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5758 throw INTERP_KERNEL::Exception(msg);
5763 throw INTERP_KERNEL::Exception(msg);
5768 DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5770 return self->negate();
5773 DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5775 const char msg[]="Unexpected situation in __add__ !";
5778 std::vector<int> aa;
5779 DataArrayIntTuple *aaa;
5781 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5786 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5787 ret->applyLin(1,val);
5793 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5794 return DataArrayInt::Add(self,aaa);
5798 return DataArrayInt::Add(self,a);
5802 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5803 return DataArrayInt::Add(self,aaaa);
5806 throw INTERP_KERNEL::Exception(msg);
5810 DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5812 const char msg[]="Unexpected situation in __radd__ !";
5815 std::vector<int> aa;
5816 DataArrayIntTuple *aaa;
5818 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5823 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5824 ret->applyLin(1,val);
5830 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5831 return DataArrayInt::Add(self,aaa);
5835 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5836 return DataArrayInt::Add(self,aaaa);
5839 throw INTERP_KERNEL::Exception(msg);
5843 PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5845 const char msg[]="Unexpected situation in __iadd__ !";
5848 std::vector<int> aa;
5849 DataArrayIntTuple *aaa;
5851 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5856 self->applyLin(1,val);
5857 Py_XINCREF(trueSelf);
5862 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5864 Py_XINCREF(trueSelf);
5870 Py_XINCREF(trueSelf);
5875 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5876 self->addEqual(aaaa);
5877 Py_XINCREF(trueSelf);
5881 throw INTERP_KERNEL::Exception(msg);
5885 DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5887 const char msg[]="Unexpected situation in __sub__ !";
5890 std::vector<int> aa;
5891 DataArrayIntTuple *aaa;
5893 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5898 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5899 ret->applyLin(1,-val);
5905 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5906 return DataArrayInt::Substract(self,aaa);
5910 return DataArrayInt::Substract(self,a);
5914 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5915 return DataArrayInt::Substract(self,aaaa);
5918 throw INTERP_KERNEL::Exception(msg);
5922 DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5924 const char msg[]="Unexpected situation in __rsub__ !";
5927 std::vector<int> aa;
5928 DataArrayIntTuple *aaa;
5930 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5935 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5936 ret->applyLin(-1,val);
5942 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5943 return DataArrayInt::Substract(aaa,self);
5947 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5948 return DataArrayInt::Substract(aaaa,self);
5951 throw INTERP_KERNEL::Exception(msg);
5955 PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5957 const char msg[]="Unexpected situation in __isub__ !";
5960 std::vector<int> aa;
5961 DataArrayIntTuple *aaa;
5963 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5968 self->applyLin(1,-val);
5969 Py_XINCREF(trueSelf);
5974 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5975 self->substractEqual(bb);
5976 Py_XINCREF(trueSelf);
5981 self->substractEqual(a);
5982 Py_XINCREF(trueSelf);
5987 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5988 self->substractEqual(aaaa);
5989 Py_XINCREF(trueSelf);
5993 throw INTERP_KERNEL::Exception(msg);
5997 DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5999 const char msg[]="Unexpected situation in __mul__ !";
6002 std::vector<int> aa;
6003 DataArrayIntTuple *aaa;
6005 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6010 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6011 ret->applyLin(val,0);
6017 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6018 return DataArrayInt::Multiply(self,aaa);
6022 return DataArrayInt::Multiply(self,a);
6026 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6027 return DataArrayInt::Multiply(self,aaaa);
6030 throw INTERP_KERNEL::Exception(msg);
6034 DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6036 const char msg[]="Unexpected situation in __rmul__ !";
6039 std::vector<int> aa;
6040 DataArrayIntTuple *aaa;
6042 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6047 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6048 ret->applyLin(val,0);
6054 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6055 return DataArrayInt::Multiply(self,aaa);
6059 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6060 return DataArrayInt::Multiply(self,aaaa);
6063 throw INTERP_KERNEL::Exception(msg);
6067 PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6069 const char msg[]="Unexpected situation in __imul__ !";
6072 std::vector<int> aa;
6073 DataArrayIntTuple *aaa;
6075 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6080 self->applyLin(val,0);
6081 Py_XINCREF(trueSelf);
6086 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6087 self->multiplyEqual(bb);
6088 Py_XINCREF(trueSelf);
6093 self->multiplyEqual(a);
6094 Py_XINCREF(trueSelf);
6099 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6100 self->multiplyEqual(aaaa);
6101 Py_XINCREF(trueSelf);
6105 throw INTERP_KERNEL::Exception(msg);
6109 DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6111 const char msg[]="Unexpected situation in __div__ !";
6114 std::vector<int> aa;
6115 DataArrayIntTuple *aaa;
6117 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6122 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6123 ret->applyDivideBy(val);
6129 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6130 return DataArrayInt::Divide(self,aaa);
6134 return DataArrayInt::Divide(self,a);
6138 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6139 return DataArrayInt::Divide(self,aaaa);
6142 throw INTERP_KERNEL::Exception(msg);
6146 DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6148 const char msg[]="Unexpected situation in __rdiv__ !";
6151 std::vector<int> aa;
6152 DataArrayIntTuple *aaa;
6154 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6159 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6166 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6167 return DataArrayInt::Divide(aaa,self);
6171 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6172 return DataArrayInt::Divide(aaaa,self);
6175 throw INTERP_KERNEL::Exception(msg);
6179 PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6181 const char msg[]="Unexpected situation in __idiv__ !";
6184 std::vector<int> aa;
6185 DataArrayIntTuple *aaa;
6187 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6192 self->applyDivideBy(val);
6193 Py_XINCREF(trueSelf);
6198 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6199 self->divideEqual(bb);
6200 Py_XINCREF(trueSelf);
6205 self->divideEqual(a);
6206 Py_XINCREF(trueSelf);
6211 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6212 self->divideEqual(aaaa);
6213 Py_XINCREF(trueSelf);
6217 throw INTERP_KERNEL::Exception(msg);
6221 DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6223 const char msg[]="Unexpected situation in __mod__ !";
6226 std::vector<int> aa;
6227 DataArrayIntTuple *aaa;
6229 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6234 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6235 ret->applyModulus(val);
6241 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6242 return DataArrayInt::Modulus(self,aaa);
6246 return DataArrayInt::Modulus(self,a);
6250 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6251 return DataArrayInt::Modulus(self,aaaa);
6254 throw INTERP_KERNEL::Exception(msg);
6258 DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6260 const char msg[]="Unexpected situation in __rmod__ !";
6263 std::vector<int> aa;
6264 DataArrayIntTuple *aaa;
6266 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6271 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6272 ret->applyRModulus(val);
6278 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6279 return DataArrayInt::Modulus(aaa,self);
6283 return DataArrayInt::Modulus(a,self);
6287 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6288 return DataArrayInt::Modulus(aaaa,self);
6291 throw INTERP_KERNEL::Exception(msg);
6295 PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6297 const char msg[]="Unexpected situation in __imod__ !";
6300 std::vector<int> aa;
6301 DataArrayIntTuple *aaa;
6303 convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6308 self->applyModulus(val);
6309 Py_XINCREF(trueSelf);
6314 self->modulusEqual(a);
6315 Py_XINCREF(trueSelf);
6320 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6321 self->modulusEqual(aaaa);
6322 Py_XINCREF(trueSelf);
6326 throw INTERP_KERNEL::Exception(msg);
6331 namespace ParaMEDMEM
6333 class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6336 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6337 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6338 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6339 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6340 virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
6341 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6342 void setName(const char *name) throw(INTERP_KERNEL::Exception);
6343 const char *getDescription() const throw(INTERP_KERNEL::Exception);
6344 void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6345 const char *getName() const throw(INTERP_KERNEL::Exception);
6346 TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6347 NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6348 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6349 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6350 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6351 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6352 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6353 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6354 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6355 void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6356 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6357 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6358 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6359 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6360 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
6361 void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
6363 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6365 MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6368 return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6371 PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6373 MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6376 return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6379 PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
6381 std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
6382 return convertIntArrToPyList3(ret);
6385 PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6388 bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6389 PyObject *ret=PyTuple_New(2);
6390 PyObject *ret0Py=ret0?Py_True:Py_False;
6392 PyTuple_SetItem(ret,0,ret0Py);
6393 PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6397 PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6399 DataArrayInt *ret1=0;
6400 MEDCouplingMesh *ret0=0;
6402 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6403 if (!SWIG_IsOK(res1))
6406 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6407 ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6411 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6413 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6414 da2->checkAllocated();
6415 ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6417 PyObject *res = PyList_New(2);
6418 PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6419 PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6423 DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6427 std::vector<int> pos2;
6428 DataArrayInt *pos3=0;
6429 DataArrayIntTuple *pos4=0;
6430 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6435 return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6439 return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6443 return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6446 throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6450 void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6451 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6454 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6455 if (!SWIG_IsOK(res1))
6458 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6459 self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6463 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6465 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6466 da2->checkAllocated();
6467 self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6471 PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6473 std::vector<int> tmp;
6474 self->getCellIdsHavingGaussLocalization(locId,tmp);
6475 DataArrayInt *ret=DataArrayInt::New();
6476 ret->alloc((int)tmp.size(),1);
6477 std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6478 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6483 class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6486 static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
6487 static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME);
6488 void setTimeUnit(const char *unit);
6489 const char *getTimeUnit() const;
6490 void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
6491 void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6492 void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6493 std::string simpleRepr() const;
6494 std::string advancedRepr() const;
6495 void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
6496 MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6497 MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6498 MEDCouplingFieldDouble *deepCpy() const;
6499 MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6500 TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6501 double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6502 double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6503 void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
6504 void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6505 void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6506 void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6507 void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6508 void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6509 void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6510 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6511 int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6512 int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6513 void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6514 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6515 void setIteration(int it) throw(INTERP_KERNEL::Exception);
6516 void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6517 void setOrder(int order) throw(INTERP_KERNEL::Exception);
6518 void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6519 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6520 void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6521 void updateTime() const throw(INTERP_KERNEL::Exception);
6522 void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6523 void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6524 bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6525 bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6526 bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6527 bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6528 bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6529 MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6530 MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6531 MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6532 MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6533 MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6534 MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6535 MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6536 MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6537 MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6538 void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6539 void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6540 MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6541 void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6542 void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6543 void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6544 void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6545 void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6546 void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6547 void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6548 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6549 void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6550 void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6551 double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6552 double getMaxValue() const throw(INTERP_KERNEL::Exception);
6553 double getMinValue() const throw(INTERP_KERNEL::Exception);
6554 double getAverageValue() const throw(INTERP_KERNEL::Exception);
6555 double norm2() const throw(INTERP_KERNEL::Exception);
6556 double normMax() const throw(INTERP_KERNEL::Exception);
6557 double getWeightedAverageValue() const throw(INTERP_KERNEL::Exception);
6558 double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6559 double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6560 double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6561 DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6562 static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6563 static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6564 static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6565 MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6566 static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6567 MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6568 static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6569 MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6570 static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6571 static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6572 static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6573 static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6574 static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6575 MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6576 MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6577 MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6578 MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6579 MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6581 MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
6583 return MEDCouplingFieldDouble::New(type,td);
6586 MEDCouplingFieldDouble(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=ONE_TIME)
6588 return MEDCouplingFieldDouble::New(ft,td);
6591 std::string __str__() const
6593 return self->simpleRepr();
6596 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6598 DataArrayDouble *ret=self->getArray();
6604 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6606 std::vector<DataArrayDouble *> arrs=self->getArrays();
6607 for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6611 PyObject *ret=PyTuple_New(sz);
6612 for(int i=0;i<sz;i++)
6615 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6617 PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6622 void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6624 std::vector<const DataArrayDouble *> tmp;
6625 convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6627 std::vector<DataArrayDouble *> arrs(sz);
6628 for(int i=0;i<sz;i++)
6629 arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6630 self->setArrays(arrs);
6633 DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6635 DataArrayDouble *ret=self->getEndArray();
6641 PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6645 DataArrayDoubleTuple *aa;
6646 std::vector<double> bb;
6648 const MEDCouplingMesh *mesh=self->getMesh();
6650 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6651 int spaceDim=mesh->getSpaceDimension();
6652 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6653 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6655 int sz=self->getNumberOfComponents();
6656 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6657 self->getValueOn(spaceLoc,res);
6658 return convertDblArrToPyList(res,sz);
6661 PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6663 int sz=self->getNumberOfComponents();
6664 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6665 self->getValueOnPos(i,j,k,res);
6666 return convertDblArrToPyList(res,sz);
6669 DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6672 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
6673 if (!SWIG_IsOK(res1))
6676 INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6677 const MEDCouplingMesh *mesh=self->getMesh();
6679 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6680 int spaceDim=mesh->getSpaceDimension();
6681 int nbOfPoints=size/spaceDim;
6682 if(size%spaceDim!=0)
6684 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6686 return self->getValueOnMulti(tmp,nbOfPoints);
6690 DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6692 throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6693 da2->checkAllocated();
6694 int size=da2->getNumberOfTuples();
6695 int nbOfCompo=da2->getNumberOfComponents();
6696 const MEDCouplingMesh *mesh=self->getMesh();
6698 throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6699 if(nbOfCompo!=mesh->getSpaceDimension())
6701 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6703 return self->getValueOnMulti(da2->getConstPointer(),size);
6707 PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6711 DataArrayDoubleTuple *aa;
6712 std::vector<double> bb;
6714 const MEDCouplingMesh *mesh=self->getMesh();
6716 throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6717 int spaceDim=mesh->getSpaceDimension();
6718 const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6719 const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6722 int sz=self->getNumberOfComponents();
6723 INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6724 self->getValueOn(spaceLoc,time,res);
6725 return convertDblArrToPyList(res,sz);
6728 void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6730 if(self->getArray()!=0)
6733 double *tmp=convertPyToNewDblArr2(li,&sz);
6734 int nbTuples=self->getArray()->getNumberOfTuples();
6735 int nbOfCompo=self->getArray()->getNumberOfComponents();
6736 self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6739 throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6742 PyObject *getTime() throw(INTERP_KERNEL::Exception)
6745 double tmp0=self->getTime(tmp1,tmp2);
6746 PyObject *res = PyList_New(3);
6747 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6748 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6749 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6753 PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6756 double tmp0=self->getStartTime(tmp1,tmp2);
6757 PyObject *res = PyList_New(3);
6758 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6759 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6760 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6764 PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6767 double tmp0=self->getEndTime(tmp1,tmp2);
6768 PyObject *res = PyList_New(3);
6769 PyList_SetItem(res,0,SWIG_From_double(tmp0));
6770 PyList_SetItem(res,1,SWIG_From_int(tmp1));
6771 PyList_SetItem(res,2,SWIG_From_int(tmp2));
6774 PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6776 int sz=self->getNumberOfComponents();
6777 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6778 self->accumulate(tmp);
6779 PyObject *ret=convertDblArrToPyList(tmp,sz);
6782 PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6784 int sz=self->getNumberOfComponents();
6785 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6786 self->integral(isWAbs,tmp);
6787 PyObject *ret=convertDblArrToPyList(tmp,sz);
6790 PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6792 int sz=self->getNumberOfComponents();
6793 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6795 PyObject *ret=convertDblArrToPyList(tmp,sz);
6798 PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6800 int sz=self->getNumberOfComponents();
6801 INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6803 PyObject *ret=convertDblArrToPyList(tmp,sz);
6806 void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6809 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6810 if (!SWIG_IsOK(res1))
6813 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6814 self->renumberCells(tmp,check);
6818 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6820 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6821 da2->checkAllocated();
6822 self->renumberCells(da2->getConstPointer(),check);
6825 void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6828 int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
6829 if (!SWIG_IsOK(res1))
6832 INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6833 self->renumberNodes(tmp);
6837 DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6839 throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6840 da2->checkAllocated();
6841 self->renumberNodes(da2->getConstPointer());
6845 MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6849 std::vector<int> multiVal;
6850 std::pair<int, std::pair<int,int> > slic;
6851 ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6852 const MEDCouplingMesh *mesh=self->getMesh();
6854 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6855 int nbc=mesh->getNumberOfCells();
6856 convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6863 std::ostringstream oss;
6864 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6865 throw INTERP_KERNEL::Exception(oss.str().c_str());
6868 return self->buildSubPart(&singleVal,&singleVal+1);
6873 int tmp=nbc+singleVal;
6874 return self->buildSubPart(&tmp,&tmp+1);
6878 std::ostringstream oss;
6879 oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6880 throw INTERP_KERNEL::Exception(oss.str().c_str());
6886 return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6890 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6891 return self->buildSubPart(rg->begin(),rg->end());
6896 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6897 daIntTyypp->checkAllocated();
6898 return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6901 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6905 MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6907 return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6910 PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6913 double r1=self->getMaxValue2(tmp);
6914 PyObject *ret=PyTuple_New(2);
6915 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6916 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6920 PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6923 double r1=self->getMinValue2(tmp);
6924 PyObject *ret=PyTuple_New(2);
6925 PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6926 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6930 MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6932 std::vector<int> tmp;
6933 convertPyToNewIntArr3(li,tmp);
6934 return self->keepSelectedComponents(tmp);
6937 void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6939 std::vector<int> tmp;
6940 convertPyToNewIntArr3(li,tmp);
6941 self->setSelectedComponents(f,tmp);
6944 MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6947 DataArrayDouble *a,*a2;
6948 DataArrayDoubleTuple *aa,*aa2;
6949 std::vector<double> bb,bb2;
6952 const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6953 const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6954 const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6955 const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
6957 return self->extractSlice3D(orig,vect,eps);
6960 PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6963 Py_XINCREF(trueSelf);
6967 PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6970 Py_XINCREF(trueSelf);
6974 PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6977 Py_XINCREF(trueSelf);
6981 PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6984 Py_XINCREF(trueSelf);
6988 static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
6990 std::vector<const MEDCouplingFieldDouble *> tmp;
6991 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6992 return MEDCouplingFieldDouble::MergeFields(tmp);
6995 static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
6997 std::vector<const MEDCouplingFieldDouble *> tmp;
6998 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6999 MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
7004 class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
7007 static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
7008 static MEDCouplingFieldTemplate *New(TypeOfField type);
7009 std::string simpleRepr() const;
7010 std::string advancedRepr() const;
7011 void updateTime() const;
7014 MEDCouplingFieldTemplate(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception)
7016 return MEDCouplingFieldTemplate::New(f);
7019 MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
7021 return MEDCouplingFieldTemplate::New(type);
7024 std::string __str__() const
7026 return self->simpleRepr();
7031 class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
7034 int getNumberOfFields() const;
7035 MEDCouplingMultiFields *deepCpy() const;
7036 virtual std::string simpleRepr() const;
7037 virtual std::string advancedRepr() const;
7038 virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7039 virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7040 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7041 void updateTime() const throw(INTERP_KERNEL::Exception);
7044 std::string __str__() const
7046 return self->simpleRepr();
7048 static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7050 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7051 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7053 std::vector<MEDCouplingFieldDouble *> fs(sz);
7054 for(int i=0;i<sz;i++)
7055 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7056 return MEDCouplingMultiFields::New(fs);
7058 MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7060 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7061 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7063 std::vector<MEDCouplingFieldDouble *> fs(sz);
7064 for(int i=0;i<sz;i++)
7065 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7066 return MEDCouplingMultiFields::New(fs);
7068 PyObject *getFields() const
7070 std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
7071 int sz=fields.size();
7072 PyObject *res = PyList_New(sz);
7073 for(int i=0;i<sz;i++)
7077 fields[i]->incrRef();
7078 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
7082 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
7087 PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
7089 const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
7093 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
7096 return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
7098 PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
7100 std::vector<MEDCouplingMesh *> ms=self->getMeshes();
7102 PyObject *res = PyList_New(sz);
7103 for(int i=0;i<sz;i++)
7108 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7112 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7117 PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
7119 std::vector<int> refs;
7120 std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
7122 PyObject *res = PyList_New(sz);
7123 for(int i=0;i<sz;i++)
7128 PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7132 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7136 PyObject *ret=PyTuple_New(2);
7137 PyTuple_SetItem(ret,0,res);
7138 PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
7141 PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7143 std::vector<DataArrayDouble *> ms=self->getArrays();
7145 PyObject *res = PyList_New(sz);
7146 for(int i=0;i<sz;i++)
7151 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7155 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7160 PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
7162 std::vector< std::vector<int> > refs;
7163 std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
7165 PyObject *res = PyList_New(sz);
7166 PyObject *res2 = PyList_New(sz);
7167 for(int i=0;i<sz;i++)
7172 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7176 PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7178 PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
7181 PyObject *ret=PyTuple_New(2);
7182 PyTuple_SetItem(ret,0,res);
7183 PyTuple_SetItem(ret,1,res2);
7189 class MEDCouplingDefinitionTime
7192 MEDCouplingDefinitionTime();
7193 void assign(const MEDCouplingDefinitionTime& other);
7194 bool isEqual(const MEDCouplingDefinitionTime& other) const;
7195 double getTimeResolution() const;
7196 std::vector<double> getHotSpotsTime() const;
7199 std::string __str__() const
7201 std::ostringstream oss;
7202 self->appendRepr(oss);
7206 PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
7208 int meshId,arrId,arrIdInField,fieldId;
7209 self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7210 PyObject *res=PyList_New(4);
7211 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7212 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7213 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7214 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7218 PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7220 int meshId,arrId,arrIdInField,fieldId;
7221 self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7222 PyObject *res=PyList_New(4);
7223 PyList_SetItem(res,0,PyInt_FromLong(meshId));
7224 PyList_SetItem(res,1,PyInt_FromLong(arrId));
7225 PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7226 PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7232 class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7235 double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7236 MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7240 MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7242 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7243 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7245 std::vector<MEDCouplingFieldDouble *> fs(sz);
7246 for(int i=0;i<sz;i++)
7247 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7248 return MEDCouplingFieldOverTime::New(fs);
7250 std::string __str__() const
7252 return self->simpleRepr();
7254 static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7256 std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7257 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7259 std::vector<MEDCouplingFieldDouble *> fs(sz);
7260 for(int i=0;i<sz;i++)
7261 fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7262 return MEDCouplingFieldOverTime::New(fs);
7270 __filename=os.environ.get('PYTHONSTARTUP')
7271 if __filename and os.path.isfile(__filename):
7272 execfile(__filename)