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