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