Salome HOME
Attributes for AMR cartesian mesh developped. Ready to test.
[modules/med.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 %module MEDCoupling
22
23 %include std_vector.i
24 %include std_string.i
25
26 %{
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingCartesianAMRMesh.hxx"
44 #include "MEDCouplingAMRAttribute.hxx"
45 #include "MEDCouplingMatrix.hxx"
46 #include "MEDCouplingTypemaps.i"
47
48 #include "InterpKernelAutoPtr.hxx"
49 #include "BoxSplittingOptions.hxx"
50
51 using namespace ParaMEDMEM;
52 using namespace INTERP_KERNEL;
53
54 %}
55
56 %template(ivec) std::vector<int>;
57 %template(dvec) std::vector<double>;
58 %template(svec) std::vector<std::string>;
59
60 ////////////////////
61 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
62 {
63   $result=convertMesh($1,$owner);
64 }
65
66 %typemap(out) MEDCouplingMesh*
67 {
68   $result=convertMesh($1,$owner);
69 }
70 //$$$$$$$$$$$$$$$$$$
71
72 ////////////////////
73 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
74 {
75   $result=convertMesh($1,$owner);
76 }
77
78 %typemap(out) MEDCouplingPointSet*
79 {
80   $result=convertMesh($1,$owner);
81 }
82 //$$$$$$$$$$$$$$$$$$
83
84 ////////////////////
85 %typemap(out) MEDCouplingCartesianAMRPatchGen*
86 {
87   $result=convertCartesianAMRPatch($1,$owner);
88 }
89 //$$$$$$$$$$$$$$$$$$
90
91 ////////////////////
92 %typemap(out) MEDCouplingCartesianAMRMeshGen*
93 {
94   $result=convertCartesianAMRMesh($1,$owner);
95 }
96 //$$$$$$$$$$$$$$$$$$
97
98 ////////////////////
99 %typemap(out) MEDCouplingDataForGodFather*
100 {
101   $result=convertDataForGodFather($1,$owner);
102 }
103 //$$$$$$$$$$$$$$$$$$
104
105 ////////////////////
106 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
107 {
108   $result=convertMesh($1,$owner);
109 }
110
111 %typemap(out) MEDCoupling1GTUMesh*
112 {
113   $result=convertMesh($1,$owner);
114 }
115 //$$$$$$$$$$$$$$$$$$
116
117 ////////////////////
118 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
119 {
120   $result=convertMesh($1,$owner);
121 }
122
123 %typemap(out) MEDCouplingStructuredMesh*
124 {
125   $result=convertMesh($1,$owner);
126 }
127 //$$$$$$$$$$$$$$$$$$
128
129 ////////////////////
130 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
131 {
132   $result=convertFieldDiscretization($1,$owner);
133 }
134
135 %typemap(out) MEDCouplingFieldDiscretization*
136 {
137   $result=convertFieldDiscretization($1,$owner);
138 }
139 //$$$$$$$$$$$$$$$$$$
140
141 ////////////////////
142 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
143 {
144   $result=convertMultiFields($1,$owner);
145 }
146
147 %typemap(out) MEDCouplingMultiFields*
148 {
149   $result=convertMultiFields($1,$owner);
150 }
151 //$$$$$$$$$$$$$$$$$$
152
153 #ifdef WITH_NUMPY
154 %init %{ import_array(); %}
155 #endif
156
157 %feature("autodoc", "1");
158 %feature("docstring");
159
160 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
161 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
162 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
163 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
164 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
165 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
166 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
167 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
168 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
169 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
170 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
171 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
172 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
173 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
174 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
213 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
214 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
215 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
216 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
217 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
218 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
219 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
220 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
221 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
222 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
223 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
224 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
225 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
226 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
227 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
228 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
229 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
230 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
231 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
232 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
233 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
234 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
235 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
236 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
237 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
238 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
239 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
240 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
241 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
242 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
243 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
244 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
245 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
246 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
247 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
248 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
249 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
250 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
251 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
252 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
253 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
254 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
255 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
256 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
257 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
258 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
259 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
260 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
261 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
262 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
263 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
278 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
279 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
280 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
281 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
282 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
301 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
302 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
303 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
304 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
305 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
306 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
307 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
308 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
309 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
310 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
311 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
312 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
313 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
314 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
315 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
316 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
317 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
318 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
319 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
320 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
321 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
322 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
323 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
324 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
325 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
326 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
327 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
328 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
329 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
330 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
331 %newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
332 %newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
333 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
334 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
335 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
336 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
337 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
338 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
339 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
340 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
341 %newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
342 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
343 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
344 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
345 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
346 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
347 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
348 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
349 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
350 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
351 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
352 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
353 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getDataConst;
354 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getData;
355 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
356 %newobject ParaMEDMEM::MEDCouplingAMRAttribute::retrieveFieldOn;
357 %newobject ParaMEDMEM::DenseMatrix::New;
358 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
359 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
360 %newobject ParaMEDMEM::DenseMatrix::getData;
361 %newobject ParaMEDMEM::DenseMatrix::matVecMult;
362 %newobject ParaMEDMEM::DenseMatrix::MatVecMult;
363 %newobject ParaMEDMEM::DenseMatrix::__add__;
364 %newobject ParaMEDMEM::DenseMatrix::__sub__;
365 %newobject ParaMEDMEM::DenseMatrix::__mul__;
366
367 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
368 %feature("unref") MEDCouplingMesh "$this->decrRef();"
369 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
370 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
371 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
372 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
373 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
374 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
375 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
376 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
377 %feature("unref") MEDCouplingField "$this->decrRef();"
378 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
379 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
380 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
381 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
382 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
383 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
384 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
385 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
386 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
387 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
388 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
389 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
390 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
391 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
392 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
393 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
394 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
395 %feature("unref") DenseMatrix "$this->decrRef();"
396
397 %rename(assign) *::operator=;
398 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
399 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
400 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
401 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
402
403 %nodefaultctor;
404
405 %rename (InterpKernelException) INTERP_KERNEL::Exception;
406
407 %include "MEDCouplingRefCountObject.i"
408 %include "MEDCouplingMemArray.i"
409
410 namespace INTERP_KERNEL
411
412   /*!
413    * \class BoxSplittingOptions
414    * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
415    */
416   class BoxSplittingOptions
417   {
418   public:
419     BoxSplittingOptions();
420     void init() throw(INTERP_KERNEL::Exception);
421     double getEffeciency() const throw(INTERP_KERNEL::Exception);
422     void setEffeciency(double effeciency) throw(INTERP_KERNEL::Exception);
423     double getEffeciencySnd() const throw(INTERP_KERNEL::Exception);
424     void setEffeciencySnd(double effeciencySnd) throw(INTERP_KERNEL::Exception);
425     int getMinCellDirection() const throw(INTERP_KERNEL::Exception);
426     void setMinCellDirection(int minCellDirection) throw(INTERP_KERNEL::Exception);
427     int getMaxCells() const throw(INTERP_KERNEL::Exception);
428     void setMaxCells(int maxCells) throw(INTERP_KERNEL::Exception);
429     void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
430     std::string printOptions() const throw(INTERP_KERNEL::Exception);
431     %extend
432     {
433       std::string __str__() const throw(INTERP_KERNEL::Exception)
434       {
435         return self->printOptions();
436       }
437     }
438   };
439 }
440
441 namespace ParaMEDMEM
442 {
443   typedef enum
444     {
445       ON_CELLS = 0,
446       ON_NODES = 1,
447       ON_GAUSS_PT = 2,
448       ON_GAUSS_NE = 3,
449       ON_NODES_KR = 4
450     } TypeOfField;
451
452   typedef enum
453     {
454       NO_TIME = 4,
455       ONE_TIME = 5,
456       LINEAR_TIME = 6,
457       CONST_ON_TIME_INTERVAL = 7
458     } TypeOfTimeDiscretization;
459
460   typedef enum
461     {
462       UNSTRUCTURED = 5,
463       CARTESIAN = 7,
464       EXTRUDED = 8,
465       CURVE_LINEAR = 9,
466       SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
467       SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
468       IMAGE_GRID = 12
469     } MEDCouplingMeshType;
470
471   class DataArrayInt;
472   class DataArrayDouble;
473   class MEDCouplingUMesh;
474   class MEDCouplingFieldDouble;
475
476   %extend RefCountObject
477   {
478     std::string getHiddenCppPointer() const
479     {
480       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
481       return oss.str();
482     }
483   }
484
485   %extend MEDCouplingGaussLocalization
486   {
487     std::string __str__() const throw(INTERP_KERNEL::Exception)
488     {
489       return self->getStringRepr();
490     }
491
492     std::string __repr__() const throw(INTERP_KERNEL::Exception)
493     {
494       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
495       oss << self->getStringRepr();
496       return oss.str();
497     }
498   }
499
500   //== MEDCouplingMesh
501   
502   class MEDCouplingMesh : public RefCountObject, public TimeLabel
503   {
504   public:
505     void setName(const std::string& name);
506     std::string getName() const;
507     void setDescription(const std::string& descr);
508     std::string getDescription() const;
509     void setTime(double val, int iteration, int order);
510     void setTimeUnit(const std::string& unit);
511     std::string getTimeUnit() const;
512     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
513     bool isStructured() const throw(INTERP_KERNEL::Exception);
514     virtual MEDCouplingMesh *deepCpy() const;
515     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
516     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
517     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
518     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
519     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
520     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
521     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
522     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
523     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
524     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
525     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
526     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
527     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
528     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
529     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
530     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
531     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
532     virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
533     virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
534     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
535     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
536     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
537     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
538     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
539     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
540     // tools
541     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
542     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
543     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
544     virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
545     virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
546     virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
547     virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
548     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
549     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
550     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
551     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
552     static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
553     static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
554     static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
555     static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
556     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
557     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
558     %extend
559        {
560          std::string __str__() const throw(INTERP_KERNEL::Exception)
561          {
562            return self->simpleRepr();
563          }
564
565          PyObject *getTime() throw(INTERP_KERNEL::Exception)
566          {
567            int tmp1,tmp2;
568            double tmp0=self->getTime(tmp1,tmp2);
569            PyObject *res = PyList_New(3);
570            PyList_SetItem(res,0,SWIG_From_double(tmp0));
571            PyList_SetItem(res,1,SWIG_From_int(tmp1));
572            PyList_SetItem(res,2,SWIG_From_int(tmp2));
573            return res;
574          }
575
576          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
577          {
578            double val;
579            DataArrayDouble *a;
580            DataArrayDoubleTuple *aa;
581            std::vector<double> bb;
582            int sw;
583            int spaceDim=self->getSpaceDimension();
584            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
585            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
586            return self->getCellContainingPoint(pos,eps);
587          }
588
589          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
590          {
591            double val;
592            DataArrayDouble *a;
593            DataArrayDoubleTuple *aa;
594            std::vector<double> bb;
595            int sw;
596            int spaceDim=self->getSpaceDimension();
597            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
598            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
599            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
600            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
601            PyObject *ret=PyTuple_New(2);
602            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
603            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
604            return ret;
605          }
606
607          PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
608          {
609            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
610            int spaceDim=self->getSpaceDimension();
611            void *da=0;
612            int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
613            if (!SWIG_IsOK(res1))
614              {
615                int size;
616                INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
617                int nbOfPoints=size/spaceDim;
618                if(size%spaceDim!=0)
619                  {
620                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
621                  }
622                self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
623              }
624            else
625              {
626                DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
627                if(!da2)
628                  throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
629                da2->checkAllocated();
630                int size=da2->getNumberOfTuples();
631                int nbOfCompo=da2->getNumberOfComponents();
632                if(nbOfCompo!=spaceDim)
633                  {
634                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
635                  }
636                self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
637              }
638            PyObject *ret=PyTuple_New(2);
639            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
640            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
641            return ret;
642          }
643
644          PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
645          {
646            double val;
647            DataArrayDouble *a;
648            DataArrayDoubleTuple *aa;
649            std::vector<double> bb;
650            int sw;
651            int spaceDim=self->getSpaceDimension();
652            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
653            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
654            std::vector<int> elts;
655            self->getCellsContainingPoint(pos,eps,elts);
656            DataArrayInt *ret=DataArrayInt::New();
657            ret->alloc((int)elts.size(),1);
658            std::copy(elts.begin(),elts.end(),ret->getPointer());
659            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
660          }
661          
662          virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
663          {
664            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
665            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
666            self->getReverseNodalConnectivity(d0,d1);
667            PyObject *ret=PyTuple_New(2);
668            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
669            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
670            return ret;
671          }
672          
673          void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
674          {
675            int sw,sz(-1);
676            int v0; std::vector<int> v1;
677            const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
678            self->renumberCells(ids,check);
679          }
680
681          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
682          {
683            DataArrayInt *cellCor, *nodeCor;
684            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
685            PyObject *res = PyList_New(2);
686            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
687            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
688            return res;
689          }
690
691          PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
692          {
693            DataArrayInt *cellCor=0,*nodeCor=0;
694            self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
695            PyObject *res = PyList_New(2);
696            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
697            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
698            return res;
699          }
700          
701          DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
702          {
703            DataArrayInt *cellCor=0;
704            self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
705            return cellCor;
706          }
707
708          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
709          {
710            void *da=0;
711            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
712            if (!SWIG_IsOK(res1))
713              {
714                int size;
715                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
716                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
717              }
718            else
719              {
720                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
721                if(!da2)
722                  throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
723                da2->checkAllocated();
724                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
725              }
726          }
727          PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
728          {
729            std::vector<int> conn;
730            self->getNodeIdsOfCell(cellId,conn);
731            return convertIntArrToPyList2(conn);
732          }
733
734          PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
735          {
736            std::vector<double> coo;
737            self->getCoordinatesOfNode(nodeId,coo);
738            return convertDblArrToPyList2(coo);
739          }
740
741          void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
742          {
743            double val;
744            DataArrayDouble *a;
745            DataArrayDoubleTuple *aa;
746            std::vector<double> bb;
747            int sw;
748            int spaceDim=self->getSpaceDimension();
749            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
750            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
751            self->scale(pointPtr,factor);
752          }
753
754          PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
755          {
756            int spaceDim=self->getSpaceDimension();
757            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
758            self->getBoundingBox(tmp);
759            PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
760            return ret;
761          }
762
763          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
764          {
765            std::string ret1;
766            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
767            PyObject *ret=PyTuple_New(2);
768            PyObject *ret0Py=ret0?Py_True:Py_False;
769            Py_XINCREF(ret0Py);
770            PyTuple_SetItem(ret,0,ret0Py);
771            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
772            return ret;
773          }
774
775          PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
776          {
777            int szArr,sw,iTypppArr;
778            std::vector<int> stdvecTyyppArr;
779            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
780            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
781            if(sw==3)//DataArrayInt
782              { 
783                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
784                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
785                std::string name=argpt->getName();
786                if(!name.empty())
787                  ret->setName(name.c_str());
788              }
789            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
790          }
791         
792          PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
793          {
794            int szArr,sw,iTypppArr;
795            std::vector<int> stdvecTyyppArr;
796            DataArrayInt *arr=0;
797            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
798            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
799            if(sw==3)//DataArrayInt
800              { 
801                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
802                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
803                std::string name=argpt->getName();
804                if(!name.empty())
805                  ret->setName(name.c_str());
806              }
807            //
808            PyObject *res = PyList_New(2);
809            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
810            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
811            PyList_SetItem(res,0,obj0);
812            PyList_SetItem(res,1,obj1);
813            return res;
814          }
815
816          PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
817          {
818            int a,b,c;
819            DataArrayInt *arr=0;
820            MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
821            PyObject *res = PyTuple_New(2);
822            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
823            PyObject *obj1=0;
824            if(arr)
825              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
826            else
827              obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
828            PyTuple_SetItem(res,0,obj0);
829            PyTuple_SetItem(res,1,obj1);
830            return res;
831          }
832
833         PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
834         {
835           std::vector<int> vals=self->getDistributionOfTypes();
836           if(vals.size()%3!=0)
837             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
838           PyObject *ret=PyList_New((int)vals.size()/3);
839           for(int j=0;j<(int)vals.size()/3;j++)
840              {
841                PyObject *ret1=PyList_New(3);
842                PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
843                PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
844                PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
845                PyList_SetItem(ret,j,ret1);
846              }
847           return ret;
848         }
849
850         DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
851         {
852           std::vector<int> code;
853           std::vector<const DataArrayInt *> idsPerType;
854           convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
855           convertPyToNewIntArr4(li,1,3,code);
856           return self->checkTypeConsistencyAndContig(code,idsPerType);
857         }
858
859         PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
860         {
861           std::vector<int> code;
862           std::vector<DataArrayInt *> idsInPflPerType;
863           std::vector<DataArrayInt *> idsPerType;
864           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
865           PyObject *ret=PyTuple_New(3);
866           //
867           if(code.size()%3!=0)
868             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
869           PyObject *ret0=PyList_New((int)code.size()/3);
870           for(int j=0;j<(int)code.size()/3;j++)
871              {
872                PyObject *ret00=PyList_New(3);
873                PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
874                PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
875                PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
876                PyList_SetItem(ret0,j,ret00);
877              }
878           PyTuple_SetItem(ret,0,ret0);
879           //
880           PyObject *ret1=PyList_New(idsInPflPerType.size());
881           for(std::size_t j=0;j<idsInPflPerType.size();j++)
882             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
883           PyTuple_SetItem(ret,1,ret1);
884           int n=idsPerType.size();
885           PyObject *ret2=PyList_New(n);
886           for(int i=0;i<n;i++)
887             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
888           PyTuple_SetItem(ret,2,ret2);
889           return ret;
890         }
891
892         void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
893         {
894           double val;
895           DataArrayDouble *a;
896           DataArrayDoubleTuple *aa;
897           std::vector<double> bb;
898           int sw;
899           int spaceDim=self->getSpaceDimension();
900           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
901           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
902           self->translate(vectorPtr);
903         }
904
905          void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
906          {
907            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
908            double val;
909            DataArrayDouble *a;
910            DataArrayDoubleTuple *aa;
911            std::vector<double> bb;
912            int sw;
913            int spaceDim=self->getSpaceDimension();
914            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
915            self->rotate(centerPtr,0,alpha);
916          }
917
918          void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
919          {
920            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
921            double val,val2;
922            DataArrayDouble *a,*a2;
923            DataArrayDoubleTuple *aa,*aa2;
924            std::vector<double> bb,bb2;
925            int sw;
926            int spaceDim=self->getSpaceDimension();
927            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
928            const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
929            self->rotate(centerPtr,vectorPtr,alpha);
930          }
931
932          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
933          {
934            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
935            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
936            PyObject *res=PyList_New(result.size());
937            for(int i=0;iL!=result.end(); i++, iL++)
938              PyList_SetItem(res,i,PyInt_FromLong(*iL));
939            return res;
940          }
941          
942          static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
943          {
944             std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
945             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
946             return MEDCouplingMesh::MergeMeshes(tmp);
947          }
948        }
949   };
950 }
951
952 //== MEDCouplingMesh End
953
954 %include "NormalizedGeometricTypes"
955 %include "MEDCouplingNatureOfFieldEnum"
956 //
957 namespace ParaMEDMEM
958 {
959   class MEDCouplingNatureOfField
960   {
961   public:
962     static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
963     static std::string GetReprNoThrow(NatureOfField nat);
964     static std::string GetAllPossibilitiesStr();
965   };
966 }
967
968 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
969 // include "MEDCouplingTimeDiscretization.i"
970
971 namespace ParaMEDMEM
972 {
973   class MEDCouplingGaussLocalization
974   {
975   public:
976     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
977                                  const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
978     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
979     INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
980     void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
981     int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
982     int getDimension() const throw(INTERP_KERNEL::Exception);
983     int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
984     std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
985     void checkCoherency() const throw(INTERP_KERNEL::Exception);
986     bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
987     //
988     const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
989     double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
990     const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
991     double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
992     const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
993     double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
994     void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
995     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
996     void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
997     void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
998     void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
999     void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
1000     //
1001     static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1002   };
1003 }
1004
1005 %include "MEDCouplingFieldDiscretization.i"
1006
1007 //== MEDCouplingPointSet
1008
1009 namespace ParaMEDMEM
1010 {
1011   class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1012     {
1013     public:
1014       void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1015       DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1016       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1017       void zipCoords() throw(INTERP_KERNEL::Exception);
1018       double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1019       void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1020       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1021       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1022       virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1023       virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1024       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1025       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1026       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1027       static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
1028       virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1029       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1030       virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1031       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1032       virtual DataArrayInt *findBoundaryNodes() const;
1033       virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1034       virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1035       virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1036       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1037       virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1038       virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1039       %extend 
1040          {
1041            std::string __str__() const throw(INTERP_KERNEL::Exception)
1042            {
1043              return self->simpleRepr();
1044            }
1045            
1046            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1047            {
1048              int newNbOfNodes;
1049              DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1050              PyObject *res = PyList_New(2);
1051              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052              PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1053              return res;
1054            }
1055            
1056            PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1057            {
1058              DataArrayInt *comm, *commIndex;
1059              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1060              PyObject *res = PyList_New(2);
1061              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1062              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1063              return res;
1064            }
1065            
1066            PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1067            {
1068              DataArrayDouble *ret1=self->getCoords();
1069              if (ret1)
1070                 ret1->incrRef();
1071              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1072            }
1073            
1074            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1075            {
1076              int szArr,sw,iTypppArr;
1077              std::vector<int> stdvecTyyppArr;
1078              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1079              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1080              if(sw==3)//DataArrayInt
1081                { 
1082                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1083                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1084                  std::string name=argpt->getName();
1085                  if(!name.empty())
1086                    ret->setName(name.c_str());
1087                }
1088              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1089            }
1090            
1091            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1092            {
1093              int szArr,sw,iTypppArr;
1094              std::vector<int> stdvecTyyppArr;
1095              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1096              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1097              if(sw==3)//DataArrayInt
1098                { 
1099                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1100                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1101                  std::string name=argpt->getName();
1102                  if(!name.empty())
1103                    ret->setName(name.c_str());
1104                }
1105              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1106            }
1107
1108            virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1109            {
1110              int szArr,sw,iTypppArr;
1111              std::vector<int> stdvecTyyppArr;
1112              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1113              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1114              if(sw==3)//DataArrayInt
1115                { 
1116                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1117                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1118                  std::string name=argpt->getName();
1119                  if(!name.empty())
1120                    ret->setName(name.c_str());
1121                }
1122              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1123            }
1124
1125            virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1126            {
1127              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1128              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1129            }
1130
1131            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1132            {
1133              int szArr,sw,iTypppArr;
1134              std::vector<int> stdvecTyyppArr;
1135              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1136              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1137              if(sw==3)//DataArrayInt
1138                { 
1139                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1140                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1141                  std::string name=argpt->getName();
1142                  if(!name.empty())
1143                    ret->setName(name.c_str());
1144                }
1145              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1146            }
1147
1148            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1149            {
1150              int szArr,sw,iTypppArr;
1151              std::vector<int> stdvecTyyppArr;
1152              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1153              self->renumberNodes(tmp,newNbOfNodes);
1154            }
1155
1156            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1157            {
1158              int szArr,sw,iTypppArr;
1159              std::vector<int> stdvecTyyppArr;
1160              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1161              self->renumberNodes2(tmp,newNbOfNodes);
1162            }
1163
1164            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1165              {
1166                int spaceDim=self->getSpaceDimension();
1167                double val,val2;
1168                DataArrayDouble *a,*a2;
1169                DataArrayDoubleTuple *aa,*aa2;
1170                std::vector<double> bb,bb2;
1171                int sw;
1172                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1173                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1174                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1175                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1176                std::vector<int> nodes;
1177                self->findNodesOnLine(p,v,eps,nodes);
1178                DataArrayInt *ret=DataArrayInt::New();
1179                ret->alloc((int)nodes.size(),1);
1180                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1181                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1182              }
1183            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1184              {
1185                int spaceDim=self->getSpaceDimension();
1186                double val,val2;
1187                DataArrayDouble *a,*a2;
1188                DataArrayDoubleTuple *aa,*aa2;
1189                std::vector<double> bb,bb2;
1190                int sw;
1191                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1192                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1193                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1194                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1195                std::vector<int> nodes;
1196                self->findNodesOnPlane(p,v,eps,nodes);
1197                DataArrayInt *ret=DataArrayInt::New();
1198                ret->alloc((int)nodes.size(),1);
1199                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1200                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1201              }
1202            
1203            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1204            {
1205              double val;
1206              DataArrayDouble *a;
1207              DataArrayDoubleTuple *aa;
1208              std::vector<double> bb;
1209              int sw;
1210              int spaceDim=self->getSpaceDimension();
1211              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1212              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1213              DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1214              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1215            }
1216
1217            PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1218            {
1219              DataArrayInt *c=0,*cI=0;
1220              //
1221              double val;
1222              DataArrayDouble *a;
1223              DataArrayDoubleTuple *aa;
1224              std::vector<double> bb;
1225              int sw;
1226              int spaceDim=self->getSpaceDimension();
1227              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1228              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1229              self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1230              PyObject *ret=PyTuple_New(2);
1231              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1232              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1233              return ret;
1234            }
1235
1236            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1237            {
1238              DataArrayInt *c=0,*cI=0;
1239              int spaceDim=self->getSpaceDimension();
1240              double val;
1241              DataArrayDouble *a;
1242              DataArrayDoubleTuple *aa;
1243              std::vector<double> bb;
1244              int sw;
1245              int nbOfTuples=-1;
1246              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1247              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1248              //
1249              PyObject *ret=PyTuple_New(2);
1250              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1251              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1252              return ret;
1253            }
1254
1255            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1256            {
1257              double val;
1258              DataArrayDouble *a;
1259              DataArrayDoubleTuple *aa;
1260              std::vector<double> bb;
1261              int sw;
1262              int spaceDim=self->getSpaceDimension();
1263              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1264              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1265              //
1266              DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1267              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1268            }
1269
1270            void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1271            {
1272              int sw;
1273              int singleVal;
1274              std::vector<int> multiVal;
1275              std::pair<int, std::pair<int,int> > slic;
1276              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1277              convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1278              switch(sw)
1279                {
1280                case 1:
1281                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1282                case 2:
1283                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1284                case 4:
1285                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1286                default:
1287                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1288                }
1289            }
1290
1291            virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1292            {
1293              DataArrayInt *v0=0,*v1=0;
1294              self->findCommonCells(compType,startCellId,v0,v1);
1295              PyObject *res = PyList_New(2);
1296              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1297              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1298              return res;
1299            }
1300
1301       
1302            virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1303            {
1304              void *da=0;
1305              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1306              if (!SWIG_IsOK(res1))
1307                {
1308                  int size;
1309                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1310                  self->renumberNodesInConn(tmp);
1311                }
1312              else
1313                {
1314                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1315                  if(!da2)
1316                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1317                  da2->checkAllocated();
1318                  self->renumberNodesInConn(da2->getConstPointer());
1319                }
1320            }
1321
1322            virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1323            {
1324              int ret1=-1;
1325              DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1326              PyObject *ret=PyTuple_New(2);
1327              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1328              PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1329              return ret;
1330            }
1331
1332            virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1333            {
1334              DataArrayInt *ret=0;
1335              //
1336              int szArr,sw,iTypppArr;
1337              std::vector<int> stdvecTyyppArr;
1338              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1339              self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1340              return ret;
1341            }
1342
1343            virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1344            {
1345              bool ret1;
1346              int ret2;
1347              DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1348              PyObject *res = PyList_New(3);
1349              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1350              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1351              PyList_SetItem(res,2,SWIG_From_int(ret2));
1352              return res;
1353            }
1354            
1355            virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1356            {
1357              bool ret1;
1358              int ret2;
1359              DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1360              PyObject *res = PyList_New(3);
1361              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1362              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1363              PyList_SetItem(res,2,SWIG_From_int(ret2));
1364              return res;
1365            }
1366            
1367            DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1368            {
1369              void *da=0;
1370              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
1371              if (!SWIG_IsOK(res1))
1372                {
1373                  int size;
1374                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1375                  return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1376                }
1377              else
1378                {
1379                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1380                  if(!da2)
1381                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1382                  da2->checkAllocated();
1383                  return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1384                }
1385            }
1386
1387            MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1388            {
1389              int sw;
1390              int singleVal;
1391              std::vector<int> multiVal;
1392              std::pair<int, std::pair<int,int> > slic;
1393              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1394              int nbc=self->getNumberOfCells();
1395              convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1396              switch(sw)
1397                {
1398                case 1:
1399                  {
1400                    if(singleVal>=nbc)
1401                      {
1402                        std::ostringstream oss;
1403                        oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1404                        throw INTERP_KERNEL::Exception(oss.str().c_str());
1405                      }
1406                    if(singleVal>=0)
1407                      return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1408                    else
1409                      {
1410                        if(nbc+singleVal>0)
1411                          {
1412                            int tmp=nbc+singleVal;
1413                            return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1414                          }
1415                        else
1416                          {
1417                            std::ostringstream oss;
1418                            oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1419                            throw INTERP_KERNEL::Exception(oss.str().c_str());
1420                          }
1421                      }
1422                  }
1423                case 2:
1424                  {
1425                    return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1426                  }
1427                case 3:
1428                  {
1429                    return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1430                  }
1431                case 4:
1432                  {
1433                    if(!daIntTyypp)
1434                      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1435                    daIntTyypp->checkAllocated();
1436                    return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1437                  }
1438                default:
1439                  throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1440                }
1441            }
1442            
1443            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1444            {
1445              int sz;
1446              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1447              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1448              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1449              for(int i=0;i<sz;i++)
1450                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1451            }
1452            
1453            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1454            {
1455              int sz;
1456              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1457              int sw,nbNodes=0;
1458              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1459              std::vector<double> val3;
1460              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1461                                                             "Rotate2DAlg",2,true,nbNodes);
1462              if(sw!=2 && sw!=3)
1463                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1464              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1465            }
1466            
1467            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1468            {
1469              int sz,sz2;
1470              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1471              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1472              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1473              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1474              for(int i=0;i<sz;i++)
1475                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1476            }
1477            
1478            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1479            {
1480              int sz,sz2;
1481              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1482              int sw,nbNodes=0;
1483              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1484              std::vector<double> val3;
1485              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1486                                                             "Rotate3DAlg",3,true,nbNodes);
1487              if(sw!=2 && sw!=3)
1488                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1489              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1490              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1491            }
1492          }
1493     };
1494
1495   //== MEDCouplingPointSet End
1496
1497   class MEDCouplingUMeshCell
1498   {
1499   public:
1500     INTERP_KERNEL::NormalizedCellType getType() const;
1501     %extend
1502       {
1503         std::string __str__() const throw(INTERP_KERNEL::Exception)
1504         {
1505           return self->repr();
1506         }
1507
1508         PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1509         {
1510           int ret2;
1511           const int *r=self->getAllConn(ret2);
1512           PyObject *ret=PyTuple_New(ret2);
1513           for(int i=0;i<ret2;i++)
1514             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1515           return ret;
1516         }
1517       }
1518   };
1519
1520   class MEDCouplingUMeshCellIterator
1521   {
1522   public:
1523     %extend
1524       {
1525         PyObject *next()
1526         {
1527           MEDCouplingUMeshCell *ret=self->nextt();
1528           if(ret)
1529             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1530           else
1531             {
1532               PyErr_SetString(PyExc_StopIteration,"No more data.");
1533               return 0;
1534             }
1535         }
1536       }
1537   };
1538
1539   class MEDCouplingUMeshCellByTypeIterator
1540   {
1541   public:
1542     ~MEDCouplingUMeshCellByTypeIterator();
1543     %extend
1544       {
1545         PyObject *next()
1546         {
1547           MEDCouplingUMeshCellEntry *ret=self->nextt();
1548           if(ret)
1549             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1550           else
1551             {
1552               PyErr_SetString(PyExc_StopIteration,"No more data.");
1553               return 0;
1554             }
1555         }
1556       }
1557   };
1558
1559   class MEDCouplingUMeshCellByTypeEntry
1560   {
1561   public:
1562     ~MEDCouplingUMeshCellByTypeEntry();
1563     %extend
1564       {
1565         MEDCouplingUMeshCellByTypeIterator *__iter__()
1566         {
1567           return self->iterator();
1568         }
1569       }
1570   };
1571
1572   class MEDCouplingUMeshCellEntry
1573   {
1574   public:
1575     INTERP_KERNEL::NormalizedCellType getType() const;
1576     int getNumberOfElems() const;
1577     %extend
1578       {
1579         MEDCouplingUMeshCellIterator *__iter__()
1580         {
1581           return self->iterator();
1582         }
1583       }
1584   };
1585   
1586   //== MEDCouplingUMesh
1587
1588   class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1589   {
1590   public:
1591     static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1592     static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1593     MEDCouplingUMesh *clone(bool recDeepCpy) const;
1594     void checkCoherency() const throw(INTERP_KERNEL::Exception);
1595     void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1596     void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1597     void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1598     MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1599     void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1600     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1601     void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1602     int getMeshLength() const throw(INTERP_KERNEL::Exception);
1603     void computeTypes() throw(INTERP_KERNEL::Exception);
1604     std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1605     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1606     //tools
1607     DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1608     DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1609     void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1610     std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1611     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1612     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1613     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1614     bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1615     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1616     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1617     DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1618     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1619     DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1620     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1621     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1622     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1623     void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1624     bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1625     bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1626     MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1627     bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1628     void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1629     void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1630     void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1631     DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1632     void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1633     bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1634     MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1635     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1636     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1637     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1638     DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1639     DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1640     std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1641     DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1642     DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1643     ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1644     DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1645     DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1646     DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1647     DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1648     DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1649     DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1650     int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0) throw(INTERP_KERNEL::Exception);
1651     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1652     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1653     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1654     static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1655     static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1656     %extend {
1657       MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1658       {
1659         return MEDCouplingUMesh::New();
1660       }
1661       
1662       MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1663       {
1664         return MEDCouplingUMesh::New(meshName,meshDim);
1665       }
1666       
1667       std::string __str__() const throw(INTERP_KERNEL::Exception)
1668       {
1669         return self->simpleRepr();
1670       }
1671       
1672       std::string __repr__() const throw(INTERP_KERNEL::Exception)
1673       {
1674         std::ostringstream oss;
1675         self->reprQuickOverview(oss);
1676         return oss.str();
1677       }
1678       
1679       MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1680       {
1681         return self->cellIterator();
1682       }
1683
1684       PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1685       {
1686         std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1687         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1688         PyObject *res=PyList_New(result.size());
1689         for(int i=0;iL!=result.end(); i++, iL++)
1690           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1691         return res;
1692       }
1693       
1694       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1695       {
1696         int sw;
1697         int singleVal;
1698         std::vector<int> multiVal;
1699         std::pair<int, std::pair<int,int> > slic;
1700         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1701         int nbc=self->getNumberOfCells();
1702         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1703         switch(sw)
1704           {
1705           case 1:
1706             {
1707               if(singleVal>=nbc)
1708                 {
1709                   std::ostringstream oss;
1710                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1711                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1712                 }
1713               if(singleVal>=0)
1714                 {
1715                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1716                   break;
1717                 }
1718               else
1719                 {
1720                   if(nbc+singleVal>0)
1721                     {
1722                       int tmp=nbc+singleVal;
1723                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1724                       break;
1725                     }
1726                   else
1727                     {
1728                       std::ostringstream oss;
1729                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1730                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1731                     }
1732                 }
1733             }
1734           case 2:
1735             {
1736               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1737               break;
1738             }
1739           case 4:
1740             {
1741               if(!daIntTyypp)
1742                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1743               daIntTyypp->checkAllocated();
1744               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1745               break;
1746             }
1747           default:
1748             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1749           }
1750       }
1751
1752       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1753       {
1754         int sw;
1755         int singleVal;
1756         std::vector<int> multiVal;
1757         std::pair<int, std::pair<int,int> > slic;
1758         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1759         int nbc=self->getNumberOfCells();
1760         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1761         switch(sw)
1762           {
1763           case 1:
1764             {
1765               if(singleVal>=nbc)
1766                 {
1767                   std::ostringstream oss;
1768                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1769                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1770                 }
1771               if(singleVal>=0)
1772                 {
1773                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1774                   break;
1775                 }
1776               else
1777                 {
1778                   if(nbc+singleVal>0)
1779                     {
1780                       int tmp=nbc+singleVal;
1781                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1782                       break;
1783                     }
1784                   else
1785                     {
1786                       std::ostringstream oss;
1787                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1788                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1789                     }
1790                 }
1791             }
1792           case 2:
1793             {
1794               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1795               break;
1796             }
1797           case 3:
1798             {
1799               self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1800               break;
1801             }
1802           case 4:
1803             {
1804               if(!daIntTyypp)
1805                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1806               daIntTyypp->checkAllocated();
1807               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1808               break;
1809             }
1810           default:
1811             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1812           }
1813       }
1814
1815       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1816       {
1817         int szArr,sw,iTypppArr;
1818         std::vector<int> stdvecTyyppArr;
1819         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1820         if(size>szArr)
1821           {
1822             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1823             throw INTERP_KERNEL::Exception(oss.str().c_str());
1824           }
1825         self->insertNextCell(type,size,tmp);
1826       }
1827
1828       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1829       {
1830         int szArr,sw,iTypppArr;
1831         std::vector<int> stdvecTyyppArr;
1832         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1833         self->insertNextCell(type,szArr,tmp);
1834       }
1835       
1836       DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1837       {
1838         DataArrayInt *ret=self->getNodalConnectivity();
1839         if(ret)
1840           ret->incrRef();
1841         return ret;
1842       }
1843       DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1844       {
1845         DataArrayInt *ret=self->getNodalConnectivityIndex();
1846         if(ret)
1847           ret->incrRef();
1848         return ret;
1849       }
1850       
1851       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1852       {
1853         int szArr,sw,iTypppArr;
1854         std::vector<int> stdvecTyyppArr;
1855         const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1856         int nbOfDepthPeelingPerformed=0;
1857         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1858         PyObject *res=PyTuple_New(2);
1859         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1860         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1861         return res;
1862       }
1863
1864       static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1865       {
1866         DataArrayInt *v0=0,*v1=0;
1867         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1868         PyObject *res = PyList_New(2);
1869         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1870         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1871         return res;
1872       }
1873       
1874       PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1875       {
1876         double val;
1877         DataArrayDouble *a;
1878         DataArrayDoubleTuple *aa;
1879         std::vector<double> bb;
1880         int sw;
1881         int nbOfCompo=self->getSpaceDimension();
1882         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1883         //
1884         int cellId=-1;
1885         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1886         PyObject *ret=PyTuple_New(2);
1887         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1888         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1889         return ret;
1890       }
1891
1892       PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1893       {
1894         DataArrayInt *ret1=0;
1895         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1896         PyObject *ret=PyTuple_New(2);
1897         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1898         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1899         return ret;
1900       }
1901
1902       PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1903       {
1904         int ret2(-1);
1905         DataArrayInt *ret1(0);
1906         MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1907         PyObject *ret=PyTuple_New(3);
1908         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1909         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1910         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1911         return ret;
1912       }
1913       
1914       PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1915       {
1916         std::vector<int> cells;
1917         self->checkButterflyCells(cells,eps);
1918         DataArrayInt *ret=DataArrayInt::New();
1919         ret->alloc((int)cells.size(),1);
1920         std::copy(cells.begin(),cells.end(),ret->getPointer());
1921         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1922       }
1923
1924       PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1925       {
1926         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1927         int sz=ms.size();
1928         PyObject *ret = PyList_New(sz);
1929         for(int i=0;i<sz;i++)
1930           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1931         return ret;
1932       }
1933
1934       PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1935       {
1936         std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1937         int sz=retCpp.size();
1938         PyObject *ret=PyList_New(sz);
1939         for(int i=0;i<sz;i++)
1940           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1941         return ret;
1942       }
1943
1944       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1945       {
1946         int size;
1947         INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1948         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1949         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1950       }
1951
1952       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1953       {
1954         int sz;
1955         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1956         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1957         return ret;
1958       }
1959
1960       DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1961       {
1962         int sz;
1963         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1964         DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1965         return ret;
1966       }
1967
1968       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1969       {
1970         DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1971         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1972         PyObject *ret=PyTuple_New(3);
1973         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1974         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1975         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1976         return ret;
1977       }
1978
1979       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1980       {
1981         DataArrayInt *tmp0=0,*tmp1=0;
1982         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1983         PyObject *ret=PyTuple_New(2);
1984         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1985         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1986         return ret;
1987       }
1988
1989       void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1990       {
1991         int sw;
1992         int singleVal;
1993         std::vector<int> multiVal;
1994         std::pair<int, std::pair<int,int> > slic;
1995         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1996         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1997         switch(sw)
1998           {
1999           case 1:
2000             return self->duplicateNodes(&singleVal,&singleVal+1);
2001           case 2:
2002             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2003           case 4:
2004             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2005           default:
2006             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2007           }
2008       }
2009
2010       void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2011       {
2012         int sw;
2013         int singleVal;
2014         std::vector<int> multiVal;
2015         std::pair<int, std::pair<int,int> > slic;
2016         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2017         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2018         switch(sw)
2019           {
2020           case 1:
2021             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2022           case 2:
2023             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2024           case 4:
2025             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2026           default:
2027             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2028           }
2029       }
2030
2031       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2032       {
2033         int sz;
2034         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2035         DataArrayInt *tmp0,*tmp1=0;
2036         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2037         PyObject *ret=PyTuple_New(2);
2038         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2039         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2040         return ret;
2041       }
2042
2043       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2044       {
2045         DataArrayInt *ret0=0,*ret1=0;
2046         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2047         PyObject *ret=PyTuple_New(2);
2048         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2049         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2050         return ret;
2051       }
2052
2053       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2054       {
2055         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2056         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2057         DataArrayInt *ret1=0,*ret2=0;
2058         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2059         PyObject *ret=PyTuple_New(3);
2060         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2061         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2062         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2063         return ret;
2064       }
2065
2066       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2067       {
2068         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2069         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2070         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2071         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2072       }
2073
2074       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2075       {
2076         int sz;
2077         std::vector<const MEDCouplingUMesh *> meshes;
2078         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2079         std::vector<DataArrayInt *> corr;
2080         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2081         sz=corr.size();
2082         PyObject *ret1=PyList_New(sz);
2083         for(int i=0;i<sz;i++)
2084           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2085         PyObject *ret=PyList_New(2);
2086         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2087         PyList_SetItem(ret,1,ret1);
2088         return ret;
2089       }
2090
2091       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2092       {
2093         std::vector<MEDCouplingUMesh *> meshes;
2094         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2095         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2096       }
2097
2098       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2099       {
2100         std::vector<MEDCouplingUMesh *> meshes;
2101         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2102         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2103       }
2104
2105       static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2106       {
2107         int sw;
2108         int singleVal;
2109         std::vector<int> multiVal;
2110         std::pair<int, std::pair<int,int> > slic;
2111         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2112         if(!arrIndx)
2113           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2114         convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2115         switch(sw)
2116           {
2117           case 1:
2118             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2119           case 2:
2120             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2121           case 4:
2122             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2123           default:
2124             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2125           }
2126       }
2127       
2128       static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2129       {
2130         DataArrayInt *arrOut=0,*arrIndexOut=0;
2131         int sw;
2132         int singleVal;
2133         std::vector<int> multiVal;
2134         std::pair<int, std::pair<int,int> > slic;
2135         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2136         if(!arrIndxIn)
2137           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2138         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2139         switch(sw)
2140           {
2141           case 1:
2142             {
2143               MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2144               break;
2145             }
2146           case 2:
2147             {
2148               MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2149               break;
2150             }
2151           case 4:
2152             {
2153               MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2154               break;
2155             }
2156           default:
2157             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2158           }
2159         PyObject *ret=PyTuple_New(2);
2160         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162         return ret;
2163       }
2164
2165       static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2166       {
2167         DataArrayInt *arrOut=0,*arrIndexOut=0;
2168         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2169         PyObject *ret=PyTuple_New(2);
2170         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2171         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172         return ret;
2173       }
2174
2175       static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2176       {
2177         if(!PySlice_Check(slic))
2178           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2179         Py_ssize_t strt=2,stp=2,step=2;
2180         PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2181         if(!arrIndxIn)
2182           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2183         arrIndxIn->checkAllocated();
2184         if(arrIndxIn->getNumberOfComponents()!=1)
2185           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2186         GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2187         DataArrayInt *arrOut=0,*arrIndexOut=0;
2188         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2189         PyObject *ret=PyTuple_New(2);
2190         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2191         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192         return ret;
2193       }
2194
2195       static PyObject *SetPartOfIndexedArrays(PyObject *li,
2196                                               const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2197                                               const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2198       {
2199         DataArrayInt *arrOut=0,*arrIndexOut=0;
2200         int sw;
2201         int singleVal;
2202         std::vector<int> multiVal;
2203         std::pair<int, std::pair<int,int> > slic;
2204         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2205         if(!arrIndxIn)
2206           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2207         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2208         switch(sw)
2209           {
2210           case 1:
2211             {
2212               MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2213               break;
2214             }
2215           case 2:
2216             {
2217               MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2218               break;
2219             }
2220           case 4:
2221             {
2222               MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2223               break;
2224             }
2225           default:
2226             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2227           }
2228         PyObject *ret=PyTuple_New(2);
2229         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2230         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2231         return ret;
2232       }
2233
2234       static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2235                                                 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2236       {
2237         int sw;
2238         int singleVal;
2239         std::vector<int> multiVal;
2240         std::pair<int, std::pair<int,int> > slic;
2241         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2242         if(!arrIndxIn)
2243           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2244         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2245         switch(sw)
2246           {
2247           case 1:
2248             {
2249               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2250               break;
2251             }
2252           case 2:
2253             {
2254               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2255               break;
2256             }
2257           case 4:
2258             {
2259               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2260               break;
2261             }
2262           default:
2263             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2264           }
2265       }
2266
2267       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2268       {
2269         double val;
2270         DataArrayDouble *a;
2271         DataArrayDoubleTuple *aa;
2272         std::vector<double> bb;
2273         int sw;
2274         int spaceDim=self->getSpaceDimension();
2275         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2276         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2277         //
2278         std::vector<int> cells;
2279         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2280         DataArrayInt *ret=DataArrayInt::New();
2281         ret->alloc((int)cells.size(),1);
2282         std::copy(cells.begin(),cells.end(),ret->getPointer());
2283         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2284       }
2285
2286       void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2287       {
2288         double val;
2289         DataArrayDouble *a;
2290         DataArrayDoubleTuple *aa;
2291         std::vector<double> bb;
2292         int sw;
2293         int spaceDim=self->getSpaceDimension();
2294         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2295         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2296         self->orientCorrectly2DCells(v,polyOnly);
2297       }
2298       
2299       PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2300       {
2301         std::vector<int> cells;
2302         self->arePolyhedronsNotCorrectlyOriented(cells);
2303         DataArrayInt *ret=DataArrayInt::New();
2304         ret->alloc((int)cells.size(),1);
2305         std::copy(cells.begin(),cells.end(),ret->getPointer());
2306         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2307       }
2308
2309       PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2310       {
2311         double vec[3];
2312         double pos[3];
2313         self->getFastAveragePlaneOfThis(vec,pos);
2314         double vals[6];
2315         std::copy(vec,vec+3,vals);
2316         std::copy(pos,pos+3,vals+3);
2317         return convertDblArrToPyListOfTuple(vals,3,2);
2318       }
2319       
2320       static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2321       {
2322         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2323         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2324         return MEDCouplingUMesh::MergeUMeshes(tmp);
2325       }
2326
2327       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2328       {
2329         DataArrayInt *ret1;
2330         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2331         PyObject *ret=PyTuple_New(2);
2332         PyObject *ret0Py=ret0?Py_True:Py_False;
2333         Py_XINCREF(ret0Py);
2334         PyTuple_SetItem(ret,0,ret0Py);
2335         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2336         return ret;
2337       }
2338
2339       PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2340       {
2341         DataArrayInt *ret1;
2342         bool ret0=self->areCellsIncludedIn2(other,ret1);
2343         PyObject *ret=PyTuple_New(2);
2344         PyObject *ret0Py=ret0?Py_True:Py_False;
2345         Py_XINCREF(ret0Py);
2346         PyTuple_SetItem(ret,0,ret0Py);
2347         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2348         return ret;
2349       }
2350
2351       PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2352       {
2353         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2354         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2355         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2356         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2357         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2358         PyObject *ret=PyTuple_New(5);
2359         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2360         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2361         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2362         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2364         return ret;
2365       }
2366
2367       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2368       {
2369         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2370         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2371         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2372         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2373         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2374         PyObject *ret=PyTuple_New(5);
2375         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2376         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2378         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2379         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380         return ret;
2381       }
2382
2383       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2384       {
2385         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2386         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2387         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2388         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2389         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2390         PyObject *ret=PyTuple_New(5);
2391         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2392         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2393         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2394         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2395         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2396         return ret;
2397       }
2398       
2399       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2400       {
2401         DataArrayInt *neighbors=0,*neighborsIdx=0;
2402         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2403         PyObject *ret=PyTuple_New(2);
2404         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2405         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406         return ret;
2407       }
2408
2409       PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2410       {
2411         DataArrayInt *neighbors=0,*neighborsIdx=0;
2412         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2413         PyObject *ret=PyTuple_New(2);
2414         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416         return ret;
2417       }
2418
2419       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2420       {
2421         DataArrayInt *neighbors=0,*neighborsIdx=0;
2422         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2423         PyObject *ret=PyTuple_New(2);
2424         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2425         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2426         return ret;
2427       }
2428
2429       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2430       {
2431         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2432         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2433         DataArrayInt *d2,*d3,*d4,*dd5;
2434         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2435         PyObject *ret=PyTuple_New(7);
2436         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2437         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2438         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2439         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2440         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2441         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2442         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2443         return ret;
2444       }
2445
2446       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2447       {
2448         if(!da)
2449           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2450         da->checkAllocated();
2451         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2452       }
2453
2454       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2455       {
2456         if(!da)
2457           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2458         da->checkAllocated();
2459         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2460       }
2461
2462       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2463       {
2464         if(!da)
2465           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2466         da->checkAllocated();
2467         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2468       }
2469
2470       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2471       {
2472         if(!da)
2473           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2474         da->checkAllocated();
2475         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2476         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2477         PyObject *res = PyList_New(result.size());
2478         for (int i=0;iL!=result.end(); i++, iL++)
2479           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2480         return res;
2481       }
2482
2483       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2484       {
2485         if(!da)
2486           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2487         da->checkAllocated();
2488         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2489         ret->setName(da->getName().c_str());
2490         return ret;
2491       }
2492
2493       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2494       {
2495         DataArrayInt *cellNb1=0,*cellNb2=0;
2496         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2497         PyObject *ret=PyTuple_New(3);
2498         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2499         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2500         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2501         return ret;
2502       }
2503
2504       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2505       {
2506         int spaceDim=self->getSpaceDimension();
2507         if(spaceDim!=3)
2508           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2509         double val,val2;
2510         DataArrayDouble *a,*a2;
2511         DataArrayDoubleTuple *aa,*aa2;
2512         std::vector<double> bb,bb2;
2513         int sw;
2514         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2515         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2516         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2517         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2518         //
2519         DataArrayInt *cellIds=0;
2520         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2521         PyObject *ret=PyTuple_New(2);
2522         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2523         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524         return ret;
2525       }
2526
2527       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2528       {
2529         int spaceDim=self->getSpaceDimension();
2530         if(spaceDim!=3)
2531           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2532         double val,val2;
2533         DataArrayDouble *a,*a2;
2534         DataArrayDoubleTuple *aa,*aa2;
2535         std::vector<double> bb,bb2;
2536         int sw;
2537         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2538         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2539         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2540         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2541         //
2542         DataArrayInt *cellIds=0;
2543         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2544         PyObject *ret=PyTuple_New(2);
2545         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2546         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2547         return ret;
2548       }
2549
2550       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2551       {
2552         int spaceDim=self->getSpaceDimension();
2553         if(spaceDim!=3)
2554           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2555         double val,val2;
2556         DataArrayDouble *a,*a2;
2557         DataArrayDoubleTuple *aa,*aa2;
2558         std::vector<double> bb,bb2;
2559         int sw;
2560         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2561         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2562         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2563         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2564         return self->getCellIdsCrossingPlane(orig,vect,eps);
2565       }
2566
2567       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2568       {
2569         int sw;
2570         int pos1;
2571         std::vector<int> pos2;
2572         DataArrayInt *pos3=0;
2573         DataArrayIntTuple *pos4=0;
2574         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2575         switch(sw)
2576           {
2577           case 1:
2578             {
2579               self->convertToPolyTypes(&pos1,&pos1+1);
2580               return;
2581             }
2582           case 2:
2583             {
2584               if(pos2.empty())
2585                 return;
2586               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2587               return ;
2588             }
2589           case 3:
2590             {
2591               self->convertToPolyTypes(pos3->begin(),pos3->end());
2592               return ;
2593             }
2594           default:
2595             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2596           }
2597       }
2598     }
2599     void convertAllToPoly();
2600     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2601     bool unPolyze() throw(INTERP_KERNEL::Exception);
2602     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2603     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2604     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2605   };
2606
2607   //== MEDCouplingUMesh End
2608
2609   //== MEDCouplingExtrudedMesh
2610
2611   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2612   {
2613   public:
2614     static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2615     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2616     %extend {
2617       MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2618       {
2619         return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2620       }
2621       
2622       std::string __str__() const throw(INTERP_KERNEL::Exception)
2623       {
2624         return self->simpleRepr();
2625       }
2626
2627       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2628       {
2629         std::ostringstream oss;
2630         self->reprQuickOverview(oss);
2631         return oss.str();
2632       }
2633       
2634       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2635       {
2636         MEDCouplingUMesh *ret=self->getMesh2D();
2637         if(ret)
2638           ret->incrRef();
2639         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2640       }
2641       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2642       {
2643         MEDCouplingUMesh *ret=self->getMesh1D();
2644         if(ret)
2645           ret->incrRef();
2646         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2647       }
2648       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2649       {
2650         DataArrayInt *ret=self->getMesh3DIds();
2651         if(ret)
2652           ret->incrRef();
2653         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2654       } 
2655     }
2656   };
2657
2658   //== MEDCouplingExtrudedMesh End
2659
2660   class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2661   {
2662   public:
2663     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2664     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2665     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2666     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2667     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2668     virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2669     %extend
2670     {
2671       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2672       {
2673         int szArr,sw,iTypppArr;
2674         std::vector<int> stdvecTyyppArr;
2675         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2676         self->insertNextCell(tmp,tmp+szArr);
2677       }
2678
2679       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2680       {
2681         DataArrayInt *ret=self->getNodalConnectivity();
2682         if(ret) ret->incrRef();
2683         return ret;
2684       }
2685       
2686       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2687       {
2688         std::vector< const MEDCoupling1GTUMesh *> parts;
2689         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2690         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2691       }
2692     }
2693   };
2694
2695   //== MEDCoupling1SGTUMesh
2696
2697   class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2698   {
2699   public:
2700     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2701     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2702     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2703     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2704     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2705     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2706     MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2707     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2708     DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2709     %extend
2710     {
2711       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2712       {
2713         return MEDCoupling1SGTUMesh::New(name,type);
2714       }
2715
2716       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2717       {
2718         return MEDCoupling1SGTUMesh::New(m);
2719       }
2720
2721       std::string __str__() const throw(INTERP_KERNEL::Exception)
2722       {
2723         return self->simpleRepr();
2724       }
2725       
2726       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2727       {
2728         std::ostringstream oss;
2729         self->reprQuickOverview(oss);
2730         return oss.str();
2731       }
2732
2733       PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2734       {
2735         DataArrayInt *cellPerm(0),*nodePerm(0);
2736         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2737         PyObject *ret(PyTuple_New(3));
2738         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2739         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2740         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2741         return ret;
2742       }
2743
2744       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2745       {
2746         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2747         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2748         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2749       }
2750       
2751       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2752       {
2753         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2754         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2755         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2756       }
2757     }
2758   };
2759   
2760   //== MEDCoupling1SGTUMesh End
2761
2762   //== MEDCoupling1DGTUMesh
2763
2764   class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2765   {
2766   public:
2767     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2768     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2769     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2770     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2771     bool isPacked() const throw(INTERP_KERNEL::Exception);
2772     %extend
2773     {
2774       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2775       {
2776         return MEDCoupling1DGTUMesh::New(name,type);
2777       }
2778
2779       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2780       {
2781         return MEDCoupling1DGTUMesh::New(m);
2782       }
2783
2784       std::string __str__() const throw(INTERP_KERNEL::Exception)
2785       {
2786         return self->simpleRepr();
2787       }
2788       
2789       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2790       {
2791         std::ostringstream oss;
2792         self->reprQuickOverview(oss);
2793         return oss.str();
2794       }
2795
2796       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2797       {
2798         DataArrayInt *ret=self->getNodalConnectivityIndex();
2799         if(ret) ret->incrRef();
2800         return ret;
2801       }
2802
2803       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2804       {
2805         DataArrayInt *ret1=0,*ret2=0;
2806         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2807         PyObject *ret0Py=ret0?Py_True:Py_False;
2808         Py_XINCREF(ret0Py);
2809         PyObject *ret=PyTuple_New(3);
2810         PyTuple_SetItem(ret,0,ret0Py);
2811         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2812         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813         return ret;
2814       }
2815       
2816       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2817       {
2818         bool ret1;
2819         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2820         PyObject *ret=PyTuple_New(2);
2821         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2822         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2823         PyTuple_SetItem(ret,1,ret1Py);
2824         return ret;
2825       }
2826
2827       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2828       {
2829         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2830         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2831         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2832       }
2833       
2834       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2835       {
2836         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2837         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2838         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2839       }
2840       
2841       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2842       {
2843         std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2844         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2845         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2846       }
2847     }
2848   };
2849
2850   //== MEDCoupling1DGTUMeshEnd
2851
2852   class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2853   {
2854   public:
2855     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2856     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2857     int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2858     int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
2859     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2860     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2861     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2862     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2863     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2864     static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2865     static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
2866     %extend
2867     {
2868       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2869       {
2870         int tmpp1=-1,tmpp2=-1;
2871         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2872         std::vector< std::pair<int,int> > inp;
2873         if(tmpp2==2)
2874           {
2875             inp.resize(tmpp1);
2876             for(int i=0;i<tmpp1;i++)
2877               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2878           }
2879         else if(tmpp2==1)
2880           {
2881             if(tmpp1%2!=0)
2882               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2883             inp.resize(tmpp1/2);
2884             for(int i=0;i<tmpp1/2;i++)
2885               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2886           }
2887         else
2888           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2889         return self->buildStructuredSubPart(inp);
2890       }
2891
2892       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2893       {
2894         std::vector< std::pair<int,int> > inp;
2895         convertPyToVectorPairInt(part,inp);
2896         //
2897         int szArr,sw,iTypppArr;
2898         std::vector<int> stdvecTyyppArr;
2899         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2900         std::vector<int> tmp5(tmp4,tmp4+szArr);
2901         //
2902         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2903       }
2904
2905       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2906       {
2907         std::vector< std::pair<int,int> > inp;
2908         convertPyToVectorPairInt(partCompactFormat,inp);
2909         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
2910       }
2911
2912       static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
2913       {
2914         std::vector< std::pair<int,int> > inp;
2915         convertPyToVectorPairInt(part,inp);
2916         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
2917       }
2918
2919       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2920       {
2921         int szArr,sw,iTypppArr;
2922         std::vector<int> stdvecTyyppArr;
2923         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2924         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2925       }
2926
2927       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2928       {
2929         int szArr,sw,iTypppArr;
2930         std::vector<int> stdvecTyyppArr;
2931         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
2932         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
2933       }
2934
2935       static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2936       {
2937         std::vector< std::pair<int,int> > inp;
2938         convertPyToVectorPairInt(partCompactFormat,inp);
2939         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
2940       }
2941
2942       static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
2943       {
2944         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
2945         PyObject *retPy=PyList_New(ret.size());
2946         for(std::size_t i=0;i<ret.size();i++)
2947           {
2948             PyObject *tmp=PyTuple_New(2);
2949             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2950             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2951             PyList_SetItem(retPy,i,tmp);
2952           }
2953         return retPy;
2954       }
2955
2956       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
2957       {
2958         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
2959         convertPyToVectorPairInt(r1,r1Cpp);
2960         convertPyToVectorPairInt(r2,r2Cpp);
2961         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
2962         PyObject *retPy=PyList_New(ret.size());
2963         for(std::size_t i=0;i<ret.size();i++)
2964           {
2965             PyObject *tmp=PyTuple_New(2);
2966             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2967             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2968             PyList_SetItem(retPy,i,tmp);
2969           }
2970         return retPy;
2971       }
2972
2973       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2974       {
2975         int szArr,sw,iTypppArr;
2976         std::vector<int> stdvecTyyppArr;
2977         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2978         int szArr2,sw2,iTypppArr2;
2979         std::vector<int> stdvecTyyppArr2;
2980         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
2981         std::vector<int> tmp3(tmp2,tmp2+szArr2);
2982         std::vector< std::pair<int,int> > partCompactFormat;
2983         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
2984         PyObject *ret=PyTuple_New(2);
2985         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
2986         PyTuple_SetItem(ret,0,ret0Py);
2987         PyObject *ret1Py=PyList_New(partCompactFormat.size());
2988         for(std::size_t i=0;i<partCompactFormat.size();i++)
2989           {
2990             PyObject *tmp4=PyTuple_New(2);
2991             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
2992             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
2993             PyList_SetItem(ret1Py,i,tmp4);
2994           }
2995         PyTuple_SetItem(ret,1,ret1Py);
2996         return ret;
2997       }
2998
2999       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3000       {
3001         std::vector< std::pair<int,int> > param0,param1,ret;
3002         convertPyToVectorPairInt(bigInAbs,param0);
3003         convertPyToVectorPairInt(partOfBigInAbs,param1);
3004         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3005         PyObject *retPy(PyList_New(ret.size()));
3006         for(std::size_t i=0;i<ret.size();i++)
3007           {
3008             PyObject *tmp(PyTuple_New(2));
3009             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3010             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3011             PyList_SetItem(retPy,i,tmp);
3012           }
3013         return retPy;
3014       }
3015
3016       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3017       {
3018         std::vector< std::pair<int,int> > param0,param1,ret;
3019         convertPyToVectorPairInt(bigInAbs,param0);
3020         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3021         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3022         PyObject *retPy(PyList_New(ret.size()));
3023         for(std::size_t i=0;i<ret.size();i++)
3024           {
3025             PyObject *tmp(PyTuple_New(2));
3026             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3027             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3028             PyList_SetItem(retPy,i,tmp);
3029           }
3030         return retPy;
3031       }
3032     }
3033   };
3034
3035   //== MEDCouplingCMesh
3036   
3037   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3038   {
3039   public:
3040     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3041     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3042     MEDCouplingCMesh *clone(bool recDeepCpy) const;
3043     void setCoords(const DataArrayDouble *coordsX,
3044                    const DataArrayDouble *coordsY=0,
3045                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3046     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3047     %extend {
3048       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3049       {
3050         return MEDCouplingCMesh::New();
3051       }
3052       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3053       {
3054         return MEDCouplingCMesh::New(meshName);
3055       }
3056       std::string __str__() const throw(INTERP_KERNEL::Exception)
3057       {
3058         return self->simpleRepr();
3059       }
3060       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3061       {
3062         std::ostringstream oss;
3063         self->reprQuickOverview(oss);
3064         return oss.str();
3065       }
3066       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3067       {
3068         DataArrayDouble *ret=self->getCoordsAt(i);
3069         if(ret)
3070           ret->incrRef();
3071         return ret;
3072       }
3073     }
3074   };
3075
3076   //== MEDCouplingCMesh End
3077
3078   //== MEDCouplingCurveLinearMesh
3079
3080   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3081   {
3082   public:
3083     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3084     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3085     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3086     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3087     %extend {
3088       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3089       {
3090         return MEDCouplingCurveLinearMesh::New();
3091       }
3092       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3093       {
3094         return MEDCouplingCurveLinearMesh::New(meshName);
3095       }
3096       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3097       {
3098         return self->simpleRepr();
3099       }
3100       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3101       {
3102         std::ostringstream oss;
3103         self->reprQuickOverview(oss);
3104         return oss.str();
3105       }
3106       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3107       {
3108         DataArrayDouble *ret=self->getCoords();
3109         if(ret)
3110           ret->incrRef();
3111         return ret;
3112       }
3113       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3114       {
3115         int szArr,sw,iTypppArr;
3116         std::vector<int> stdvecTyyppArr;
3117         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3118         self->setNodeGridStructure(tmp,tmp+szArr);
3119       }
3120     }
3121   };
3122
3123   //== MEDCouplingCurveLinearMesh End
3124
3125   //== MEDCouplingIMesh
3126
3127   class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3128   {
3129   public:
3130     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3131     //
3132     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3133     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3134     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3135     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3136     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3137     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3138     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3139     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3140     void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3141     MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3142     MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3143     %extend
3144     {
3145       MEDCouplingIMesh()
3146       {
3147         return MEDCouplingIMesh::New();
3148       }
3149       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3150       {
3151         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3152         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3153         const int *nodeStrctPtr(0);
3154         const double *originPtr(0),*dxyzPtr(0);
3155         int sw,sz,val0;
3156         std::vector<int> bb0;
3157         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3158         //
3159         double val,val2;
3160         std::vector<double> bb,bb2;
3161         int sz1,sz2;
3162         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3163         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3164         //
3165         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3166       }
3167
3168       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3169       {
3170         return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3171       }
3172
3173       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3174       {
3175         int sw,sz,val0;
3176         std::vector<int> bb0;
3177         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3178         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3179       }
3180
3181       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3182       {
3183         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3184         double val;
3185         DataArrayDouble *a;
3186         DataArrayDoubleTuple *aa;
3187         std::vector<double> bb;
3188         int sw,nbTuples;
3189         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3190         self->setOrigin(originPtr,originPtr+nbTuples);
3191       }
3192       
3193       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3194       {
3195         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3196         double val;
3197         DataArrayDouble *a;
3198         DataArrayDoubleTuple *aa;
3199         std::vector<double> bb;
3200         int sw,nbTuples;
3201         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3202         self->setDXYZ(originPtr,originPtr+nbTuples);
3203       }
3204
3205       static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3206       {
3207         std::vector< std::pair<int,int> > inp;
3208         convertPyToVectorPairInt(fineLocInCoarse,inp);
3209         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3210       }
3211
3212       static void CondenseFineToCoarseGhost(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA, int ghostSize) throw(INTERP_KERNEL::Exception)
3213       {
3214         std::vector< std::pair<int,int> > inp;
3215         convertPyToVectorPairInt(fineLocInCoarse,inp);
3216         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3217       }
3218
3219       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3220       {
3221         std::vector< std::pair<int,int> > inp;
3222         convertPyToVectorPairInt(fineLocInCoarse,inp);
3223         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3224       }
3225
3226       static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3227       {
3228         std::vector< std::pair<int,int> > inp;
3229         convertPyToVectorPairInt(fineLocInCoarse,inp);
3230         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3231       }
3232
3233       static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
3234       {
3235         std::vector< std::pair<int,int> > inp;
3236         convertPyToVectorPairInt(fineLocInCoarse,inp);
3237         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3238       }
3239
3240       std::string __str__() const throw(INTERP_KERNEL::Exception)
3241       {
3242         return self->simpleRepr();
3243       }
3244       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3245       {
3246         std::ostringstream oss;
3247         self->reprQuickOverview(oss);
3248         return oss.str();
3249       }
3250     }
3251   };
3252
3253   //== MEDCouplingIMesh End
3254
3255 }
3256
3257 namespace ParaMEDMEM
3258 {
3259   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3260   {
3261   public:
3262     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3263     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3264     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3265     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3266     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3267     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3268     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3269     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3270     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3271     std::string getName() const throw(INTERP_KERNEL::Exception);
3272     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3273     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3274     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3275     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3276     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3277     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3278     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3279     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3280                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3281     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3282     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3283     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3284     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3285     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3286     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3287     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3288     %extend {
3289       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3290       {
3291         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3292         if(ret1)
3293           ret1->incrRef();
3294         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3295       }
3296
3297       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3298       {
3299         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3300         if(ret)
3301           ret->incrRef();
3302         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3303       }
3304
3305       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3306       {
3307         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3308         return convertIntArrToPyList3(ret);
3309       }
3310
3311       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3312       {
3313         std::string ret1;
3314         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3315         PyObject *ret=PyTuple_New(2);
3316         PyObject *ret0Py=ret0?Py_True:Py_False;
3317         Py_XINCREF(ret0Py);
3318         PyTuple_SetItem(ret,0,ret0Py);
3319         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3320         return ret;
3321       }
3322
3323       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3324       {
3325         DataArrayInt *ret1=0;
3326         MEDCouplingMesh *ret0=0;
3327         void *da=0;
3328         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3329         if (!SWIG_IsOK(res1))
3330           {
3331             int size;
3332             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3333             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3334           }
3335         else
3336           {
3337             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3338             if(!da2)
3339               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3340             da2->checkAllocated();
3341             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3342           }
3343         PyObject *res = PyList_New(2);
3344         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3345         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3346         return res;
3347       }
3348
3349       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3350       {
3351         DataArrayInt *ret1=0;
3352         int bb,ee,ss;
3353         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3354         PyObject *res=PyTuple_New(2);
3355         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3356         if(ret1)
3357           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3358         else
3359           {
3360             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3361             PyTuple_SetItem(res,1,res1);
3362           }
3363         return res;
3364       }
3365
3366       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3367       {
3368         int sw,sz(-1);
3369         int v0; std::vector<int> v1;
3370         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3371         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3372       }
3373
3374       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3375                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3376       {
3377         void *da=0;
3378         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3379         if (!SWIG_IsOK(res1))
3380           {
3381             int size;
3382             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3383             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3384           }
3385         else
3386           {
3387             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3388             if(!da2)
3389               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3390             da2->checkAllocated();
3391             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3392           }
3393       }
3394
3395       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3396       {
3397         std::vector<int> tmp;
3398         self->getCellIdsHavingGaussLocalization(locId,tmp);
3399         DataArrayInt *ret=DataArrayInt::New();
3400         ret->alloc((int)tmp.size(),1);
3401         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3402         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3403       }
3404       
3405       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3406       {
3407         std::vector<int> inp0;
3408         convertPyToNewIntArr4(code,1,3,inp0);
3409         std::vector<const DataArrayInt *> inp1;
3410         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3411         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3412       }
3413     }
3414   };
3415   
3416   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3417   {
3418   public:
3419     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3420     static MEDCouplingFieldTemplate *New(TypeOfField type);
3421     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3422     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3423     %extend
3424        {
3425          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3426          {
3427            return MEDCouplingFieldTemplate::New(f);
3428          }
3429          
3430          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3431          {
3432            return MEDCouplingFieldTemplate::New(type);
3433          }
3434          
3435          std::string __str__() const throw(INTERP_KERNEL::Exception)
3436          {
3437            return self->simpleRepr();
3438          }
3439          
3440          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3441          {
3442            std::ostringstream oss;
3443            self->reprQuickOverview(oss);
3444            return oss.str();
3445          }
3446        }
3447   };
3448   
3449   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3450   {
3451   public:
3452     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3453     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3454     void setTimeUnit(const std::string& unit);
3455     std::string getTimeUnit() const;
3456     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3457     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3458     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3459     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3460     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3461     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3462     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3463     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3464     MEDCouplingFieldDouble *deepCpy() const;
3465     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3466     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3467     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3468     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3469     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3470     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3471     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3472     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3473     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3474     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3475     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3476     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3477     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3478     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3479     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3480     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3481     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3482     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3483     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3484     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3485     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3486     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3487     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3488     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3489     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3490     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3491     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3492     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3493     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3494     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3495     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3496     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3497     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3498     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3499     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3500     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3501     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3502     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3503     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3504     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3505     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3506     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3507     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3508     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3509     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3510     void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3511     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3512     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3513     void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3514     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3515     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3516     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3517     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3518     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3519     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3520     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3521     double getMinValue() const throw(INTERP_KERNEL::Exception);
3522     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3523     double norm2() const throw(INTERP_KERNEL::Exception);
3524     double normMax() const throw(INTERP_KERNEL::Exception);
3525     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3526     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3527     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3528     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3529     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3530     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3531     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3532     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3533     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3534     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3535     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3536     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3537     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3538     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3539     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3540     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3541     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3542     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3543     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3544     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3545     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3546     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3547     %extend {
3548       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3549       {
3550         return MEDCouplingFieldDouble::New(type,td);
3551       }
3552
3553       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3554       {
3555         return MEDCouplingFieldDouble::New(ft,td);
3556       }
3557
3558       std::string __str__() const throw(INTERP_KERNEL::Exception)
3559       {
3560         return self->simpleRepr();
3561       }
3562
3563       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3564       {
3565         std::ostringstream oss;
3566         self->reprQuickOverview(oss);
3567         return oss.str();
3568       }
3569
3570       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3571       {
3572         DataArrayDouble *ret=self->getArray();
3573         if(ret)
3574           ret->incrRef();
3575         return ret;
3576       }
3577
3578       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3579       {
3580         std::vector<DataArrayDouble *> arrs=self->getArrays();
3581         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3582           if(*it)
3583             (*it)->incrRef();
3584         int sz=arrs.size();
3585         PyObject *ret=PyTuple_New(sz);
3586         for(int i=0;i<sz;i++)
3587           {
3588             if(arrs[i])
3589               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3590             else
3591               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3592           }
3593         return ret;
3594       }
3595
3596       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3597       {
3598         std::vector<const DataArrayDouble *> tmp;
3599         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3600         int sz=tmp.size();
3601         std::vector<DataArrayDouble *> arrs(sz);
3602         for(int i=0;i<sz;i++)
3603           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3604         self->setArrays(arrs);
3605       }
3606
3607       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3608       {
3609         DataArrayDouble *ret=self->getEndArray();
3610         if(ret)
3611           ret->incrRef();
3612         return ret;
3613       }
3614
3615       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3616       {
3617         double val;
3618         DataArrayDouble *a;
3619         DataArrayDoubleTuple *aa;
3620         std::vector<double> bb;
3621         int sw;
3622         const MEDCouplingMesh *mesh=self->getMesh();
3623         if(!mesh)
3624           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3625         int spaceDim=mesh->getSpaceDimension();
3626         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3627         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3628         //
3629         int sz=self->getNumberOfComponents();
3630         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3631         self->getValueOn(spaceLoc,res);
3632         return convertDblArrToPyList(res,sz);
3633       }
3634
3635        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3636        {
3637          int sz=self->getNumberOfComponents();
3638          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3639          self->getValueOnPos(i,j,k,res);
3640          return convertDblArrToPyList(res,sz);
3641        }
3642
3643       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3644       {
3645         const MEDCouplingMesh *mesh(self->getMesh());
3646         if(!mesh)
3647           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3648         //
3649         int sw,nbPts;
3650         double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3651         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3652                                                          mesh->getSpaceDimension(),true,nbPts);
3653         return self->getValueOnMulti(inp,nbPts);
3654       }
3655
3656       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3657       {
3658         double val;
3659         DataArrayDouble *a;
3660         DataArrayDoubleTuple *aa;
3661         std::vector<double> bb;
3662         int sw;
3663         const MEDCouplingMesh *mesh=self->getMesh();
3664         if(!mesh)
3665           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3666         int spaceDim=mesh->getSpaceDimension();
3667         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3668         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3669         //
3670         //
3671         int sz=self->getNumberOfComponents();
3672         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3673         self->getValueOn(spaceLoc,time,res);
3674         return convertDblArrToPyList(res,sz);
3675       }
3676
3677       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3678       {
3679         if(self->getArray()!=0)
3680           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3681         else
3682           {
3683             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3684             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3685             self->setArray(arr);
3686           }
3687       }
3688       
3689       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3690       {
3691         int tmp1,tmp2;
3692         double tmp0=self->getTime(tmp1,tmp2);
3693         PyObject *res = PyList_New(3);
3694         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3695         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3696         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3697         return res;
3698       }
3699
3700       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3701       {
3702         int tmp1,tmp2;
3703         double tmp0=self->getStartTime(tmp1,tmp2);
3704         PyObject *res = PyList_New(3);
3705         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3706         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3707         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3708         return res;
3709       }
3710
3711       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3712       {
3713         int tmp1,tmp2;
3714         double tmp0=self->getEndTime(tmp1,tmp2);
3715         PyObject *res = PyList_New(3);
3716         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3717         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3718         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3719         return res;
3720       }
3721       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3722       {
3723         int sz=self->getNumberOfComponents();
3724         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3725         self->accumulate(tmp);
3726         return convertDblArrToPyList(tmp,sz);
3727       }
3728       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3729       {
3730         int sz=self->getNumberOfComponents();
3731         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3732         self->integral(isWAbs,tmp);
3733         return convertDblArrToPyList(tmp,sz);
3734       }
3735       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3736       {
3737         int sz=self->getNumberOfComponents();
3738         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3739         self->getWeightedAverageValue(tmp,isWAbs);
3740         return convertDblArrToPyList(tmp,sz);
3741       }
3742       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3743       {
3744         int sz=self->getNumberOfComponents();
3745         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3746         self->normL1(tmp);
3747         return convertDblArrToPyList(tmp,sz);
3748       }
3749       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3750       {
3751         int sz=self->getNumberOfComponents();
3752         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3753         self->normL2(tmp);
3754         return convertDblArrToPyList(tmp,sz);
3755       }
3756       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3757       {
3758         int szArr,sw,iTypppArr;
3759         std::vector<int> stdvecTyyppArr;
3760         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3761         self->renumberCells(tmp,check);
3762       }
3763       
3764       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3765       {
3766         int szArr,sw,iTypppArr;
3767         std::vector<int> stdvecTyyppArr;
3768         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3769         self->renumberCellsWithoutMesh(tmp,check);
3770       }
3771       
3772       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3773       {
3774         int szArr,sw,iTypppArr;
3775         std::vector<int> stdvecTyyppArr;
3776         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3777         self->renumberNodes(tmp,eps);
3778       }
3779
3780       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3781       {
3782         int szArr,sw,iTypppArr;
3783         std::vector<int> stdvecTyyppArr;
3784         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3785         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3786       }
3787
3788       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3789       {
3790         int sw;
3791         int singleVal;
3792         std::vector<int> multiVal;
3793         std::pair<int, std::pair<int,int> > slic;
3794         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3795         const MEDCouplingMesh *mesh=self->getMesh();
3796         if(!mesh)
3797           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3798         int nbc=mesh->getNumberOfCells();
3799         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3800         switch(sw)
3801           {
3802           case 1:
3803             {
3804               if(singleVal>=nbc)
3805                 {
3806                   std::ostringstream oss;
3807                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3808                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3809                 }
3810               if(singleVal>=0)
3811                 return self->buildSubPart(&singleVal,&singleVal+1);
3812               else
3813                 {
3814                   if(nbc+singleVal>0)
3815                     {
3816                       int tmp=nbc+singleVal;
3817                       return self->buildSubPart(&tmp,&tmp+1);
3818                     }
3819                   else
3820                     {
3821                       std::ostringstream oss;
3822                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3823                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3824                     }
3825                 }
3826             }
3827           case 2:
3828             {
3829               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3830             }
3831           case 3:
3832             {
3833               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3834             }
3835           case 4:
3836             {
3837               if(!daIntTyypp)
3838                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3839               daIntTyypp->checkAllocated();
3840               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3841             }
3842           default:
3843             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3844           }
3845       }
3846
3847       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3848       {
3849         const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call  Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
3850         if(PyTuple_Check(li))
3851           {
3852             Py_ssize_t sz=PyTuple_Size(li);
3853             if(sz!=2)
3854               throw INTERP_KERNEL::Exception(msg);
3855             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3856             int sw;
3857             int singleVal;
3858             std::vector<int> multiVal;
3859             std::pair<int, std::pair<int,int> > slic;
3860             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3861             if(!self->getArray())
3862               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3863             try
3864               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3865             catch(INTERP_KERNEL::Exception& e)
3866               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3867             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3868             DataArrayDouble *ret0Arr=ret0->getArray();
3869             if(!ret0Arr)
3870               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3871             switch(sw)
3872               {
3873               case 1:
3874                 {
3875                   std::vector<int> v2(1,singleVal);
3876                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3877                   ret0->setArray(aarr);
3878                   return ret0.retn();
3879                 }
3880               case 2:
3881                 {
3882                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3883                   ret0->setArray(aarr);
3884                   return ret0.retn();
3885                 }
3886               case 3:
3887                 {
3888                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3889                   std::vector<int> v2(nbOfComp);
3890                   for(int i=0;i<nbOfComp;i++)
3891                     v2[i]=slic.first+i*slic.second.second;
3892                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3893                   ret0->setArray(aarr);
3894                   return ret0.retn();
3895                 }
3896               default:
3897                 throw INTERP_KERNEL::Exception(msg);
3898               }
3899             
3900           }
3901         else
3902           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3903       }
3904
3905       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3906       {
3907         DataArrayInt *tmp;
3908         double r1=self->getMaxValue2(tmp);
3909         PyObject *ret=PyTuple_New(2);
3910         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3911         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3912         return ret;
3913       }
3914       
3915       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3916       {
3917         DataArrayInt *tmp;
3918         double r1=self->getMinValue2(tmp);
3919         PyObject *ret=PyTuple_New(2);
3920         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3921         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3922         return ret;
3923       }
3924       
3925       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3926       {
3927         std::vector<int> tmp;
3928         convertPyToNewIntArr3(li,tmp);
3929         return self->keepSelectedComponents(tmp);
3930       }
3931
3932       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3933       {
3934         std::vector<int> tmp;
3935         convertPyToNewIntArr3(li,tmp);
3936         self->setSelectedComponents(f,tmp);
3937       }
3938
3939       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3940       {
3941         double val,val2;
3942         DataArrayDouble *a,*a2;
3943         DataArrayDoubleTuple *aa,*aa2;
3944         std::vector<double> bb,bb2;
3945         int sw;
3946         int spaceDim=3;
3947         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3948         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3949         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3950         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3951         //
3952         return self->extractSlice3D(orig,vect,eps);
3953       }
3954
3955       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3956       {
3957         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3958       }
3959
3960       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3961       {
3962         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3963       }
3964
3965       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3966       {
3967         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__sub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
3968         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3969         void *argp;
3970         //
3971         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3972           {
3973             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3974             if(other)
3975               return (*self)-(*other);
3976             else
3977               throw INTERP_KERNEL::Exception(msg);
3978           }
3979         //
3980         double val;
3981         DataArrayDouble *a;
3982         DataArrayDoubleTuple *aa;
3983         std::vector<double> bb;
3984         int sw;
3985         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3986         switch(sw)
3987           {
3988           case 1:
3989             {
3990               if(!self->getArray())
3991                 throw INTERP_KERNEL::Exception(msg2);
3992               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3993               ret->applyLin(1.,-val);
3994               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3995               ret2->setArray(ret);
3996               return ret2.retn();
3997             }
3998           case 2:
3999             {
4000               if(!self->getArray())
4001                 throw INTERP_KERNEL::Exception(msg2);
4002               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4003               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4004               ret2->setArray(ret);
4005               return ret2.retn();
4006             }
4007           case 3:
4008             {
4009               if(!self->getArray())
4010                 throw INTERP_KERNEL::Exception(msg2);
4011               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4012               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4013               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4014               ret2->setArray(ret);
4015               return ret2.retn();
4016             }
4017           case 4:
4018             {
4019               if(!self->getArray())
4020                 throw INTERP_KERNEL::Exception(msg2);
4021               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4022               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4023               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4024               ret2->setArray(ret);
4025               return ret2.retn();
4026             }
4027           default:
4028             { throw INTERP_KERNEL::Exception(msg); }
4029           }
4030       }
4031
4032       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4033       {
4034         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4035       }
4036
4037       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4038       {
4039         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4040       }
4041
4042       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4043       {
4044         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4045       }
4046
4047       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4048       {
4049         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__div__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4050         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4051         void *argp;
4052         //
4053         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4054           {
4055             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4056             if(other)
4057               return (*self)/(*other);
4058             else
4059               throw INTERP_KERNEL::Exception(msg);
4060           }
4061         //
4062         double val;
4063         DataArrayDouble *a;
4064         DataArrayDoubleTuple *aa;
4065         std::vector<double> bb;
4066         int sw;
4067         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4068         switch(sw)
4069           {
4070           case 1:
4071             {
4072               if(val==0.)
4073                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4074               if(!self->getArray())
4075                 throw INTERP_KERNEL::Exception(msg2);
4076               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4077               ret->applyLin(1./val,0);
4078               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4079               ret2->setArray(ret);
4080               return ret2.retn();
4081             }
4082           case 2:
4083             {
4084               if(!self->getArray())
4085                 throw INTERP_KERNEL::Exception(msg2);
4086               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4087               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4088               ret2->setArray(ret);
4089               return ret2.retn();
4090             }
4091           case 3:
4092             {
4093               if(!self->getArray())
4094                 throw INTERP_KERNEL::Exception(msg2);
4095               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4096               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4097               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4098               ret2->setArray(ret);
4099               return ret2.retn();
4100             }
4101           case 4:
4102             {
4103               if(!self->getArray())
4104                 throw INTERP_KERNEL::Exception(msg2);
4105               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4106               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4107               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4108               ret2->setArray(ret);
4109               return ret2.retn();
4110             }
4111           default:
4112             { throw INTERP_KERNEL::Exception(msg); }
4113           }
4114       }
4115
4116       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4117       {
4118         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4119       }
4120
4121       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4122       {
4123         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__pow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4124         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4125         void *argp;
4126         //
4127         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4128           {
4129             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4130             if(other)
4131               return (*self)^(*other);
4132             else
4133               throw INTERP_KERNEL::Exception(msg);
4134           }
4135         //
4136         double val;
4137         DataArrayDouble *a;
4138         DataArrayDoubleTuple *aa;
4139         std::vector<double> bb;
4140         int sw;
4141         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4142         switch(sw)
4143           {
4144           case 1:
4145             {
4146               if(!self->getArray())
4147                 throw INTERP_KERNEL::Exception(msg2);
4148               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4149               ret->applyPow(val);
4150               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4151               ret2->setArray(ret);
4152               return ret2.retn();
4153             }
4154           case 2:
4155             {
4156               if(!self->getArray())
4157                 throw INTERP_KERNEL::Exception(msg2);
4158               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4159               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4160               ret2->setArray(ret);
4161               return ret2.retn();
4162             }
4163           case 3:
4164             {
4165               if(!self->getArray())
4166                 throw INTERP_KERNEL::Exception(msg2);
4167               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4168               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4169               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4170               ret2->setArray(ret);
4171               return ret2.retn();
4172             }
4173           case 4:
4174             {
4175               if(!self->getArray())
4176                 throw INTERP_KERNEL::Exception(msg2);
4177               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4178               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4179               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4180               ret2->setArray(ret);
4181               return ret2.retn();
4182             }
4183           default:
4184             { throw INTERP_KERNEL::Exception(msg); }
4185           }
4186       }
4187
4188       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4189       {
4190         return self->negate();
4191       }
4192
4193       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4194       {
4195         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__iadd__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4196         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4197         void *argp;
4198         //
4199         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4200           {
4201             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4202             if(other)
4203               {
4204                 *self+=*other;
4205                 Py_XINCREF(trueSelf);
4206                 return trueSelf;
4207               }
4208             else
4209               throw INTERP_KERNEL::Exception(msg);
4210           }
4211         //
4212         double val;
4213         DataArrayDouble *a;
4214         DataArrayDoubleTuple *aa;
4215         std::vector<double> bb;
4216         int sw;
4217         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4218         switch(sw)
4219           {
4220           case 1:
4221             {
4222               if(!self->getArray())
4223                 throw INTERP_KERNEL::Exception(msg2);
4224               self->getArray()->applyLin(1.,val);
4225               Py_XINCREF(trueSelf);
4226               return trueSelf;
4227             }
4228           case 2:
4229             {
4230               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4231               ret2->setArray(a);
4232               *self+=*ret2;
4233               Py_XINCREF(trueSelf);
4234               return trueSelf;
4235             }
4236           case 3:
4237             {
4238               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4239               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4240               ret2->setArray(aaa);
4241               *self+=*ret2;
4242               Py_XINCREF(trueSelf);
4243               return trueSelf;
4244             }
4245           case 4:
4246             {
4247               if(!self->getArray())
4248                 throw INTERP_KERNEL::Exception(msg2);
4249               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4250               self->getArray()->addEqual(aaa);
4251               Py_XINCREF(trueSelf);
4252               return trueSelf;
4253             }
4254           default:
4255             { throw INTERP_KERNEL::Exception(msg); }
4256           }
4257       }
4258
4259       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4260       {
4261         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__isub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4262         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4263         void *argp;
4264         //
4265         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4266           {
4267             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4268             if(other)
4269               {
4270                 *self-=*other;
4271                 Py_XINCREF(trueSelf);
4272                 return trueSelf;
4273               }
4274             else
4275               throw INTERP_KERNEL::Exception(msg);
4276           }
4277         //
4278         double val;
4279         DataArrayDouble *a;
4280         DataArrayDoubleTuple *aa;
4281         std::vector<double> bb;
4282         int sw;
4283         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4284         switch(sw)
4285           {
4286           case 1:
4287             {
4288               if(!self->getArray())
4289                 throw INTERP_KERNEL::Exception(msg2);
4290               self->getArray()->applyLin(1.,-val);
4291               Py_XINCREF(trueSelf);
4292               return trueSelf;
4293             }
4294           case 2:
4295             {
4296               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4297               ret2->setArray(a);
4298               *self-=*ret2;
4299               Py_XINCREF(trueSelf);
4300               return trueSelf;
4301             }
4302           case 3:
4303             {
4304               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4305               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4306               ret2->setArray(aaa);
4307               *self-=*ret2;
4308               Py_XINCREF(trueSelf);
4309               return trueSelf;
4310             }
4311           case 4:
4312             {
4313               if(!self->getArray())
4314                 throw INTERP_KERNEL::Exception(msg2);
4315               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4316               self->getArray()->substractEqual(aaa);
4317               Py_XINCREF(trueSelf);
4318               return trueSelf;
4319             }
4320           default:
4321             { throw INTERP_KERNEL::Exception(msg); }
4322           }
4323       }
4324
4325       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4326       {
4327         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__imul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4328         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4329         void *argp;
4330         //
4331         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4332           {
4333             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4334             if(other)
4335               {
4336                 *self*=*other;
4337                 Py_XINCREF(trueSelf);
4338                 return trueSelf;
4339               }
4340             else
4341               throw INTERP_KERNEL::Exception(msg);
4342           }
4343         //
4344         double val;
4345         DataArrayDouble *a;
4346         DataArrayDoubleTuple *aa;
4347         std::vector<double> bb;
4348         int sw;
4349         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4350         switch(sw)
4351           {
4352           case 1:
4353             {
4354               if(!self->getArray())
4355                 throw INTERP_KERNEL::Exception(msg2);
4356               self->getArray()->applyLin(val,0);
4357               Py_XINCREF(trueSelf);
4358               return trueSelf;
4359             }
4360           case 2:
4361             {
4362               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4363               ret2->setArray(a);
4364               *self*=*ret2;
4365               Py_XINCREF(trueSelf);
4366               return trueSelf;
4367             }
4368           case 3:
4369             {
4370               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4371               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4372               ret2->setArray(aaa);
4373               *self*=*ret2;
4374               Py_XINCREF(trueSelf);
4375               return trueSelf;
4376             }
4377           case 4:
4378             {
4379               if(!self->getArray())
4380                 throw INTERP_KERNEL::Exception(msg2);
4381               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4382               self->getArray()->multiplyEqual(aaa);
4383               Py_XINCREF(trueSelf);
4384               return trueSelf;
4385             }
4386           default:
4387             { throw INTERP_KERNEL::Exception(msg); }
4388           }
4389       }
4390
4391       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4392       {
4393         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__idiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4394         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4395         void *argp;
4396         //
4397         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4398           {
4399             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4400             if(other)
4401               {
4402                 *self/=*other;
4403                 Py_XINCREF(trueSelf);
4404                 return trueSelf;
4405               }
4406             else
4407               throw INTERP_KERNEL::Exception(msg);
4408           }
4409         //
4410         double val;
4411         DataArrayDouble *a;
4412         DataArrayDoubleTuple *aa;
4413         std::vector<double> bb;
4414         int sw;
4415         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4416         switch(sw)
4417           {
4418           case 1:
4419             {
4420               if(val==0.)
4421                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4422               if(!self->getArray())
4423                 throw INTERP_KERNEL::Exception(msg2);
4424               self->getArray()->applyLin(1./val,0);
4425               Py_XINCREF(trueSelf);
4426               return trueSelf;
4427             }
4428           case 2:
4429             {
4430               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4431               ret2->setArray(a);
4432               *self/=*ret2;
4433               Py_XINCREF(trueSelf);
4434               return trueSelf;
4435             }
4436           case 3:
4437             {
4438               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4439               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4440               ret2->setArray(aaa);
4441               *self/=*ret2;
4442               Py_XINCREF(trueSelf);
4443               return trueSelf;
4444             }
4445           case 4:
4446             {
4447               if(!self->getArray())
4448                 throw INTERP_KERNEL::Exception(msg2);
4449               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4450               self->getArray()->divideEqual(aaa);
4451               Py_XINCREF(trueSelf);
4452               return trueSelf;
4453             }
4454           default:
4455             { throw INTERP_KERNEL::Exception(msg); }
4456           }
4457       }
4458
4459       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4460       {
4461         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__ipow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4462         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4463         void *argp;
4464         //
4465         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4466           {
4467             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4468             if(other)
4469               {
4470                 *self^=*other;
4471                 Py_XINCREF(trueSelf);
4472                 return trueSelf;
4473               }
4474             else
4475               throw INTERP_KERNEL::Exception(msg);
4476           }
4477         //
4478         double val;
4479         DataArrayDouble *a;
4480         DataArrayDoubleTuple *aa;
4481         std::vector<double> bb;
4482         int sw;
4483         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4484         switch(sw)
4485           {
4486           case 1:
4487             {
4488               if(!self->getArray())
4489                 throw INTERP_KERNEL::Exception(msg2);
4490               self->getArray()->applyPow(val);
4491               Py_XINCREF(trueSelf);
4492               return trueSelf;
4493             }
4494           case 2:
4495             {
4496               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4497               ret2->setArray(a);
4498               *self^=*ret2;
4499               Py_XINCREF(trueSelf);
4500               return trueSelf;
4501             }
4502           case 3:
4503             {
4504               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4505               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4506               ret2->setArray(aaa);
4507               *self^=*ret2;
4508               Py_XINCREF(trueSelf);
4509               return trueSelf;
4510             }
4511           case 4:
4512             {
4513               if(!self->getArray())
4514                 throw INTERP_KERNEL::Exception(msg2);
4515               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4516               self->getArray()->powEqual(aaa);
4517               Py_XINCREF(trueSelf);
4518               return trueSelf;
4519             }
4520           default:
4521             { throw INTERP_KERNEL::Exception(msg); }
4522           }
4523       }
4524
4525       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4526       {
4527         std::vector<const MEDCouplingFieldDouble *> tmp;
4528         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4529         return MEDCouplingFieldDouble::MergeFields(tmp);
4530       }
4531
4532       static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4533       {
4534         std::vector<const MEDCouplingFieldDouble *> tmp;
4535         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4536         MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4537       }
4538     }
4539   };
4540
4541   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4542   {
4543   public:
4544     int getNumberOfFields() const;
4545     MEDCouplingMultiFields *deepCpy() const;
4546     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4547     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4548     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4549     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4550     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4551     %extend
4552        {
4553          std::string __str__() const throw(INTERP_KERNEL::Exception)
4554          {
4555            return self->simpleRepr();
4556          }
4557          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4558          {
4559            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4560            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4561            int sz=tmp.size();
4562            std::vector<MEDCouplingFieldDouble *> fs(sz);
4563            for(int i=0;i<sz;i++)
4564              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4565            return MEDCouplingMultiFields::New(fs);
4566          }
4567          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4568          {
4569            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4570            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4571            int sz=tmp.size();
4572            std::vector<MEDCouplingFieldDouble *> fs(sz);
4573            for(int i=0;i<sz;i++)
4574              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4575            return MEDCouplingMultiFields::New(fs);
4576          }
4577          PyObject *getFields() const
4578          {
4579            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4580            int sz=fields.size();
4581            PyObject *res = PyList_New(sz);
4582            for(int i=0;i<sz;i++)
4583              {
4584                if(fields[i])
4585                  {
4586                    fields[i]->incrRef();
4587                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4588                  }
4589                else
4590                  {
4591                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4592                  }
4593              }
4594            return res;
4595          }
4596          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4597          {
4598            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4599            if(ret)
4600              {
4601                ret->incrRef();
4602                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4603              }
4604            else
4605              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4606          }
4607          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4608          {
4609            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4610            int sz=ms.size();
4611            PyObject *res = PyList_New(sz);
4612            for(int i=0;i<sz;i++)
4613              {
4614                if(ms[i])
4615                  {
4616                    ms[i]->incrRef();
4617                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4618                  }
4619                else
4620                  {
4621                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4622                  }
4623              }
4624            return res;
4625          }
4626          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4627          {
4628            std::vector<int> refs;
4629            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4630            int sz=ms.size();
4631            PyObject *res = PyList_New(sz);
4632            for(int i=0;i<sz;i++)
4633              {
4634                if(ms[i])
4635                  {
4636                    ms[i]->incrRef();
4637                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4638                  }
4639                else
4640                  {
4641                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4642                  }
4643              }
4644            //
4645            PyObject *ret=PyTuple_New(2);
4646            PyTuple_SetItem(ret,0,res);
4647            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4648            return ret;
4649          }
4650          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4651          {
4652            std::vector<DataArrayDouble *> ms=self->getArrays();
4653            int sz=ms.size();
4654            PyObject *res = PyList_New(sz);
4655            for(int i=0;i<sz;i++)
4656              {
4657                if(ms[i])
4658                  {
4659                    ms[i]->incrRef();
4660                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4661                  }
4662                else
4663                  {
4664                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4665                  }
4666              }
4667            return res;
4668          }
4669          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4670          {
4671            std::vector< std::vector<int> > refs;
4672            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4673            int sz=ms.size();
4674            PyObject *res = PyList_New(sz);
4675            PyObject *res2 = PyList_New(sz);
4676            for(int i=0;i<sz;i++)
4677              {
4678                if(ms[i])
4679                  {
4680                    ms[i]->incrRef();
4681                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4682                  }
4683                else
4684                  {
4685                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4686                  }
4687                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4688              }
4689            //
4690            PyObject *ret=PyTuple_New(2);
4691            PyTuple_SetItem(ret,0,res);
4692            PyTuple_SetItem(ret,1,res2);
4693            return ret;
4694          }
4695        }
4696   };
4697   
4698   class MEDCouplingDefinitionTime
4699   {
4700   public:
4701     MEDCouplingDefinitionTime();
4702     void assign(const MEDCouplingDefinitionTime& other);
4703     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4704     double getTimeResolution() const;
4705     std::vector<double> getHotSpotsTime() const;
4706     %extend
4707       {
4708         std::string __str__() const throw(INTERP_KERNEL::Exception)
4709           {
4710             std::ostringstream oss;
4711             self->appendRepr(oss);
4712             return oss.str();
4713           }
4714
4715         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4716         {
4717           int meshId,arrId,arrIdInField,fieldId;
4718           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4719           PyObject *res=PyList_New(4);
4720           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4721           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4722           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4723           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4724           return res;
4725         }
4726
4727         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4728         {
4729           int meshId,arrId,arrIdInField,fieldId;
4730           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4731           PyObject *res=PyList_New(4);
4732           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4733           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4734           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4735           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4736           return res;
4737         }
4738       }
4739   };
4740
4741   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4742   {
4743   public:
4744     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4745     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4746     
4747     %extend
4748       {
4749         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4750           {
4751             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4752             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4753             int sz=tmp.size();
4754             std::vector<MEDCouplingFieldDouble *> fs(sz);
4755             for(int i=0;i<sz;i++)
4756               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4757             return MEDCouplingFieldOverTime::New(fs);
4758           }
4759         std::string __str__() const throw(INTERP_KERNEL::Exception)
4760           {
4761             return self->simpleRepr();
4762           }
4763         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4764         {
4765           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4766           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4767            int sz=tmp.size();
4768            std::vector<MEDCouplingFieldDouble *> fs(sz);
4769            for(int i=0;i<sz;i++)
4770              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4771            return MEDCouplingFieldOverTime::New(fs);
4772          }
4773       }
4774   };
4775
4776   class MEDCouplingCartesianAMRMesh;
4777   
4778   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
4779   {
4780   public:
4781     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4782     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4783     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4784     %extend
4785     {
4786       MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
4787       {
4788         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4789         if(ret)
4790           ret->incrRef();
4791         return ret;
4792       }
4793     }
4794   };
4795
4796   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
4797   {
4798   public:
4799     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4800     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
4801     %extend
4802     {
4803       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4804       {
4805         const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4806         return convertFromVectorPairInt(ret);
4807       }
4808
4809       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4810       {
4811         std::vector< std::pair<int,int> > inp;
4812         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4813         self->addPatch(inp,factors);
4814       }
4815
4816       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4817       {
4818         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4819         if(!mesh)
4820           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
4821         if(patchId==mesh->getNumberOfPatches())
4822           {
4823             std::ostringstream oss;
4824             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4825             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4826             return 0;
4827           }
4828         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
4829         if(ret)
4830           ret->incrRef();
4831         return ret;
4832       }
4833
4834       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4835       {
4836         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4837         if(!mesh)
4838           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
4839         mesh->removePatch(patchId);
4840       }
4841
4842       int __len__() const throw(INTERP_KERNEL::Exception)
4843       {
4844         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4845         if(!mesh)
4846           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
4847         return mesh->getNumberOfPatches();
4848       }
4849     }
4850   };
4851
4852   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
4853   {
4854   };
4855
4856   class MEDCouplingDataForGodFather : public RefCountObject
4857   {
4858   public:
4859     virtual void synchronizeFineToCoarse(int ghostLev) throw(INTERP_KERNEL::Exception);
4860     virtual void synchronizeCoarseToFine(int ghostLev) throw(INTERP_KERNEL::Exception);
4861     virtual void synchronizeCoarseToFineOnlyInGhostZone(int ghostLev) throw(INTERP_KERNEL::Exception);
4862     virtual void synchronizeFineEachOtherInGhostZone(int ghostLev) throw(INTERP_KERNEL::Exception);
4863     virtual void alloc(int ghostLev) throw(INTERP_KERNEL::Exception);
4864     virtual void dealloc() throw(INTERP_KERNEL::Exception);
4865   };
4866   
4867   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
4868   {
4869   public:
4870     int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
4871     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4872     const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
4873     void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
4874     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4875     int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4876     int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
4877     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4878     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4879     bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
4880     //
4881     int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
4882     int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
4883     MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
4884     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
4885     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
4886     void removeAllPatches() throw(INTERP_KERNEL::Exception);
4887     void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
4888     void detachFromFather() throw(INTERP_KERNEL::Exception);
4889     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
4890     DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
4891     void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch) const throw(INTERP_KERNEL::Exception);
4892     void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
4893     void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
4894     void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
4895     void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev) const throw(INTERP_KERNEL::Exception);
4896     DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
4897     %extend
4898     {
4899       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4900       {
4901         std::vector< std::pair<int,int> > inp;
4902         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4903         self->addPatch(inp,factors);
4904       }
4905
4906       PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
4907       {
4908         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
4909         int sz(ps.size());
4910         PyObject *ret = PyList_New(sz);
4911         for(int i=0;i<sz;i++)
4912           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
4913         return ret;
4914       }
4915
4916       MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
4917       {
4918         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
4919         if(ret)
4920           ret->incrRef();
4921         return ret;
4922       }
4923       
4924       MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
4925       {
4926         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
4927         if(ret)
4928           ret->incrRef();
4929         return ret;
4930       }
4931
4932       MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
4933       {
4934         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
4935         if(ret)
4936           ret->incrRef();
4937         return ret;
4938       }
4939
4940       MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
4941       {
4942         const MEDCouplingIMesh *ret(self->getImageMesh());
4943         if(ret)
4944           ret->incrRef();
4945         return const_cast<MEDCouplingIMesh *>(ret);
4946       }
4947
4948       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4949       {
4950         if(patchId==self->getNumberOfPatches())
4951           {
4952             std::ostringstream oss;
4953             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
4954             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4955             return 0;
4956           }
4957         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
4958         if(ret)
4959           ret->incrRef();
4960         return ret;
4961       }
4962
4963       void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches) const throw(INTERP_KERNEL::Exception)
4964       {
4965         std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
4966         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
4967         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2);
4968       }
4969
4970       void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
4971       {
4972         std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
4973         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
4974         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
4975       }
4976
4977       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4978       {
4979         self->removePatch(patchId);
4980       }
4981
4982       int __len__() const throw(INTERP_KERNEL::Exception)
4983       {
4984         return self->getNumberOfPatches();
4985       }
4986     }
4987   };
4988
4989   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
4990   {
4991   };
4992
4993   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
4994   {
4995   public:
4996     void setData(MEDCouplingDataForGodFather *data) throw(INTERP_KERNEL::Exception);
4997     void allocData(int ghostLev) const throw(INTERP_KERNEL::Exception);
4998     void deallocData() const throw(INTERP_KERNEL::Exception);
4999     %extend
5000     {
5001       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5002       {
5003         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5004         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5005         const int *nodeStrctPtr(0);
5006         const double *originPtr(0),*dxyzPtr(0);
5007         int sw,sz,val0;
5008         std::vector<int> bb0;
5009         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5010         //
5011         double val,val2;
5012         std::vector<double> bb,bb2;
5013         int sz1,sz2;
5014         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5015         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5016         //
5017         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5018       }
5019
5020       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5021       {
5022         return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
5023       }
5024
5025       MEDCouplingDataForGodFather *getDataConst() const throw(INTERP_KERNEL::Exception)
5026       {
5027         const MEDCouplingDataForGodFather *ret(self->getDataConst());
5028         if(ret)
5029           ret->incrRef();
5030         return const_cast<MEDCouplingDataForGodFather *>(ret);
5031       }
5032
5033       MEDCouplingDataForGodFather *getData() throw(INTERP_KERNEL::Exception)
5034       {
5035         MEDCouplingDataForGodFather *ret(self->getData());
5036         if(ret)
5037           ret->incrRef();
5038         return ret;
5039       }
5040     }
5041   };
5042   
5043   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5044   {
5045   public:
5046     DataArrayDouble *retrieveFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5047     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5048     %extend
5049     {
5050       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames) throw(INTERP_KERNEL::Exception)
5051       {
5052         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5053         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5054         MEDCouplingAMRAttribute *ret(0);
5055         try
5056           {
5057             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5058             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0);
5059           }
5060         catch(INTERP_KERNEL::Exception&)
5061           {
5062             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5063             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1);
5064           }
5065         return ret;
5066       }
5067
5068       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames) throw(INTERP_KERNEL::Exception)
5069       {
5070         return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames);
5071       }
5072       
5073       void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5074       {
5075         std::vector< std::vector<std::string> > compNamesCpp;
5076         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5077         self->spillInfoOnComponents(compNamesCpp);
5078       }
5079       
5080       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5081       {
5082         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5083         int sz((int)ret.size());
5084         PyObject *retPy(PyList_New(sz));
5085         for(int i=0;i<sz;i++)
5086           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5087         return retPy;
5088       }
5089     }
5090   };
5091
5092   class DenseMatrix : public RefCountObject, public TimeLabel
5093   {
5094   public:
5095     static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5096     static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5097     DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5098     DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5099     //
5100     int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5101     int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5102     int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5103     void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5104     void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5105     void transpose() throw(INTERP_KERNEL::Exception);
5106     //
5107     bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5108     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5109     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5110     %extend
5111     {
5112       DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5113       {
5114         return DenseMatrix::New(nbRows,nbCols);
5115       }
5116
5117       DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5118       {
5119         return DenseMatrix::New(array,nbRows,nbCols);
5120       }
5121
5122       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5123       {
5124         std::string ret1;
5125         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5126         PyObject *ret=PyTuple_New(2);
5127         PyObject *ret0Py=ret0?Py_True:Py_False;
5128         Py_XINCREF(ret0Py);
5129         PyTuple_SetItem(ret,0,ret0Py);
5130         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5131         return ret;
5132       }
5133
5134       DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5135       {
5136         DataArrayDouble *ret(self->getData());
5137         if(ret)
5138           ret->incrRef();
5139         return ret;
5140       }
5141
5142       DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5143       {
5144         return ParaMEDMEM::DenseMatrix::Add(self,other);
5145       }
5146
5147       DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5148       {
5149         return ParaMEDMEM::DenseMatrix::Substract(self,other);
5150       }
5151
5152       DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5153       {
5154         return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5155       }
5156
5157       DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5158       {
5159         return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5160       }
5161
5162       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5163       {
5164         self->addEqual(other);
5165         Py_XINCREF(trueSelf);
5166         return trueSelf;
5167       }
5168
5169       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5170       {
5171         self->substractEqual(other);
5172         Py_XINCREF(trueSelf);
5173         return trueSelf;
5174       }
5175 #ifdef WITH_NUMPY
5176       PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5177       {
5178         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5179         return obj;
5180       }
5181 #endif
5182     }
5183   };
5184 }
5185
5186 %pythoncode %{
5187 import os
5188 __filename=os.environ.get('PYTHONSTARTUP')
5189 if __filename and os.path.isfile(__filename):
5190   execfile(__filename)
5191   pass
5192 %}