Salome HOME
On the road of reimplementation of basic MEDLoader API with advanced one.
[modules/med.git] / src / MEDLoader / Swig / MEDLoaderCommon.i
1 // Copyright (C) 2007-2013  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.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 %module MEDLoader
22
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
25
26 %include "MEDCouplingCommon.i"
27
28 %{
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDLoaderTypemaps.i"
35 #include "SauvReader.hxx"
36 #include "SauvWriter.hxx"
37
38 using namespace ParaMEDMEM;
39 %}
40
41 #if SWIG_VERSION >= 0x010329
42 %template()  std::vector<std::string>;
43 #endif
44
45 %typemap(out) ParaMEDMEM::MEDFileMesh*
46 {
47   $result=convertMEDFileMesh($1,$owner);
48 }
49
50 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
51 {
52   $result=convertMEDFileParameter1TS($1,$owner);
53 }
54
55 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
56 {
57   $result=convertMEDFileFieldMultiTS($1,$owner);
58 }
59
60 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
61 {
62   $result=convertMEDFileField1TS($1,$owner);
63 }
64
65 %newobject MEDLoader::ReadUMeshFromFamilies;
66 %newobject MEDLoader::ReadUMeshFromGroups;
67 %newobject MEDLoader::ReadUMeshFromFile;
68 %newobject MEDLoader::ReadField;
69 %newobject MEDLoader::ReadFieldCell;
70 %newobject MEDLoader::ReadFieldNode;
71 %newobject MEDLoader::ReadFieldGauss;
72 %newobject MEDLoader::ReadFieldGaussNE;
73 %newobject ParaMEDMEM::MEDFileMesh::New;
74 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
75 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
76 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
77 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
78 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
79 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
80 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
81 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
82 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
83 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
84 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
85 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
86 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
87 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
88 %newobject ParaMEDMEM::MEDFileUMesh::New;
89 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
90 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
91 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
92 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
93 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
94 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
95 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
96 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
98 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
99 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
100 %newobject ParaMEDMEM::MEDFileCMesh::New;
101 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
102 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
103 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
104 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
105 %newobject ParaMEDMEM::MEDFileMeshes::New;
106 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
107 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
108 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
109 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
110 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
111
112 %newobject ParaMEDMEM::MEDFileFields::New;
113 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
114 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
115 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
116 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
117 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
118 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
119 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
120 %newobject ParaMEDMEM::MEDFileFields::__iter__;
121
122 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
123 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
124 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
125 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
126 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
127 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
128 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
129 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
130 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
131 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
132 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
133 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
134 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
135 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
136 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
137
138 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
139 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
140 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
141 %newobject ParaMEDMEM::MEDFileField1TS::New;
142 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
143 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
144 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
145 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
146 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
147 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
148 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
149
150 %newobject ParaMEDMEM::MEDFileData::New;
151 %newobject ParaMEDMEM::MEDFileData::deepCpy;
152 %newobject ParaMEDMEM::MEDFileData::getMeshes;
153 %newobject ParaMEDMEM::MEDFileData::getFields;
154 %newobject ParaMEDMEM::MEDFileData::getParams;
155
156 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
157 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
158 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
159 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
160 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
161 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
162 %newobject ParaMEDMEM::MEDFileParameters::New;
163 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
164 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
165 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
166 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
167
168 %newobject ParaMEDMEM::SauvWriter::New;
169 %newobject ParaMEDMEM::SauvReader::New;
170 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
171
172 %feature("unref") MEDFileMesh "$this->decrRef();"
173 %feature("unref") MEDFileUMesh "$this->decrRef();"
174 %feature("unref") MEDFileCMesh "$this->decrRef();"
175 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
176 %feature("unref") MEDFileMeshes "$this->decrRef();"
177 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
178 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
179 %feature("unref") MEDFileField1TS "$this->decrRef();"
180 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
181 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
182 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
183 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
184 %feature("unref") MEDFileFields "$this->decrRef();"
185 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
186 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
187 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
188 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
189 %feature("unref") MEDFileParameters "$this->decrRef();"
190 %feature("unref") MEDFileData "$this->decrRef();"
191 %feature("unref") SauvReader "$this->decrRef();"
192 %feature("unref") SauvWriter "$this->decrRef();"
193
194 class MEDLoader
195 {
196 public:
197   static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
198   static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
199   static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
200   static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
201   static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
202   static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
203   static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
204   static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
205   static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
206   static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
207   static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
208   static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
209   static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
210   static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
211   static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
212   static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
213   %extend
214      {
215        static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
216        {
217          std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
218          PyObject *ret=PyList_New(res.size());
219          int rk=0;
220          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
221            {
222              PyObject *elt=PyTuple_New(2);
223              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
224              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
225              PyList_SetItem(ret,rk,elt);
226            }
227          return ret;
228        }
229
230        static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
231        {
232          std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
233          PyObject *ret=PyList_New(res.size());
234          int rk=0;
235          for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
236            {
237              PyObject *elt=PyTuple_New(3);
238              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
239              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
240              PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
241              PyList_SetItem(ret,rk,elt);
242            }
243          return ret;
244        }
245
246        static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
247        {
248          std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
249          PyObject *ret=PyList_New(res.size());
250          int rk=0;
251          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
252            {
253              PyObject *elt=PyTuple_New(2);
254              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
255              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
256              PyList_SetItem(ret,rk,elt);
257            }
258          return ret;
259        }
260        static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
261        {
262          std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
263          PyObject *ret=PyList_New(res.size());
264          int rk=0;
265          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
266            {
267              PyObject *elt=PyTuple_New(2);
268              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
269              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
270              PyList_SetItem(ret,rk,elt);
271            }
272          return ret;
273        }
274        static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
275        {
276          std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
277          PyObject *ret=PyList_New(res.size());
278          int rk=0;
279          for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
280            {
281              PyObject *elt=PyTuple_New(2);
282              PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
283              PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
284              PyList_SetItem(ret,rk,elt);
285            }
286          return ret;
287        }
288        static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
289        {
290          int meshDim,spaceDim,numberOfNodes;
291          std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
292          PyObject *ret=PyTuple_New(4);
293          PyObject *elt0=PyList_New(res.size());
294          int i=0;
295          for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
296            {
297              const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
298              int j=0;
299              PyObject *elt1=PyList_New(obj2.size());
300              for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
301                {
302                  PyObject *elt2=PyTuple_New(2);
303                  PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
304                  PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
305                  PyList_SetItem(elt1,j,elt2);
306                }
307              PyList_SetItem(elt0,i,elt1);
308            }
309          PyTuple_SetItem(ret,0,elt0);
310          PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
311          PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
312          PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
313          return ret;
314        }
315        static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
316                                              const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
317        {
318          std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
319          std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
320          return convertFieldDoubleVecToPy(res);
321        }
322        static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
323        {
324          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
325          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
326          MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
327        }
328        static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
329        {
330          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
331          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
332          MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
333        }
334        static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
335        {
336          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
337          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
338          MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
339        }
340        static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
341        {
342          std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
343          int size=v.size();
344          PyObject *ret=PyList_New(size);
345          for(int i=0;i<size;i++)
346            PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
347          return ret;
348        }
349        static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
350        {
351          std::vector<std::string> grps;
352          converPyListToVecString(li,grps);
353          return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
354        }
355        static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
356        {
357          std::vector<std::string> fams;
358          converPyListToVecString(li,fams);
359          return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
360        }
361      }
362   static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
363   static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
364   static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
365   static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
366   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
367   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
368   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
369   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
370   static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
371   static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
372   static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
373   static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
374   static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
375 };
376
377 namespace ParaMEDMEM
378 {
379   class MEDFileWritable
380   {
381   public:
382     void copyOptionsFrom(const MEDFileWritable& other) const;
383     int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
384     void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
385     int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
386     void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
387   };
388
389   class MEDFileMesh : public RefCountObject, public MEDFileWritable
390   {
391   public:
392     static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
393     static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
394     virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
395     virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
396     virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
397     virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
398     void setName(const char *name);
399     const char *getName();
400     const char *getUnivName() const;
401     bool getUnivNameWrStatus() const;
402     void setUnivNameWrStatus(bool newStatus);
403     void setDescription(const char *name);
404     const char *getDescription() const;
405     void setOrder(int order);
406     int getOrder() const;
407     void setIteration(int it);
408     int getIteration();
409     void setTimeValue(double time);
410     void setTime(int dt, int it, double time);
411     double getTimeValue() const;
412     void setTimeUnit(const char *unit);
413     const char *getTimeUnit() const;
414     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
415     virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
416     virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
417     virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
418     std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
419     std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
420     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
421     int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
422     //
423     bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
424     bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
425     bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
426     void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
427     void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
428     void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
429     void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
430     virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
431     virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
432     void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
433     const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
434     const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
435     std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
436     std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
437     std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
438     void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
439     void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
440     std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
441     void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
442     std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
443     std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
444     void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
445     std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
446     void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
447     void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
448     std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
449     std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
450     void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
451     void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
452     void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
453     void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
454     void setFamilyInfo(const std::map<std::string,int>& info);
455     void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
456     int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
457     int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
458     int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
459     int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
460     int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
461     int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
462     int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
463     virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
464     virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
465     virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
466     DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
467     DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
468     std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
469     std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
470     bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
471     void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
472     void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
473     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
474     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
475     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
476     //
477     virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
478     virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
479     virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
480     virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
481     virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
482     virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
483     virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
484     virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
485     virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
486     virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
487     virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
488     virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
489     %extend
490        {
491          MEDFileMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
492          {
493            return MEDFileMesh::New(fileName);
494          }
495
496          MEDFileMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
497          {
498            return MEDFileMesh::New(fileName,mName,dt,it);
499          }
500          
501          std::string __str__() const throw(INTERP_KERNEL::Exception)
502          {
503            return self->simpleRepr();
504          }
505
506          PyObject *getTime() throw(INTERP_KERNEL::Exception)
507          {
508            int tmp1,tmp2;
509            double tmp0=self->getTime(tmp1,tmp2);
510            PyObject *res = PyList_New(3);
511            PyList_SetItem(res,0,SWIG_From_int(tmp1));
512            PyList_SetItem(res,1,SWIG_From_int(tmp2));
513            PyList_SetItem(res,2,SWIG_From_double(tmp0));
514            return res;
515          }
516
517          virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
518          {
519            std::string what;
520            bool ret0=self->isEqual(other,eps,what);
521            PyObject *res=PyList_New(2);
522            PyObject *ret0Py=ret0?Py_True:Py_False;
523            Py_XINCREF(ret0Py);
524            PyList_SetItem(res,0,ret0Py);
525            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
526            return res;
527          }
528          
529          PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
530          {
531            std::string what;
532            bool ret0=self->areFamsEqual(other,what);
533            PyObject *res=PyList_New(2);
534            PyObject *ret0Py=ret0?Py_True:Py_False;
535            Py_XINCREF(ret0Py);
536            PyList_SetItem(res,0,ret0Py);
537            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
538            return res;
539          }
540
541          PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
542          {
543            std::string what;
544            bool ret0=self->areGrpsEqual(other,what);
545            PyObject *res=PyList_New(2);
546            PyObject *ret0Py=ret0?Py_True:Py_False;
547            Py_XINCREF(ret0Py);
548            PyList_SetItem(res,0,ret0Py);
549            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
550            return res;
551          }
552
553          PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
554          {
555            const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
556            if(tmp)
557              tmp->incrRef();
558            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
559          }
560
561          PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
562          {
563            const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
564            if(tmp)
565              tmp->incrRef();
566            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
567          }
568          
569          PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
570          {
571            const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
572            if(tmp)
573              tmp->incrRef();
574            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
575          }
576
577          PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
578          {
579            bool ret1;
580            std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
581            PyObject *ret=PyTuple_New(2);
582            PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
583            PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
584            return ret;
585          }
586          
587          PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
588          {
589            DataArrayInt *ret3=0;
590            std::vector<int> ret1,ret2;
591            bool ret0=self->unPolyze(ret1,ret2,ret3);
592            PyObject *ret=PyTuple_New(4);
593            PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
594            //
595            PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
596            for(int j=0;j<(int)ret1.size()/3;j++)
597              {
598                PyObject *retLev2=PyList_New(3);
599                PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
600                PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
601                PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
602                PyList_SetItem(retLev1_0,j,retLev2);
603              }
604            PyTuple_SetItem(ret,1,retLev1_0);
605            //
606            PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
607            for(int j=0;j<(int)ret2.size()/3;j++)
608              {
609                PyObject *retLev2=PyList_New(3);
610                PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
611                PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
612                PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
613                PyList_SetItem(retLev1_1,j,retLev2);
614              }
615            PyTuple_SetItem(ret,2,retLev1_1);
616            //
617            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
618            return ret;
619          }
620        }
621   };
622
623   class MEDFileUMesh : public MEDFileMesh
624   {
625   public:
626     static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
627     static MEDFileUMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
628     static MEDFileUMesh *New();
629     ~MEDFileUMesh();
630     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
631     //
632     std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
633     std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
634     std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
635     std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
636     std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
637     std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
638     std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
639     std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
640     std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
641     MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
642     DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
643     MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
644     DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
645     MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
646     DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
647     MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
648     DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
649     DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
650     DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
651     DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
652     DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
653     MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
654     MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
655     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
656     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
657     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
658     //
659     void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
660     void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
661     void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
662     void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
663     void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
664     void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
665     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
666     void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum=false) throw(INTERP_KERNEL::Exception);
667     void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception);
668     void optimizeFamilies() throw(INTERP_KERNEL::Exception);
669     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
670     %extend
671        { 
672          MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
673          {
674            return MEDFileUMesh::New(fileName,mName,dt,it);
675          }
676
677          MEDFileUMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
678          {
679            return MEDFileUMesh::New(fileName);
680          }
681
682          MEDFileUMesh()
683          {
684            return MEDFileUMesh::New();
685          }
686          
687          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
688          {
689            const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
690            if(tmp)
691              tmp->incrRef();
692            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
693          }
694          
695          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
696          {
697            std::vector<const DataArrayInt *> grps;
698            convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
699            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
700          }
701
702          DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
703          {
704            DataArrayDouble *ret=self->getCoords();
705            if(ret)
706              ret->incrRef();
707            return ret;
708          }
709
710          PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
711          {
712            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
713            self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
714            PyObject *ret=PyTuple_New(3);
715            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
716            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
717            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
718            return ret;
719          }
720        }
721   };
722
723   class MEDFileStructuredMesh : public MEDFileMesh
724   {
725   };
726
727   class MEDFileCMesh : public MEDFileStructuredMesh
728   {
729   public:
730     static MEDFileCMesh *New();
731     static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
732     static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
733     void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
734     %extend
735        {
736          MEDFileCMesh()
737          {
738            return MEDFileCMesh::New();
739          }
740
741          MEDFileCMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
742          {
743            return MEDFileCMesh::New(fileName);
744          }
745
746          MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
747          {
748            return MEDFileCMesh::New(fileName,mName,dt,it);
749          }
750          
751          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
752          {
753            const MEDCouplingCMesh *tmp=self->getMesh();
754            if(tmp)
755              tmp->incrRef();
756            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
757          }
758        }
759   };
760
761   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
762   {
763   public:
764     static MEDFileCurveLinearMesh *New();
765     static MEDFileCurveLinearMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
766     static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
767     void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
768     %extend
769        {
770          MEDFileCurveLinearMesh()
771          {
772            return MEDFileCurveLinearMesh::New();
773          }
774
775          MEDFileCurveLinearMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
776          {
777            return MEDFileCurveLinearMesh::New(fileName);
778          }
779
780          MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
781          {
782            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it);
783          }
784          
785          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
786          {
787            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
788            if(tmp)
789              tmp->incrRef();
790            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
791          }
792        }
793   };
794
795   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
796   {
797   public:
798     static MEDFileMeshMultiTS *New();
799     static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
800     static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
801     MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
802     const char *getName() const throw(INTERP_KERNEL::Exception);
803     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
804     void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
805     %extend
806        { 
807          MEDFileMeshMultiTS()
808          {
809            return MEDFileMeshMultiTS::New();
810          }
811
812          MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
813          {
814            return MEDFileMeshMultiTS::New(fileName);
815          }
816
817          MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
818          {
819            return MEDFileMeshMultiTS::New(fileName,mName);
820          }
821
822          MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
823            {
824              MEDFileMesh *ret=self->getOneTimeStep();
825              if(ret)
826                ret->incrRef();
827              return ret;
828            }
829        }
830   };
831
832   class MEDFileMeshesIterator
833   {
834   public:
835     %extend
836     {
837       PyObject *next() throw(INTERP_KERNEL::Exception)
838       {
839         MEDFileMesh *ret=self->nextt();
840         if(ret)
841           {
842             ret->incrRef();
843             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
844           }
845         else
846           {
847             PyErr_SetString(PyExc_StopIteration,"No more data.");
848             return 0;
849           }
850       }
851     }
852   };
853
854   class MEDFileMeshes : public RefCountObject, public MEDFileWritable
855   {
856   public:
857     static MEDFileMeshes *New();
858     static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
859     MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
860     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
861     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
862     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
863     //
864     void resize(int newSize) throw(INTERP_KERNEL::Exception);
865     void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
866     void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
867     void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
868     %extend
869        {
870          MEDFileMeshes()
871          {
872            return MEDFileMeshes::New();
873          }
874
875          MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
876          {
877            return MEDFileMeshes::New(fileName);
878          }
879
880          std::string __str__() const throw(INTERP_KERNEL::Exception)
881            {
882              return self->simpleRepr();
883            }
884
885          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
886          {
887            if(PyInt_Check(obj))
888              {
889                MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
890                if(ret)
891                  ret->incrRef();
892                return ret;
893              }
894            else if(PyString_Check(obj))
895              {
896                MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
897                if(ret)
898                  ret->incrRef();
899                return ret;
900              }
901            else
902              throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
903          }
904
905          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
906          {
907            self->setMeshAtPos(obj,mesh);
908            return self;
909          }
910
911          MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
912          {
913            return self->iterator();
914          }
915
916          int __len__() const throw(INTERP_KERNEL::Exception)
917          {
918            return self->getNumberOfMeshes();
919          }
920          
921          MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
922            {
923              MEDFileMesh *ret=self->getMeshAtPos(i);
924              if(ret)
925                ret->incrRef();
926              return ret;
927            }
928          MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
929            {
930              MEDFileMesh *ret=self->getMeshWithName(mname);
931              if(ret)
932                ret->incrRef();
933              return ret;
934            }
935        }
936   };
937
938   class MEDFileFieldLoc : public RefCountObject
939   {
940   public:
941     const std::string& getName() const;
942     int getDimension() const;
943     int getNumberOfGaussPoints() const;
944     int getNumberOfPointsInCells() const;
945     const std::vector<double>& getRefCoords() const;
946     const std::vector<double>& getGaussCoords() const;
947     const std::vector<double>& getGaussWeights() const;
948     bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
949   %extend
950     {
951       std::string __str__() const throw(INTERP_KERNEL::Exception)
952       {
953         return self->repr();
954       }
955     }
956   };
957
958   class MEDFileFieldGlobsReal
959   {
960   public:
961     void resetContent();
962     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
963     void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
964     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
965     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
966     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
967     void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
968     void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
969     void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
970     std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
971     std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
972     bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
973     bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
974     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
975     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
976     std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
977     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
978     virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
979     virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
980     virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
981     virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
982     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
983     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
984     void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
985     void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
986     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
987     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
988   %extend
989      {
990        PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
991        {
992          const DataArrayInt *ret=self->getProfile(pflName);
993          if(ret)
994            ret->incrRef();
995          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
996        }
997
998        PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
999        {
1000          const DataArrayInt *ret=self->getProfileFromId(pflId);
1001          if(ret)
1002            ret->incrRef();
1003          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1004        }
1005
1006        PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1007        {
1008          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1009          if(loc)
1010            loc->incrRef();
1011          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1012        }
1013        
1014        PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1015        {
1016          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1017          if(loc)
1018            loc->incrRef();
1019          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1020        }
1021        
1022        PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1023        {
1024          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1025          return convertVecPairVecStToPy(ret);
1026        }
1027
1028        PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1029        {
1030          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1031          return convertVecPairVecStToPy(ret);
1032        }
1033
1034        void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1035        {
1036          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1037          self->changePflsNames(v);
1038        }
1039
1040        void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1041        {
1042          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1043          self->changePflsRefsNamesGen(v);
1044        }
1045
1046        void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1047        {
1048          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1049          self->changePflsNamesInStruct(v);
1050        }
1051
1052        void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1053        {
1054          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1055          self->changeLocsNames(v);
1056        }
1057
1058        void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1059        {
1060          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1061          self->changeLocsRefsNamesGen(v);
1062        }
1063        
1064        void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1065        {
1066          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1067          self->changeLocsNamesInStruct(v);
1068        }
1069
1070        std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1071        {
1072          std::ostringstream oss;
1073          self->simpleReprGlobs(oss);
1074          return oss.str();
1075        }
1076      }
1077   };
1078
1079   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1080   {
1081   public:
1082     static MEDFileAnyTypeField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1083     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1084     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1085     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1086     int getDimension() const throw(INTERP_KERNEL::Exception);
1087     int getIteration() const throw(INTERP_KERNEL::Exception);
1088     int getOrder() const throw(INTERP_KERNEL::Exception);
1089     std::string getName() throw(INTERP_KERNEL::Exception);
1090     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1091     std::string getMeshName() throw(INTERP_KERNEL::Exception);
1092     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1093     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1094     bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1095     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1096     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1097     void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1098     virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1099     MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1100     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1101     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1102     %extend
1103     {
1104       PyObject *getTime() throw(INTERP_KERNEL::Exception)
1105       {
1106         int tmp1,tmp2;
1107         double tmp0=self->getTime(tmp1,tmp2);
1108         PyObject *res = PyList_New(3);
1109         PyList_SetItem(res,0,SWIG_From_int(tmp1));
1110         PyList_SetItem(res,1,SWIG_From_int(tmp2));
1111         PyList_SetItem(res,2,SWIG_From_double(tmp0));
1112         return res;
1113       }
1114
1115       PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1116       {
1117         std::pair<int,int> res=self->getDtIt();
1118         PyObject *elt=PyTuple_New(2);
1119         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1120         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1121         return elt;
1122       }
1123
1124       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1125       {
1126         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1127       }
1128       
1129       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1130       {
1131         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1132       }
1133
1134       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1135       {
1136         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1137         return self->changeMeshNames(modifTab);
1138       }
1139       
1140       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1141       {
1142         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1143         PyObject *ret2=PyList_New(ret.size());
1144         for(int i=0;i<(int)ret.size();i++)
1145           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1146         return ret2;
1147       }
1148
1149       PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1150       {
1151         std::vector<int> ret1;
1152         int ret0=self->getNonEmptyLevels(mname,ret1);
1153         PyObject *elt=PyTuple_New(2);
1154         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1155         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1156         return elt;
1157       }
1158
1159       PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1160       {
1161         std::vector<INTERP_KERNEL::NormalizedCellType> types;
1162         std::vector< std::vector<TypeOfField> > typesF;
1163         std::vector< std::vector<std::string> > pfls;
1164         std::vector< std::vector<std::string> > locs;
1165         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1166         int sz=ret.size();
1167         PyObject *ret2=PyList_New(sz);
1168            for(int i=0;i<sz;i++)
1169              {
1170                const std::vector< std::pair<int,int> >& dadsI=ret[i];
1171                const std::vector<TypeOfField>& typesFI=typesF[i];
1172                const std::vector<std::string>& pflsI=pfls[i];
1173                const std::vector<std::string>& locsI=locs[i];
1174                PyObject *elt=PyTuple_New(2);
1175                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1176                int sz2=ret[i].size();
1177                PyObject *elt2=PyList_New(sz2);
1178                for(int j=0;j<sz2;j++)
1179                  {
1180                    PyObject *elt3=PyTuple_New(4);
1181                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1182                    PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
1183                    PyTuple_SetItem(elt3,1,elt4);
1184                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1185                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1186                    PyList_SetItem(elt2,j,elt3);
1187                  }
1188                PyTuple_SetItem(elt,1,elt2);
1189                PyList_SetItem(ret2,i,elt);
1190              }
1191            return ret2;
1192       }
1193
1194       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1195       {
1196         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1197         std::size_t sz=ret.size();
1198         PyObject *retPy=PyList_New(sz);
1199         for(std::size_t i=0;i<sz;i++)
1200           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1201         return retPy;
1202       }
1203     }
1204   };
1205
1206   class MEDFileField1TS : public MEDFileAnyTypeField1TS
1207   {
1208   public:
1209     static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1210     static MEDFileField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1211     static MEDFileField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1212     static MEDFileField1TS *New();
1213     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1214     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1215     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1216     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1217     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1218     //
1219     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1220     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1221     void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1222     void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1223     %extend
1224        {
1225          MEDFileField1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
1226          {
1227            return MEDFileField1TS::New(fileName);
1228          }
1229          
1230          MEDFileField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1231          {
1232            return MEDFileField1TS::New(fileName,fieldName);
1233          }
1234
1235          MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
1236          {
1237            return MEDFileField1TS::New(fileName,fieldName,iteration,order);
1238          }
1239
1240          MEDFileField1TS()
1241          {
1242            return MEDFileField1TS::New();
1243          }
1244
1245          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1246          {
1247            const DataArrayDouble *arr=0;
1248            if(field)
1249              arr=field->getArray();
1250            self->copyTinyInfoFrom(field,arr);
1251          }
1252          
1253          std::string __str__() const throw(INTERP_KERNEL::Exception)
1254          {
1255            return self->simpleRepr();
1256          }
1257          
1258          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1259          {
1260            DataArrayInt *ret1=0;
1261            DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1262            PyObject *ret=PyTuple_New(2);
1263            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1264            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1265            return ret;
1266          }
1267
1268          PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1269          {
1270            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1271            std::vector< std::vector<TypeOfField> > typesF;
1272            std::vector< std::vector<std::string> > pfls;
1273            std::vector< std::vector<std::string> > locs;
1274            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1275            int sz=ret.size();
1276            PyObject *ret2=PyList_New(sz);
1277            for(int i=0;i<sz;i++)
1278              {
1279                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1280                const std::vector<TypeOfField>& typesFI=typesF[i];
1281                const std::vector<std::string>& pflsI=pfls[i];
1282                const std::vector<std::string>& locsI=locs[i];
1283                PyObject *elt=PyTuple_New(2);
1284                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1285                int sz2=ret[i].size();
1286                PyObject *elt2=PyList_New(sz2);
1287                for(int j=0;j<sz2;j++)
1288                  {
1289                    PyObject *elt3=PyTuple_New(4);
1290                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1291                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1292                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1293                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1294                    PyList_SetItem(elt2,j,elt3);
1295                  }
1296                PyTuple_SetItem(elt,1,elt2);
1297                PyList_SetItem(ret2,i,elt);
1298              }
1299            return ret2;
1300          }
1301
1302          DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1303          {
1304            DataArrayDouble *ret=self->getUndergroundDataArray();
1305            if(ret)
1306              ret->incrRef();
1307            return ret;
1308          }
1309
1310          PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1311          {
1312            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1313            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1314            if(elt0)
1315              elt0->incrRef();
1316            PyObject *ret=PyTuple_New(2);
1317            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1318            std::size_t sz=elt1Cpp.size();
1319            PyObject *elt=PyList_New(sz);
1320            for(std::size_t i=0;i<sz;i++)
1321              {
1322                PyObject *elt1=PyTuple_New(2);
1323                PyObject *elt2=PyTuple_New(2);
1324                PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1325                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1326                PyObject *elt3=PyTuple_New(2);
1327                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1328                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1329                PyTuple_SetItem(elt1,0,elt2);
1330                PyTuple_SetItem(elt1,1,elt3);
1331                PyList_SetItem(elt,i,elt1);
1332              }
1333            PyTuple_SetItem(ret,1,elt);
1334            return ret;
1335          }
1336        }
1337   };
1338
1339   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1340   {
1341   public:
1342     static MEDFileIntField1TS *New();
1343     static MEDFileIntField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1344     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1345     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1346     //
1347     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1348     void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1349     %extend
1350     {
1351       MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1352       {
1353         return MEDFileIntField1TS::New();
1354       }
1355
1356       MEDFileIntField1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
1357       {
1358         return MEDFileIntField1TS::New(fileName);
1359       }
1360
1361       MEDFileIntField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1362       {
1363         return MEDFileIntField1TS::New(fileName,fieldName);
1364       }
1365
1366       MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
1367       {
1368         return MEDFileIntField1TS::New(fileName,fieldName,iteration,order);
1369       }
1370
1371       std::string __str__() const throw(INTERP_KERNEL::Exception)
1372       {
1373         return self->simpleRepr();
1374       }
1375
1376       PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1377       {
1378         DataArrayInt *ret1=0;
1379         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1380         PyObject *ret=PyTuple_New(2);
1381         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1382         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1383         return ret;
1384       }
1385
1386       PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1387       {
1388         DataArrayInt *ret1=0;
1389         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1390         PyObject *ret=PyTuple_New(2);
1391         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1392         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1393         return ret;
1394       }
1395
1396       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1397       {
1398         DataArrayInt *ret1=0;
1399         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1400         PyObject *ret=PyTuple_New(2);
1401         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1402         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1403         return ret;
1404       }
1405       
1406       PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1407       {
1408         DataArrayInt *ret1=0;
1409         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1410         PyObject *ret=PyTuple_New(2);
1411         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1412         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1413         return ret;
1414       }
1415       
1416       PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1417       {
1418         DataArrayInt *ret1=0;
1419         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1420         PyObject *ret=PyTuple_New(2);
1421         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1422         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1423         return ret;
1424       }
1425
1426       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1427       {
1428          DataArrayInt *ret1=0;
1429          DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1430          PyObject *ret=PyTuple_New(2);
1431          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1432          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1433          return ret;
1434       }
1435       
1436       DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1437       {
1438         DataArrayInt *ret=self->getUndergroundDataArray();
1439         if(ret)
1440           ret->incrRef();
1441         return ret;
1442       }
1443     }
1444   };
1445
1446   class MEDFileAnyTypeFieldMultiTSIterator
1447   {
1448   public:
1449     %extend
1450     {
1451       PyObject *next() throw(INTERP_KERNEL::Exception)
1452       {
1453         MEDFileAnyTypeField1TS *ret=self->nextt();
1454         if(ret)
1455           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1456         else
1457           {
1458             PyErr_SetString(PyExc_StopIteration,"No more data.");
1459             return 0;
1460           }
1461       }
1462     }
1463   };
1464
1465   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1466   {
1467   public:
1468     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1469     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1470     MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1471     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1472     std::string getName() const throw(INTERP_KERNEL::Exception);
1473     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1474     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1475     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1476     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1477     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1478     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1479     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1480     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1481     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1482     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1483     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1484     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1485     //
1486     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1487     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1488     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1489     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1490     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1491     %extend
1492     {
1493       int __len__() const throw(INTERP_KERNEL::Exception)
1494       {
1495         return self->getNumberOfTS();
1496       }
1497
1498       int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1499       {
1500         if(elt0 && PyInt_Check(elt0))
1501           {//fmts[3]
1502             int pos=PyInt_AS_LONG(elt0);
1503             return pos;
1504           }
1505         else if(elt0 && PyTuple_Check(elt0))
1506           {
1507             if(PyTuple_Size(elt0)==2)
1508               {
1509                 PyObject *o0=PyTuple_GetItem(elt0,0);
1510                 PyObject *o1=PyTuple_GetItem(elt0,1);
1511                 if(PyInt_Check(o0) && PyInt_Check(o1))
1512                   {//fmts(1,-1)
1513                     int iter=PyInt_AS_LONG(o0);
1514                     int order=PyInt_AS_LONG(o1);
1515                     return self->getPosOfTimeStep(iter,order);
1516                   }
1517                 else
1518                   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 !");
1519               }
1520             else
1521               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 !");
1522           }
1523         else if(elt0 && PyFloat_Check(elt0))
1524           {
1525             double val=PyFloat_AS_DOUBLE(elt0);
1526             return self->getPosGivenTime(val);
1527           }
1528         else
1529           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1530       }
1531       
1532       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1533       {
1534         std::vector< std::pair<int,int> > res=self->getIterations();
1535         PyObject *ret=PyList_New(res.size());
1536         int rk=0;
1537         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1538           {
1539             PyObject *elt=PyTuple_New(2);
1540             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1541             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1542             PyList_SetItem(ret,rk,elt);
1543           }
1544         return ret;
1545       }
1546       
1547       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1548       {
1549         std::vector<double> ret1;
1550         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1551         std::size_t sz=ret.size();
1552         PyObject *ret2=PyList_New(sz);
1553         for(std::size_t i=0;i<sz;i++)
1554           {
1555             PyObject *elt=PyTuple_New(3);
1556             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1557             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1558             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1559             PyList_SetItem(ret2,i,elt);
1560           }
1561         return ret2;
1562       }
1563       
1564       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1565       {
1566         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1567         PyObject *ret2=PyList_New(ret.size());
1568         for(int i=0;i<(int)ret.size();i++)
1569           {
1570             const std::vector<TypeOfField>& rett=ret[i];
1571             PyObject *ret3=PyList_New(rett.size());
1572             for(int j=0;j<(int)rett.size();j++)
1573               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1574             PyList_SetItem(ret2,i,ret3);
1575           }
1576         return ret2;
1577       }
1578       
1579       PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1580       {
1581         std::vector<int> ret1;
1582         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1583         PyObject *elt=PyTuple_New(2);
1584         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1585         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1586         return elt;
1587       }
1588       
1589       PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1590       {
1591         std::vector<INTERP_KERNEL::NormalizedCellType> types;
1592         std::vector< std::vector<TypeOfField> > typesF;
1593         std::vector< std::vector<std::string> > pfls;
1594         std::vector< std::vector<std::string> > locs;
1595         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1596         int sz=ret.size();
1597         PyObject *ret2=PyList_New(sz);
1598         for(int i=0;i<sz;i++)
1599           {
1600             const std::vector< std::pair<int,int> >& dadsI=ret[i];
1601             const std::vector<TypeOfField>& typesFI=typesF[i];
1602             const std::vector<std::string>& pflsI=pfls[i];
1603             const std::vector<std::string>& locsI=locs[i];
1604             PyObject *elt=PyTuple_New(2);
1605             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1606             int sz2=ret[i].size();
1607             PyObject *elt2=PyList_New(sz2);
1608             for(int j=0;j<sz2;j++)
1609               {
1610                 PyObject *elt3=PyTuple_New(4);
1611                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1612                 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
1613                 PyTuple_SetItem(elt3,1,elt4);
1614                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1615                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1616                 PyList_SetItem(elt2,j,elt3);
1617               }
1618             PyTuple_SetItem(elt,1,elt2);
1619             PyList_SetItem(ret2,i,elt);
1620           }
1621         return ret2;
1622       }
1623
1624       std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1625       {
1626         if(PyList_Check(elts))
1627           {
1628             int sz=PyList_Size(elts);
1629             std::vector<int> ret(sz);
1630             for(int i=0;i<sz;i++)
1631               {
1632                 PyObject *elt=PyList_GetItem(elts,i);
1633                 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1634               }
1635             return ret;
1636           }
1637         else
1638           {
1639             std::vector<int> ret(1);
1640             ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1641             return ret;
1642           }
1643       }
1644       
1645       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1646       {
1647         if(PySlice_Check(elts))
1648           {
1649             Py_ssize_t strt=2,stp=2,step=2;
1650             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1651             if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1652               {
1653                 self->eraseTimeStepIds2(strt,stp,step);
1654               }
1655             else
1656               throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1657           }
1658         else
1659           {
1660             std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1661             if(!idsToRemove.empty())
1662               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1663           }
1664       }
1665       
1666       void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1667       {
1668         int sw;
1669         int pos1;
1670         std::vector<int> pos2;
1671         DataArrayInt *pos3=0;
1672         DataArrayIntTuple *pos4=0;
1673         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1674         switch(sw)
1675           {
1676           case 1:
1677             {
1678               self->eraseTimeStepIds(&pos1,&pos1+1);
1679               return;
1680             }
1681           case 2:
1682             {
1683               if(pos2.empty())
1684                 return;
1685               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1686               return ;
1687             }
1688           case 3:
1689             {
1690               self->eraseTimeStepIds(pos3->begin(),pos3->end());
1691               return ;
1692             }
1693           default:
1694             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1695           }
1696       }
1697
1698       MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1699       {
1700         return self->iterator();
1701       }
1702
1703       PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1704       {
1705         if(elt0 && PyList_Check(elt0))
1706           {
1707             int sz=PyList_Size(elt0);
1708             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1709             int *pt=da->getPointer();
1710             for(int i=0;i<sz;i++,pt++)
1711               {
1712                 PyObject *elt1=PyList_GetItem(elt0,i);
1713                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1714               }
1715             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1716           }
1717         else if(elt0 && PySlice_Check(elt0))
1718           {
1719             Py_ssize_t strt=2,stp=2,step=2;
1720             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1721             if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1722               return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1723             else
1724               throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1725           }
1726         else
1727           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1728       }
1729
1730       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1731       {
1732         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1733         return self->changeMeshNames(modifTab);
1734       }
1735
1736       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1737       {
1738         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1739         std::size_t sz=ret.size();
1740         PyObject *retPy=PyList_New(sz);
1741         for(std::size_t i=0;i<sz;i++)
1742           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1743         return retPy;
1744       }
1745
1746       void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1747       {
1748         std::vector<MEDFileAnyTypeField1TS *> tmp;
1749         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1750         self->pushBackTimeSteps(tmp);
1751       }
1752     }
1753   };
1754
1755   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1756   {
1757   public:
1758     static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1759     static MEDFileFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1760     static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1761     //
1762     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1763     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1764     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1765     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1766     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1767     //
1768     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1769     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1770     %extend
1771        {
1772          MEDFileFieldMultiTS()
1773          {
1774            return MEDFileFieldMultiTS::New();
1775          }
1776
1777          MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
1778          {
1779            return MEDFileFieldMultiTS::New(fileName);
1780          }
1781
1782          MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1783          {
1784            return MEDFileFieldMultiTS::New(fileName,fieldName);
1785          }
1786          
1787          std::string __str__() const throw(INTERP_KERNEL::Exception)
1788          {
1789            return self->simpleRepr();
1790          }
1791
1792          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1793          {
1794            DataArrayInt *ret1=0;
1795            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1796            PyObject *ret=PyTuple_New(2);
1797            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1798            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1799            return ret;
1800          }
1801
1802          PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1803          {
1804            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1805            std::vector< std::vector<TypeOfField> > typesF;
1806            std::vector< std::vector<std::string> > pfls;
1807            std::vector< std::vector<std::string> > locs;
1808            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1809            int sz=ret.size();
1810            PyObject *ret2=PyList_New(sz);
1811            for(int i=0;i<sz;i++)
1812              {
1813                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1814                const std::vector<TypeOfField>& typesFI=typesF[i];
1815                const std::vector<std::string>& pflsI=pfls[i];
1816                const std::vector<std::string>& locsI=locs[i];
1817                PyObject *elt=PyTuple_New(2);
1818                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1819                int sz2=ret[i].size();
1820                PyObject *elt2=PyList_New(sz2);
1821                for(int j=0;j<sz2;j++)
1822                  {
1823                    PyObject *elt3=PyTuple_New(4);
1824                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1825                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1826                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1827                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1828                    PyList_SetItem(elt2,j,elt3);
1829                  }
1830                PyTuple_SetItem(elt,1,elt2);
1831                PyList_SetItem(ret2,i,elt);
1832              }
1833            return ret2;
1834          }
1835          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1836          {
1837            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
1838            if(ret)
1839              ret->incrRef();
1840            return ret;
1841          }
1842          
1843          PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1844          {
1845            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1846            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
1847            if(elt0)
1848              elt0->incrRef();
1849            PyObject *ret=PyTuple_New(2);
1850            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1851            std::size_t sz=elt1Cpp.size();
1852            PyObject *elt=PyList_New(sz);
1853            for(std::size_t i=0;i<sz;i++)
1854              {
1855                PyObject *elt1=PyTuple_New(2);
1856                PyObject *elt2=PyTuple_New(2);
1857                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
1858                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1859                PyObject *elt3=PyTuple_New(2);
1860                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1861                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1862                PyTuple_SetItem(elt1,0,elt2);
1863                PyTuple_SetItem(elt1,1,elt3);
1864                PyList_SetItem(elt,i,elt1);
1865              }
1866            PyTuple_SetItem(ret,1,elt);
1867            return ret;
1868          }
1869        }
1870   };
1871
1872   class MEDFileFieldsIterator
1873   {
1874   public:
1875     %extend
1876     {
1877       PyObject *next() throw(INTERP_KERNEL::Exception)
1878       {
1879         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
1880         if(ret)
1881           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
1882         else
1883           {
1884             PyErr_SetString(PyExc_StopIteration,"No more data.");
1885             return 0;
1886           }
1887       }
1888     }
1889   };
1890
1891   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1892   {
1893   public:
1894     static MEDFileIntFieldMultiTS *New();
1895     static MEDFileIntFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1896     static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1897     //
1898     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1899     void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1900     %extend
1901     {
1902       MEDFileIntFieldMultiTS()
1903       {
1904         return MEDFileIntFieldMultiTS::New();
1905       }
1906       
1907       MEDFileIntFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
1908       {
1909         return MEDFileIntFieldMultiTS::New(fileName);
1910       }
1911       
1912       MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1913       {
1914         return MEDFileIntFieldMultiTS::New(fileName,fieldName);
1915       }
1916
1917       std::string __str__() const throw(INTERP_KERNEL::Exception)
1918       {
1919         return self->simpleRepr();
1920       }
1921
1922       PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1923       {
1924         DataArrayInt *ret1=0;
1925         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
1926         PyObject *ret=PyTuple_New(2);
1927         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1928         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1929         return ret;
1930       }
1931
1932       PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1933       {
1934         DataArrayInt *ret1=0;
1935         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
1936         PyObject *ret=PyTuple_New(2);
1937         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1938         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1939         return ret;
1940       }
1941
1942       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1943       {
1944         DataArrayInt *ret1=0;
1945         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
1946         PyObject *ret=PyTuple_New(2);
1947         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1948         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1949         return ret;
1950       }
1951       
1952       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1953       {
1954         DataArrayInt *ret1=0;
1955         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
1956         PyObject *ret=PyTuple_New(2);
1957         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1958         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1959         return ret;
1960       }
1961       
1962       PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1963       {
1964         DataArrayInt *ret1=0;
1965         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
1966         PyObject *ret=PyTuple_New(2);
1967         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1968         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1969         return ret;
1970       }
1971
1972       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1973       {
1974          DataArrayInt *ret1=0;
1975          DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1976          PyObject *ret=PyTuple_New(2);
1977          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1978          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1979          return ret;
1980       }
1981
1982       DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1983       {
1984         DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
1985         if(ret)
1986           ret->incrRef();
1987         return ret;
1988       }
1989     }
1990   };
1991
1992   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1993   {
1994   public:
1995     static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
1996     static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1997     MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
1998     MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
1999     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2000     int getNumberOfFields() const;
2001     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2002     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2003     //
2004     void resize(int newSize) throw(INTERP_KERNEL::Exception);
2005     void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2006     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2007     int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2008     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2009     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2010     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2011     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2012     %extend
2013        {
2014          MEDFileFields()
2015          {
2016            return MEDFileFields::New();
2017          }
2018
2019          MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception)
2020          {
2021            return MEDFileFields::New(fileName);
2022          }
2023          
2024          std::string __str__() const throw(INTERP_KERNEL::Exception)
2025          {
2026            return self->simpleRepr();
2027          }
2028
2029          PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2030          {
2031            bool ret1;
2032            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2033            PyObject *ret=PyTuple_New(2);
2034            PyObject *ret_0=PyList_New(ret0.size());
2035            int rk=0;
2036            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2037              {
2038                PyObject *elt=PyTuple_New(2);
2039                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2040                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2041                PyList_SetItem(ret_0,rk,elt);
2042              }
2043            PyTuple_SetItem(ret,0,ret_0);
2044            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2045            PyTuple_SetItem(ret,1,ret_1);
2046            return ret;
2047          }
2048
2049          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2050          {
2051            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2052            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2053          }
2054
2055          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2056          {
2057            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2058            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2059          }
2060          
2061          PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2062          {
2063            if(obj && PyList_Check(obj))
2064              {
2065                int sz=PyList_Size(obj);
2066                MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2067                int *pt=da->getPointer();
2068                for(int i=0;i<sz;i++,pt++)
2069                  {
2070                    PyObject *elt1=PyList_GetItem(obj,i);
2071                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2072                  }
2073                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2074              }
2075            else
2076              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2077          }
2078
2079          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2080          {
2081            self->setFieldAtPos(obj,field);
2082            return self;
2083          }
2084
2085          int __len__() const throw(INTERP_KERNEL::Exception)
2086          {
2087            return self->getNumberOfFields();
2088          }
2089
2090          MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2091          {
2092            return self->iterator();
2093          }
2094          
2095          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2096          {
2097            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2098            return self->changeMeshNames(modifTab);
2099          }
2100
2101          int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2102          {
2103            if(elt0 && PyInt_Check(elt0))
2104              {//fmts[3]
2105                return PyInt_AS_LONG(elt0);
2106              }
2107            else if(elt0 && PyString_Check(elt0))
2108              return self->getPosFromFieldName(PyString_AsString(elt0));
2109            else
2110              throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2111          }
2112          
2113          std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2114          {
2115            if(PyList_Check(elts))
2116              {
2117                int sz=PyList_Size(elts);
2118                std::vector<int> ret(sz);
2119                for(int i=0;i<sz;i++)
2120                  {
2121                    PyObject *elt=PyList_GetItem(elts,i);
2122                    ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2123                  }
2124                return ret;
2125              }
2126            else
2127              {
2128                std::vector<int> ret(1);
2129                ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2130                return ret;
2131              }
2132          }
2133
2134          void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2135          {
2136            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2137            convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2138            self->pushFields(tmp);
2139          }
2140          
2141          void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2142          {
2143            if(elts && PySlice_Check(elts))
2144              {
2145                Py_ssize_t strt=2,stp=2,step=2;
2146                PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2147                if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2148                  self->destroyFieldsAtPos2(strt,stp,step);
2149                else
2150                  throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2151              }
2152            else
2153              {
2154                std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2155                if(!idsToRemove.empty())
2156                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2157              }
2158          }
2159        }
2160   };
2161
2162   class MEDFileParameter1TS : public RefCountObject
2163   {
2164   public:
2165     void setIteration(int it);
2166     int getIteration() const;
2167     void setOrder(int order);
2168     int getOrder() const;
2169     void setTimeValue(double time);
2170     void setTime(int dt, int it, double time);
2171     double getTime(int& dt, int& it);
2172     double getTimeValue() const;
2173   };
2174
2175   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2176   {
2177   public:
2178     void setValue(double val) throw(INTERP_KERNEL::Exception);
2179     double getValue() const throw(INTERP_KERNEL::Exception);
2180     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2181     %extend
2182     {
2183       std::string __str__() const throw(INTERP_KERNEL::Exception)
2184       {
2185         return self->simpleRepr();
2186       }
2187     }
2188   };
2189
2190   class MEDFileParameterTinyInfo : public MEDFileWritable
2191   {
2192   public:
2193     void setDescription(const char *name);
2194     const char *getDescription() const;
2195     void setTimeUnit(const char *unit);
2196     const char *getTimeUnit() const;
2197   };
2198
2199   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2200   {
2201   public:
2202     static MEDFileParameterDouble1TS *New();
2203     static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2204     static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2205     static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2206     virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2207     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2208     void setName(const char *name) throw(INTERP_KERNEL::Exception);
2209     const char *getName() const throw(INTERP_KERNEL::Exception);
2210     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2211     %extend
2212     {
2213       MEDFileParameterDouble1TS()
2214       {
2215         return MEDFileParameterDouble1TS::New();
2216       }
2217       
2218       MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2219       {
2220         return MEDFileParameterDouble1TS::New(fileName);
2221       }
2222
2223       MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2224       {
2225         return MEDFileParameterDouble1TS::New(fileName,paramName);
2226       }
2227
2228       MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2229       {
2230         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2231       }
2232
2233       std::string __str__() const throw(INTERP_KERNEL::Exception)
2234       {
2235         return self->simpleRepr();
2236       }
2237
2238       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2239       {
2240         std::string what;
2241         bool ret0=self->isEqual(other,eps,what);
2242         PyObject *res=PyList_New(2);
2243         PyObject *ret0Py=ret0?Py_True:Py_False;
2244         Py_XINCREF(ret0Py);
2245         PyList_SetItem(res,0,ret0Py);
2246         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2247         return res;
2248       }
2249     }
2250   };
2251
2252   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2253   {
2254   public:
2255     static MEDFileParameterMultiTS *New();
2256     static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2257     static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2258     const char *getName() const;
2259     void setName(const char *name);
2260     MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2261     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2262     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2263     void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2264     double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2265     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2266     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2267     %extend
2268     {
2269       MEDFileParameterMultiTS()
2270       {
2271         return MEDFileParameterMultiTS::New();
2272       }
2273       
2274       MEDFileParameterMultiTS(const char *fileName)
2275       {
2276         return MEDFileParameterMultiTS::New(fileName);
2277       }
2278
2279       MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2280       {
2281         return MEDFileParameterMultiTS::New(fileName,paramName);
2282       }
2283
2284       std::string __str__() const throw(INTERP_KERNEL::Exception)
2285       {
2286         return self->simpleRepr();
2287       }
2288       
2289       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2290       {
2291         std::string what;
2292         bool ret0=self->isEqual(other,eps,what);
2293         PyObject *res=PyList_New(2);
2294         PyObject *ret0Py=ret0?Py_True:Py_False;
2295         Py_XINCREF(ret0Py);
2296         PyList_SetItem(res,0,ret0Py);
2297         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2298         return res;
2299       }
2300       
2301       void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2302       {
2303         int sw;
2304         int pos1;
2305         std::vector<int> pos2;
2306         DataArrayInt *pos3=0;
2307         DataArrayIntTuple *pos4=0;
2308         convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2309         switch(sw)
2310           {
2311           case 1:
2312             {
2313               self->eraseTimeStepIds(&pos1,&pos1+1);
2314               return;
2315             }
2316           case 2:
2317             {
2318               if(pos2.empty())
2319                 return;
2320               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2321               return ;
2322             }
2323           case 3:
2324             {
2325               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2326               return ;
2327             }
2328           default:
2329             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2330           }
2331       }
2332
2333       int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2334       {
2335         if(elt0 && PyInt_Check(elt0))
2336           {//fmts[3]
2337             int pos=PyInt_AS_LONG(elt0);
2338             return pos;
2339           }
2340         else if(elt0 && PyTuple_Check(elt0))
2341           {
2342             if(PyTuple_Size(elt0)==2)
2343               {
2344                 PyObject *o0=PyTuple_GetItem(elt0,0);
2345                 PyObject *o1=PyTuple_GetItem(elt0,1);
2346                 if(PyInt_Check(o0) && PyInt_Check(o1))
2347                   {//fmts(1,-1)
2348                     int iter=PyInt_AS_LONG(o0);
2349                     int order=PyInt_AS_LONG(o1);
2350                     return self->getPosOfTimeStep(iter,order);
2351                   }
2352                 else
2353                   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 !");
2354               }
2355             else
2356               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 !");
2357           }
2358         else if(elt0 && PyFloat_Check(elt0))
2359           {
2360             double val=PyFloat_AS_DOUBLE(elt0);
2361             return self->getPosGivenTime(val);
2362           }
2363         else
2364           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2365       }
2366
2367       MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2368       {
2369         MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2370         if(ret)
2371           ret->incrRef();
2372         return ret;
2373       }
2374
2375       std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2376       {
2377         if(PyList_Check(elts))
2378           {
2379             int sz=PyList_Size(elts);
2380             std::vector<int> ret(sz);
2381             for(int i=0;i<sz;i++)
2382               {
2383                 PyObject *elt=PyList_GetItem(elts,i);
2384                 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2385               }
2386             return ret;
2387           }
2388         else
2389           {
2390             std::vector<int> ret(1);
2391             ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2392             return ret;
2393           }
2394       }
2395
2396       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2397       {
2398         std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2399         if(!idsToRemove.empty())
2400           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2401       }
2402       
2403       MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2404       {
2405         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2406         if(ret)
2407           ret->incrRef();
2408         return ret;
2409       }
2410
2411       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2412       {
2413         std::vector< std::pair<int,int> > res=self->getIterations();
2414         PyObject *ret=PyList_New(res.size());
2415         int rk=0;
2416         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2417           {
2418             PyObject *elt=PyTuple_New(2);
2419             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2420             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2421             PyList_SetItem(ret,rk,elt);
2422           }
2423         return ret;
2424       }
2425
2426       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2427       {
2428         std::vector<double> res2;
2429         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2430         PyObject *ret=PyList_New(res.size());
2431         int rk=0;
2432         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2433           {
2434             PyObject *elt=PyTuple_New(3);
2435             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2436             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2437             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2438             PyList_SetItem(ret,rk,elt);
2439           }
2440         return ret;
2441       }
2442     }
2443   };
2444
2445   class MEDFileParameters : public RefCountObject, public MEDFileWritable
2446   {
2447   public:
2448     static MEDFileParameters *New();
2449     static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2450     MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2451     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2452     std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2453     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2454     void resize(int newSize) throw(INTERP_KERNEL::Exception);
2455     void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2456     void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2457     void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2458     int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2459     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2460     %extend
2461     {
2462       MEDFileParameters()
2463       {
2464         return MEDFileParameters::New();
2465       }
2466       
2467       MEDFileParameters(const char *fileName)
2468       {
2469         return MEDFileParameters::New(fileName);
2470       }
2471
2472       std::string __str__() const throw(INTERP_KERNEL::Exception)
2473       {
2474         return self->simpleRepr();
2475       }
2476
2477       MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2478       {
2479         if(PyInt_Check(obj))
2480           {
2481             MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2482             if(ret)
2483               ret->incrRef();
2484             return ret;
2485           }
2486         else if(PyString_Check(obj))
2487           {
2488             MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2489             if(ret)
2490               ret->incrRef();
2491             return ret;
2492           }
2493         else
2494           throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2495       }
2496
2497       int __len__() const throw(INTERP_KERNEL::Exception)
2498       {
2499         return self->getNumberOfParams();
2500       }
2501       
2502       MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2503       {
2504         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2505         if(ret)
2506           ret->incrRef();
2507         return ret;
2508       }
2509
2510       MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2511       {
2512         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2513         if(ret)
2514           ret->incrRef();
2515         return ret;
2516       }
2517       
2518       PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2519       {
2520         std::string what;
2521         bool ret0=self->isEqual(other,eps,what);
2522         PyObject *res=PyList_New(2);
2523         PyObject *ret0Py=ret0?Py_True:Py_False;
2524         Py_XINCREF(ret0Py);
2525         PyList_SetItem(res,0,ret0Py);
2526         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2527         return res;
2528       }
2529     }
2530   };
2531
2532   class MEDFileData : public RefCountObject, public MEDFileWritable
2533   {
2534   public:
2535     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2536     static MEDFileData *New();
2537     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2538     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2539     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2540     void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2541     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2542     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2543     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2544     //
2545     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2546     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2547     //
2548     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2549     %extend
2550        {
2551          MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2552          {
2553            return MEDFileData::New(fileName);
2554          }
2555
2556          MEDFileData()
2557          {
2558            return MEDFileData::New();
2559          }
2560
2561          std::string __str__() const throw(INTERP_KERNEL::Exception)
2562          {
2563            return self->simpleRepr();
2564          }
2565
2566          MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2567          {
2568            MEDFileMeshes *ret=self->getMeshes();
2569            if(ret)
2570              ret->incrRef();
2571            return ret;
2572          }
2573
2574          MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2575          {
2576            MEDFileParameters *ret=self->getParams();
2577            if(ret)
2578              ret->incrRef();
2579            return ret;
2580          }
2581
2582          MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2583          {
2584            MEDFileFields *ret=self->getFields();
2585            if(ret)
2586              ret->incrRef();
2587            return ret;
2588          }
2589
2590          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2591          {
2592            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2593            return self->changeMeshNames(modifTab);
2594          }
2595        }
2596   };
2597
2598   class SauvReader : public RefCountObject
2599   {
2600   public:
2601     static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2602     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2603   };
2604
2605   class SauvWriter : public RefCountObject
2606   {
2607   public:
2608     static SauvWriter * New();
2609     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2610     void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2611   };
2612
2613 }