]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDLoader/Swig/MEDLoaderCommon.i
Salome HOME
feat: new crackAlong method
[tools/medcoupling.git] / src / MEDLoader / Swig / MEDLoaderCommon.i
1 // Copyright (C) 2017-2024  CEA, EDF
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 (EDF R&D)
20
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
23
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
26 #endif
27
28 %include "MEDCouplingCommon.i"
29
30 %{
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDCouplingTypemaps.i"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
45 #include "MeshFormatReader.hxx"
46 #include "MeshFormatWriter.hxx"
47
48 using namespace MEDCoupling;
49 %}
50
51 #if SWIG_VERSION >= 0x010329
52 %template()  std::vector<std::string>;
53 #endif
54
55 %typemap(out) MEDCoupling::MEDFileMesh*
56 {
57   $result=convertMEDFileMesh($1,$owner);
58 }
59
60 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 {
62   $result=convertMEDFileParameter1TS($1,$owner);
63 }
64
65 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 {
67   $result=convertMEDFileFieldMultiTS($1,$owner);
68 }
69
70 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 {
72   $result=convertMEDFileField1TS($1,$owner);
73 }
74
75 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 {
77   $result=convertMEDMeshMultiLev($1,$owner);
78 }
79
80 %newobject ReadUMeshFromFamiliesSwig;
81 %newobject ReadUMeshFromGroupsSwig;
82 %newobject ReadFieldSwig;
83 %newobject MEDCoupling::ReadUMeshFromFile;
84 %newobject MEDCoupling::ReadMeshFromFile;
85 %newobject MEDCoupling::ReadFieldCell;
86 %newobject MEDCoupling::ReadFieldNode;
87 %newobject MEDCoupling::ReadFieldGauss;
88 %newobject MEDCoupling::ReadFieldGaussNE;
89 %newobject MEDCoupling::MEDFileMesh::New;
90 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
91 %newobject MEDCoupling::MEDFileMesh::deepCopy;
92 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
93 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
94 %newobject MEDCoupling::MEDFileMesh::__getitem__;
95 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
96 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
98 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
102 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
103 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
104 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
105 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
106 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
107 %newobject MEDCoupling::MEDFileMesh::cartesianize;
108 %newobject MEDCoupling::MEDFileData::getJoints;
109 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
110 %newobject MEDCoupling::MEDFileUMesh::New;
111 %newobject MEDCoupling::MEDFileUMesh::LoadConnectivityOnlyPartOf;
112 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
113 %newobject MEDCoupling::MEDFileUMesh::getCoords;
114 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
115 %newobject MEDCoupling::MEDFileUMesh::getGroup;
116 %newobject MEDCoupling::MEDFileUMesh::getGroups;
117 %newobject MEDCoupling::MEDFileUMesh::getFamily;
118 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
119 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
122 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
123 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
124 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
125 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
126 %newobject MEDCoupling::MEDFileUMesh::computeFetchedNodeIds;
127 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
128 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
129 %newobject MEDCoupling::MEDFileUMesh::extractPart;
130 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
131 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
132 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
133 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
134 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
135 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
136 %newobject MEDCoupling::MEDFileCMesh::New;
137 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
138 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
139 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
141 %newobject MEDCoupling::MEDFileMeshes::New;
142 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
143 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
144 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
145 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
146 %newobject MEDCoupling::MEDFileMeshes::__iter__;
147
148 %newobject MEDCoupling::MEDFileMeshSupports::New;
149 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
150
151 %newobject MEDCoupling::MEDFileStructureElements::New;
152
153 %newobject MEDCoupling::MEDFileFields::New;
154 %newobject MEDCoupling::MEDFileFields::NewAdv;
155 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
156 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
157 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
158 %newobject MEDCoupling::MEDFileFields::deepCopy;
159 %newobject MEDCoupling::MEDFileFields::shallowCpy;
160 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
161 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
162 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
163 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
164 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
165 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
166 %newobject MEDCoupling::MEDFileFields::__iter__;
167 %newobject MEDCoupling::MEDFileFields::extractPart;
168 %newobject MEDCoupling::MEDFileFields::linearToQuadratic;
169
170 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
176 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
177 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
178 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
179 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
185 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
186 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
187 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
189 %newobject MEDCoupling::MEDFileFieldMultiTS::Aggregate;
190
191 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
192 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
193 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
194 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
195 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
196 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
197 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
198 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
199 %newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
200
201 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
202 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
203 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
204 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
206 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
207 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
208 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
209 %newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
210
211 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
212 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
213 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
214 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
215 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
216 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
217 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
218 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
219 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
220
221 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
222 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
223 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
224 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
225 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
226 %newobject MEDCoupling::MEDFileAnyTypeField1TS::buildNewEmpty;
227 %newobject MEDCoupling::MEDFileField1TS::New;
228 %newobject MEDCoupling::MEDFileField1TS::field;
229 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
230 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
231 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
232 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
233 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
234 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
235 %newobject MEDCoupling::MEDFileField1TS::convertToInt64;
236
237 %newobject MEDCoupling::MEDFileInt32Field1TS::New;
238 %newobject MEDCoupling::MEDFileInt32Field1TS::field;
239 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
240 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
241 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
242 %newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
243 %newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
244 %newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
245
246 %newobject MEDCoupling::MEDFileInt64Field1TS::New;
247 %newobject MEDCoupling::MEDFileInt64Field1TS::field;
248 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
249 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
250 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
251 %newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
252 %newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
253 %newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
254
255 %newobject MEDCoupling::MEDFileFloatField1TS::New;
256 %newobject MEDCoupling::MEDFileFloatField1TS::field;
257 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
258 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
259 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
260 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
261 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
262 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
263
264 %newobject MEDCoupling::MEDFileData::New;
265 %newobject MEDCoupling::MEDFileData::deepCopy;
266 %newobject MEDCoupling::MEDFileData::getMeshes;
267 %newobject MEDCoupling::MEDFileData::getFields;
268 %newobject MEDCoupling::MEDFileData::getParams;
269 %newobject MEDCoupling::MEDFileData::Aggregate;
270
271 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
272
273 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
274 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
275 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
276 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
277 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
278 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
279 %newobject MEDCoupling::MEDFileParameters::New;
280 %newobject MEDCoupling::MEDFileParameters::deepCopy;
281 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
282 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
283 %newobject MEDCoupling::MEDFileParameters::__getitem__;
284
285 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
286 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
287 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
288 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
289 %newobject MEDCoupling::MEDFileJointOneStep::New;
290 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
291 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
292 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
293 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
294 %newobject MEDCoupling::MEDFileJoint::New;
295 %newobject MEDCoupling::MEDFileJoint::deepCopy;
296 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
297 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
298 %newobject MEDCoupling::MEDFileJoint::__getitem__;
299 %newobject MEDCoupling::MEDFileJoints::New;
300 %newobject MEDCoupling::MEDFileJoints::deepCopy;
301 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
302 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
303 %newobject MEDCoupling::MEDFileJoints::__getitem__;
304 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
305 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
306 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
307 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
308 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
309 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
310 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
311 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
312 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
313
314 %newobject MEDCoupling::SauvWriter::New;
315 %newobject MEDCoupling::SauvReader::New;
316 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
317
318
319 %newobject MEDCoupling::MEDFileMeshStruct::New;
320 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
321 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
322 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
323 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
324 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
325
326 %newobject MEDCoupling::MeshFormatReader::loadInMEDFileDS;
327 %newobject MEDCoupling::MeshFormatReader::MeshFormatReader;
328 %newobject MEDCoupling::MeshFormatWriter::MeshFormatWriter;
329
330 %feature("unref") MEDFileMesh "$this->decrRef();"
331 %feature("unref") MEDFileUMesh "$this->decrRef();"
332 %feature("unref") MEDFileCMesh "$this->decrRef();"
333 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
334 %feature("unref") MEDFileMeshes "$this->decrRef();"
335 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
336 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
337 %feature("unref") MEDFileField1TS "$this->decrRef();"
338 %feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
339 %feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
340 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
341 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
342 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
343 %feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
344 %feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
345 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
346 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
347 %feature("unref") MEDFileStructureElements "$this->decrRef();"
348 %feature("unref") MEDFileFields "$this->decrRef();"
349 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
350 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
351 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
352 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
353 %feature("unref") MEDFileParameters "$this->decrRef();"
354 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
355 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
356 %feature("unref") MEDFileJoint "$this->decrRef();"
357 %feature("unref") MEDFileJoints "$this->decrRef();"
358 %feature("unref") MEDFileEquivalences "$this->decrRef();"
359 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
360 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
361 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
362 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
363 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
364 %feature("unref") MEDFileData "$this->decrRef();"
365 %feature("unref") SauvReader "$this->decrRef();"
366 %feature("unref") SauvWriter "$this->decrRef();"
367 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
368 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
369 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
370 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
371 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
372 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
373
374 namespace MEDCoupling
375 {
376   bool HasXDR();
377   std::string MEDFileVersionStr();
378   std::string MEDFileVersionOfFileStr(const std::string& fileName);
379   void SetEpsilonForNodeComp(double val);
380   void SetCompPolicyForCell(int val);
381   void SetTooLongStrPolicy(int val);
382   void CheckFileForRead(const std::string& fileName);
383   std::vector<std::string> GetMeshNames(const std::string& fileName);
384   std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
385   std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
386   std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
387   std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
388   std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
389   std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
390   std::vector<std::string> GetAllFieldNames(const std::string& fileName);
391   std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
392   std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
393   std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
394   double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
395   void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
396   MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
397   MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
398   MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
399   MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
400   int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
401   MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
402   MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
403   MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
404   MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
405   void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
406   void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
407   void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
408   void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
409   void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch);
410   void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f);
411 }
412
413 %rename (MEDFileVersion) MEDFileVersionSwig;
414 %rename (GetFieldIterations) GetFieldIterationsSwig;
415 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
416 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
417 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
418 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
419 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
420 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
421 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
422 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
423 %rename (WriteUMeshes) WriteUMeshesSwig;
424 %rename (GetTypesOfField) GetTypesOfFieldSwig;
425 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
426 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
427 %rename (ReadField) ReadFieldSwig;
428 %rename (GetFamiliesGroupsInfo) GetFamiliesGroupsInfoSwig;
429
430 %inline
431 {
432   PyObject *MEDFileVersionSwig()
433   {
434     int major,minor,release;
435     MEDCoupling::MEDFileVersion(major,minor,release);
436     PyObject *ret(PyTuple_New(3));
437     PyTuple_SetItem(ret,0,SWIG_From_int(major));
438     PyTuple_SetItem(ret,1,SWIG_From_int(minor));
439     PyTuple_SetItem(ret,2,SWIG_From_int(release));
440     return ret;
441   }
442
443   int MEDFileSizeOfMedInt()
444   {
445     return 8*sizeof(med_int);
446   }
447
448   PyObject *GetFamiliesGroupsInfoSwig(const std::string& fileName, const std::string& meshName)
449   {
450     std::map<std::string,mcIdType> families;
451     std::map<std::string,std::vector<std::string>> groupsOnFam;
452     MEDCoupling::GetFamiliesGroupsInfo(fileName,meshName,families,groupsOnFam);
453     AutoPyPtr a(convertMapStringInt(families)),b(convertMapStringVectString(groupsOnFam));
454     AutoPyPtr ret(PyTuple_New(2));
455     PyTuple_SetItem(ret,0,a.retn());
456     PyTuple_SetItem(ret,1,b.retn());
457     return ret.retn();
458   }
459
460   MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName)
461   {
462     MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
463     return ret.retn();
464   }
465
466   MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName)
467   {
468     MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
469     return ret.retn();
470   }
471
472   MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order)
473   {
474     MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
475     return ret.retn();
476   }
477
478   MEDCoupling::MEDCouplingField *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
479   {
480     MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
481     return ret.retn();
482   }
483
484   PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
485   {
486     std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
487     PyObject *ret=PyList_New(res.size());
488     int rk=0;
489     for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
490       {
491         PyObject *elt=PyTuple_New(2);
492         PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
493         PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
494         PyList_SetItem(ret,rk,elt);
495       }
496     return ret;
497   }
498
499   PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName)
500     {
501       std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
502       PyObject *ret=PyList_New(res.size());
503       int rk=0;
504       for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
505         {
506           PyObject *elt=PyTuple_New(3);
507           PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
508           PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
509           PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
510           PyList_SetItem(ret,rk,elt);
511         }
512       return ret;
513     }
514
515   PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
516     {
517       std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
518       PyObject *ret=PyList_New(res.size());
519       int rk=0;
520       for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
521         {
522           PyObject *elt=PyTuple_New(2);
523           PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
524           PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
525           PyList_SetItem(ret,rk,elt);
526         }
527       return ret;
528     }
529
530   PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
531     {
532       std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
533       PyObject *ret=PyList_New(res.size());
534       int rk=0;
535       for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
536         {
537           PyObject *elt=PyTuple_New(2);
538           PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
539           PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
540           PyList_SetItem(ret,rk,elt);
541         }
542       return ret;
543     }
544
545   PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName)
546     {
547       std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
548       PyObject *ret=PyList_New(res.size());
549       int rk=0;
550       for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
551         {
552           PyObject *elt=PyTuple_New(2);
553           PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
554           PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
555           PyList_SetItem(ret,rk,elt);
556         }
557       return ret;
558     }
559
560   PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
561     {
562       int meshDim,spaceDim;
563       mcIdType numberOfNodes;
564       std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
565       PyObject *ret=PyTuple_New(4);
566       PyObject *elt0=PyList_New(res.size());
567       int i=0;
568       for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
569         {
570           const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
571           int j=0;
572           PyObject *elt1=PyList_New(obj2.size());
573           for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
574             {
575               PyObject *elt2=PyTuple_New(2);
576               PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
577               PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
578               PyList_SetItem(elt1,j,elt2);
579             }
580           PyList_SetItem(elt0,i,elt1);
581         }
582       PyTuple_SetItem(ret,0,elt0);
583       PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
584       PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
585       PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
586       return ret;
587     }
588
589   PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
590                                      const std::string& fieldName, PyObject *liIts)
591     {
592       std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
593       std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
594       return convertFieldDoubleVecToPy(res);
595     }
596
597   void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
598   {
599     std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
600     convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
601     MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
602   }
603
604   void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch)
605   {
606     std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
607     convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
608     MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
609   }
610
611   void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch)
612   {
613     std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
614     convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
615     MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
616   }
617
618   PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
619     {
620       std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
621       std::size_t size=v.size();
622       PyObject *ret=PyList_New(size);
623       for(std::size_t i=0;i<size;i++)
624         PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
625       return ret;
626     }
627
628   MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
629     {
630       std::vector<std::string> grps;
631       converPyListToVecString(li,grps);
632       return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
633     }
634
635   MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li)
636     {
637       std::vector<std::string> fams;
638       converPyListToVecString(li,fams);
639       return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
640     }
641 }
642
643 namespace MEDCoupling
644 {
645   class MEDFileWritable
646   {
647   public:
648     void copyOptionsFrom(const MEDFileWritable& other) const;
649     int getTooLongStrPolicy() const;
650     void setTooLongStrPolicy(int newVal);
651     int getZipConnPolicy();
652     void setZipConnPolicy(int newVal);
653   };
654
655   class MEDFileWritableStandAlone : public MEDFileWritable
656   {
657   public:
658     void write(const std::string& fileName, int mode) const;
659     void write33(const std::string& fileName, int mode) const;
660     void write30(const std::string& fileName, int mode) const;
661     %extend
662        {
663          DataArrayByte *serialize() const
664          {
665            MCAuto<DataArrayByte> ret(self->serialize());
666            return ret.retn();
667          }
668
669          PyObject *__getstate__()
670          {
671            PyObject *ret(PyList_New(0));
672            return ret;
673          }
674
675          void __setstate__(PyObject *inp)
676          {
677          }
678        }
679   };
680
681   class MEDFileMeshReadSelector
682   {
683   public:
684     MEDFileMeshReadSelector();
685     MEDFileMeshReadSelector(unsigned int code);
686     mcIdType getNumberOfCoordsLoadSessions();
687     void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
688     unsigned int getCode() const;
689     void setCode(unsigned int newCode);
690     bool isCellFamilyFieldReading() const;
691     bool isNodeFamilyFieldReading() const;
692     bool isCellNameFieldReading() const;
693     bool isNodeNameFieldReading() const;
694     bool isCellNumFieldReading() const;
695     bool isNodeNumFieldReading() const;
696     bool isGlobalNodeNumFieldReading() const;
697     void setCellFamilyFieldReading(bool b);
698     void setNodeFamilyFieldReading(bool b);
699     void setCellNameFieldReading(bool b);
700     void setNodeNameFieldReading(bool b);
701     void setCellNumFieldReading(bool b);
702     void setNodeNumFieldReading(bool b);
703     void setGlobalNodeNumFieldReading(bool b);
704     %extend
705     {
706       std::string __str__() const
707       {
708         std::ostringstream oss;
709         self->reprAll(oss);
710         return oss.str();
711       }
712
713       std::string __repr__() const
714       {
715         std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
716         return oss.str();
717       }
718     }
719   };
720
721   class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
722   {
723   public:
724     static MEDFileJointCorrespondence *New();
725     static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence) // nodes
726      ;
727     static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence,  // cells
728                                            INTERP_KERNEL::NormalizedCellType loc_geo_type,
729                                            INTERP_KERNEL::NormalizedCellType rem_geo_type)
730      ;
731     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
732     MEDFileJointCorrespondence *deepCopy() const;
733     MEDFileJointCorrespondence *shallowCpy() const;
734     void setIsNodal(bool isNodal);
735     bool getIsNodal() const;
736     bool isEqual(const MEDFileJointCorrespondence *other) const;
737     void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
738     INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
739     void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
740     INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
741     void setCorrespondence(DataArrayIdType *corr);
742     void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
743     std::string simpleRepr() const;
744     %extend
745     {
746       MEDFileJointCorrespondence()
747       {
748         return MEDFileJointCorrespondence::New();
749       }
750       MEDFileJointCorrespondence(DataArrayIdType* correspondence)
751       {
752         return MEDFileJointCorrespondence::New(correspondence);
753       }
754       MEDFileJointCorrespondence(DataArrayIdType* correspondence,  // cells
755                                  INTERP_KERNEL::NormalizedCellType loc_geo_type,
756                                  INTERP_KERNEL::NormalizedCellType rem_geo_type)
757       {
758         return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
759       }
760
761       std::string __str__() const
762       {
763         return self->simpleRepr();
764       }
765
766       DataArrayIdType *getCorrespondence() const
767       {
768         const DataArrayIdType *ret(self->getCorrespondence());
769         if(ret)
770           ret->incrRef();
771         return const_cast<DataArrayIdType *>(ret);
772       }
773     }
774   };
775
776   class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
777   {
778   public:
779     static MEDFileJointOneStep *New(int dt=-1, int it=-1);
780     static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
781     MEDFileJointOneStep *deepCopy() const;
782     MEDFileJointOneStep *shallowCpy() const;
783     bool isEqual(const MEDFileJointOneStep *other) const;
784     void setOrder(int order);
785     int getOrder() const;
786     void setIteration(int it);
787     int getIteration() const;
788     void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
789     void clearCorrespondences();
790     int getNumberOfCorrespondences() const;
791     void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
792     std::string simpleRepr() const;
793     %extend
794     {
795       MEDFileJointOneStep()
796       {
797         return MEDFileJointOneStep::New();
798       }
799
800       MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
801       {
802         return MEDFileJointOneStep::New(fileName,mName,jointName,number);
803       }
804
805       std::string __str__() const
806       {
807         return self->simpleRepr();
808       }
809
810       MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
811       {
812         MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
813         if(ret)
814           ret->incrRef();
815         return ret;
816       }
817
818       MEDFileJointCorrespondence *__getitem__(int i) const
819       {
820         return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
821       }
822     }
823   };
824
825   class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
826   {
827   public:
828     static MEDFileJoint *New();
829     static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
830     static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
831     MEDFileJoint *deepCopy() const;
832     MEDFileJoint *shallowCpy() const;
833     bool isEqual(const MEDFileJoint *other) const;
834     void setLocalMeshName(const std::string& name);
835     std::string getLocalMeshName() const;
836     void setRemoteMeshName(const std::string& name);
837     std::string getRemoteMeshName() const;
838     void setDescription(const std::string& name);
839     std::string getDescription() const;
840     void setJointName(const std::string& name);
841     std::string getJointName() const;
842     bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
843     void setDomainNumber(const int& number);
844     int getDomainNumber() const;
845     void pushStep(MEDFileJointOneStep* step);
846     int getNumberOfSteps() const;
847     std::string simpleRepr() const;
848     %extend
849     {
850       MEDFileJoint()
851       {
852         return MEDFileJoint::New();
853       }
854
855       MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
856       {
857         return MEDFileJoint::New(fileName,mName,num);
858       }
859
860       MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
861       {
862         return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
863       }
864
865       std::string __str__() const
866       {
867         return self->simpleRepr();
868       }
869
870       MEDFileJointOneStep *getStepAtPos(int i) const
871       {
872         MEDFileJointOneStep *ret(self->getStepAtPos(i));
873         if(ret)
874           ret->incrRef();
875         return ret;
876       }
877
878       MEDFileJointOneStep *__getitem__(int i)
879       {
880         return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
881       }
882     }
883   };
884
885   class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
886   {
887   public:
888     static MEDFileJoints *New();
889     static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
890     MEDFileJoints *deepCopy() const;
891     std::string simpleRepr() const;
892     std::string getMeshName() const;
893     int getNumberOfJoints() const;
894     std::vector<std::string> getJointsNames() const;
895     bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
896     void resize(int newSize);
897     void pushJoint(MEDFileJoint *joint);
898     void setJointAtPos(int i, MEDFileJoint *joint);
899     void destroyJointAtPos(int i);
900     %extend
901     {
902       MEDFileJoints()
903       {
904         return MEDFileJoints::New();
905       }
906
907       MEDFileJoints(const std::string& fileName, const std::string& meshName)
908       {
909         return MEDFileJoints::New(fileName,meshName);
910       }
911
912       std::string __str__() const
913       {
914         return self->simpleRepr();
915       }
916
917       MEDFileJoint *__getitem__(PyObject *obj)
918       {
919         static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
920         if(PyInt_Check(obj))
921           {
922             MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
923             if(ret)
924               ret->incrRef();
925             return ret;
926           }
927         MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
928         if(ret)
929           ret->incrRef();
930         return ret;
931       }
932
933       int __len__() const
934       {
935         return self->getNumberOfJoints();
936       }
937
938       MEDFileJoint *getJointAtPos(int i) const
939       {
940         MEDFileJoint *ret=self->getJointAtPos(i);
941         if(ret)
942           ret->incrRef();
943         return ret;
944       }
945
946       MEDFileJoint *getJointWithName(const std::string& paramName) const
947       {
948         MEDFileJoint *ret=self->getJointWithName(paramName);
949         if(ret)
950           ret->incrRef();
951         return ret;
952       }
953     }
954   };
955
956   class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
957   {
958   private:
959     MEDFileEquivalenceBase();
960   };
961
962   class MEDFileEquivalenceData : public MEDFileEquivalenceBase
963   {
964   private:
965     MEDFileEquivalenceData();
966   public:
967     void setArray(DataArrayInt32 *data);
968     %extend
969     {
970       DataArrayInt32 *getArray()
971       {
972         DataArrayInt32 *ret(self->getArray());
973         if(ret) ret->incrRef();
974         return ret;
975       }
976     }
977   };
978
979   class MEDFileEquivalenceNode : public MEDFileEquivalenceData
980   {
981   private:
982     MEDFileEquivalenceNode();
983   };
984
985   class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
986   {
987   private:
988     MEDFileEquivalenceCell();
989   public:
990     void clear();
991     std::size_t size() const;
992     void setArray(int meshDimRelToMax, DataArrayInt32 *da);
993     void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt32 *da);
994     %extend
995     {
996       DataArrayInt32 *getArray(INTERP_KERNEL::NormalizedCellType type)
997       {
998         DataArrayInt32 *ret(self->getArray(type));
999         if(ret) ret->incrRef();
1000         return ret;
1001       }
1002
1003       PyObject *getTypes() const
1004       {
1005         std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
1006         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1007         PyObject *res=PyList_New(result.size());
1008         for(int i=0;iL!=result.end(); i++, iL++)
1009           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1010         return res;
1011       }
1012     }
1013   };
1014
1015   class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
1016   {
1017   private:
1018     MEDFileEquivalencePair();
1019   public:
1020     std::string getName() const;
1021     void setName(const std::string& name);
1022     std::string getDescription() const;
1023     void setDescription(const std::string& descr);
1024     void setArray(int meshDimRelToMaxExt, DataArrayInt32 *da);;
1025     %extend
1026     {
1027       MEDFileEquivalenceCell *initCell()
1028       {
1029         MEDFileEquivalenceCell *ret(self->initCell());
1030         if(ret) ret->incrRef();
1031         return ret;
1032       }
1033
1034       MEDFileEquivalenceNode *initNode()
1035       {
1036         MEDFileEquivalenceNode *ret(self->initNode());
1037         if(ret) ret->incrRef();
1038         return ret;
1039       }
1040
1041       MEDFileEquivalenceCell *getCell()
1042       {
1043         MEDFileEquivalenceCell *ret(self->getCell());
1044         if(ret) ret->incrRef();
1045         return ret;
1046       }
1047
1048       MEDFileEquivalenceNode *getNode()
1049       {
1050         MEDFileEquivalenceNode *ret(self->getNode());
1051         if(ret) ret->incrRef();
1052         return ret;
1053       }
1054     }
1055   };
1056
1057   class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1058   {
1059   private:
1060     MEDFileEquivalences();
1061   public:
1062     int size() const;
1063     std::vector<std::string> getEquivalenceNames() const;
1064     void killEquivalenceWithName(const std::string& name);
1065     void killEquivalenceAt(int i);
1066     void clear();
1067     %extend
1068     {
1069       MEDFileEquivalencePair *getEquivalence(int i)
1070       {
1071         MEDFileEquivalencePair *ret(self->getEquivalence(i));
1072         if(ret) ret->incrRef();
1073         return ret;
1074       }
1075       MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
1076       {
1077         MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1078         if(ret) ret->incrRef();
1079         return ret;
1080       }
1081
1082       MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
1083       {
1084         MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1085         if(ret) ret->incrRef();
1086         return ret;
1087       }
1088     }
1089   };
1090
1091   class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1092   {
1093   public:
1094     static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1095     static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1096     static MEDFileMesh *New(DataArrayByte *db);
1097     virtual MEDFileMesh *createNewEmpty() const;
1098     virtual MEDFileMesh *deepCopy() const;
1099     virtual MEDFileMesh *shallowCpy() const;
1100     virtual void clearNonDiscrAttributes() const;
1101     void setName(const std::string& name);
1102     std::string getName();
1103     std::string getUnivName() const;
1104     bool getUnivNameWrStatus() const;
1105     void setUnivNameWrStatus(bool newStatus);
1106     void setDescription(const std::string& name);
1107     std::string getDescription() const;
1108     void setOrder(int order);
1109     int getOrder() const;
1110     void setIteration(int it);
1111     int getIteration();
1112     void setTimeValue(double time);
1113     void setTime(int dt, int it, double time);
1114     double getTimeValue() const;
1115     void setTimeUnit(const std::string& unit);
1116     std::string getTimeUnit() const;
1117     void setAxisType(MEDCouplingAxisType at);
1118     MEDCouplingAxisType getAxisType() const;
1119     virtual int getNumberOfNodes() const;
1120     virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
1121     virtual bool hasImplicitPart() const;
1122     virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
1123     virtual void releaseImplicitPartIfAny() const;
1124     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
1125     virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
1126     virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
1127     virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
1128     virtual std::vector<mcIdType> getDistributionOfTypes(int meshDimRelToMax) const;
1129     virtual MEDFileMesh *cartesianize() const;
1130     std::vector<int> getNonEmptyLevels() const;
1131     std::vector<int> getNonEmptyLevelsExt() const;
1132     int getSizeAtLevel(int meshDimRelToMaxExt) const;
1133     //
1134     bool existsGroup(const std::string& groupName) const;
1135     bool existsFamily(int famId) const;
1136     bool existsFamily(const std::string& familyName) const;
1137     void setFamilyId(const std::string& familyName, int id);
1138     void setFamilyIdUnique(const std::string& familyName, int id);
1139     void addFamily(const std::string& familyName, int id);
1140     void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
1141     virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
1142     virtual bool keepFamIdsOnlyOnLevs(const std::vector<mcIdType>& famIds, const std::vector<int>& levs);
1143     void copyFamGrpMapsFrom(const MEDFileMesh& other);
1144     void clearGrpMap();
1145     void clearFamMap();
1146     void clearFamGrpMaps();
1147     const std::map<std::string,int>& getFamilyInfo() const;
1148     const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
1149     std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
1150     std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
1151     std::vector<mcIdType> getFamiliesIdsOnGroup(const std::string& name) const;
1152     void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
1153     void setFamiliesIdsOnGroup(const std::string& name, const std::vector<mcIdType>& famIds);
1154     std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
1155     void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
1156     std::vector<std::string> getGroupsNames() const;
1157     std::vector<std::string> getFamiliesNames() const;
1158     std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
1159     std::vector<mcIdType> getGrpNonEmptyLevelsExt(const std::string& grp) const;
1160     std::vector<mcIdType> getGrpNonEmptyLevels(const std::string& grp) const;
1161     std::vector<mcIdType> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
1162     std::vector<mcIdType> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
1163     std::vector<mcIdType> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
1164     std::vector<mcIdType> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
1165     std::vector<mcIdType> getFamNonEmptyLevels(const std::string& fam) const;
1166     std::vector<mcIdType> getFamNonEmptyLevelsExt(const std::string& fam) const;
1167     std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
1168     static std::string GetMagicFamilyStr();
1169     void assignFamilyNameWithGroupName();
1170     std::vector<std::string> removeEmptyGroups();
1171     void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
1172     void removeGroup(const std::string& name);
1173     void removeFamily(const std::string& name);
1174     std::vector<std::string> removeOrphanGroups();
1175     std::vector<std::string> removeOrphanFamilies();
1176     void removeFamiliesReferedByNoGroups();
1177     void rearrangeFamilies();
1178     void zipFamilies();
1179     void checkOrphanFamilyZero() const;
1180     void changeGroupName(const std::string& oldName, const std::string& newName);
1181     void changeFamilyName(const std::string& oldName, const std::string& newName);
1182     void changeFamilyId(int oldId, int newId);
1183     void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
1184     void setFamilyInfo(const std::map<std::string,mcIdType>& info);
1185     void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1186     int getFamilyId(const std::string& name) const;
1187     int getMaxAbsFamilyId() const;
1188     int getMaxFamilyId() const;
1189     int getMinFamilyId() const;
1190     int getTheMaxAbsFamilyId() const;
1191     int getTheMaxFamilyId() const;
1192     int getTheMinFamilyId() const;
1193     virtual int getMaxAbsFamilyIdInArrays() const;
1194     virtual int getMaxFamilyIdInArrays() const;
1195     virtual int getMinFamilyIdInArrays() const;
1196     DataArrayIdType *getAllFamiliesIdsReferenced() const;
1197     DataArrayIdType *computeAllFamilyIdsInUse() const;
1198     std::vector<mcIdType> getFamiliesIds(const std::vector<std::string>& famNames) const;
1199     std::string getFamilyNameGivenId(int id) const;
1200     bool ensureDifferentFamIdsPerLevel();
1201     void normalizeFamIdsTrio();
1202     void normalizeFamIdsMEDFile();
1203     virtual int getMeshDimension() const;
1204     virtual std::string simpleRepr() const;
1205     virtual std::string advancedRepr() const;
1206     //
1207     virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
1208     virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayIdType *famArr);
1209     virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayIdType *renumArr);
1210     virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
1211     virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayIdType *globalNumArr);
1212     virtual void addNodeGroup(const DataArrayIdType *ids);
1213     virtual void addGroup(int meshDimRelToMaxExt, const DataArrayIdType *ids);
1214     virtual DataArrayIdType *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1215     virtual DataArrayIdType *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1216     virtual DataArrayIdType *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1217     virtual DataArrayIdType *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1218     virtual DataArrayIdType *getNodeGroupArr(const std::string& grp, bool renum=false) const;
1219     virtual DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1220     virtual DataArrayIdType *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
1221     virtual DataArrayIdType *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
1222     int getNumberOfJoints();
1223     MEDFileJoints *getJoints();
1224     void setJoints( MEDFileJoints* joints );
1225     void initializeEquivalences();
1226     void killEquivalences();
1227     bool presenceOfStructureElements() const;
1228     void killStructureElements();
1229     %extend
1230        {
1231          std::string __str__() const
1232          {
1233            return self->simpleRepr();
1234          }
1235
1236          MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
1237          {
1238            return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1239          }
1240
1241          static INTERP_KERNEL::NormalizedCellType ConvertFromMEDFileGeoType(int geoType)
1242          {
1243             med_geometry_type geoType2((med_geometry_type) geoType);
1244             return MEDFileMesh::ConvertFromMEDFileGeoType(geoType2);
1245          }
1246
1247          static int ConvertToMEDFileGeoType(INTERP_KERNEL::NormalizedCellType geoType)
1248          {
1249             return (int) MEDFileMesh::ConvertToMEDFileGeoType(geoType);
1250          }
1251
1252          PyObject *getTime()
1253          {
1254            int tmp1,tmp2;
1255            double tmp0=self->getTime(tmp1,tmp2);
1256            PyObject *res = PyList_New(3);
1257            PyList_SetItem(res,0,SWIG_From_int(tmp1));
1258            PyList_SetItem(res,1,SWIG_From_int(tmp2));
1259            PyList_SetItem(res,2,SWIG_From_double(tmp0));
1260            return res;
1261          }
1262
1263          virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
1264          {
1265            std::string what;
1266            bool ret0=self->isEqual(other,eps,what);
1267            PyObject *res=PyList_New(2);
1268            PyObject *ret0Py=ret0?Py_True:Py_False;
1269            Py_XINCREF(ret0Py);
1270            PyList_SetItem(res,0,ret0Py);
1271            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1272            return res;
1273          }
1274
1275          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
1276          {
1277            std::vector<const DataArrayIdType *> grps;
1278            convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grps);
1279            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1280          }
1281
1282          void addGroupsAtLevel(int meshDimRelToMaxExt, PyObject *grps)
1283          {
1284            std::vector<const DataArrayIdType *> grpsCpp;
1285            convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(grps,SWIGTITraits<mcIdType>::TI,"DataArrayInt",grpsCpp);
1286            self->addGroupsAtLevel(meshDimRelToMaxExt,grpsCpp);
1287          }
1288
1289          PyObject *areFamsEqual(const MEDFileMesh *other) const
1290          {
1291            std::string what;
1292            bool ret0=self->areFamsEqual(other,what);
1293            PyObject *res=PyList_New(2);
1294            PyObject *ret0Py=ret0?Py_True:Py_False;
1295            Py_XINCREF(ret0Py);
1296            PyList_SetItem(res,0,ret0Py);
1297            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1298            return res;
1299          }
1300
1301          PyObject *areGrpsEqual(const MEDFileMesh *other) const
1302          {
1303            std::string what;
1304            bool ret0=self->areGrpsEqual(other,what);
1305            PyObject *res=PyList_New(2);
1306            PyObject *ret0Py=ret0?Py_True:Py_False;
1307            Py_XINCREF(ret0Py);
1308            PyList_SetItem(res,0,ret0Py);
1309            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1310            return res;
1311          }
1312
1313          PyObject *getAllGeoTypes() const
1314          {
1315            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1316            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1317            PyObject *res=PyList_New(result.size());
1318            for(int i=0;iL!=result.end(); i++, iL++)
1319              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1320            return res;
1321          }
1322
1323          PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
1324          {
1325            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1326            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1327            PyObject *res=PyList_New(result.size());
1328            for(int i=0;iL!=result.end(); i++, iL++)
1329              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1330            return res;
1331          }
1332
1333          PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
1334          {
1335            const DataArrayIdType *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1336            if(tmp)
1337              tmp->incrRef();
1338            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1339          }
1340
1341          PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
1342          {
1343            const DataArrayIdType *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1344            if(tmp)
1345              tmp->incrRef();
1346            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1347          }
1348
1349          PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
1350          {
1351            const DataArrayIdType *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1352            if(tmp)
1353              tmp->incrRef();
1354            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1355          }
1356
1357          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
1358          {
1359            const DataArrayIdType *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1360            if(tmp)
1361              tmp->incrRef();
1362            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1363          }
1364
1365          PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
1366          {
1367            const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1368            if(tmp)
1369              tmp->incrRef();
1370            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1371          }
1372
1373          PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
1374          {
1375            bool ret1;
1376            std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1377            PyObject *ret=PyTuple_New(2);
1378            PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1379            PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1380            return ret;
1381          }
1382
1383          PyObject *unPolyze()
1384          {
1385            DataArrayIdType *ret3=0;
1386            std::vector<mcIdType> ret1,ret2;
1387            bool ret0=self->unPolyze(ret1,ret2,ret3);
1388            PyObject *ret=PyTuple_New(4);
1389            PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1390            //
1391            PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1392            for(int j=0;j<(int)ret1.size()/3;j++)
1393              {
1394                PyObject *retLev2=PyList_New(3);
1395                PyList_SetItem(retLev2,0,PyInt_FromLong(ret1[3*j]));
1396                PyList_SetItem(retLev2,1,PyInt_FromLong(ret1[3*j+1]));
1397                PyList_SetItem(retLev2,2,PyInt_FromLong(ret1[3*j+2]));
1398                PyList_SetItem(retLev1_0,j,retLev2);
1399              }
1400            PyTuple_SetItem(ret,1,retLev1_0);
1401            //
1402            PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1403            for(int j=0;j<(int)ret2.size()/3;j++)
1404              {
1405                PyObject *retLev2=PyList_New(3);
1406                PyList_SetItem(retLev2,0,PyInt_FromLong(ret2[3*j]));
1407                PyList_SetItem(retLev2,1,PyInt_FromLong(ret2[3*j+1]));
1408                PyList_SetItem(retLev2,2,PyInt_FromLong(ret2[3*j+2]));
1409                PyList_SetItem(retLev1_1,j,retLev2);
1410              }
1411            PyTuple_SetItem(ret,2,retLev1_1);
1412            //
1413            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1414            return ret;
1415          }
1416
1417          MEDFileEquivalences *getEquivalences()
1418          {
1419            MEDFileEquivalences *ret(self->getEquivalences());
1420            if(ret) ret->incrRef();
1421            return ret;
1422          }
1423
1424          virtual DataArrayIdType *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
1425          {
1426            MCAuto<DataArrayIdType> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1427            return ret.retn();
1428          }
1429        }
1430   };
1431
1432   class MEDFileUMesh : public MEDFileMesh
1433   {
1434   public:
1435     static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1436     static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1437     static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
1438     static MEDFileUMesh *New(DataArrayByte *db);
1439     static MEDFileUMesh *New();
1440     static const char *GetSpeStr4ExtMesh();
1441     ~MEDFileUMesh();
1442     int getSpaceDimension() const;
1443     int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1444     void checkConsistency() const;
1445     void checkSMESHConsistency() const;
1446     void clearNodeAndCellNumbers();
1447     //
1448     MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
1449     MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
1450     MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
1451     MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
1452     DataArrayIdType *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
1453     MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
1454     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
1455     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
1456     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
1457     void declarePartsUpdated() const;
1458     void forceComputationOfParts() const;
1459     void computeRevNum() const;
1460     //
1461     void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
1462     void setCoords(DataArrayDouble *coords);
1463     void setCoordsForced(DataArrayDouble *coords);
1464     void eraseGroupsAtLevel(int meshDimRelToMaxExt);
1465     void removeMeshAtLevel(int meshDimRelToMax);
1466     void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
1467     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
1468     void optimizeFamilies();
1469     DataArrayIdType *computeFetchedNodeIds() const;
1470     DataArrayIdType *zipCoords();
1471     DataArrayIdType *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1472     DataArrayIdType *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
1473     MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
1474     MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
1475     MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
1476     MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
1477     %extend
1478        {
1479          MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1480          {
1481            return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1482          }
1483
1484          MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1485          {
1486            return MEDFileUMesh::New(fileName,mrs);
1487          }
1488
1489          MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
1490          {
1491            return MEDFileUMesh::New(mem);
1492          }
1493
1494          MEDFileUMesh(DataArrayByte *db)
1495          {
1496            return MEDFileUMesh::New(db);
1497          }
1498
1499          MEDFileUMesh()
1500          {
1501            return MEDFileUMesh::New();
1502          }
1503          
1504          static MEDFileUMesh *LoadConnectivityOnlyPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1505          {
1506            std::vector<int> typesCpp1;
1507            convertPyToNewIntArr3(types,typesCpp1);
1508            std::size_t sz(typesCpp1.size());
1509            std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1510            for(std::size_t ii=0;ii<sz;ii++)
1511              typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1512            return MEDFileUMesh::LoadConnectivityOnlyPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs).retn();
1513          }
1514
1515          static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<mcIdType>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1516          {
1517            std::vector<int> typesCpp1;
1518            convertPyToNewIntArr3(types,typesCpp1);
1519            std::size_t sz(typesCpp1.size());
1520            std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1521            for(std::size_t ii=0;ii<sz;ii++)
1522              typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1523            return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1524          }
1525
1526          static PyObject *LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector<std::string>& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId)
1527          {
1528            MCAuto<DataArrayDouble> coords;
1529            MCAuto<PartDefinition> partCoords;
1530            MCAuto<DataArrayIdType> famCoords,numCoords;
1531            MCAuto<DataArrayAsciiChar> nameCoord;
1532            MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord);
1533            PyObject *ret(PyTuple_New(5));
1534            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1535            PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));
1536            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(famCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1537            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(numCoords.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1538            PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(nameCoord.retn()),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 ));
1539            return ret;
1540          }
1541
1542          PyObject *__getstate__()
1543          {
1544            std::vector<double> a0;
1545            std::vector<mcIdType> a1;
1546            std::vector<std::string> a2;
1547            std::vector< MCAuto<DataArrayIdType> > a3;
1548            MCAuto<DataArrayDouble> a4;
1549            self->serialize(a0,a1,a2,a3,a4);
1550            PyObject *ret(PyTuple_New(5));
1551            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1552            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1553            std::size_t sz(a2.size());
1554            PyObject *ret2(PyList_New(sz));
1555            for(std::size_t i=0;i<sz;i++)
1556              PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1557            PyTuple_SetItem(ret,2,ret2);
1558            sz=a3.size();
1559            PyObject *ret3(PyList_New(sz));
1560            for(std::size_t i=0;i<sz;i++)
1561              {
1562                DataArrayIdType *elt(a3[i]);
1563                if(elt)
1564                  elt->incrRef();
1565                PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1566              }
1567            PyTuple_SetItem(ret,3,ret3);
1568            DataArrayDouble *ret4(a4);
1569            if(ret4)
1570              ret4->incrRef();
1571            PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1572            return ret;
1573          }
1574
1575          void __setstate__(PyObject *inp)
1576          {
1577            static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1578            if(!PyTuple_Check(inp))
1579              throw INTERP_KERNEL::Exception(MSG);
1580            std::size_t sz(PyTuple_Size(inp));
1581            if(sz!=5)
1582              throw INTERP_KERNEL::Exception(MSG);
1583            std::vector<double> a0;
1584            std::vector<mcIdType> a1;
1585            std::vector<std::string> a2;
1586            std::vector< MCAuto<DataArrayIdType> > a3;
1587            MCAuto<DataArrayDouble> a4;
1588            //
1589            PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1590            mcIdType tmp(-1);
1591            fillArrayWithPyListDbl3(a0py,tmp,a0);
1592            convertPyToNewIntArr3(a1py,a1);
1593            fillStringVector(a2py,a2);
1594            //
1595            PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1596            void *argp(0);
1597            int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1598            if(!SWIG_IsOK(status))
1599              throw INTERP_KERNEL::Exception(MSG);
1600            a4=reinterpret_cast<DataArrayDouble *>(argp);
1601            if((DataArrayDouble *)a4)
1602              a4->incrRef();
1603            {
1604              std::vector< DataArrayIdType * > a3Tmp;
1605              convertFromPyObjVectorOfObj<MEDCoupling::DataArrayIdType *>(b0py,SWIGTITraits<mcIdType>::TI,"DataArrayInt",a3Tmp);
1606              std::size_t sz(a3Tmp.size());
1607              a3.resize(sz);
1608              for(std::size_t i=0;i<sz;i++)
1609                {
1610                  a3[i]=a3Tmp[i];
1611                  if(a3Tmp[i])
1612                    a3Tmp[i]->incrRef();
1613                }
1614              self->unserialize(a0,a1,a2,a3,a4);
1615            }
1616          }
1617
1618          void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh)
1619          {
1620            if(!mesh)
1621              throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1622            MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1623            if(m0)
1624              {
1625                self->setMeshAtLevel(meshDimRelToMax,m0,false);
1626                return ;
1627              }
1628            MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1629            if(m1)
1630              {
1631                self->setMeshAtLevel(meshDimRelToMax,m1);
1632                return ;
1633              }
1634            throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1635          }
1636
1637          void __delitem__(int meshDimRelToMax)
1638          {
1639            self->removeMeshAtLevel(meshDimRelToMax);
1640          }
1641
1642          MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const
1643          {
1644            const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1645            double val,val2;
1646            DataArrayDouble *a,*a2;
1647            DataArrayDoubleTuple *aa,*aa2;
1648            std::vector<double> bb,bb2;
1649            mcIdType sw;
1650            const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1651            const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1652            MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1653            return ret.retn();
1654          }
1655
1656          static MEDFileUMesh *Aggregate(PyObject *meshes)
1657          {
1658            std::vector<const MEDFileUMesh *> meshesCpp;
1659            convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1660            MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1661            return ret.retn();
1662          }
1663
1664          PyObject *getAllDistributionOfTypes() const
1665          {
1666            std::vector< std::pair<int,mcIdType> > ret(self->getAllDistributionOfTypes());
1667            return convertVecPairIntToPy(ret);
1668          }
1669
1670          DataArrayIdType *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const
1671          {
1672            std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1673            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1674            return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1675          }
1676
1677          MEDFileUMesh *extractPart(PyObject *extractDef) const
1678          {
1679            std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
1680            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1681            return self->extractPart(extractDefCpp);
1682          }
1683
1684          void setMeshes(PyObject *li, bool renum=false)
1685          {
1686            std::vector<const MEDCouplingUMesh *> ms;
1687            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1688            self->setMeshes(ms,renum);
1689          }
1690
1691          void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false)
1692          {
1693            std::vector<const MEDCouplingUMesh *> ms;
1694            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1695            self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1696          }
1697
1698          void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false)
1699          {
1700            std::vector<const MEDCouplingUMesh *> ms;
1701            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1702            self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1703          }
1704
1705          DataArrayDouble *getCoords() const
1706          {
1707            DataArrayDouble *ret=self->getCoords();
1708            if(ret)
1709              ret->incrRef();
1710            return ret;
1711          }
1712
1713          PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const
1714          {
1715            const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1716            if(ret)
1717              ret->incrRef();
1718            return const_cast<PartDefinition *>(ret);
1719          }
1720
1721          PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1)
1722          {
1723            DataArrayIdType *ret0=0,*ret1=0,*ret2=0;
1724            self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1725            PyObject *ret=PyTuple_New(3);
1726            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1727            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1728            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1729            return ret;
1730          }
1731
1732          PyObject * crackAlong(const std::string& grpNameM1, bool grpMustBeFullyDup=true)
1733          {
1734            const std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>> cellOld2NewNode = self->crackAlong(grpNameM1, grpMustBeFullyDup);
1735            PyObject * cellOld2NewNodePy = PyDict_New();
1736            for (const auto & cellIt: cellOld2NewNode) {
1737                PyObject * old2NewPy = PyDict_New();
1738                for (const auto & keyVal: cellIt.second) {
1739                    PyDict_SetItem(old2NewPy, PyInt_FromLong(keyVal.first), PyInt_FromLong(keyVal.second));
1740                }
1741                PyDict_SetItem(cellOld2NewNodePy, PyInt_FromLong(cellIt.first), old2NewPy);
1742            }
1743            return cellOld2NewNodePy;
1744          }
1745
1746          // void OpenCrack(const std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>>& c2o2nN, double factor=0.9)
1747          // {
1748          //   self->OpenCrack(c2o2nN, factor);
1749          // }
1750
1751          void openCrack(PyObject* c2o2nNPy, double factor=0.9)
1752          {
1753              if (!PyDict_Check(c2o2nNPy))
1754                  throw INTERP_KERNEL::Exception("c2o2nNPy is not a python dict");
1755
1756              std::unordered_map<mcIdType, std::unordered_map<mcIdType, mcIdType>> c2o2nN;
1757              Py_ssize_t i_cells = 0;
1758              PyObject *cell, *val;
1759
1760              while (PyDict_Next(c2o2nNPy, &i_cells, &cell, &val)) {
1761                  if (!PyInt_Check(cell))
1762                      throw INTERP_KERNEL::Exception("One of c2o2nNPy cell id is not an int.");
1763
1764                  if (!PyDict_Check(val))
1765                      throw INTERP_KERNEL::Exception("One of c2o2nNPy val is not a python dict");
1766                  std::unordered_map<mcIdType, mcIdType> o2nN {};
1767                  Py_ssize_t i_node = 0;
1768                  PyObject *oldN, *newN;
1769
1770                  while (PyDict_Next(val, &i_node, &oldN, &newN)) {
1771                      if (!PyInt_Check(oldN))
1772                          throw INTERP_KERNEL::Exception(
1773                              "One of c2o2nNPy old node id is not an int.");
1774                      if (!PyInt_Check(newN))
1775                          throw INTERP_KERNEL::Exception(
1776                              "One of c2o2nNPy new node id is not an int.");
1777                      o2nN[PyInt_AsLong(oldN)] = PyInt_AsLong(newN);
1778                  }
1779
1780                  c2o2nN[PyInt_AsLong(cell)] = o2nN;
1781              }
1782
1783              self->openCrack(c2o2nN, factor);
1784          }
1785
1786          MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1787          {
1788            MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1789            if(ret)
1790              ret->incrRef();
1791            return ret;
1792          }
1793
1794          PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1795          {
1796            std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1797            std::size_t sz(tmp.size());
1798            PyObject *ret=PyList_New(sz);
1799            for(std::size_t i=0;i<sz;i++)
1800              {
1801                if(tmp[i])
1802                  tmp[i]->incrRef();
1803                PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1804              }
1805            return ret;
1806          }
1807        }
1808   };
1809
1810   class MEDFileStructuredMesh : public MEDFileMesh
1811   {
1812   public:
1813     %extend
1814     {
1815       MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1816       {
1817         MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1818         if(ret)
1819           ret->incrRef();
1820         return ret;
1821       }
1822     }
1823   };
1824
1825   class MEDFileCMesh : public MEDFileStructuredMesh
1826   {
1827   public:
1828     static MEDFileCMesh *New();
1829     static MEDFileCMesh *New(DataArrayByte *db);
1830     static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1831     static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1832     void setMesh(MEDCouplingCMesh *m);
1833     int getSpaceDimension() const;
1834     %extend
1835        {
1836          MEDFileCMesh()
1837          {
1838            return MEDFileCMesh::New();
1839          }
1840
1841          MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1842          {
1843            return MEDFileCMesh::New(fileName,mrs);
1844          }
1845
1846          MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1847          {
1848            return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1849          }
1850
1851          MEDFileCMesh(DataArrayByte *db)
1852          {
1853            return MEDFileCMesh::New(db);
1854          }
1855
1856          PyObject *getMesh() const
1857          {
1858            const MEDCouplingCMesh *tmp=self->getMesh();
1859            if(tmp)
1860              tmp->incrRef();
1861            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1862          }
1863        }
1864   };
1865
1866   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1867   {
1868   public:
1869     static MEDFileCurveLinearMesh *New();
1870     static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1871     static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1872     static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1873     void setMesh(MEDCouplingCurveLinearMesh *m);
1874     int getSpaceDimension() const;
1875     int getMeshDimension() const;
1876     %extend
1877        {
1878          MEDFileCurveLinearMesh()
1879          {
1880            return MEDFileCurveLinearMesh::New();
1881          }
1882
1883          MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1884          {
1885            return MEDFileCurveLinearMesh::New(fileName,mrs);
1886          }
1887
1888          MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1889          {
1890            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1891          }
1892
1893          MEDFileCurveLinearMesh(DataArrayByte *db)
1894          {
1895            return MEDFileCurveLinearMesh::New(db);
1896          }
1897
1898          PyObject *getMesh() const
1899          {
1900            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1901            if(tmp)
1902              tmp->incrRef();
1903            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1904          }
1905        }
1906   };
1907
1908   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1909   {
1910   public:
1911     static MEDFileMeshMultiTS *New();
1912     static MEDFileMeshMultiTS *New(const std::string& fileName);
1913     static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1914     MEDFileMeshMultiTS *deepCopy() const;
1915     std::string getName() const;
1916     void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1917     void cartesianizeMe();
1918     %extend
1919        {
1920          MEDFileMeshMultiTS()
1921          {
1922            return MEDFileMeshMultiTS::New();
1923          }
1924
1925          MEDFileMeshMultiTS(const std::string& fileName)
1926          {
1927            return MEDFileMeshMultiTS::New(fileName);
1928          }
1929
1930          MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1931          {
1932            return MEDFileMeshMultiTS::New(fileName,mName);
1933          }
1934
1935          MEDFileMesh *getOneTimeStep() const
1936            {
1937              MEDFileMesh *ret=self->getOneTimeStep();
1938              if(ret)
1939                ret->incrRef();
1940              return ret;
1941            }
1942        }
1943   };
1944
1945   class MEDFileMeshesIterator
1946   {
1947   public:
1948     %extend
1949     {
1950       PyObject *next()
1951       {
1952         MEDFileMesh *ret=self->nextt();
1953         if(ret)
1954           {
1955             ret->incrRef();
1956             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1957           }
1958         else
1959           {
1960             PyErr_SetString(PyExc_StopIteration,"No more data.");
1961             return 0;
1962           }
1963       }
1964     }
1965   };
1966
1967   class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1968   {
1969   public:
1970     static MEDFileMeshes *New();
1971     static MEDFileMeshes *New(DataArrayByte *db);
1972     MEDFileMeshes *deepCopy() const;
1973     int getNumberOfMeshes() const;
1974     std::vector<std::string> getMeshesNames() const;
1975     //
1976     void resize(int newSize);
1977     void pushMesh(MEDFileMesh *mesh);
1978     void setMeshAtPos(int i, MEDFileMesh *mesh);
1979     void destroyMeshAtPos(int i);
1980     void cartesianizeMe();
1981     bool presenceOfStructureElements() const;
1982     void killStructureElements();
1983     %extend
1984        {
1985          MEDFileMeshes()
1986          {
1987            return MEDFileMeshes::New();
1988          }
1989
1990          MEDFileMeshes(const std::string& fileName)
1991          {
1992            return MEDFileMeshes::New(fileName);
1993          }
1994
1995          MEDFileMeshes(DataArrayByte *db)
1996          {
1997            return MEDFileMeshes::New(db);
1998          }
1999
2000          std::string __str__() const
2001            {
2002              return self->simpleRepr();
2003            }
2004
2005          MEDFileMesh *__getitem__(PyObject *obj)
2006          {
2007            static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
2008              if(PyInt_Check(obj))
2009              {
2010                MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
2011                if(ret)
2012                  ret->incrRef();
2013                return ret;
2014              }
2015            MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
2016            if(ret)
2017              ret->incrRef();
2018            return ret;
2019          }
2020
2021          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
2022          {
2023            self->setMeshAtPos(obj,mesh);
2024            return self;
2025          }
2026
2027          MEDFileMeshesIterator *__iter__()
2028          {
2029            return self->iterator();
2030          }
2031
2032          int __len__() const
2033          {
2034            return self->getNumberOfMeshes();
2035          }
2036
2037          MEDFileMesh *getMeshAtPos(int i) const
2038            {
2039              MEDFileMesh *ret=self->getMeshAtPos(i);
2040              if(ret)
2041                ret->incrRef();
2042              return ret;
2043            }
2044          MEDFileMesh *getMeshWithName(const std::string& mname) const
2045            {
2046              MEDFileMesh *ret=self->getMeshWithName(mname);
2047              if(ret)
2048                ret->incrRef();
2049              return ret;
2050            }
2051        }
2052   };
2053
2054   class MEDFileFieldLoc : public RefCountObject
2055   {
2056   public:
2057     std::string getName() const;
2058     int getDimension() const;
2059     int getNumberOfGaussPoints() const;
2060     int getNumberOfPointsInCells() const;
2061     const std::vector<double>& getRefCoords() const;
2062     const std::vector<double>& getGaussCoords() const;
2063     const std::vector<double>& getGaussWeights() const;
2064     bool isEqual(const MEDFileFieldLoc& other, double eps) const;
2065   %extend
2066     {
2067       std::string __str__() const
2068       {
2069         return self->repr();
2070       }
2071     }
2072   };
2073
2074   class MEDFileFieldGlobsReal
2075   {
2076   public:
2077     void resetContent();
2078     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
2079     void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2080     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2081     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2082     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2083     void checkGlobsCoherency() const;
2084     void checkGlobsPflsPartCoherency() const;
2085     void checkGlobsLocsPartCoherency() const;
2086     std::vector<std::string> getPfls() const;
2087     std::vector<std::string> getLocs() const;
2088     bool existsPfl(const std::string& pflName) const;
2089     bool existsLoc(const std::string& locName) const;
2090     std::string createNewNameOfPfl() const;
2091     std::string createNewNameOfLoc() const;
2092     std::vector< std::vector<int> > whichAreEqualProfiles() const;
2093     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2094     virtual std::vector<std::string> getPflsReallyUsed() const;
2095     virtual std::vector<std::string> getLocsReallyUsed() const;
2096     virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2097     virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2098     void killProfileIds(const std::vector<int>& pflIds);
2099     void killLocalizationIds(const std::vector<int>& locIds);
2100     void changePflName(const std::string& oldName, const std::string& newName);
2101     void changeLocName(const std::string& oldName, const std::string& newName);
2102     int getNbOfGaussPtPerCell(int locId) const;
2103     int getLocalizationId(const std::string& loc) const;
2104     int getProfileId(const std::string& pfl) const;
2105     void killStructureElementsInGlobs();
2106   %extend
2107      {
2108        PyObject *getProfile(const std::string& pflName) const
2109        {
2110          const DataArrayIdType *ret=self->getProfile(pflName);
2111          if(ret)
2112            ret->incrRef();
2113          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2114        }
2115
2116        PyObject *getProfileFromId(int pflId) const
2117        {
2118          const DataArrayIdType *ret=self->getProfileFromId(pflId);
2119          if(ret)
2120            ret->incrRef();
2121          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2122        }
2123
2124        PyObject *getLocalizationFromId(int locId) const
2125        {
2126          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2127          if(loc)
2128            loc->incrRef();
2129          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2130        }
2131
2132        PyObject *getLocalization(const std::string& locName) const
2133        {
2134          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2135          if(loc)
2136            loc->incrRef();
2137          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2138        }
2139
2140        PyObject *zipPflsNames()
2141        {
2142          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2143          return convertVecPairVecStToPy(ret);
2144        }
2145
2146        PyObject *zipLocsNames(double eps)
2147        {
2148          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2149          return convertVecPairVecStToPy(ret);
2150        }
2151
2152        void changePflsNames(PyObject *li)
2153        {
2154          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2155          self->changePflsNames(v);
2156        }
2157
2158        void changePflsRefsNamesGen(PyObject *li)
2159        {
2160          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2161          self->changePflsRefsNamesGen(v);
2162        }
2163
2164        void changePflsNamesInStruct(PyObject *li)
2165        {
2166          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2167          self->changePflsNamesInStruct(v);
2168        }
2169
2170        void changeLocsNames(PyObject *li)
2171        {
2172          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2173          self->changeLocsNames(v);
2174        }
2175
2176        void changeLocsRefsNamesGen(PyObject *li)
2177        {
2178          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2179          self->changeLocsRefsNamesGen(v);
2180        }
2181
2182        void changeLocsNamesInStruct(PyObject *li)
2183        {
2184          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2185          self->changeLocsNamesInStruct(v);
2186        }
2187
2188        std::string simpleReprGlobs() const
2189        {
2190          std::ostringstream oss;
2191          self->simpleReprGlobs(oss);
2192          return oss.str();
2193        }
2194      }
2195   };
2196
2197   class MEDFileEntities
2198   {
2199   public:
2200     %extend
2201       {
2202         static MEDFileEntities *BuildFrom(PyObject *entities)
2203         {
2204           std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2205           std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2206           {
2207             std::size_t sz(inp0.size());
2208             inp.resize(sz);
2209             for(std::size_t i=0;i<sz;i++)
2210               inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2211           }
2212           return MEDFileEntities::BuildFrom(&inp);
2213         }
2214       }
2215   private:
2216     MEDFileEntities();
2217   };
2218
2219   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2220   {
2221   public:
2222     static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2223     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2224     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2225     static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2226     void loadArrays();
2227     void loadArraysIfNecessary();
2228     void unloadArrays();
2229     void unloadArraysWithoutDataLoss();
2230     int getDimension() const;
2231     int getIteration() const;
2232     int getOrder() const;
2233     std::string getName();
2234     void setName(const std::string& name);
2235     std::string getMeshName();
2236     void setMeshName(const std::string& newMeshName);
2237     int getMeshIteration() const;
2238     int getMeshOrder() const;
2239     int getNumberOfComponents() const;
2240     bool isDealingTS(int iteration, int order) const;
2241     void setInfo(const std::vector<std::string>& infos);
2242     const std::vector<std::string>& getInfo() const;
2243     bool presenceOfMultiDiscPerGeoType() const;
2244     void setTime(int iteration, int order, double val);
2245     virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2246     MEDFileAnyTypeField1TS *deepCopy() const;
2247     std::string getDtUnit() const;
2248     void setDtUnit(const std::string& dtUnit);
2249     %extend
2250     {
2251       PyObject *getTime()
2252       {
2253         int tmp1,tmp2;
2254         double tmp0=self->getTime(tmp1,tmp2);
2255         PyObject *res = PyList_New(3);
2256         PyList_SetItem(res,0,SWIG_From_int(tmp1));
2257         PyList_SetItem(res,1,SWIG_From_int(tmp2));
2258         PyList_SetItem(res,2,SWIG_From_double(tmp0));
2259         return res;
2260       }
2261
2262       PyObject *getDtIt() const
2263       {
2264         std::pair<int,int> res=self->getDtIt();
2265         PyObject *elt=PyTuple_New(2);
2266         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2267         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2268         return elt;
2269       }
2270
2271       MEDFileAnyTypeField1TS *buildNewEmpty() const
2272       {
2273         MCAuto<MEDFileAnyTypeField1TS> ret = self->buildNewEmpty();
2274         return ret.retn();
2275       }
2276
2277       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2278       {
2279         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2280       }
2281
2282       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2283       {
2284         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2285       }
2286
2287       bool changeMeshNames(PyObject *li)
2288       {
2289         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2290         return self->changeMeshNames(modifTab);
2291       }
2292
2293       PyObject *getTypesOfFieldAvailable() const
2294       {
2295         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2296         PyObject *ret2=PyList_New(ret.size());
2297         for(int i=0;i<(int)ret.size();i++)
2298           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2299         return ret2;
2300       }
2301
2302       PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2303       {
2304         std::vector<int> ret1;
2305         int ret0=self->getNonEmptyLevels(mname,ret1);
2306         PyObject *elt=PyTuple_New(2);
2307         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2308         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2309         return elt;
2310       }
2311
2312       PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2313       {
2314         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2315         std::vector< std::vector<TypeOfField> > typesF;
2316         std::vector< std::vector<std::string> > pfls;
2317         std::vector< std::vector<std::string> > locs;
2318         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2319         std::size_t sz=ret.size();
2320         PyObject *ret2=PyList_New(sz);
2321            for(std::size_t i=0;i<sz;i++)
2322              {
2323                const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2324                const std::vector<TypeOfField>& typesFI=typesF[i];
2325                const std::vector<std::string>& pflsI=pfls[i];
2326                const std::vector<std::string>& locsI=locs[i];
2327                PyObject *elt=PyTuple_New(2);
2328                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2329                std::size_t sz2=ret[i].size();
2330                PyObject *elt2=PyList_New(sz2);
2331                for(std::size_t j=0;j<sz2;j++)
2332                  {
2333                    PyObject *elt3=PyTuple_New(4);
2334                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2335                    PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2336                    PyTuple_SetItem(elt3,1,elt4);
2337                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2338                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2339                    PyList_SetItem(elt2,j,elt3);
2340                  }
2341                PyTuple_SetItem(elt,1,elt2);
2342                PyList_SetItem(ret2,i,elt);
2343              }
2344            return ret2;
2345       }
2346
2347       PyObject *splitComponents() const
2348       {
2349         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2350         std::size_t sz=ret.size();
2351         PyObject *retPy=PyList_New(sz);
2352         for(std::size_t i=0;i<sz;i++)
2353           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2354         return retPy;
2355       }
2356
2357       PyObject *splitDiscretizations() const
2358       {
2359         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2360         std::size_t sz=ret.size();
2361         PyObject *retPy=PyList_New(sz);
2362         for(std::size_t i=0;i<sz;i++)
2363           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2364         return retPy;
2365       }
2366
2367       PyObject *splitMultiDiscrPerGeoTypes() const
2368       {
2369         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2370         std::size_t sz=ret.size();
2371         PyObject *retPy=PyList_New(sz);
2372         for(std::size_t i=0;i<sz;i++)
2373           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2374         return retPy;
2375       }
2376
2377       MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2378       {
2379         std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2380         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2381         return self->extractPart(extractDefCpp,mm);
2382       }
2383     }
2384   };
2385
2386   class MEDFileField1TS : public MEDFileAnyTypeField1TS
2387   {
2388   public:
2389     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2390     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2391     static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2392     static MEDFileField1TS *New(DataArrayByte *db);
2393     static MEDFileField1TS *New();
2394     MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2395     MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2396     void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2397     MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2398     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2399     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2400     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2401     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2402     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2403     //
2404     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2405     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2406     void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2407     void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2408     void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2409     %extend
2410        {
2411          MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2412          {
2413            return MEDFileField1TS::New(fileName,loadAll);
2414          }
2415
2416          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2417          {
2418            return MEDFileField1TS::New(fileName,fieldName,loadAll);
2419          }
2420
2421          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2422          {
2423            return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2424          }
2425
2426          MEDFileField1TS(DataArrayByte *db)
2427          {
2428            return MEDFileField1TS::New(db);
2429          }
2430
2431          MEDFileField1TS()
2432          {
2433            return MEDFileField1TS::New();
2434          }
2435
2436          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2437          {
2438            const DataArrayDouble *arr=0;
2439            if(field)
2440              arr=field->getArray();
2441            self->copyTinyInfoFrom(field,arr);
2442          }
2443
2444          std::string __str__() const
2445          {
2446            return self->simpleRepr();
2447          }
2448
2449          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2450          {
2451            return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2452          }
2453
2454          PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2455          {
2456            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2457            std::vector< std::vector<TypeOfField> > typesF;
2458            std::vector< std::vector<std::string> > pfls;
2459            std::vector< std::vector<std::string> > locs;
2460            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2461            std::size_t sz=ret.size();
2462            PyObject *ret2=PyList_New(sz);
2463            for(std::size_t i=0;i<sz;i++)
2464              {
2465                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2466                const std::vector<TypeOfField>& typesFI=typesF[i];
2467                const std::vector<std::string>& pflsI=pfls[i];
2468                const std::vector<std::string>& locsI=locs[i];
2469                PyObject *elt=PyTuple_New(2);
2470                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2471                std::size_t sz2=ret[i].size();
2472                PyObject *elt2=PyList_New(sz2);
2473                for(std::size_t j=0;j<sz2;j++)
2474                  {
2475                    PyObject *elt3=PyTuple_New(4);
2476                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2477                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2478                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2479                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2480                    PyList_SetItem(elt2,j,elt3);
2481                  }
2482                PyTuple_SetItem(elt,1,elt2);
2483                PyList_SetItem(ret2,i,elt);
2484              }
2485            return ret2;
2486          }
2487
2488          DataArrayDouble *getUndergroundDataArray() const
2489          {
2490            DataArrayDouble *ret=self->getUndergroundDataArray();
2491            if(ret)
2492              ret->incrRef();
2493            return ret;
2494          }
2495
2496          PyObject *getUndergroundDataArrayExt() const
2497          {
2498            return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2499          }
2500        }
2501   };
2502
2503   class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2504   {
2505   public:
2506     static MEDFileInt32Field1TS *New();
2507     static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2508     static MEDFileInt32Field1TS *New(DataArrayByte *db);
2509     static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2510     static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2511     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2512     //
2513     void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2514     void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2515     void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2516     void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2517     MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2518     MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2519     MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2520     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2521     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2522     MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2523     %extend
2524     {
2525       MEDFileInt32Field1TS()
2526       {
2527         return MEDFileInt32Field1TS::New();
2528       }
2529
2530       MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2531       {
2532         return MEDFileInt32Field1TS::New(fileName,loadAll);
2533       }
2534
2535       MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2536       {
2537         return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2538       }
2539
2540       MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2541       {
2542         return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2543       }
2544
2545       MEDFileInt32Field1TS(DataArrayByte *db)
2546       {
2547         return MEDFileInt32Field1TS::New(db);
2548       }
2549
2550       std::string __str__() const
2551       {
2552         return self->simpleRepr();
2553       }
2554
2555       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2556       {
2557          return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2558       }
2559
2560       DataArrayInt32 *getUndergroundDataArray() const
2561       {
2562         DataArrayInt32 *ret=self->getUndergroundDataArray();
2563         if(ret)
2564           ret->incrRef();
2565         return ret;
2566       }
2567
2568       PyObject *getUndergroundDataArrayExt() const
2569       {
2570         return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2571       }
2572     }
2573   };
2574
2575   class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2576   {
2577   public:
2578     static MEDFileInt64Field1TS *New();
2579     static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2580     static MEDFileInt64Field1TS *New(DataArrayByte *db);
2581     static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2582     static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2583     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2584     //
2585     void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2586     void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2587     void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2588     void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2589     MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2590     MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2591     MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2592     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2593     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2594     MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2595     %extend
2596     {
2597       MEDFileInt64Field1TS()
2598       {
2599         return MEDFileInt64Field1TS::New();
2600       }
2601
2602       MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2603       {
2604         return MEDFileInt64Field1TS::New(fileName,loadAll);
2605       }
2606
2607       MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2608       {
2609         return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2610       }
2611
2612       MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2613       {
2614         return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2615       }
2616
2617       MEDFileInt64Field1TS(DataArrayByte *db)
2618       {
2619         return MEDFileInt64Field1TS::New(db);
2620       }
2621
2622       std::string __str__() const
2623       {
2624         return self->simpleRepr();
2625       }
2626
2627       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2628       {
2629          return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2630       }
2631
2632       DataArrayInt64 *getUndergroundDataArray() const
2633       {
2634         DataArrayInt64 *ret=self->getUndergroundDataArray();
2635         if(ret)
2636           ret->incrRef();
2637         return ret;
2638       }
2639
2640       PyObject *getUndergroundDataArrayExt() const
2641       {
2642         return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2643       }
2644     }
2645   };
2646
2647   class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2648   {
2649   public:
2650     static MEDFileFloatField1TS *New();
2651     static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2652     static MEDFileFloatField1TS *New(DataArrayByte *db);
2653     static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2654     static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2655     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2656     //
2657     void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2658     void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2659     void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2660     void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2661     MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2662     MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2663     MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2664     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2665     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2666     MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2667     %extend
2668     {
2669       MEDFileFloatField1TS()
2670       {
2671         return MEDFileFloatField1TS::New();
2672       }
2673
2674       MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2675       {
2676         return MEDFileFloatField1TS::New(fileName,loadAll);
2677       }
2678
2679       MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2680       {
2681         return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2682       }
2683
2684       MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2685       {
2686         return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2687       }
2688
2689       MEDFileFloatField1TS(DataArrayByte *db)
2690       {
2691         return MEDFileFloatField1TS::New(db);
2692       }
2693
2694       std::string __str__() const
2695       {
2696         return self->simpleRepr();
2697       }
2698
2699       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2700       {
2701          return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2702       }
2703
2704       DataArrayFloat *getUndergroundDataArray() const
2705       {
2706         DataArrayFloat *ret=self->getUndergroundDataArray();
2707         if(ret)
2708           ret->incrRef();
2709         return ret;
2710       }
2711
2712       PyObject *getUndergroundDataArrayExt() const
2713       {
2714         return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2715       }
2716     }
2717   };
2718
2719   class MEDFileAnyTypeFieldMultiTSIterator
2720   {
2721   public:
2722     %extend
2723     {
2724       PyObject *next()
2725       {
2726         MEDFileAnyTypeField1TS *ret=self->nextt();
2727         if(ret)
2728           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2729         else
2730           {
2731             PyErr_SetString(PyExc_StopIteration,"No more data.");
2732             return 0;
2733           }
2734       }
2735     }
2736   };
2737
2738   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2739   {
2740   public:
2741     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2742     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2743     MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2744     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2745     std::string getName() const;
2746     void setName(const std::string& name);
2747     std::string getDtUnit() const;
2748     void setDtUnit(const std::string& dtUnit);
2749     std::string getMeshName() const;
2750     void setMeshName(const std::string& newMeshName);
2751     void setInfo(const std::vector<std::string>& infos);
2752     const std::vector<std::string>& getInfo() const;
2753     bool presenceOfMultiDiscPerGeoType() const;
2754     int getNumberOfComponents() const;
2755     int getNumberOfTS() const;
2756     void eraseEmptyTS();
2757     int getPosOfTimeStep(int iteration, int order) const;
2758     int getPosGivenTime(double time, double eps=1e-8) const;
2759     void loadArrays();
2760     void loadArraysIfNecessary();
2761     void unloadArrays();
2762     void unloadArraysWithoutDataLoss();
2763     //
2764     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2765     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2766     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2767     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2768     void synchronizeNameScope();
2769     MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2770     %extend
2771     {
2772       int __len__() const
2773       {
2774         return self->getNumberOfTS();
2775       }
2776
2777       int getTimeId(PyObject *elt0) const
2778       {
2779         if(elt0 && PyInt_Check(elt0))
2780           {//fmts[3]
2781             int pos=(int)PyInt_AS_LONG(elt0);
2782             return pos;
2783           }
2784         else if(elt0 && PyTuple_Check(elt0))
2785           {
2786             if(PyTuple_Size(elt0)==2)
2787               {
2788                 PyObject *o0=PyTuple_GetItem(elt0,0);
2789                 PyObject *o1=PyTuple_GetItem(elt0,1);
2790                 if(PyInt_Check(o0) && PyInt_Check(o1))
2791                   {//fmts(1,-1)
2792                     int iter=(int)PyInt_AS_LONG(o0);
2793                     int order=(int)PyInt_AS_LONG(o1);
2794                     return self->getPosOfTimeStep(iter,order);
2795                   }
2796                 else
2797                   throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
2798               }
2799             else
2800               throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
2801           }
2802         else if(elt0 && PyFloat_Check(elt0))
2803           {
2804             double val=PyFloat_AS_DOUBLE(elt0);
2805             return self->getPosGivenTime(val);
2806           }
2807         else
2808           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2809       }
2810
2811       PyObject *getIterations() const
2812       {
2813         std::vector< std::pair<int,int> > res(self->getIterations());
2814         return convertVecPairIntToPy(res);
2815       }
2816
2817       PyObject *getTimeSteps() const
2818       {
2819         std::vector<double> ret1;
2820         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2821         std::size_t sz=ret.size();
2822         PyObject *ret2=PyList_New(sz);
2823         for(std::size_t i=0;i<sz;i++)
2824           {
2825             PyObject *elt=PyTuple_New(3);
2826             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2827             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2828             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2829             PyList_SetItem(ret2,i,elt);
2830           }
2831         return ret2;
2832       }
2833
2834       PyObject *getTypesOfFieldAvailable() const
2835       {
2836         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2837         PyObject *ret2=PyList_New(ret.size());
2838         for(int i=0;i<(int)ret.size();i++)
2839           {
2840             const std::vector<TypeOfField>& rett=ret[i];
2841             PyObject *ret3=PyList_New(rett.size());
2842             for(int j=0;j<(int)rett.size();j++)
2843               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2844             PyList_SetItem(ret2,i,ret3);
2845           }
2846         return ret2;
2847       }
2848
2849       PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2850       {
2851         std::vector<int> ret1;
2852         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2853         PyObject *elt=PyTuple_New(2);
2854         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2855         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2856         return elt;
2857       }
2858
2859       PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2860       {
2861         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2862         std::vector< std::vector<TypeOfField> > typesF;
2863         std::vector< std::vector<std::string> > pfls;
2864         std::vector< std::vector<std::string> > locs;
2865         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2866         std::size_t sz=ret.size();
2867         PyObject *ret2=PyList_New(sz);
2868         for(std::size_t i=0;i<sz;i++)
2869           {
2870             const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2871             const std::vector<TypeOfField>& typesFI=typesF[i];
2872             const std::vector<std::string>& pflsI=pfls[i];
2873             const std::vector<std::string>& locsI=locs[i];
2874             PyObject *elt=PyTuple_New(2);
2875             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2876             std::size_t sz2=ret[i].size();
2877             PyObject *elt2=PyList_New(sz2);
2878             for(std::size_t j=0;j<sz2;j++)
2879               {
2880                 PyObject *elt3=PyTuple_New(4);
2881                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2882                 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2883                 PyTuple_SetItem(elt3,1,elt4);
2884                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2885                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2886                 PyList_SetItem(elt2,j,elt3);
2887               }
2888             PyTuple_SetItem(elt,1,elt2);
2889             PyList_SetItem(ret2,i,elt);
2890           }
2891         return ret2;
2892       }
2893
2894       std::vector<int> getTimeIds(PyObject *elts) const
2895       {
2896         if(PyList_Check(elts))
2897           {
2898             std::size_t sz=PyList_Size(elts);
2899             std::vector<int> ret(sz);
2900             for(std::size_t i=0;i<sz;i++)
2901               {
2902                 PyObject *elt=PyList_GetItem(elts,i);
2903                 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2904               }
2905             return ret;
2906           }
2907         else
2908           {
2909             std::vector<int> ret(1);
2910             ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2911             return ret;
2912           }
2913       }
2914
2915       void __delitem__(PyObject *elts)
2916       {
2917         if(PySlice_Check(elts))
2918           {
2919             Py_ssize_t strt=2,stp=2,step=2;
2920             GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2921             self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2922           }
2923         else
2924           {
2925             std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2926             if(!idsToRemove.empty())
2927               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2928           }
2929       }
2930
2931       void eraseTimeStepIds(PyObject *li)
2932       {
2933         mcIdType sw;
2934         int pos1;
2935         std::vector<int> pos2;
2936         DataArrayInt32 *pos3=0;
2937         DataArrayIntTuple *pos4=0;
2938         convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2939         switch(sw)
2940           {
2941           case 1:
2942             {
2943               self->eraseTimeStepIds(&pos1,&pos1+1);
2944               return;
2945             }
2946           case 2:
2947             {
2948               if(pos2.empty())
2949                 return;
2950               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2951               return ;
2952             }
2953           case 3:
2954             {
2955               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2956               return ;
2957             }
2958           default:
2959             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2960           }
2961       }
2962
2963       MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2964       {
2965         return self->iterator();
2966       }
2967
2968       PyObject *__getitem__(PyObject *elt0) const
2969       {
2970         if(elt0 && PyList_Check(elt0))
2971           {
2972             std::size_t sz=PyList_Size(elt0);
2973             MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2974             int *pt=da->getPointer();
2975             for(std::size_t i=0;i<sz;i++,pt++)
2976               {
2977                 PyObject *elt1=PyList_GetItem(elt0,i);
2978                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2979               }
2980             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2981           }
2982         else if(elt0 && PySlice_Check(elt0))
2983           {
2984             Py_ssize_t strt=2,stp=2,step=2;
2985             GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2986             return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2987           }
2988         else
2989           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2990       }
2991
2992       bool changeMeshNames(PyObject *li)
2993       {
2994         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2995         return self->changeMeshNames(modifTab);
2996       }
2997
2998       PyObject *splitComponents() const
2999       {
3000         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
3001         std::size_t sz=ret.size();
3002         PyObject *retPy=PyList_New(sz);
3003         for(std::size_t i=0;i<sz;i++)
3004           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3005         return retPy;
3006       }
3007
3008       PyObject *splitDiscretizations() const
3009       {
3010         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
3011         std::size_t sz=ret.size();
3012         PyObject *retPy=PyList_New(sz);
3013         for(std::size_t i=0;i<sz;i++)
3014           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3015         return retPy;
3016       }
3017
3018       PyObject *splitMultiDiscrPerGeoTypes() const
3019       {
3020         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
3021         std::size_t sz=ret.size();
3022         PyObject *retPy=PyList_New(sz);
3023         for(std::size_t i=0;i<sz;i++)
3024           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
3025         return retPy;
3026       }
3027
3028       void pushBackTimeSteps(PyObject *li)
3029       {
3030         void *argp(0);
3031         int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
3032         if(SWIG_IsOK(status))
3033           {
3034             self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
3035           }
3036         else
3037           {
3038             std::vector<MEDFileAnyTypeField1TS *> tmp;
3039             convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
3040             self->pushBackTimeSteps(tmp);
3041           }
3042       }
3043
3044       MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3045       {
3046         std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3047         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3048         return self->extractPart(extractDefCpp,mm);
3049       }
3050
3051       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
3052       {
3053         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3054         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3055         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
3056         std::size_t sz=ret.size();
3057         PyObject *retPy=PyList_New(sz);
3058         for(std::size_t i=0;i<sz;i++)
3059           {
3060             std::size_t sz2=ret[i].size();
3061             PyObject *ret1Py=PyList_New(sz2);
3062             for(std::size_t j=0;j<sz2;j++)
3063               {
3064                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3065                 if(elt)
3066                   elt->incrRef();
3067                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3068               }
3069             PyList_SetItem(retPy,i,ret1Py);
3070           }
3071         return retPy;
3072       }
3073
3074       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
3075       {
3076         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3077         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3078         std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
3079         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
3080         if(ret2.size()!=ret.size())
3081           {
3082             std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
3083             throw INTERP_KERNEL::Exception(oss.str().c_str());
3084           }
3085         std::size_t sz=ret.size();
3086         PyObject *retPy=PyList_New(sz);
3087         for(std::size_t i=0;i<sz;i++)
3088           {
3089             std::size_t sz2=ret[i].size();
3090             PyObject *ret0Py=PyTuple_New(2);
3091             PyObject *ret1Py=PyList_New(sz2);
3092             for(std::size_t j=0;j<sz2;j++)
3093               {
3094                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3095                 if(elt)
3096                   elt->incrRef();
3097                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3098               }
3099             PyTuple_SetItem(ret0Py,0,ret1Py);
3100             PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3101             PyList_SetItem(retPy,i,ret0Py);
3102           }
3103         return retPy;
3104       }
3105     }
3106   };
3107
3108   class MEDFileInt32FieldMultiTS;
3109   class MEDFileInt64FieldMultiTS;
3110
3111   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3112   {
3113   public:
3114     static MEDFileFieldMultiTS *New();
3115     static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3116     static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3117     static MEDFileFieldMultiTS *New(DataArrayByte *db);
3118     //
3119     MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3120     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3121     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3122     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3123     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3124     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3125     //
3126     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3127     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3128     MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3129     %extend
3130        {
3131          static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3132          {
3133             std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3134             convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3135             std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3136             convertPyToVectorVectorPairInt(dtsPy,dts2);
3137             std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3138             MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3139             return ret.retn();
3140          }
3141
3142          MEDFileFieldMultiTS()
3143          {
3144            return MEDFileFieldMultiTS::New();
3145          }
3146
3147          MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3148          {
3149            return MEDFileFieldMultiTS::New(fileName,loadAll);
3150          }
3151
3152          MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3153          {
3154            return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3155          }
3156
3157          MEDFileFieldMultiTS(DataArrayByte *db)
3158          {
3159            return MEDFileFieldMultiTS::New(db);
3160          }
3161
3162          static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3163          {
3164            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3165            std::size_t sz(tmp.size());
3166            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3167            for(std::size_t i=0;i<sz;i++)
3168              {
3169                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3170                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3171              }
3172            return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3173          }
3174
3175          std::string __str__() const
3176          {
3177            return self->simpleRepr();
3178          }
3179
3180          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3181          {
3182            DataArrayIdType *ret1=0;
3183            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3184            PyObject *ret=PyTuple_New(2);
3185            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3186            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3187            return ret;
3188          }
3189
3190          PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3191          {
3192            std::vector<INTERP_KERNEL::NormalizedCellType> types;
3193            std::vector< std::vector<TypeOfField> > typesF;
3194            std::vector< std::vector<std::string> > pfls;
3195            std::vector< std::vector<std::string> > locs;
3196            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3197            std::size_t sz=ret.size();
3198            PyObject *ret2=PyList_New(sz);
3199            for(std::size_t i=0;i<sz;i++)
3200              {
3201                const std::vector<DataArrayDouble *>& dadsI=ret[i];
3202                const std::vector<TypeOfField>& typesFI=typesF[i];
3203                const std::vector<std::string>& pflsI=pfls[i];
3204                const std::vector<std::string>& locsI=locs[i];
3205                PyObject *elt=PyTuple_New(2);
3206                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3207                std::size_t sz2=ret[i].size();
3208                PyObject *elt2=PyList_New(sz2);
3209                for(std::size_t j=0;j<sz2;j++)
3210                  {
3211                    PyObject *elt3=PyTuple_New(4);
3212                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3213                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3214                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3215                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3216                    PyList_SetItem(elt2,j,elt3);
3217                  }
3218                PyTuple_SetItem(elt,1,elt2);
3219                PyList_SetItem(ret2,i,elt);
3220              }
3221            return ret2;
3222          }
3223          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3224          {
3225            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3226            if(ret)
3227              ret->incrRef();
3228            return ret;
3229          }
3230
3231          PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3232          {
3233            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3234            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3235            if(elt0)
3236              elt0->incrRef();
3237            PyObject *ret=PyTuple_New(2);
3238            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3239            std::size_t sz=elt1Cpp.size();
3240            PyObject *elt=PyList_New(sz);
3241            for(std::size_t i=0;i<sz;i++)
3242              {
3243                PyObject *elt1=PyTuple_New(2);
3244                PyObject *elt2=PyTuple_New(2);
3245                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3246                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3247                PyObject *elt3=PyTuple_New(2);
3248                PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3249                PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3250                PyTuple_SetItem(elt1,0,elt2);
3251                PyTuple_SetItem(elt1,1,elt3);
3252                PyList_SetItem(elt,i,elt1);
3253              }
3254            PyTuple_SetItem(ret,1,elt);
3255            return ret;
3256          }
3257        }
3258   };
3259
3260   class MEDFileFieldsIterator
3261   {
3262   public:
3263     %extend
3264     {
3265       PyObject *next()
3266       {
3267         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3268         if(ret)
3269           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3270         else
3271           {
3272             PyErr_SetString(PyExc_StopIteration,"No more data.");
3273             return 0;
3274           }
3275       }
3276     }
3277   };
3278
3279   class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3280   {
3281   public:
3282     static MEDFileInt32FieldMultiTS *New();
3283     static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3284     static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3285     static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3286     //
3287     void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3288     void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3289     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3290     MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3291     MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3292     MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3293     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3294     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3295     MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3296     %extend
3297     {
3298       MEDFileInt32FieldMultiTS()
3299       {
3300         return MEDFileInt32FieldMultiTS::New();
3301       }
3302
3303       MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3304       {
3305         return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3306       }
3307
3308       MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3309       {
3310         return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3311       }
3312
3313       MEDFileInt32FieldMultiTS(DataArrayByte *db)
3314       {
3315         return MEDFileInt32FieldMultiTS::New(db);
3316       }
3317
3318       static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3319       {
3320         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3321         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3322         return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3323       }
3324
3325       std::string __str__() const
3326       {
3327         return self->simpleRepr();
3328       }
3329
3330       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3331       {
3332          DataArrayIdType *ret1=0;
3333          DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3334          PyObject *ret=PyTuple_New(2);
3335          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3336          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3337          return ret;
3338       }
3339
3340       DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3341       {
3342         DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3343         if(ret)
3344           ret->incrRef();
3345         return ret;
3346       }
3347     }
3348   };
3349
3350   class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3351   {
3352   public:
3353     static MEDFileInt64FieldMultiTS *New();
3354     static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3355     static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3356     static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3357     //
3358     void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3359     void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3360     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3361     MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3362     MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3363     MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3364     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3365     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3366     MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3367     %extend
3368     {
3369       MEDFileInt64FieldMultiTS()
3370       {
3371         return MEDFileInt64FieldMultiTS::New();
3372       }
3373
3374       MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3375       {
3376         return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3377       }
3378
3379       MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3380       {
3381         return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3382       }
3383
3384       MEDFileInt64FieldMultiTS(DataArrayByte *db)
3385       {
3386         return MEDFileInt64FieldMultiTS::New(db);
3387       }
3388
3389       static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3390       {
3391         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3392         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3393         return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3394       }
3395
3396       std::string __str__() const
3397       {
3398         return self->simpleRepr();
3399       }
3400
3401       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3402       {
3403          DataArrayIdType *ret1=0;
3404          DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3405          PyObject *ret=PyTuple_New(2);
3406          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3407          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3408          return ret;
3409       }
3410
3411       DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3412       {
3413         DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3414         if(ret)
3415           ret->incrRef();
3416         return ret;
3417       }
3418     }
3419   };
3420
3421   class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3422   {
3423   public:
3424     static MEDFileFloatFieldMultiTS *New();
3425     static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3426     static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3427     static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3428     //
3429     void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3430     void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3431     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3432     MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3433     MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3434     MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3435     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3436     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3437     MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3438     %extend
3439     {
3440       MEDFileFloatFieldMultiTS()
3441       {
3442         return MEDFileFloatFieldMultiTS::New();
3443       }
3444
3445       MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3446       {
3447         return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3448       }
3449
3450       MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3451       {
3452         return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3453       }
3454
3455       MEDFileFloatFieldMultiTS(DataArrayByte *db)
3456       {
3457         return MEDFileFloatFieldMultiTS::New(db);
3458       }
3459
3460       static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3461       {
3462         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3463         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3464         return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3465       }
3466
3467       std::string __str__() const
3468       {
3469         return self->simpleRepr();
3470       }
3471
3472       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3473       {
3474          DataArrayIdType *ret1=0;
3475          DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3476          PyObject *ret=PyTuple_New(2);
3477          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3478          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3479          return ret;
3480       }
3481
3482       DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3483       {
3484         DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3485         if(ret)
3486           ret->incrRef();
3487         return ret;
3488       }
3489     }
3490   };
3491
3492   class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3493   {
3494   public:
3495     static MEDFileMeshSupports *New(const std::string& fileName);
3496     std::vector<std::string> getSupMeshNames() const;
3497     %extend
3498        {
3499          MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3500          {
3501            const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3502            MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3503            if(ret2)
3504              ret2->incrRef();
3505            return ret2;
3506          }
3507        }
3508   };
3509
3510   class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3511   {
3512   public:
3513     static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3514   private:
3515     MEDFileStructureElements();
3516   };
3517
3518   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3519   {
3520   public:
3521     static MEDFileFields *New();
3522     static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3523     static MEDFileFields *New(DataArrayByte *db);
3524     static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3525     static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3526     static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3527     MEDFileFields *deepCopy() const;
3528     MEDFileFields *shallowCpy() const;
3529     void loadArrays();
3530     void loadArraysIfNecessary();
3531     void unloadArrays();
3532     void unloadArraysWithoutDataLoss();
3533     int getNumberOfFields() const;
3534     std::vector<std::string> getFieldsNames() const;
3535     std::vector<std::string> getMeshesNames() const;
3536     //
3537     void resize(int newSize);
3538     void pushField(MEDFileAnyTypeFieldMultiTS *field);
3539     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3540     int getPosFromFieldName(const std::string& fieldName) const;
3541     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3542     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3543     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3544     bool presenceOfStructureElements() const;
3545     void aggregate(const MEDFileFields& other);
3546     void killStructureElements();
3547     void keepOnlyStructureElements();
3548     void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3549     void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3550     void destroyFieldAtPos(int i);
3551     bool removeFieldsWithoutAnyTimeStep();
3552     %extend
3553        {
3554          MEDFileFields()
3555          {
3556            return MEDFileFields::New();
3557          }
3558
3559          MEDFileFields(const std::string& fileName, bool loadAll=true)
3560          {
3561            return MEDFileFields::New(fileName,loadAll);
3562          }
3563
3564          MEDFileFields(DataArrayByte *db)
3565          {
3566            return MEDFileFields::New(db);
3567          }
3568
3569          MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3570          {
3571            return MEDFileFields::NewAdv(fileName,loadAll,entities);
3572          }
3573
3574          std::string __str__() const
3575          {
3576            return self->simpleRepr();
3577          }
3578
3579          MEDFileFields *partOfThisOnStructureElements() const
3580          {
3581            MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3582            return ret.retn();
3583          }
3584
3585          MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3586          {
3587            MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3588            return ret.retn();
3589          }
3590
3591          static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3592          {
3593            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3594            std::size_t sz(tmp.size());
3595            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3596            for(std::size_t i=0;i<sz;i++)
3597              {
3598                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3599                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3600              }
3601            return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3602          }
3603
3604          PyObject *getMeshSENames() const
3605          {
3606            std::vector< std::pair<std::string,std::string> > ps;
3607            self->getMeshSENames(ps);
3608            return convertVectPairStToPy(ps);
3609          }
3610
3611          PyObject *getCommonIterations() const
3612          {
3613            bool ret1;
3614            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3615            PyObject *ret=PyTuple_New(2);
3616            PyObject *ret_0=PyList_New(ret0.size());
3617            int rk=0;
3618            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3619              {
3620                PyObject *elt=PyTuple_New(2);
3621                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3622                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3623                PyList_SetItem(ret_0,rk,elt);
3624              }
3625            PyTuple_SetItem(ret,0,ret_0);
3626            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3627            PyTuple_SetItem(ret,1,ret_1);
3628            return ret;
3629          }
3630
3631          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3632          {
3633            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3634            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3635          }
3636
3637          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3638          {
3639            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3640            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3641          }
3642
3643          PyObject *__getitem__(PyObject *obj)
3644          {
3645            if(obj && PyList_Check(obj))
3646              {
3647                std::size_t sz=PyList_Size(obj);
3648                MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3649                int *pt=da->getPointer();
3650                for(std::size_t i=0;i<sz;i++,pt++)
3651                  {
3652                    PyObject *elt1=PyList_GetItem(obj,i);
3653                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3654                  }
3655                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3656              }
3657            else
3658              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3659          }
3660
3661          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3662          {
3663            self->setFieldAtPos(obj,field);
3664            return self;
3665          }
3666
3667          int __len__() const
3668          {
3669            return self->getNumberOfFields();
3670          }
3671
3672          MEDFileFieldsIterator *__iter__()
3673          {
3674            return self->iterator();
3675          }
3676
3677          bool changeMeshNames(PyObject *li)
3678          {
3679            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3680            return self->changeMeshNames(modifTab);
3681          }
3682
3683          int getPosOfField(PyObject *elt0) const
3684          {
3685            static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3686            if(!elt0)
3687              throw INTERP_KERNEL::Exception(msg);
3688            if(PyInt_Check(elt0))
3689              {//fmts[3]
3690                return (int)PyInt_AS_LONG(elt0);
3691              }
3692            return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3693          }
3694
3695          std::vector<int> getPosOfFields(PyObject *elts) const
3696          {
3697            if(PyList_Check(elts))
3698              {
3699                std::size_t sz=PyList_Size(elts);
3700                std::vector<int> ret(sz);
3701                for(std::size_t i=0;i<sz;i++)
3702                  {
3703                    PyObject *elt=PyList_GetItem(elts,i);
3704                    ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3705                  }
3706                return ret;
3707              }
3708            else
3709              {
3710                std::vector<int> ret(1);
3711                ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3712                return ret;
3713              }
3714          }
3715
3716          void pushFields(PyObject *fields)
3717          {
3718            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3719            convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3720            self->pushFields(tmp);
3721          }
3722
3723          void __delitem__(PyObject *elts)
3724          {
3725            if(elts && PySlice_Check(elts))
3726              {
3727                Py_ssize_t strt=2,stp=2,step=2;
3728                GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3729                self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3730              }
3731            else
3732              {
3733                std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3734                if(!idsToRemove.empty())
3735                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3736              }
3737          }
3738
3739          MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3740          {
3741            std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3742            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3743            return self->extractPart(extractDefCpp,mm);
3744          }
3745
3746          MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3747          {
3748            MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3749            return ret.retn();
3750          }
3751        }
3752   };
3753
3754   class MEDFileParameter1TS : public RefCountObject
3755   {
3756   public:
3757     void setIteration(int it);
3758     int getIteration() const;
3759     void setOrder(int order);
3760     int getOrder() const;
3761     void setTimeValue(double time);
3762     void setTime(int dt, int it, double time);
3763     double getTime(int& dt, int& it);
3764     double getTimeValue() const;
3765   };
3766
3767   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3768   {
3769   public:
3770     void setValue(double val);
3771     double getValue() const;
3772     std::string simpleRepr() const;
3773     %extend
3774     {
3775       std::string __str__() const
3776       {
3777         return self->simpleRepr();
3778       }
3779     }
3780   };
3781
3782   class MEDFileParameterTinyInfo : public MEDFileWritable
3783   {
3784   public:
3785     void setDescription(const std::string& name);
3786     std::string getDescription() const;
3787     void setTimeUnit(const std::string& unit);
3788     std::string getTimeUnit() const;
3789   };
3790
3791   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3792   {
3793   public:
3794     static MEDFileParameterDouble1TS *New();
3795     static MEDFileParameterDouble1TS *New(const std::string& fileName);
3796     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3797     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3798     virtual MEDFileParameter1TS *deepCopy() const;
3799     virtual std::string simpleRepr() const;
3800     void setName(const std::string& name);
3801     std::string getName() const;
3802     void write(const std::string& fileName, int mode) const;
3803     %extend
3804     {
3805       MEDFileParameterDouble1TS()
3806       {
3807         return MEDFileParameterDouble1TS::New();
3808       }
3809
3810       MEDFileParameterDouble1TS(const std::string& fileName)
3811       {
3812         return MEDFileParameterDouble1TS::New(fileName);
3813       }
3814
3815       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3816       {
3817         return MEDFileParameterDouble1TS::New(fileName,paramName);
3818       }
3819
3820       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3821       {
3822         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3823       }
3824
3825       std::string __str__() const
3826       {
3827         return self->simpleRepr();
3828       }
3829
3830       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3831       {
3832         std::string what;
3833         bool ret0=self->isEqual(other,eps,what);
3834         PyObject *res=PyList_New(2);
3835         PyObject *ret0Py=ret0?Py_True:Py_False;
3836         Py_XINCREF(ret0Py);
3837         PyList_SetItem(res,0,ret0Py);
3838         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3839         return res;
3840       }
3841     }
3842   };
3843
3844   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3845   {
3846   public:
3847     static MEDFileParameterMultiTS *New();
3848     static MEDFileParameterMultiTS *New(const std::string& fileName);
3849     static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3850     std::string getName() const;
3851     void setName(const std::string& name);
3852     MEDFileParameterMultiTS *deepCopy() const;
3853     void write(const std::string& fileName, int mode) const;
3854     std::string simpleRepr() const;
3855     void appendValue(int dt, int it, double time, double val);
3856     double getDoubleValue(int iteration, int order) const;
3857     int getPosOfTimeStep(int iteration, int order) const;
3858     int getPosGivenTime(double time, double eps=1e-8) const;
3859     int getNumberOfTS() const;
3860     %extend
3861     {
3862       MEDFileParameterMultiTS()
3863       {
3864         return MEDFileParameterMultiTS::New();
3865       }
3866
3867       MEDFileParameterMultiTS(const std::string& fileName)
3868       {
3869         return MEDFileParameterMultiTS::New(fileName);
3870       }
3871
3872       MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3873       {
3874         return MEDFileParameterMultiTS::New(fileName,paramName);
3875       }
3876
3877       std::string __str__() const
3878       {
3879         return self->simpleRepr();
3880       }
3881
3882       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3883       {
3884         std::string what;
3885         bool ret0=self->isEqual(other,eps,what);
3886         PyObject *res=PyList_New(2);
3887         PyObject *ret0Py=ret0?Py_True:Py_False;
3888         Py_XINCREF(ret0Py);
3889         PyList_SetItem(res,0,ret0Py);
3890         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3891         return res;
3892       }
3893
3894       void eraseTimeStepIds(PyObject *ids)
3895       {
3896         mcIdType sw;
3897         int pos1;
3898         std::vector<int> pos2;
3899         DataArrayInt *pos3=0;
3900         DataArrayIntTuple *pos4=0;
3901         convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3902         switch(sw)
3903           {
3904           case 1:
3905             {
3906               self->eraseTimeStepIds(&pos1,&pos1+1);
3907               return;
3908             }
3909           case 2:
3910             {
3911               if(pos2.empty())
3912                 return;
3913               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3914               return ;
3915             }
3916           case 3:
3917             {
3918               self->eraseTimeStepIds(pos3->begin(),pos3->end());
3919               return ;
3920             }
3921           default:
3922             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3923           }
3924       }
3925
3926       int getTimeStepId(PyObject *elt0) const
3927       {
3928         if(elt0 && PyInt_Check(elt0))
3929           {//fmts[3]
3930             int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3931             return pos;
3932           }
3933         else if(elt0 && PyTuple_Check(elt0))
3934           {
3935             if(PyTuple_Size(elt0)==2)
3936               {
3937                 PyObject *o0=PyTuple_GetItem(elt0,0);
3938                 PyObject *o1=PyTuple_GetItem(elt0,1);
3939                 if(PyInt_Check(o0) && PyInt_Check(o1))
3940                   {//fmts(1,-1)
3941                     int iter=(int)PyInt_AS_LONG(o0);
3942                     int order=(int)PyInt_AS_LONG(o1);
3943                     return self->getPosOfTimeStep(iter,order);
3944                   }
3945                 else
3946                   throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
3947               }
3948             else
3949               throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
3950           }
3951         else if(elt0 && PyFloat_Check(elt0))
3952           {
3953             double val=PyFloat_AS_DOUBLE(elt0);
3954             return self->getPosGivenTime(val);
3955           }
3956         else
3957           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3958       }
3959
3960       MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3961       {
3962         MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3963         if(ret)
3964           ret->incrRef();
3965         return ret;
3966       }
3967
3968       std::vector<int> getTimeStepIds(PyObject *elts) const
3969       {
3970         if(PyList_Check(elts))
3971           {
3972             std::size_t sz=PyList_Size(elts);
3973             std::vector<int> ret(sz);
3974             for(std::size_t i=0;i<sz;i++)
3975               {
3976                 PyObject *elt=PyList_GetItem(elts,i);
3977                 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3978               }
3979             return ret;
3980           }
3981         else
3982           {
3983             std::vector<int> ret(1);
3984             ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3985             return ret;
3986           }
3987       }
3988
3989       void __delitem__(PyObject *elts)
3990       {
3991         std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3992         if(!idsToRemove.empty())
3993           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3994       }
3995
3996       MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3997       {
3998         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3999         if(ret)
4000           ret->incrRef();
4001         return ret;
4002       }
4003
4004       PyObject *getIterations() const
4005       {
4006         std::vector< std::pair<int,int> > res=self->getIterations();
4007         PyObject *ret=PyList_New(res.size());
4008         int rk=0;
4009         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
4010           {
4011             PyObject *elt=PyTuple_New(2);
4012             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
4013             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
4014             PyList_SetItem(ret,rk,elt);
4015           }
4016         return ret;
4017       }
4018
4019       PyObject *getTimeSteps() const
4020       {
4021         std::vector<double> res2;
4022         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
4023         PyObject *ret=PyList_New(res.size());
4024         int rk=0;
4025         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
4026           {
4027             PyObject *elt=PyTuple_New(3);
4028             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
4029             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
4030             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
4031             PyList_SetItem(ret,rk,elt);
4032           }
4033         return ret;
4034       }
4035     }
4036   };
4037
4038   class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
4039   {
4040   public:
4041     static MEDFileParameters *New();
4042     static MEDFileParameters *New(const std::string& fileName);
4043     static MEDFileParameters *New(DataArrayByte *db);
4044     MEDFileParameters *deepCopy() const;
4045     std::vector<std::string> getParamsNames() const;
4046     std::string simpleRepr() const;
4047     void resize(int newSize);
4048     void pushParam(MEDFileParameterMultiTS *param);
4049     void setParamAtPos(int i, MEDFileParameterMultiTS *param);
4050     void destroyParamAtPos(int i);
4051     int getPosFromParamName(const std::string& paramName) const;
4052     int getNumberOfParams() const;
4053     %extend
4054     {
4055       MEDFileParameters()
4056       {
4057         return MEDFileParameters::New();
4058       }
4059
4060       MEDFileParameters(const std::string& fileName)
4061       {
4062         return MEDFileParameters::New(fileName);
4063       }
4064
4065       MEDFileParameters(DataArrayByte *db)
4066       {
4067         return MEDFileParameters::New(db);
4068       }
4069
4070       std::string __str__() const
4071       {
4072         return self->simpleRepr();
4073       }
4074
4075       MEDFileParameterMultiTS *__getitem__(PyObject *obj)
4076       {
4077         static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
4078         if(PyInt_Check(obj))
4079           {
4080             MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
4081             if(ret)
4082               ret->incrRef();
4083             return ret;
4084           }
4085         MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4086         if(ret)
4087           ret->incrRef();
4088         return ret;
4089       }
4090
4091       int __len__() const
4092       {
4093         return self->getNumberOfParams();
4094       }
4095
4096       MEDFileParameterMultiTS *getParamAtPos(int i) const
4097       {
4098         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4099         if(ret)
4100           ret->incrRef();
4101         return ret;
4102       }
4103
4104       MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4105       {
4106         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4107         if(ret)
4108           ret->incrRef();
4109         return ret;
4110       }
4111
4112       PyObject *isEqual(const MEDFileParameters *other, double eps) const
4113       {
4114         std::string what;
4115         bool ret0=self->isEqual(other,eps,what);
4116         PyObject *res=PyList_New(2);
4117         PyObject *ret0Py=ret0?Py_True:Py_False;
4118         Py_XINCREF(ret0Py);
4119         PyList_SetItem(res,0,ret0Py);
4120         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4121         return res;
4122       }
4123     }
4124   };
4125
4126   class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4127   {
4128   public:
4129     static MEDFileData *New(DataArrayByte *db);
4130     static MEDFileData *New(const std::string& fileName);
4131     static MEDFileData *New();
4132     MEDFileData *deepCopy() const;
4133     void setFields(MEDFileFields *fields);
4134     void setMeshes(MEDFileMeshes *meshes);
4135     void setParams(MEDFileParameters *params);
4136     int getNumberOfFields() const;
4137     int getNumberOfMeshes() const;
4138     int getNumberOfParams() const;
4139     //
4140     bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4141     bool unPolyzeMeshes();
4142     void dealWithStructureElements();
4143     std::string getHeader() const;
4144     void setHeader(const std::string& header);
4145     //
4146     %extend
4147        {
4148          MEDFileData(const std::string& fileName)
4149          {
4150            return MEDFileData::New(fileName);
4151          }
4152
4153          MEDFileData(DataArrayByte *db)
4154          {
4155            return MEDFileData::New(db);
4156          }
4157
4158          MEDFileData()
4159          {
4160            return MEDFileData::New();
4161          }
4162
4163          std::string __str__() const
4164          {
4165            return self->simpleRepr();
4166          }
4167
4168          MEDFileMeshes *getMeshes() const
4169          {
4170            MEDFileMeshes *ret=self->getMeshes();
4171            if(ret)
4172              ret->incrRef();
4173            return ret;
4174          }
4175
4176          MEDFileParameters *getParams() const
4177          {
4178            MEDFileParameters *ret=self->getParams();
4179            if(ret)
4180              ret->incrRef();
4181            return ret;
4182          }
4183
4184          MEDFileFields *getFields() const
4185          {
4186            MEDFileFields *ret=self->getFields();
4187            if(ret)
4188              ret->incrRef();
4189            return ret;
4190          }
4191
4192          bool changeMeshNames(PyObject *li)
4193          {
4194            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4195            return self->changeMeshNames(modifTab);
4196          }
4197
4198          static MEDFileData *Aggregate(PyObject *mfds)
4199          {
4200            std::vector<const MEDFileData *> mfdsCpp;
4201            convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4202            MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4203            return ret.retn();
4204          }
4205        }
4206   };
4207
4208   class SauvReader : public RefCountObject
4209   {
4210   public:
4211     static SauvReader* New(const std::string& fileName);
4212     MEDFileData * loadInMEDFileDS();
4213     %extend
4214     {
4215       SauvReader(const std::string& fileName)
4216       {
4217         return SauvReader::New(fileName);
4218       }
4219     }
4220   };
4221
4222   class SauvWriter : public RefCountObject
4223   {
4224   public:
4225     static SauvWriter * New();
4226     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4227     void write(const std::string& fileName);
4228     void setCpyGrpIfOnASingleFamilyStatus(bool status);
4229     bool getCpyGrpIfOnASingleFamilyStatus() const;
4230     %extend
4231     {
4232       SauvWriter()
4233       {
4234         return SauvWriter::New();
4235       }
4236     }
4237   };
4238
4239   ///////////////
4240
4241   class MEDFileMeshStruct;
4242
4243   class MEDFileField1TSStructItem
4244   {
4245   public:
4246     static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4247   };
4248
4249   class MEDFileMeshStruct : public RefCountObject
4250   {
4251   public:
4252     static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4253   protected:
4254     ~MEDFileMeshStruct();
4255   };
4256
4257   class MEDMeshMultiLev : public RefCountObject
4258   {
4259   public:
4260     virtual MEDMeshMultiLev *prepare() const;
4261     DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4262     DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4263   protected:
4264     ~MEDMeshMultiLev();
4265   public:
4266     %extend
4267     {
4268       PyObject *retrieveFamilyIdsOnCells() const
4269       {
4270         DataArrayIdType *famIds(0);
4271         bool isWithoutCopy(false);
4272         self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4273         PyObject *ret=PyTuple_New(2);
4274         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4275         Py_XINCREF(ret1Py);
4276         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4277         PyTuple_SetItem(ret,1,ret1Py);
4278         return ret;
4279       }
4280
4281       PyObject *retrieveNumberIdsOnCells() const
4282       {
4283         DataArrayIdType *numIds(0);
4284         bool isWithoutCopy(false);
4285         self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4286         PyObject *ret=PyTuple_New(2);
4287         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4288         Py_XINCREF(ret1Py);
4289         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4290         PyTuple_SetItem(ret,1,ret1Py);
4291         return ret;
4292       }
4293
4294       PyObject *retrieveFamilyIdsOnNodes() const
4295       {
4296         DataArrayIdType *famIds(0);
4297         bool isWithoutCopy(false);
4298         self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4299         PyObject *ret=PyTuple_New(2);
4300         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4301         Py_XINCREF(ret1Py);
4302         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4303         PyTuple_SetItem(ret,1,ret1Py);
4304         return ret;
4305       }
4306
4307       PyObject *retrieveNumberIdsOnNodes() const
4308       {
4309         DataArrayIdType *numIds(0);
4310         bool isWithoutCopy(false);
4311         self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4312         PyObject *ret=PyTuple_New(2);
4313         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4314         Py_XINCREF(ret1Py);
4315         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4316         PyTuple_SetItem(ret,1,ret1Py);
4317         return ret;
4318       }
4319
4320       PyObject *getGeoTypes() const
4321       {
4322         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4323         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4324         PyObject *res(PyList_New(result.size()));
4325         for(int i=0;iL!=result.end(); i++, iL++)
4326           PyList_SetItem(res,i,PyInt_FromLong(*iL));
4327         return res;
4328       }
4329     }
4330   };
4331
4332   class MEDUMeshMultiLev : public MEDMeshMultiLev
4333   {
4334   protected:
4335     ~MEDUMeshMultiLev();
4336   public:
4337     %extend
4338      {
4339        PyObject *buildVTUArrays() const
4340        {
4341          DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4342          bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4343          PyObject *ret0Py=ncc?Py_True:Py_False;
4344          Py_XINCREF(ret0Py);
4345          PyObject *ret=PyTuple_New(7);
4346          PyTuple_SetItem(ret,0,ret0Py);
4347          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4348          PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4349          PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4350          PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4351          PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4352          PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4353          return ret;
4354        }
4355      }
4356   };
4357
4358   class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4359   {
4360   protected:
4361     ~MEDStructuredMeshMultiLev();
4362   };
4363
4364   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4365   {
4366   protected:
4367     ~MEDCMeshMultiLev();
4368   public:
4369     %extend
4370     {
4371       PyObject *buildVTUArrays() const
4372       {
4373         bool isInternal;
4374         std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4375         std::size_t sz(objs.size());
4376         PyObject *ret(PyTuple_New(2));
4377         PyObject *ret0=PyList_New(sz);
4378         for(std::size_t i=0;i<sz;i++)
4379           PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4380         PyTuple_SetItem(ret,0,ret0);
4381         PyObject *ret1Py(isInternal?Py_True:Py_False);
4382         Py_XINCREF(ret1Py);
4383         PyTuple_SetItem(ret,1,ret1Py);
4384         return ret;
4385       }
4386     }
4387   };
4388
4389   class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4390   {
4391   protected:
4392     ~MEDCurveLinearMeshMultiLev();
4393   public:
4394     %extend
4395     {
4396       PyObject *buildVTUArrays() const
4397       {
4398         DataArrayDouble *ret0(0);
4399         std::vector<mcIdType> ret1;
4400         bool ret2;
4401         self->buildVTUArrays(ret0,ret1,ret2);
4402         std::size_t sz(ret1.size());
4403         PyObject *ret=PyTuple_New(3);
4404         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4405         PyObject *ret1Py=PyList_New(sz);
4406         for(std::size_t i=0;i<sz;i++)
4407           PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4408         PyTuple_SetItem(ret,1,ret1Py);
4409         PyObject *ret2Py(ret2?Py_True:Py_False);
4410         Py_XINCREF(ret2Py);
4411         PyTuple_SetItem(ret,2,ret2Py);
4412         return ret;
4413       }
4414     }
4415   };
4416
4417   class MEDFileFastCellSupportComparator : public RefCountObject
4418   {
4419   public:
4420     static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4421     MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4422     bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4423     int getNumberOfTS() const;
4424   protected:
4425     ~MEDFileFastCellSupportComparator();
4426   public:
4427     %extend
4428     {
4429       PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4430       {
4431         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4432         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4433         PyObject *res(PyList_New(result.size()));
4434         for(int i=0;iL!=result.end(); i++, iL++)
4435           PyList_SetItem(res,i,PyInt_FromLong(*iL));
4436         return res;
4437       }
4438     }
4439   };
4440
4441   class MeshFormatReader
4442   {
4443   public:
4444     MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4445     MeshFormatReader();
4446     MEDFileData* loadInMedFileDS();
4447     void setMeshName(const std::string& theMeshName);
4448     std::string getMeshName() const;
4449     void setFile(const std::string& theFileName);
4450     void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4451     std::vector<std::string> getFieldFileNames() const;
4452   };
4453   class MeshFormatWriter
4454   {
4455   public:
4456     MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4457     MeshFormatWriter();
4458     void setMeshFileName(const std::string& meshFileName);
4459     std::string getMeshFileName() const;
4460     void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4461     std::vector<std::string> getFieldFileNames() const;
4462     void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4463     void write();
4464   };
4465
4466 }
4467
4468 %pythoncode %{
4469 def enter1TS(self):
4470     self.loadArraysIfNecessary()
4471     pass
4472 def exit1TS(self, exctype, exc, tb):
4473     self.unloadArraysWithoutDataLoss()
4474     pass
4475 MEDFileAnyTypeField1TS.__enter__=enter1TS
4476 MEDFileAnyTypeField1TS.__exit__=exit1TS
4477 MEDFileIntField1TS = MEDFileInt32Field1TS
4478 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4479 if MEDCouplingUse64BitIDs():
4480   MEDFileIDField1TS = MEDFileInt64Field1TS
4481   MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4482 else:
4483   MEDFileIDField1TS = MEDFileInt32Field1TS
4484   MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS
4485 %}