Salome HOME
Add test for .mesh file format
[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          MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
1733          {
1734            MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1735            if(ret)
1736              ret->incrRef();
1737            return ret;
1738          }
1739
1740          PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
1741          {
1742            std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1743            std::size_t sz(tmp.size());
1744            PyObject *ret=PyList_New(sz);
1745            for(std::size_t i=0;i<sz;i++)
1746              {
1747                if(tmp[i])
1748                  tmp[i]->incrRef();
1749                PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1750              }
1751            return ret;
1752          }
1753        }
1754   };
1755
1756   class MEDFileStructuredMesh : public MEDFileMesh
1757   {
1758   public:
1759     %extend
1760     {
1761       MEDCoupling1SGTUMesh *getImplicitFaceMesh() const
1762       {
1763         MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1764         if(ret)
1765           ret->incrRef();
1766         return ret;
1767       }
1768     }
1769   };
1770
1771   class MEDFileCMesh : public MEDFileStructuredMesh
1772   {
1773   public:
1774     static MEDFileCMesh *New();
1775     static MEDFileCMesh *New(DataArrayByte *db);
1776     static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1777     static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1778     void setMesh(MEDCouplingCMesh *m);
1779     int getSpaceDimension() const;
1780     %extend
1781        {
1782          MEDFileCMesh()
1783          {
1784            return MEDFileCMesh::New();
1785          }
1786
1787          MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1788          {
1789            return MEDFileCMesh::New(fileName,mrs);
1790          }
1791
1792          MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1793          {
1794            return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1795          }
1796
1797          MEDFileCMesh(DataArrayByte *db)
1798          {
1799            return MEDFileCMesh::New(db);
1800          }
1801
1802          PyObject *getMesh() const
1803          {
1804            const MEDCouplingCMesh *tmp=self->getMesh();
1805            if(tmp)
1806              tmp->incrRef();
1807            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1808          }
1809        }
1810   };
1811
1812   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1813   {
1814   public:
1815     static MEDFileCurveLinearMesh *New();
1816     static MEDFileCurveLinearMesh *New(DataArrayByte *db);
1817     static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
1818     static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
1819     void setMesh(MEDCouplingCurveLinearMesh *m);
1820     int getSpaceDimension() const;
1821     int getMeshDimension() const;
1822     %extend
1823        {
1824          MEDFileCurveLinearMesh()
1825          {
1826            return MEDFileCurveLinearMesh::New();
1827          }
1828
1829          MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
1830          {
1831            return MEDFileCurveLinearMesh::New(fileName,mrs);
1832          }
1833
1834          MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
1835          {
1836            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1837          }
1838
1839          MEDFileCurveLinearMesh(DataArrayByte *db)
1840          {
1841            return MEDFileCurveLinearMesh::New(db);
1842          }
1843
1844          PyObject *getMesh() const
1845          {
1846            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1847            if(tmp)
1848              tmp->incrRef();
1849            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1850          }
1851        }
1852   };
1853
1854   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1855   {
1856   public:
1857     static MEDFileMeshMultiTS *New();
1858     static MEDFileMeshMultiTS *New(const std::string& fileName);
1859     static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
1860     MEDFileMeshMultiTS *deepCopy() const;
1861     std::string getName() const;
1862     void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
1863     void cartesianizeMe();
1864     %extend
1865        {
1866          MEDFileMeshMultiTS()
1867          {
1868            return MEDFileMeshMultiTS::New();
1869          }
1870
1871          MEDFileMeshMultiTS(const std::string& fileName)
1872          {
1873            return MEDFileMeshMultiTS::New(fileName);
1874          }
1875
1876          MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName)
1877          {
1878            return MEDFileMeshMultiTS::New(fileName,mName);
1879          }
1880
1881          MEDFileMesh *getOneTimeStep() const
1882            {
1883              MEDFileMesh *ret=self->getOneTimeStep();
1884              if(ret)
1885                ret->incrRef();
1886              return ret;
1887            }
1888        }
1889   };
1890
1891   class MEDFileMeshesIterator
1892   {
1893   public:
1894     %extend
1895     {
1896       PyObject *next()
1897       {
1898         MEDFileMesh *ret=self->nextt();
1899         if(ret)
1900           {
1901             ret->incrRef();
1902             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1903           }
1904         else
1905           {
1906             PyErr_SetString(PyExc_StopIteration,"No more data.");
1907             return 0;
1908           }
1909       }
1910     }
1911   };
1912
1913   class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1914   {
1915   public:
1916     static MEDFileMeshes *New();
1917     static MEDFileMeshes *New(DataArrayByte *db);
1918     MEDFileMeshes *deepCopy() const;
1919     int getNumberOfMeshes() const;
1920     std::vector<std::string> getMeshesNames() const;
1921     //
1922     void resize(int newSize);
1923     void pushMesh(MEDFileMesh *mesh);
1924     void setMeshAtPos(int i, MEDFileMesh *mesh);
1925     void destroyMeshAtPos(int i);
1926     void cartesianizeMe();
1927     bool presenceOfStructureElements() const;
1928     void killStructureElements();
1929     %extend
1930        {
1931          MEDFileMeshes()
1932          {
1933            return MEDFileMeshes::New();
1934          }
1935
1936          MEDFileMeshes(const std::string& fileName)
1937          {
1938            return MEDFileMeshes::New(fileName);
1939          }
1940
1941          MEDFileMeshes(DataArrayByte *db)
1942          {
1943            return MEDFileMeshes::New(db);
1944          }
1945
1946          std::string __str__() const
1947            {
1948              return self->simpleRepr();
1949            }
1950
1951          MEDFileMesh *__getitem__(PyObject *obj)
1952          {
1953            static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1954              if(PyInt_Check(obj))
1955              {
1956                MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1957                if(ret)
1958                  ret->incrRef();
1959                return ret;
1960              }
1961            MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1962            if(ret)
1963              ret->incrRef();
1964            return ret;
1965          }
1966
1967          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
1968          {
1969            self->setMeshAtPos(obj,mesh);
1970            return self;
1971          }
1972
1973          MEDFileMeshesIterator *__iter__()
1974          {
1975            return self->iterator();
1976          }
1977
1978          int __len__() const
1979          {
1980            return self->getNumberOfMeshes();
1981          }
1982
1983          MEDFileMesh *getMeshAtPos(int i) const
1984            {
1985              MEDFileMesh *ret=self->getMeshAtPos(i);
1986              if(ret)
1987                ret->incrRef();
1988              return ret;
1989            }
1990          MEDFileMesh *getMeshWithName(const std::string& mname) const
1991            {
1992              MEDFileMesh *ret=self->getMeshWithName(mname);
1993              if(ret)
1994                ret->incrRef();
1995              return ret;
1996            }
1997        }
1998   };
1999
2000   class MEDFileFieldLoc : public RefCountObject
2001   {
2002   public:
2003     std::string getName() const;
2004     int getDimension() const;
2005     int getNumberOfGaussPoints() const;
2006     int getNumberOfPointsInCells() const;
2007     const std::vector<double>& getRefCoords() const;
2008     const std::vector<double>& getGaussCoords() const;
2009     const std::vector<double>& getGaussWeights() const;
2010     bool isEqual(const MEDFileFieldLoc& other, double eps) const;
2011   %extend
2012     {
2013       std::string __str__() const
2014       {
2015         return self->repr();
2016       }
2017     }
2018   };
2019
2020   class MEDFileFieldGlobsReal
2021   {
2022   public:
2023     void resetContent();
2024     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
2025     void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
2026     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2027     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
2028     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
2029     void checkGlobsCoherency() const;
2030     void checkGlobsPflsPartCoherency() const;
2031     void checkGlobsLocsPartCoherency() const;
2032     std::vector<std::string> getPfls() const;
2033     std::vector<std::string> getLocs() const;
2034     bool existsPfl(const std::string& pflName) const;
2035     bool existsLoc(const std::string& locName) const;
2036     std::string createNewNameOfPfl() const;
2037     std::string createNewNameOfLoc() const;
2038     std::vector< std::vector<int> > whichAreEqualProfiles() const;
2039     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
2040     virtual std::vector<std::string> getPflsReallyUsed() const;
2041     virtual std::vector<std::string> getLocsReallyUsed() const;
2042     virtual std::vector<std::string> getPflsReallyUsedMulti() const;
2043     virtual std::vector<std::string> getLocsReallyUsedMulti() const;
2044     void killProfileIds(const std::vector<int>& pflIds);
2045     void killLocalizationIds(const std::vector<int>& locIds);
2046     void changePflName(const std::string& oldName, const std::string& newName);
2047     void changeLocName(const std::string& oldName, const std::string& newName);
2048     int getNbOfGaussPtPerCell(int locId) const;
2049     int getLocalizationId(const std::string& loc) const;
2050     int getProfileId(const std::string& pfl) const;
2051     void killStructureElementsInGlobs();
2052   %extend
2053      {
2054        PyObject *getProfile(const std::string& pflName) const
2055        {
2056          const DataArrayIdType *ret=self->getProfile(pflName);
2057          if(ret)
2058            ret->incrRef();
2059          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2060        }
2061
2062        PyObject *getProfileFromId(int pflId) const
2063        {
2064          const DataArrayIdType *ret=self->getProfileFromId(pflId);
2065          if(ret)
2066            ret->incrRef();
2067          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2068        }
2069
2070        PyObject *getLocalizationFromId(int locId) const
2071        {
2072          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2073          if(loc)
2074            loc->incrRef();
2075          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2076        }
2077
2078        PyObject *getLocalization(const std::string& locName) const
2079        {
2080          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2081          if(loc)
2082            loc->incrRef();
2083          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2084        }
2085
2086        PyObject *zipPflsNames()
2087        {
2088          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2089          return convertVecPairVecStToPy(ret);
2090        }
2091
2092        PyObject *zipLocsNames(double eps)
2093        {
2094          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2095          return convertVecPairVecStToPy(ret);
2096        }
2097
2098        void changePflsNames(PyObject *li)
2099        {
2100          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2101          self->changePflsNames(v);
2102        }
2103
2104        void changePflsRefsNamesGen(PyObject *li)
2105        {
2106          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2107          self->changePflsRefsNamesGen(v);
2108        }
2109
2110        void changePflsNamesInStruct(PyObject *li)
2111        {
2112          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2113          self->changePflsNamesInStruct(v);
2114        }
2115
2116        void changeLocsNames(PyObject *li)
2117        {
2118          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2119          self->changeLocsNames(v);
2120        }
2121
2122        void changeLocsRefsNamesGen(PyObject *li)
2123        {
2124          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2125          self->changeLocsRefsNamesGen(v);
2126        }
2127
2128        void changeLocsNamesInStruct(PyObject *li)
2129        {
2130          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2131          self->changeLocsNamesInStruct(v);
2132        }
2133
2134        std::string simpleReprGlobs() const
2135        {
2136          std::ostringstream oss;
2137          self->simpleReprGlobs(oss);
2138          return oss.str();
2139        }
2140      }
2141   };
2142
2143   class MEDFileEntities
2144   {
2145   public:
2146     %extend
2147       {
2148         static MEDFileEntities *BuildFrom(PyObject *entities)
2149         {
2150           std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2151           std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2152           {
2153             std::size_t sz(inp0.size());
2154             inp.resize(sz);
2155             for(std::size_t i=0;i<sz;i++)
2156               inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2157           }
2158           return MEDFileEntities::BuildFrom(&inp);
2159         }
2160       }
2161   private:
2162     MEDFileEntities();
2163   };
2164
2165   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2166   {
2167   public:
2168     static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
2169     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2170     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2171     static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
2172     void loadArrays();
2173     void loadArraysIfNecessary();
2174     void unloadArrays();
2175     void unloadArraysWithoutDataLoss();
2176     int getDimension() const;
2177     int getIteration() const;
2178     int getOrder() const;
2179     std::string getName();
2180     void setName(const std::string& name);
2181     std::string getMeshName();
2182     void setMeshName(const std::string& newMeshName);
2183     int getMeshIteration() const;
2184     int getMeshOrder() const;
2185     int getNumberOfComponents() const;
2186     bool isDealingTS(int iteration, int order) const;
2187     void setInfo(const std::vector<std::string>& infos);
2188     const std::vector<std::string>& getInfo() const;
2189     bool presenceOfMultiDiscPerGeoType() const;
2190     void setTime(int iteration, int order, double val);
2191     virtual MEDFileAnyTypeField1TS *shallowCpy() const;
2192     MEDFileAnyTypeField1TS *deepCopy() const;
2193     std::string getDtUnit() const;
2194     void setDtUnit(const std::string& dtUnit);
2195     %extend
2196     {
2197       PyObject *getTime()
2198       {
2199         int tmp1,tmp2;
2200         double tmp0=self->getTime(tmp1,tmp2);
2201         PyObject *res = PyList_New(3);
2202         PyList_SetItem(res,0,SWIG_From_int(tmp1));
2203         PyList_SetItem(res,1,SWIG_From_int(tmp2));
2204         PyList_SetItem(res,2,SWIG_From_double(tmp0));
2205         return res;
2206       }
2207
2208       PyObject *getDtIt() const
2209       {
2210         std::pair<int,int> res=self->getDtIt();
2211         PyObject *elt=PyTuple_New(2);
2212         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2213         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2214         return elt;
2215       }
2216
2217       MEDFileAnyTypeField1TS *buildNewEmpty() const
2218       {
2219         MCAuto<MEDFileAnyTypeField1TS> ret = self->buildNewEmpty();
2220         return ret.retn();
2221       }
2222
2223       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
2224       {
2225         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2226       }
2227
2228       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
2229       {
2230         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2231       }
2232
2233       bool changeMeshNames(PyObject *li)
2234       {
2235         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2236         return self->changeMeshNames(modifTab);
2237       }
2238
2239       PyObject *getTypesOfFieldAvailable() const
2240       {
2241         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2242         PyObject *ret2=PyList_New(ret.size());
2243         for(int i=0;i<(int)ret.size();i++)
2244           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2245         return ret2;
2246       }
2247
2248       PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
2249       {
2250         std::vector<int> ret1;
2251         int ret0=self->getNonEmptyLevels(mname,ret1);
2252         PyObject *elt=PyTuple_New(2);
2253         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2254         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2255         return elt;
2256       }
2257
2258       PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
2259       {
2260         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2261         std::vector< std::vector<TypeOfField> > typesF;
2262         std::vector< std::vector<std::string> > pfls;
2263         std::vector< std::vector<std::string> > locs;
2264         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2265         std::size_t sz=ret.size();
2266         PyObject *ret2=PyList_New(sz);
2267            for(std::size_t i=0;i<sz;i++)
2268              {
2269                const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2270                const std::vector<TypeOfField>& typesFI=typesF[i];
2271                const std::vector<std::string>& pflsI=pfls[i];
2272                const std::vector<std::string>& locsI=locs[i];
2273                PyObject *elt=PyTuple_New(2);
2274                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2275                std::size_t sz2=ret[i].size();
2276                PyObject *elt2=PyList_New(sz2);
2277                for(std::size_t j=0;j<sz2;j++)
2278                  {
2279                    PyObject *elt3=PyTuple_New(4);
2280                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2281                    PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2282                    PyTuple_SetItem(elt3,1,elt4);
2283                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2284                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2285                    PyList_SetItem(elt2,j,elt3);
2286                  }
2287                PyTuple_SetItem(elt,1,elt2);
2288                PyList_SetItem(ret2,i,elt);
2289              }
2290            return ret2;
2291       }
2292
2293       PyObject *splitComponents() const
2294       {
2295         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2296         std::size_t sz=ret.size();
2297         PyObject *retPy=PyList_New(sz);
2298         for(std::size_t i=0;i<sz;i++)
2299           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2300         return retPy;
2301       }
2302
2303       PyObject *splitDiscretizations() const
2304       {
2305         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2306         std::size_t sz=ret.size();
2307         PyObject *retPy=PyList_New(sz);
2308         for(std::size_t i=0;i<sz;i++)
2309           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2310         return retPy;
2311       }
2312
2313       PyObject *splitMultiDiscrPerGeoTypes() const
2314       {
2315         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2316         std::size_t sz=ret.size();
2317         PyObject *retPy=PyList_New(sz);
2318         for(std::size_t i=0;i<sz;i++)
2319           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2320         return retPy;
2321       }
2322
2323       MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2324       {
2325         std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2326         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2327         return self->extractPart(extractDefCpp,mm);
2328       }
2329     }
2330   };
2331
2332   class MEDFileField1TS : public MEDFileAnyTypeField1TS
2333   {
2334   public:
2335     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2336     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2337     static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
2338     static MEDFileField1TS *New(DataArrayByte *db);
2339     static MEDFileField1TS *New();
2340     MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
2341     MEDCoupling::MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const;
2342     void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
2343     MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
2344     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2345     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2346     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2347     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2348     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2349     //
2350     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
2351     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2352     void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2353     void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
2354     void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
2355     %extend
2356        {
2357          MEDFileField1TS(const std::string& fileName, bool loadAll=true)
2358          {
2359            return MEDFileField1TS::New(fileName,loadAll);
2360          }
2361
2362          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2363          {
2364            return MEDFileField1TS::New(fileName,fieldName,loadAll);
2365          }
2366
2367          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2368          {
2369            return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2370          }
2371
2372          MEDFileField1TS(DataArrayByte *db)
2373          {
2374            return MEDFileField1TS::New(db);
2375          }
2376
2377          MEDFileField1TS()
2378          {
2379            return MEDFileField1TS::New();
2380          }
2381
2382          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
2383          {
2384            const DataArrayDouble *arr=0;
2385            if(field)
2386              arr=field->getArray();
2387            self->copyTinyInfoFrom(field,arr);
2388          }
2389
2390          std::string __str__() const
2391          {
2392            return self->simpleRepr();
2393          }
2394
2395          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2396          {
2397            return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2398          }
2399
2400          PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
2401          {
2402            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2403            std::vector< std::vector<TypeOfField> > typesF;
2404            std::vector< std::vector<std::string> > pfls;
2405            std::vector< std::vector<std::string> > locs;
2406            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2407            std::size_t sz=ret.size();
2408            PyObject *ret2=PyList_New(sz);
2409            for(std::size_t i=0;i<sz;i++)
2410              {
2411                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2412                const std::vector<TypeOfField>& typesFI=typesF[i];
2413                const std::vector<std::string>& pflsI=pfls[i];
2414                const std::vector<std::string>& locsI=locs[i];
2415                PyObject *elt=PyTuple_New(2);
2416                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2417                std::size_t sz2=ret[i].size();
2418                PyObject *elt2=PyList_New(sz2);
2419                for(std::size_t j=0;j<sz2;j++)
2420                  {
2421                    PyObject *elt3=PyTuple_New(4);
2422                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2423                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2424                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2425                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2426                    PyList_SetItem(elt2,j,elt3);
2427                  }
2428                PyTuple_SetItem(elt,1,elt2);
2429                PyList_SetItem(ret2,i,elt);
2430              }
2431            return ret2;
2432          }
2433
2434          DataArrayDouble *getUndergroundDataArray() const
2435          {
2436            DataArrayDouble *ret=self->getUndergroundDataArray();
2437            if(ret)
2438              ret->incrRef();
2439            return ret;
2440          }
2441
2442          PyObject *getUndergroundDataArrayExt() const
2443          {
2444            return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2445          }
2446        }
2447   };
2448
2449   class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
2450   {
2451   public:
2452     static MEDFileInt32Field1TS *New();
2453     static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
2454     static MEDFileInt32Field1TS *New(DataArrayByte *db);
2455     static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2456     static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2457     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2458     //
2459     void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
2460     void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2461     void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2462     void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
2463     MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
2464     MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2465     MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2466     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2467     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2468     MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2469     %extend
2470     {
2471       MEDFileInt32Field1TS()
2472       {
2473         return MEDFileInt32Field1TS::New();
2474       }
2475
2476       MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
2477       {
2478         return MEDFileInt32Field1TS::New(fileName,loadAll);
2479       }
2480
2481       MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2482       {
2483         return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
2484       }
2485
2486       MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2487       {
2488         return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2489       }
2490
2491       MEDFileInt32Field1TS(DataArrayByte *db)
2492       {
2493         return MEDFileInt32Field1TS::New(db);
2494       }
2495
2496       std::string __str__() const
2497       {
2498         return self->simpleRepr();
2499       }
2500
2501       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2502       {
2503          return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
2504       }
2505
2506       DataArrayInt32 *getUndergroundDataArray() const
2507       {
2508         DataArrayInt32 *ret=self->getUndergroundDataArray();
2509         if(ret)
2510           ret->incrRef();
2511         return ret;
2512       }
2513
2514       PyObject *getUndergroundDataArrayExt() const
2515       {
2516         return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
2517       }
2518     }
2519   };
2520
2521   class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
2522   {
2523   public:
2524     static MEDFileInt64Field1TS *New();
2525     static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
2526     static MEDFileInt64Field1TS *New(DataArrayByte *db);
2527     static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2528     static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2529     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2530     //
2531     void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
2532     void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2533     void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2534     void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
2535     MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
2536     MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2537     MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2538     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2539     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2540     MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2541     %extend
2542     {
2543       MEDFileInt64Field1TS()
2544       {
2545         return MEDFileInt64Field1TS::New();
2546       }
2547
2548       MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
2549       {
2550         return MEDFileInt64Field1TS::New(fileName,loadAll);
2551       }
2552
2553       MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2554       {
2555         return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
2556       }
2557
2558       MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2559       {
2560         return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
2561       }
2562
2563       MEDFileInt64Field1TS(DataArrayByte *db)
2564       {
2565         return MEDFileInt64Field1TS::New(db);
2566       }
2567
2568       std::string __str__() const
2569       {
2570         return self->simpleRepr();
2571       }
2572
2573       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2574       {
2575          return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
2576       }
2577
2578       DataArrayInt64 *getUndergroundDataArray() const
2579       {
2580         DataArrayInt64 *ret=self->getUndergroundDataArray();
2581         if(ret)
2582           ret->incrRef();
2583         return ret;
2584       }
2585
2586       PyObject *getUndergroundDataArrayExt() const
2587       {
2588         return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
2589       }
2590     }
2591   };
2592
2593   class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2594   {
2595   public:
2596     static MEDFileFloatField1TS *New();
2597     static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
2598     static MEDFileFloatField1TS *New(DataArrayByte *db);
2599     static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2600     static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
2601     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
2602     //
2603     void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
2604     void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2605     void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
2606     void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
2607     MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
2608     MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
2609     MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
2610     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
2611     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
2612     MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
2613     %extend
2614     {
2615       MEDFileFloatField1TS()
2616       {
2617         return MEDFileFloatField1TS::New();
2618       }
2619
2620       MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
2621       {
2622         return MEDFileFloatField1TS::New(fileName,loadAll);
2623       }
2624
2625       MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
2626       {
2627         return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2628       }
2629
2630       MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
2631       {
2632         return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2633       }
2634
2635       MEDFileFloatField1TS(DataArrayByte *db)
2636       {
2637         return MEDFileFloatField1TS::New(db);
2638       }
2639
2640       std::string __str__() const
2641       {
2642         return self->simpleRepr();
2643       }
2644
2645       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
2646       {
2647          return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2648       }
2649
2650       DataArrayFloat *getUndergroundDataArray() const
2651       {
2652         DataArrayFloat *ret=self->getUndergroundDataArray();
2653         if(ret)
2654           ret->incrRef();
2655         return ret;
2656       }
2657
2658       PyObject *getUndergroundDataArrayExt() const
2659       {
2660         return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2661       }
2662     }
2663   };
2664
2665   class MEDFileAnyTypeFieldMultiTSIterator
2666   {
2667   public:
2668     %extend
2669     {
2670       PyObject *next()
2671       {
2672         MEDFileAnyTypeField1TS *ret=self->nextt();
2673         if(ret)
2674           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2675         else
2676           {
2677             PyErr_SetString(PyExc_StopIteration,"No more data.");
2678             return 0;
2679           }
2680       }
2681     }
2682   };
2683
2684   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2685   {
2686   public:
2687     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
2688     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
2689     MEDFileAnyTypeFieldMultiTS *deepCopy() const;
2690     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
2691     std::string getName() const;
2692     void setName(const std::string& name);
2693     std::string getDtUnit() const;
2694     void setDtUnit(const std::string& dtUnit);
2695     std::string getMeshName() const;
2696     void setMeshName(const std::string& newMeshName);
2697     void setInfo(const std::vector<std::string>& infos);
2698     const std::vector<std::string>& getInfo() const;
2699     bool presenceOfMultiDiscPerGeoType() const;
2700     int getNumberOfComponents() const;
2701     int getNumberOfTS() const;
2702     void eraseEmptyTS();
2703     int getPosOfTimeStep(int iteration, int order) const;
2704     int getPosGivenTime(double time, double eps=1e-8) const;
2705     void loadArrays();
2706     void loadArraysIfNecessary();
2707     void unloadArrays();
2708     void unloadArraysWithoutDataLoss();
2709     //
2710     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
2711     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
2712     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
2713     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
2714     void synchronizeNameScope();
2715     MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
2716     %extend
2717     {
2718       int __len__() const
2719       {
2720         return self->getNumberOfTS();
2721       }
2722
2723       int getTimeId(PyObject *elt0) const
2724       {
2725         if(elt0 && PyInt_Check(elt0))
2726           {//fmts[3]
2727             int pos=(int)PyInt_AS_LONG(elt0);
2728             return pos;
2729           }
2730         else if(elt0 && PyTuple_Check(elt0))
2731           {
2732             if(PyTuple_Size(elt0)==2)
2733               {
2734                 PyObject *o0=PyTuple_GetItem(elt0,0);
2735                 PyObject *o1=PyTuple_GetItem(elt0,1);
2736                 if(PyInt_Check(o0) && PyInt_Check(o1))
2737                   {//fmts(1,-1)
2738                     int iter=(int)PyInt_AS_LONG(o0);
2739                     int order=(int)PyInt_AS_LONG(o1);
2740                     return self->getPosOfTimeStep(iter,order);
2741                   }
2742                 else
2743                   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 !");
2744               }
2745             else
2746               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 !");
2747           }
2748         else if(elt0 && PyFloat_Check(elt0))
2749           {
2750             double val=PyFloat_AS_DOUBLE(elt0);
2751             return self->getPosGivenTime(val);
2752           }
2753         else
2754           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2755       }
2756
2757       PyObject *getIterations() const
2758       {
2759         std::vector< std::pair<int,int> > res(self->getIterations());
2760         return convertVecPairIntToPy(res);
2761       }
2762
2763       PyObject *getTimeSteps() const
2764       {
2765         std::vector<double> ret1;
2766         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2767         std::size_t sz=ret.size();
2768         PyObject *ret2=PyList_New(sz);
2769         for(std::size_t i=0;i<sz;i++)
2770           {
2771             PyObject *elt=PyTuple_New(3);
2772             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2773             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2774             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2775             PyList_SetItem(ret2,i,elt);
2776           }
2777         return ret2;
2778       }
2779
2780       PyObject *getTypesOfFieldAvailable() const
2781       {
2782         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2783         PyObject *ret2=PyList_New(ret.size());
2784         for(int i=0;i<(int)ret.size();i++)
2785           {
2786             const std::vector<TypeOfField>& rett=ret[i];
2787             PyObject *ret3=PyList_New(rett.size());
2788             for(int j=0;j<(int)rett.size();j++)
2789               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2790             PyList_SetItem(ret2,i,ret3);
2791           }
2792         return ret2;
2793       }
2794
2795       PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
2796       {
2797         std::vector<int> ret1;
2798         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2799         PyObject *elt=PyTuple_New(2);
2800         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2801         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2802         return elt;
2803       }
2804
2805       PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
2806       {
2807         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2808         std::vector< std::vector<TypeOfField> > typesF;
2809         std::vector< std::vector<std::string> > pfls;
2810         std::vector< std::vector<std::string> > locs;
2811         std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2812         std::size_t sz=ret.size();
2813         PyObject *ret2=PyList_New(sz);
2814         for(std::size_t i=0;i<sz;i++)
2815           {
2816             const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
2817             const std::vector<TypeOfField>& typesFI=typesF[i];
2818             const std::vector<std::string>& pflsI=pfls[i];
2819             const std::vector<std::string>& locsI=locs[i];
2820             PyObject *elt=PyTuple_New(2);
2821             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2822             std::size_t sz2=ret[i].size();
2823             PyObject *elt2=PyList_New(sz2);
2824             for(std::size_t j=0;j<sz2;j++)
2825               {
2826                 PyObject *elt3=PyTuple_New(4);
2827                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2828                 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
2829                 PyTuple_SetItem(elt3,1,elt4);
2830                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2831                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2832                 PyList_SetItem(elt2,j,elt3);
2833               }
2834             PyTuple_SetItem(elt,1,elt2);
2835             PyList_SetItem(ret2,i,elt);
2836           }
2837         return ret2;
2838       }
2839
2840       std::vector<int> getTimeIds(PyObject *elts) const
2841       {
2842         if(PyList_Check(elts))
2843           {
2844             std::size_t sz=PyList_Size(elts);
2845             std::vector<int> ret(sz);
2846             for(std::size_t i=0;i<sz;i++)
2847               {
2848                 PyObject *elt=PyList_GetItem(elts,i);
2849                 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2850               }
2851             return ret;
2852           }
2853         else
2854           {
2855             std::vector<int> ret(1);
2856             ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2857             return ret;
2858           }
2859       }
2860
2861       void __delitem__(PyObject *elts)
2862       {
2863         if(PySlice_Check(elts))
2864           {
2865             Py_ssize_t strt=2,stp=2,step=2;
2866             GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2867             self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
2868           }
2869         else
2870           {
2871             std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2872             if(!idsToRemove.empty())
2873               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2874           }
2875       }
2876
2877       void eraseTimeStepIds(PyObject *li)
2878       {
2879         mcIdType sw;
2880         int pos1;
2881         std::vector<int> pos2;
2882         DataArrayInt32 *pos3=0;
2883         DataArrayIntTuple *pos4=0;
2884         convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2885         switch(sw)
2886           {
2887           case 1:
2888             {
2889               self->eraseTimeStepIds(&pos1,&pos1+1);
2890               return;
2891             }
2892           case 2:
2893             {
2894               if(pos2.empty())
2895                 return;
2896               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2897               return ;
2898             }
2899           case 3:
2900             {
2901               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2902               return ;
2903             }
2904           default:
2905             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2906           }
2907       }
2908
2909       MEDFileAnyTypeFieldMultiTSIterator *__iter__()
2910       {
2911         return self->iterator();
2912       }
2913
2914       PyObject *__getitem__(PyObject *elt0) const
2915       {
2916         if(elt0 && PyList_Check(elt0))
2917           {
2918             std::size_t sz=PyList_Size(elt0);
2919             MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
2920             int *pt=da->getPointer();
2921             for(std::size_t i=0;i<sz;i++,pt++)
2922               {
2923                 PyObject *elt1=PyList_GetItem(elt0,i);
2924                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2925               }
2926             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2927           }
2928         else if(elt0 && PySlice_Check(elt0))
2929           {
2930             Py_ssize_t strt=2,stp=2,step=2;
2931             GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2932             return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
2933           }
2934         else
2935           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2936       }
2937
2938       bool changeMeshNames(PyObject *li)
2939       {
2940         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2941         return self->changeMeshNames(modifTab);
2942       }
2943
2944       PyObject *splitComponents() const
2945       {
2946         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2947         std::size_t sz=ret.size();
2948         PyObject *retPy=PyList_New(sz);
2949         for(std::size_t i=0;i<sz;i++)
2950           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2951         return retPy;
2952       }
2953
2954       PyObject *splitDiscretizations() const
2955       {
2956         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2957         std::size_t sz=ret.size();
2958         PyObject *retPy=PyList_New(sz);
2959         for(std::size_t i=0;i<sz;i++)
2960           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2961         return retPy;
2962       }
2963
2964       PyObject *splitMultiDiscrPerGeoTypes() const
2965       {
2966         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2967         std::size_t sz=ret.size();
2968         PyObject *retPy=PyList_New(sz);
2969         for(std::size_t i=0;i<sz;i++)
2970           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2971         return retPy;
2972       }
2973
2974       void pushBackTimeSteps(PyObject *li)
2975       {
2976         void *argp(0);
2977         int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2978         if(SWIG_IsOK(status))
2979           {
2980             self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2981           }
2982         else
2983           {
2984             std::vector<MEDFileAnyTypeField1TS *> tmp;
2985             convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2986             self->pushBackTimeSteps(tmp);
2987           }
2988       }
2989
2990       MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2991       {
2992         std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
2993         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2994         return self->extractPart(extractDefCpp,mm);
2995       }
2996
2997       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
2998       {
2999         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3000         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3001         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
3002         std::size_t sz=ret.size();
3003         PyObject *retPy=PyList_New(sz);
3004         for(std::size_t i=0;i<sz;i++)
3005           {
3006             std::size_t sz2=ret[i].size();
3007             PyObject *ret1Py=PyList_New(sz2);
3008             for(std::size_t j=0;j<sz2;j++)
3009               {
3010                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3011                 if(elt)
3012                   elt->incrRef();
3013                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3014               }
3015             PyList_SetItem(retPy,i,ret1Py);
3016           }
3017         return retPy;
3018       }
3019
3020       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
3021       {
3022         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
3023         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
3024         std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
3025         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
3026         if(ret2.size()!=ret.size())
3027           {
3028             std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
3029             throw INTERP_KERNEL::Exception(oss.str().c_str());
3030           }
3031         std::size_t sz=ret.size();
3032         PyObject *retPy=PyList_New(sz);
3033         for(std::size_t i=0;i<sz;i++)
3034           {
3035             std::size_t sz2=ret[i].size();
3036             PyObject *ret0Py=PyTuple_New(2);
3037             PyObject *ret1Py=PyList_New(sz2);
3038             for(std::size_t j=0;j<sz2;j++)
3039               {
3040                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
3041                 if(elt)
3042                   elt->incrRef();
3043                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
3044               }
3045             PyTuple_SetItem(ret0Py,0,ret1Py);
3046             PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
3047             PyList_SetItem(retPy,i,ret0Py);
3048           }
3049         return retPy;
3050       }
3051     }
3052   };
3053
3054   class MEDFileInt32FieldMultiTS;
3055   class MEDFileInt64FieldMultiTS;
3056
3057   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3058   {
3059   public:
3060     static MEDFileFieldMultiTS *New();
3061     static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3062     static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3063     static MEDFileFieldMultiTS *New(DataArrayByte *db);
3064     //
3065     MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
3066     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3067     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3068     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3069     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3070     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3071     //
3072     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
3073     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3074     MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
3075     %extend
3076        {
3077          static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
3078          {
3079             std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
3080             convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
3081             std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
3082             convertPyToVectorVectorPairInt(dtsPy,dts2);
3083             std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
3084             MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
3085             return ret.retn();
3086          }
3087
3088          MEDFileFieldMultiTS()
3089          {
3090            return MEDFileFieldMultiTS::New();
3091          }
3092
3093          MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
3094          {
3095            return MEDFileFieldMultiTS::New(fileName,loadAll);
3096          }
3097
3098          MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3099          {
3100            return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
3101          }
3102
3103          MEDFileFieldMultiTS(DataArrayByte *db)
3104          {
3105            return MEDFileFieldMultiTS::New(db);
3106          }
3107
3108          static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3109          {
3110            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3111            std::size_t sz(tmp.size());
3112            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3113            for(std::size_t i=0;i<sz;i++)
3114              {
3115                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3116                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3117              }
3118            return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3119          }
3120
3121          std::string __str__() const
3122          {
3123            return self->simpleRepr();
3124          }
3125
3126          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3127          {
3128            DataArrayIdType *ret1=0;
3129            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3130            PyObject *ret=PyTuple_New(2);
3131            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3132            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3133            return ret;
3134          }
3135
3136          PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const
3137          {
3138            std::vector<INTERP_KERNEL::NormalizedCellType> types;
3139            std::vector< std::vector<TypeOfField> > typesF;
3140            std::vector< std::vector<std::string> > pfls;
3141            std::vector< std::vector<std::string> > locs;
3142            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3143            std::size_t sz=ret.size();
3144            PyObject *ret2=PyList_New(sz);
3145            for(std::size_t i=0;i<sz;i++)
3146              {
3147                const std::vector<DataArrayDouble *>& dadsI=ret[i];
3148                const std::vector<TypeOfField>& typesFI=typesF[i];
3149                const std::vector<std::string>& pflsI=pfls[i];
3150                const std::vector<std::string>& locsI=locs[i];
3151                PyObject *elt=PyTuple_New(2);
3152                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3153                std::size_t sz2=ret[i].size();
3154                PyObject *elt2=PyList_New(sz2);
3155                for(std::size_t j=0;j<sz2;j++)
3156                  {
3157                    PyObject *elt3=PyTuple_New(4);
3158                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3159                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3160                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3161                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3162                    PyList_SetItem(elt2,j,elt3);
3163                  }
3164                PyTuple_SetItem(elt,1,elt2);
3165                PyList_SetItem(ret2,i,elt);
3166              }
3167            return ret2;
3168          }
3169          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const
3170          {
3171            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3172            if(ret)
3173              ret->incrRef();
3174            return ret;
3175          }
3176
3177          PyObject *getUndergroundDataArrayExt(int iteration, int order) const
3178          {
3179            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > > elt1Cpp;
3180            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3181            if(elt0)
3182              elt0->incrRef();
3183            PyObject *ret=PyTuple_New(2);
3184            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3185            std::size_t sz=elt1Cpp.size();
3186            PyObject *elt=PyList_New(sz);
3187            for(std::size_t i=0;i<sz;i++)
3188              {
3189                PyObject *elt1=PyTuple_New(2);
3190                PyObject *elt2=PyTuple_New(2);
3191                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3192                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3193                PyObject *elt3=PyTuple_New(2);
3194                PyTuple_SetItem(elt3,0,PyInt_FromLong(elt1Cpp[i].second.first));
3195                PyTuple_SetItem(elt3,1,PyInt_FromLong(elt1Cpp[i].second.second));
3196                PyTuple_SetItem(elt1,0,elt2);
3197                PyTuple_SetItem(elt1,1,elt3);
3198                PyList_SetItem(elt,i,elt1);
3199              }
3200            PyTuple_SetItem(ret,1,elt);
3201            return ret;
3202          }
3203        }
3204   };
3205
3206   class MEDFileFieldsIterator
3207   {
3208   public:
3209     %extend
3210     {
3211       PyObject *next()
3212       {
3213         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3214         if(ret)
3215           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3216         else
3217           {
3218             PyErr_SetString(PyExc_StopIteration,"No more data.");
3219             return 0;
3220           }
3221       }
3222     }
3223   };
3224
3225   class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3226   {
3227   public:
3228     static MEDFileInt32FieldMultiTS *New();
3229     static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3230     static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3231     static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
3232     //
3233     void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
3234     void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3235     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3236     MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3237     MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3238     MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3239     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3240     MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3241     MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3242     %extend
3243     {
3244       MEDFileInt32FieldMultiTS()
3245       {
3246         return MEDFileInt32FieldMultiTS::New();
3247       }
3248
3249       MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
3250       {
3251         return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
3252       }
3253
3254       MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3255       {
3256         return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
3257       }
3258
3259       MEDFileInt32FieldMultiTS(DataArrayByte *db)
3260       {
3261         return MEDFileInt32FieldMultiTS::New(db);
3262       }
3263
3264       static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3265       {
3266         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3267         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3268         return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3269       }
3270
3271       std::string __str__() const
3272       {
3273         return self->simpleRepr();
3274       }
3275
3276       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3277       {
3278          DataArrayIdType *ret1=0;
3279          DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3280          PyObject *ret=PyTuple_New(2);
3281          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
3282          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3283          return ret;
3284       }
3285
3286       DataArrayInt32 *getUndergroundDataArray(int iteration, int order) const
3287       {
3288         DataArrayInt32 *ret=self->getUndergroundDataArray(iteration,order);
3289         if(ret)
3290           ret->incrRef();
3291         return ret;
3292       }
3293     }
3294   };
3295
3296   class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3297   {
3298   public:
3299     static MEDFileInt64FieldMultiTS *New();
3300     static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3301     static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3302     static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
3303     //
3304     void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
3305     void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3306     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3307     MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
3308     MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3309     MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3310     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3311     MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3312     MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3313     %extend
3314     {
3315       MEDFileInt64FieldMultiTS()
3316       {
3317         return MEDFileInt64FieldMultiTS::New();
3318       }
3319
3320       MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
3321       {
3322         return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
3323       }
3324
3325       MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3326       {
3327         return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
3328       }
3329
3330       MEDFileInt64FieldMultiTS(DataArrayByte *db)
3331       {
3332         return MEDFileInt64FieldMultiTS::New(db);
3333       }
3334
3335       static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3336       {
3337         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3338         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3339         return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3340       }
3341
3342       std::string __str__() const
3343       {
3344         return self->simpleRepr();
3345       }
3346
3347       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3348       {
3349          DataArrayIdType *ret1=0;
3350          DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3351          PyObject *ret=PyTuple_New(2);
3352          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
3353          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3354          return ret;
3355       }
3356
3357       DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
3358       {
3359         DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
3360         if(ret)
3361           ret->incrRef();
3362         return ret;
3363       }
3364     }
3365   };
3366
3367   class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3368   {
3369   public:
3370     static MEDFileFloatFieldMultiTS *New();
3371     static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
3372     static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
3373     static MEDFileFloatFieldMultiTS *New(DataArrayByte *db);
3374     //
3375     void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
3376     void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
3377     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
3378     MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const;
3379     MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
3380     MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
3381     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
3382     MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
3383     MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
3384     %extend
3385     {
3386       MEDFileFloatFieldMultiTS()
3387       {
3388         return MEDFileFloatFieldMultiTS::New();
3389       }
3390
3391       MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true)
3392       {
3393         return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3394       }
3395
3396       MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
3397       {
3398         return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3399       }
3400
3401       MEDFileFloatFieldMultiTS(DataArrayByte *db)
3402       {
3403         return MEDFileFloatFieldMultiTS::New(db);
3404       }
3405
3406       static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3407       {
3408         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3409         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3410         return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3411       }
3412
3413       std::string __str__() const
3414       {
3415         return self->simpleRepr();
3416       }
3417
3418       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
3419       {
3420          DataArrayIdType *ret1=0;
3421          DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3422          PyObject *ret=PyTuple_New(2);
3423          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3424          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3425          return ret;
3426       }
3427
3428       DataArrayFloat *getUndergroundDataArray(int iteration, int order) const
3429       {
3430         DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3431         if(ret)
3432           ret->incrRef();
3433         return ret;
3434       }
3435     }
3436   };
3437
3438   class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3439   {
3440   public:
3441     static MEDFileMeshSupports *New(const std::string& fileName);
3442     std::vector<std::string> getSupMeshNames() const;
3443     %extend
3444        {
3445          MEDFileUMesh *getSupMeshWithName(const std::string& name) const
3446          {
3447            const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3448            MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3449            if(ret2)
3450              ret2->incrRef();
3451            return ret2;
3452          }
3453        }
3454   };
3455
3456   class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3457   {
3458   public:
3459     static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms);
3460   private:
3461     MEDFileStructureElements();
3462   };
3463
3464   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3465   {
3466   public:
3467     static MEDFileFields *New();
3468     static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
3469     static MEDFileFields *New(DataArrayByte *db);
3470     static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
3471     static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
3472     static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
3473     MEDFileFields *deepCopy() const;
3474     MEDFileFields *shallowCpy() const;
3475     void loadArrays();
3476     void loadArraysIfNecessary();
3477     void unloadArrays();
3478     void unloadArraysWithoutDataLoss();
3479     int getNumberOfFields() const;
3480     std::vector<std::string> getFieldsNames() const;
3481     std::vector<std::string> getMeshesNames() const;
3482     //
3483     void resize(int newSize);
3484     void pushField(MEDFileAnyTypeFieldMultiTS *field);
3485     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
3486     int getPosFromFieldName(const std::string& fieldName) const;
3487     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
3488     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
3489     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
3490     bool presenceOfStructureElements() const;
3491     void aggregate(const MEDFileFields& other);
3492     void killStructureElements();
3493     void keepOnlyStructureElements();
3494     void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
3495     void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
3496     void destroyFieldAtPos(int i);
3497     bool removeFieldsWithoutAnyTimeStep();
3498     %extend
3499        {
3500          MEDFileFields()
3501          {
3502            return MEDFileFields::New();
3503          }
3504
3505          MEDFileFields(const std::string& fileName, bool loadAll=true)
3506          {
3507            return MEDFileFields::New(fileName,loadAll);
3508          }
3509
3510          MEDFileFields(DataArrayByte *db)
3511          {
3512            return MEDFileFields::New(db);
3513          }
3514
3515          MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities)
3516          {
3517            return MEDFileFields::NewAdv(fileName,loadAll,entities);
3518          }
3519
3520          std::string __str__() const
3521          {
3522            return self->simpleRepr();
3523          }
3524
3525          MEDFileFields *partOfThisOnStructureElements() const
3526          {
3527            MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3528            return ret.retn();
3529          }
3530
3531          MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const
3532          {
3533            MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3534            return ret.retn();
3535          }
3536
3537          static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true)
3538          {
3539            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3540            std::size_t sz(tmp.size());
3541            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3542            for(std::size_t i=0;i<sz;i++)
3543              {
3544                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3545                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3546              }
3547            return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3548          }
3549
3550          PyObject *getMeshSENames() const
3551          {
3552            std::vector< std::pair<std::string,std::string> > ps;
3553            self->getMeshSENames(ps);
3554            return convertVectPairStToPy(ps);
3555          }
3556
3557          PyObject *getCommonIterations() const
3558          {
3559            bool ret1;
3560            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3561            PyObject *ret=PyTuple_New(2);
3562            PyObject *ret_0=PyList_New(ret0.size());
3563            int rk=0;
3564            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3565              {
3566                PyObject *elt=PyTuple_New(2);
3567                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3568                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3569                PyList_SetItem(ret_0,rk,elt);
3570              }
3571            PyTuple_SetItem(ret,0,ret_0);
3572            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3573            PyTuple_SetItem(ret,1,ret_1);
3574            return ret;
3575          }
3576
3577          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3578          {
3579            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3580            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3581          }
3582
3583          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const
3584          {
3585            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3586            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3587          }
3588
3589          PyObject *__getitem__(PyObject *obj)
3590          {
3591            if(obj && PyList_Check(obj))
3592              {
3593                std::size_t sz=PyList_Size(obj);
3594                MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3595                int *pt=da->getPointer();
3596                for(std::size_t i=0;i<sz;i++,pt++)
3597                  {
3598                    PyObject *elt1=PyList_GetItem(obj,i);
3599                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3600                  }
3601                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3602              }
3603            else
3604              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3605          }
3606
3607          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field)
3608          {
3609            self->setFieldAtPos(obj,field);
3610            return self;
3611          }
3612
3613          int __len__() const
3614          {
3615            return self->getNumberOfFields();
3616          }
3617
3618          MEDFileFieldsIterator *__iter__()
3619          {
3620            return self->iterator();
3621          }
3622
3623          bool changeMeshNames(PyObject *li)
3624          {
3625            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3626            return self->changeMeshNames(modifTab);
3627          }
3628
3629          int getPosOfField(PyObject *elt0) const
3630          {
3631            static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3632            if(!elt0)
3633              throw INTERP_KERNEL::Exception(msg);
3634            if(PyInt_Check(elt0))
3635              {//fmts[3]
3636                return (int)PyInt_AS_LONG(elt0);
3637              }
3638            return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3639          }
3640
3641          std::vector<int> getPosOfFields(PyObject *elts) const
3642          {
3643            if(PyList_Check(elts))
3644              {
3645                std::size_t sz=PyList_Size(elts);
3646                std::vector<int> ret(sz);
3647                for(std::size_t i=0;i<sz;i++)
3648                  {
3649                    PyObject *elt=PyList_GetItem(elts,i);
3650                    ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3651                  }
3652                return ret;
3653              }
3654            else
3655              {
3656                std::vector<int> ret(1);
3657                ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3658                return ret;
3659              }
3660          }
3661
3662          void pushFields(PyObject *fields)
3663          {
3664            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3665            convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3666            self->pushFields(tmp);
3667          }
3668
3669          void __delitem__(PyObject *elts)
3670          {
3671            if(elts && PySlice_Check(elts))
3672              {
3673                Py_ssize_t strt=2,stp=2,step=2;
3674                GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3675                self->destroyFieldsAtPos2((int)strt,(int)stp,(int)step);
3676              }
3677            else
3678              {
3679                std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3680                if(!idsToRemove.empty())
3681                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3682              }
3683          }
3684
3685          MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
3686          {
3687            std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
3688            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3689            return self->extractPart(extractDefCpp,mm);
3690          }
3691
3692          MEDFileFields *linearToQuadratic(const MEDFileMeshes *oldLin, const MEDFileMeshes *newQuad) const
3693          {
3694            MCAuto<MEDFileFields> ret(self->linearToQuadratic(oldLin,newQuad));
3695            return ret.retn();
3696          }
3697        }
3698   };
3699
3700   class MEDFileParameter1TS : public RefCountObject
3701   {
3702   public:
3703     void setIteration(int it);
3704     int getIteration() const;
3705     void setOrder(int order);
3706     int getOrder() const;
3707     void setTimeValue(double time);
3708     void setTime(int dt, int it, double time);
3709     double getTime(int& dt, int& it);
3710     double getTimeValue() const;
3711   };
3712
3713   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3714   {
3715   public:
3716     void setValue(double val);
3717     double getValue() const;
3718     std::string simpleRepr() const;
3719     %extend
3720     {
3721       std::string __str__() const
3722       {
3723         return self->simpleRepr();
3724       }
3725     }
3726   };
3727
3728   class MEDFileParameterTinyInfo : public MEDFileWritable
3729   {
3730   public:
3731     void setDescription(const std::string& name);
3732     std::string getDescription() const;
3733     void setTimeUnit(const std::string& unit);
3734     std::string getTimeUnit() const;
3735   };
3736
3737   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3738   {
3739   public:
3740     static MEDFileParameterDouble1TS *New();
3741     static MEDFileParameterDouble1TS *New(const std::string& fileName);
3742     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
3743     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
3744     virtual MEDFileParameter1TS *deepCopy() const;
3745     virtual std::string simpleRepr() const;
3746     void setName(const std::string& name);
3747     std::string getName() const;
3748     void write(const std::string& fileName, int mode) const;
3749     %extend
3750     {
3751       MEDFileParameterDouble1TS()
3752       {
3753         return MEDFileParameterDouble1TS::New();
3754       }
3755
3756       MEDFileParameterDouble1TS(const std::string& fileName)
3757       {
3758         return MEDFileParameterDouble1TS::New(fileName);
3759       }
3760
3761       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName)
3762       {
3763         return MEDFileParameterDouble1TS::New(fileName,paramName);
3764       }
3765
3766       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it)
3767       {
3768         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3769       }
3770
3771       std::string __str__() const
3772       {
3773         return self->simpleRepr();
3774       }
3775
3776       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const
3777       {
3778         std::string what;
3779         bool ret0=self->isEqual(other,eps,what);
3780         PyObject *res=PyList_New(2);
3781         PyObject *ret0Py=ret0?Py_True:Py_False;
3782         Py_XINCREF(ret0Py);
3783         PyList_SetItem(res,0,ret0Py);
3784         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3785         return res;
3786       }
3787     }
3788   };
3789
3790   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3791   {
3792   public:
3793     static MEDFileParameterMultiTS *New();
3794     static MEDFileParameterMultiTS *New(const std::string& fileName);
3795     static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName);
3796     std::string getName() const;
3797     void setName(const std::string& name);
3798     MEDFileParameterMultiTS *deepCopy() const;
3799     void write(const std::string& fileName, int mode) const;
3800     std::string simpleRepr() const;
3801     void appendValue(int dt, int it, double time, double val);
3802     double getDoubleValue(int iteration, int order) const;
3803     int getPosOfTimeStep(int iteration, int order) const;
3804     int getPosGivenTime(double time, double eps=1e-8) const;
3805     int getNumberOfTS() const;
3806     %extend
3807     {
3808       MEDFileParameterMultiTS()
3809       {
3810         return MEDFileParameterMultiTS::New();
3811       }
3812
3813       MEDFileParameterMultiTS(const std::string& fileName)
3814       {
3815         return MEDFileParameterMultiTS::New(fileName);
3816       }
3817
3818       MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3819       {
3820         return MEDFileParameterMultiTS::New(fileName,paramName);
3821       }
3822
3823       std::string __str__() const
3824       {
3825         return self->simpleRepr();
3826       }
3827
3828       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const
3829       {
3830         std::string what;
3831         bool ret0=self->isEqual(other,eps,what);
3832         PyObject *res=PyList_New(2);
3833         PyObject *ret0Py=ret0?Py_True:Py_False;
3834         Py_XINCREF(ret0Py);
3835         PyList_SetItem(res,0,ret0Py);
3836         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3837         return res;
3838       }
3839
3840       void eraseTimeStepIds(PyObject *ids)
3841       {
3842         mcIdType sw;
3843         int pos1;
3844         std::vector<int> pos2;
3845         DataArrayInt *pos3=0;
3846         DataArrayIntTuple *pos4=0;
3847         convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3848         switch(sw)
3849           {
3850           case 1:
3851             {
3852               self->eraseTimeStepIds(&pos1,&pos1+1);
3853               return;
3854             }
3855           case 2:
3856             {
3857               if(pos2.empty())
3858                 return;
3859               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3860               return ;
3861             }
3862           case 3:
3863             {
3864               self->eraseTimeStepIds(pos3->begin(),pos3->end());
3865               return ;
3866             }
3867           default:
3868             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3869           }
3870       }
3871
3872       int getTimeStepId(PyObject *elt0) const
3873       {
3874         if(elt0 && PyInt_Check(elt0))
3875           {//fmts[3]
3876             int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3877             return pos;
3878           }
3879         else if(elt0 && PyTuple_Check(elt0))
3880           {
3881             if(PyTuple_Size(elt0)==2)
3882               {
3883                 PyObject *o0=PyTuple_GetItem(elt0,0);
3884                 PyObject *o1=PyTuple_GetItem(elt0,1);
3885                 if(PyInt_Check(o0) && PyInt_Check(o1))
3886                   {//fmts(1,-1)
3887                     int iter=(int)PyInt_AS_LONG(o0);
3888                     int order=(int)PyInt_AS_LONG(o1);
3889                     return self->getPosOfTimeStep(iter,order);
3890                   }
3891                 else
3892                   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 !");
3893               }
3894             else
3895               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 !");
3896           }
3897         else if(elt0 && PyFloat_Check(elt0))
3898           {
3899             double val=PyFloat_AS_DOUBLE(elt0);
3900             return self->getPosGivenTime(val);
3901           }
3902         else
3903           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3904       }
3905
3906       MEDFileParameter1TS *__getitem__(PyObject *elt0) const
3907       {
3908         MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3909         if(ret)
3910           ret->incrRef();
3911         return ret;
3912       }
3913
3914       std::vector<int> getTimeStepIds(PyObject *elts) const
3915       {
3916         if(PyList_Check(elts))
3917           {
3918             std::size_t sz=PyList_Size(elts);
3919             std::vector<int> ret(sz);
3920             for(std::size_t i=0;i<sz;i++)
3921               {
3922                 PyObject *elt=PyList_GetItem(elts,i);
3923                 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3924               }
3925             return ret;
3926           }
3927         else
3928           {
3929             std::vector<int> ret(1);
3930             ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3931             return ret;
3932           }
3933       }
3934
3935       void __delitem__(PyObject *elts)
3936       {
3937         std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3938         if(!idsToRemove.empty())
3939           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3940       }
3941
3942       MEDFileParameter1TS *getTimeStepAtPos(int posId) const
3943       {
3944         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3945         if(ret)
3946           ret->incrRef();
3947         return ret;
3948       }
3949
3950       PyObject *getIterations() const
3951       {
3952         std::vector< std::pair<int,int> > res=self->getIterations();
3953         PyObject *ret=PyList_New(res.size());
3954         int rk=0;
3955         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3956           {
3957             PyObject *elt=PyTuple_New(2);
3958             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3959             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3960             PyList_SetItem(ret,rk,elt);
3961           }
3962         return ret;
3963       }
3964
3965       PyObject *getTimeSteps() const
3966       {
3967         std::vector<double> res2;
3968         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3969         PyObject *ret=PyList_New(res.size());
3970         int rk=0;
3971         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3972           {
3973             PyObject *elt=PyTuple_New(3);
3974             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3975             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3976             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3977             PyList_SetItem(ret,rk,elt);
3978           }
3979         return ret;
3980       }
3981     }
3982   };
3983
3984   class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3985   {
3986   public:
3987     static MEDFileParameters *New();
3988     static MEDFileParameters *New(const std::string& fileName);
3989     static MEDFileParameters *New(DataArrayByte *db);
3990     MEDFileParameters *deepCopy() const;
3991     std::vector<std::string> getParamsNames() const;
3992     std::string simpleRepr() const;
3993     void resize(int newSize);
3994     void pushParam(MEDFileParameterMultiTS *param);
3995     void setParamAtPos(int i, MEDFileParameterMultiTS *param);
3996     void destroyParamAtPos(int i);
3997     int getPosFromParamName(const std::string& paramName) const;
3998     int getNumberOfParams() const;
3999     %extend
4000     {
4001       MEDFileParameters()
4002       {
4003         return MEDFileParameters::New();
4004       }
4005
4006       MEDFileParameters(const std::string& fileName)
4007       {
4008         return MEDFileParameters::New(fileName);
4009       }
4010
4011       MEDFileParameters(DataArrayByte *db)
4012       {
4013         return MEDFileParameters::New(db);
4014       }
4015
4016       std::string __str__() const
4017       {
4018         return self->simpleRepr();
4019       }
4020
4021       MEDFileParameterMultiTS *__getitem__(PyObject *obj)
4022       {
4023         static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
4024         if(PyInt_Check(obj))
4025           {
4026             MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
4027             if(ret)
4028               ret->incrRef();
4029             return ret;
4030           }
4031         MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
4032         if(ret)
4033           ret->incrRef();
4034         return ret;
4035       }
4036
4037       int __len__() const
4038       {
4039         return self->getNumberOfParams();
4040       }
4041
4042       MEDFileParameterMultiTS *getParamAtPos(int i) const
4043       {
4044         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
4045         if(ret)
4046           ret->incrRef();
4047         return ret;
4048       }
4049
4050       MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const
4051       {
4052         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
4053         if(ret)
4054           ret->incrRef();
4055         return ret;
4056       }
4057
4058       PyObject *isEqual(const MEDFileParameters *other, double eps) const
4059       {
4060         std::string what;
4061         bool ret0=self->isEqual(other,eps,what);
4062         PyObject *res=PyList_New(2);
4063         PyObject *ret0Py=ret0?Py_True:Py_False;
4064         Py_XINCREF(ret0Py);
4065         PyList_SetItem(res,0,ret0Py);
4066         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
4067         return res;
4068       }
4069     }
4070   };
4071
4072   class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
4073   {
4074   public:
4075     static MEDFileData *New(DataArrayByte *db);
4076     static MEDFileData *New(const std::string& fileName);
4077     static MEDFileData *New();
4078     MEDFileData *deepCopy() const;
4079     void setFields(MEDFileFields *fields);
4080     void setMeshes(MEDFileMeshes *meshes);
4081     void setParams(MEDFileParameters *params);
4082     int getNumberOfFields() const;
4083     int getNumberOfMeshes() const;
4084     int getNumberOfParams() const;
4085     //
4086     bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName);
4087     bool unPolyzeMeshes();
4088     void dealWithStructureElements();
4089     std::string getHeader() const;
4090     void setHeader(const std::string& header);
4091     //
4092     %extend
4093        {
4094          MEDFileData(const std::string& fileName)
4095          {
4096            return MEDFileData::New(fileName);
4097          }
4098
4099          MEDFileData(DataArrayByte *db)
4100          {
4101            return MEDFileData::New(db);
4102          }
4103
4104          MEDFileData()
4105          {
4106            return MEDFileData::New();
4107          }
4108
4109          std::string __str__() const
4110          {
4111            return self->simpleRepr();
4112          }
4113
4114          MEDFileMeshes *getMeshes() const
4115          {
4116            MEDFileMeshes *ret=self->getMeshes();
4117            if(ret)
4118              ret->incrRef();
4119            return ret;
4120          }
4121
4122          MEDFileParameters *getParams() const
4123          {
4124            MEDFileParameters *ret=self->getParams();
4125            if(ret)
4126              ret->incrRef();
4127            return ret;
4128          }
4129
4130          MEDFileFields *getFields() const
4131          {
4132            MEDFileFields *ret=self->getFields();
4133            if(ret)
4134              ret->incrRef();
4135            return ret;
4136          }
4137
4138          bool changeMeshNames(PyObject *li)
4139          {
4140            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
4141            return self->changeMeshNames(modifTab);
4142          }
4143
4144          static MEDFileData *Aggregate(PyObject *mfds)
4145          {
4146            std::vector<const MEDFileData *> mfdsCpp;
4147            convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
4148            MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
4149            return ret.retn();
4150          }
4151        }
4152   };
4153
4154   class SauvReader : public RefCountObject
4155   {
4156   public:
4157     static SauvReader* New(const std::string& fileName);
4158     MEDFileData * loadInMEDFileDS();
4159     %extend
4160     {
4161       SauvReader(const std::string& fileName)
4162       {
4163         return SauvReader::New(fileName);
4164       }
4165     }
4166   };
4167
4168   class SauvWriter : public RefCountObject
4169   {
4170   public:
4171     static SauvWriter * New();
4172     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
4173     void write(const std::string& fileName);
4174     void setCpyGrpIfOnASingleFamilyStatus(bool status);
4175     bool getCpyGrpIfOnASingleFamilyStatus() const;
4176     %extend
4177     {
4178       SauvWriter()
4179       {
4180         return SauvWriter::New();
4181       }
4182     }
4183   };
4184
4185   ///////////////
4186
4187   class MEDFileMeshStruct;
4188
4189   class MEDFileField1TSStructItem
4190   {
4191   public:
4192     static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
4193   };
4194
4195   class MEDFileMeshStruct : public RefCountObject
4196   {
4197   public:
4198     static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
4199   protected:
4200     ~MEDFileMeshStruct();
4201   };
4202
4203   class MEDMeshMultiLev : public RefCountObject
4204   {
4205   public:
4206     virtual MEDMeshMultiLev *prepare() const;
4207     DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
4208     DataArrayIdType *retrieveGlobalNodeIdsIfAny() const;
4209   protected:
4210     ~MEDMeshMultiLev();
4211   public:
4212     %extend
4213     {
4214       PyObject *retrieveFamilyIdsOnCells() const
4215       {
4216         DataArrayIdType *famIds(0);
4217         bool isWithoutCopy(false);
4218         self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4219         PyObject *ret=PyTuple_New(2);
4220         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4221         Py_XINCREF(ret1Py);
4222         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4223         PyTuple_SetItem(ret,1,ret1Py);
4224         return ret;
4225       }
4226
4227       PyObject *retrieveNumberIdsOnCells() const
4228       {
4229         DataArrayIdType *numIds(0);
4230         bool isWithoutCopy(false);
4231         self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4232         PyObject *ret=PyTuple_New(2);
4233         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4234         Py_XINCREF(ret1Py);
4235         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4236         PyTuple_SetItem(ret,1,ret1Py);
4237         return ret;
4238       }
4239
4240       PyObject *retrieveFamilyIdsOnNodes() const
4241       {
4242         DataArrayIdType *famIds(0);
4243         bool isWithoutCopy(false);
4244         self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4245         PyObject *ret=PyTuple_New(2);
4246         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4247         Py_XINCREF(ret1Py);
4248         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4249         PyTuple_SetItem(ret,1,ret1Py);
4250         return ret;
4251       }
4252
4253       PyObject *retrieveNumberIdsOnNodes() const
4254       {
4255         DataArrayIdType *numIds(0);
4256         bool isWithoutCopy(false);
4257         self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4258         PyObject *ret=PyTuple_New(2);
4259         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4260         Py_XINCREF(ret1Py);
4261         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4262         PyTuple_SetItem(ret,1,ret1Py);
4263         return ret;
4264       }
4265
4266       PyObject *getGeoTypes() const
4267       {
4268         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4269         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4270         PyObject *res(PyList_New(result.size()));
4271         for(int i=0;iL!=result.end(); i++, iL++)
4272           PyList_SetItem(res,i,PyInt_FromLong(*iL));
4273         return res;
4274       }
4275     }
4276   };
4277
4278   class MEDUMeshMultiLev : public MEDMeshMultiLev
4279   {
4280   protected:
4281     ~MEDUMeshMultiLev();
4282   public:
4283     %extend
4284      {
4285        PyObject *buildVTUArrays() const
4286        {
4287          DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayIdType *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4288          bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4289          PyObject *ret0Py=ncc?Py_True:Py_False;
4290          Py_XINCREF(ret0Py);
4291          PyObject *ret=PyTuple_New(7);
4292          PyTuple_SetItem(ret,0,ret0Py);
4293          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4294          PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4295          PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4296          PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4297          PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4298          PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4299          return ret;
4300        }
4301      }
4302   };
4303
4304   class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4305   {
4306   protected:
4307     ~MEDStructuredMeshMultiLev();
4308   };
4309
4310   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4311   {
4312   protected:
4313     ~MEDCMeshMultiLev();
4314   public:
4315     %extend
4316     {
4317       PyObject *buildVTUArrays() const
4318       {
4319         bool isInternal;
4320         std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4321         std::size_t sz(objs.size());
4322         PyObject *ret(PyTuple_New(2));
4323         PyObject *ret0=PyList_New(sz);
4324         for(std::size_t i=0;i<sz;i++)
4325           PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4326         PyTuple_SetItem(ret,0,ret0);
4327         PyObject *ret1Py(isInternal?Py_True:Py_False);
4328         Py_XINCREF(ret1Py);
4329         PyTuple_SetItem(ret,1,ret1Py);
4330         return ret;
4331       }
4332     }
4333   };
4334
4335   class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4336   {
4337   protected:
4338     ~MEDCurveLinearMeshMultiLev();
4339   public:
4340     %extend
4341     {
4342       PyObject *buildVTUArrays() const
4343       {
4344         DataArrayDouble *ret0(0);
4345         std::vector<mcIdType> ret1;
4346         bool ret2;
4347         self->buildVTUArrays(ret0,ret1,ret2);
4348         std::size_t sz(ret1.size());
4349         PyObject *ret=PyTuple_New(3);
4350         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4351         PyObject *ret1Py=PyList_New(sz);
4352         for(std::size_t i=0;i<sz;i++)
4353           PyList_SetItem(ret1Py,i,PyInt_FromLong(ret1[i]));
4354         PyTuple_SetItem(ret,1,ret1Py);
4355         PyObject *ret2Py(ret2?Py_True:Py_False);
4356         Py_XINCREF(ret2Py);
4357         PyTuple_SetItem(ret,2,ret2Py);
4358         return ret;
4359       }
4360     }
4361   };
4362
4363   class MEDFileFastCellSupportComparator : public RefCountObject
4364   {
4365   public:
4366     static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
4367     MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4368     bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const;
4369     int getNumberOfTS() const;
4370   protected:
4371     ~MEDFileFastCellSupportComparator();
4372   public:
4373     %extend
4374     {
4375       PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const
4376       {
4377         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4378         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4379         PyObject *res(PyList_New(result.size()));
4380         for(int i=0;iL!=result.end(); i++, iL++)
4381           PyList_SetItem(res,i,PyInt_FromLong(*iL));
4382         return res;
4383       }
4384     }
4385   };
4386
4387   class MeshFormatReader
4388   {
4389   public:
4390     MeshFormatReader(const std::string& meshFileName, const std::vector<std::string>& fieldFileName);
4391     MeshFormatReader();
4392     MEDFileData* loadInMedFileDS();
4393     void setMeshName(const std::string& theMeshName);
4394     std::string getMeshName() const;
4395     void setFile(const std::string& theFileName);
4396     void setFieldFileNames(const std::vector<std::string>& theFieldFileNames);
4397     std::vector<std::string> getFieldFileNames() const;
4398   };
4399   class MeshFormatWriter
4400   {
4401   public:
4402     MeshFormatWriter(const std::string& meshFileName, const std::vector<std::string>& fieldFileNames);
4403     MeshFormatWriter();
4404     void setMeshFileName(const std::string& meshFileName);
4405     std::string getMeshFileName() const;
4406     void setFieldFileNames(const std::vector<std::string>& fieldFileNames);
4407     std::vector<std::string> getFieldFileNames() const;
4408     void setMEDFileDS(MEDCoupling::MEDFileData* mfd);
4409     void write();
4410   };
4411
4412 }
4413
4414 %pythoncode %{
4415 def enter1TS(self):
4416     self.loadArraysIfNecessary()
4417     pass
4418 def exit1TS(self, exctype, exc, tb):
4419     self.unloadArraysWithoutDataLoss()
4420     pass
4421 MEDFileAnyTypeField1TS.__enter__=enter1TS
4422 MEDFileAnyTypeField1TS.__exit__=exit1TS
4423 MEDFileIntField1TS = MEDFileInt32Field1TS
4424 MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
4425 if MEDCouplingUse64BitIDs():
4426   MEDFileIDField1TS = MEDFileInt64Field1TS
4427   MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
4428 else:
4429   MEDFileIDField1TS = MEDFileInt32Field1TS
4430   MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS
4431 %}