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