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