Salome HOME
7003e67524efa63d732ef32adf1abc141fdb3a5d
[tools/medcoupling.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 optimizeFamilies() throw(INTERP_KERNEL::Exception);
667     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
668     %extend
669        { 
670          MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
671          {
672            return MEDFileUMesh::New(fileName,mName,dt,it);
673          }
674
675          MEDFileUMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
676          {
677            return MEDFileUMesh::New(fileName);
678          }
679
680          MEDFileUMesh()
681          {
682            return MEDFileUMesh::New();
683          }
684          
685          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
686          {
687            const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
688            if(tmp)
689              tmp->incrRef();
690            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
691          }
692          
693          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
694          {
695            std::vector<const DataArrayInt *> grps;
696            convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
697            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
698          }
699
700          void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
701          {
702            std::vector<const MEDCouplingUMesh *> ms;
703            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
704            self->setMeshes(ms,renum);
705          }
706
707          void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
708          {
709            std::vector<const MEDCouplingUMesh *> ms;
710            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
711            self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
712          }
713          
714          void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
715          {
716            std::vector<const MEDCouplingUMesh *> ms;
717            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
718            self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
719          }
720
721          DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
722          {
723            DataArrayDouble *ret=self->getCoords();
724            if(ret)
725              ret->incrRef();
726            return ret;
727          }
728
729          PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
730          {
731            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
732            self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
733            PyObject *ret=PyTuple_New(3);
734            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
735            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
736            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
737            return ret;
738          }
739        }
740   };
741
742   class MEDFileStructuredMesh : public MEDFileMesh
743   {
744   };
745
746   class MEDFileCMesh : public MEDFileStructuredMesh
747   {
748   public:
749     static MEDFileCMesh *New();
750     static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
751     static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
752     void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
753     %extend
754        {
755          MEDFileCMesh()
756          {
757            return MEDFileCMesh::New();
758          }
759
760          MEDFileCMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
761          {
762            return MEDFileCMesh::New(fileName);
763          }
764
765          MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
766          {
767            return MEDFileCMesh::New(fileName,mName,dt,it);
768          }
769          
770          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
771          {
772            const MEDCouplingCMesh *tmp=self->getMesh();
773            if(tmp)
774              tmp->incrRef();
775            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
776          }
777        }
778   };
779
780   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
781   {
782   public:
783     static MEDFileCurveLinearMesh *New();
784     static MEDFileCurveLinearMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
785     static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
786     void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
787     %extend
788        {
789          MEDFileCurveLinearMesh()
790          {
791            return MEDFileCurveLinearMesh::New();
792          }
793
794          MEDFileCurveLinearMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
795          {
796            return MEDFileCurveLinearMesh::New(fileName);
797          }
798
799          MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
800          {
801            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it);
802          }
803          
804          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
805          {
806            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
807            if(tmp)
808              tmp->incrRef();
809            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
810          }
811        }
812   };
813
814   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
815   {
816   public:
817     static MEDFileMeshMultiTS *New();
818     static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
819     static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
820     MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
821     const char *getName() const throw(INTERP_KERNEL::Exception);
822     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
823     void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
824     %extend
825        { 
826          MEDFileMeshMultiTS()
827          {
828            return MEDFileMeshMultiTS::New();
829          }
830
831          MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
832          {
833            return MEDFileMeshMultiTS::New(fileName);
834          }
835
836          MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
837          {
838            return MEDFileMeshMultiTS::New(fileName,mName);
839          }
840
841          MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
842            {
843              MEDFileMesh *ret=self->getOneTimeStep();
844              if(ret)
845                ret->incrRef();
846              return ret;
847            }
848        }
849   };
850
851   class MEDFileMeshesIterator
852   {
853   public:
854     %extend
855     {
856       PyObject *next() throw(INTERP_KERNEL::Exception)
857       {
858         MEDFileMesh *ret=self->nextt();
859         if(ret)
860           {
861             ret->incrRef();
862             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
863           }
864         else
865           {
866             PyErr_SetString(PyExc_StopIteration,"No more data.");
867             return 0;
868           }
869       }
870     }
871   };
872
873   class MEDFileMeshes : public RefCountObject, public MEDFileWritable
874   {
875   public:
876     static MEDFileMeshes *New();
877     static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
878     MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
879     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
880     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
881     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
882     //
883     void resize(int newSize) throw(INTERP_KERNEL::Exception);
884     void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
885     void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
886     void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
887     %extend
888        {
889          MEDFileMeshes()
890          {
891            return MEDFileMeshes::New();
892          }
893
894          MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
895          {
896            return MEDFileMeshes::New(fileName);
897          }
898
899          std::string __str__() const throw(INTERP_KERNEL::Exception)
900            {
901              return self->simpleRepr();
902            }
903
904          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
905          {
906            if(PyInt_Check(obj))
907              {
908                MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
909                if(ret)
910                  ret->incrRef();
911                return ret;
912              }
913            else if(PyString_Check(obj))
914              {
915                MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
916                if(ret)
917                  ret->incrRef();
918                return ret;
919              }
920            else
921              throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
922          }
923
924          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
925          {
926            self->setMeshAtPos(obj,mesh);
927            return self;
928          }
929
930          MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
931          {
932            return self->iterator();
933          }
934
935          int __len__() const throw(INTERP_KERNEL::Exception)
936          {
937            return self->getNumberOfMeshes();
938          }
939          
940          MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
941            {
942              MEDFileMesh *ret=self->getMeshAtPos(i);
943              if(ret)
944                ret->incrRef();
945              return ret;
946            }
947          MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
948            {
949              MEDFileMesh *ret=self->getMeshWithName(mname);
950              if(ret)
951                ret->incrRef();
952              return ret;
953            }
954        }
955   };
956
957   class MEDFileFieldLoc : public RefCountObject
958   {
959   public:
960     const std::string& getName() const;
961     int getDimension() const;
962     int getNumberOfGaussPoints() const;
963     int getNumberOfPointsInCells() const;
964     const std::vector<double>& getRefCoords() const;
965     const std::vector<double>& getGaussCoords() const;
966     const std::vector<double>& getGaussWeights() const;
967     bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
968   %extend
969     {
970       std::string __str__() const throw(INTERP_KERNEL::Exception)
971       {
972         return self->repr();
973       }
974     }
975   };
976
977   class MEDFileFieldGlobsReal
978   {
979   public:
980     void resetContent();
981     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
982     void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
983     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
984     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
985     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
986     void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
987     void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
988     void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
989     std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
990     std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
991     bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
992     bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
993     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
994     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
995     std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
996     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
997     virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
998     virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
999     virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1000     virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1001     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1002     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1003     void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1004     void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1005     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1006     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1007   %extend
1008      {
1009        PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1010        {
1011          const DataArrayInt *ret=self->getProfile(pflName);
1012          if(ret)
1013            ret->incrRef();
1014          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1015        }
1016
1017        PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1018        {
1019          const DataArrayInt *ret=self->getProfileFromId(pflId);
1020          if(ret)
1021            ret->incrRef();
1022          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1023        }
1024
1025        PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1026        {
1027          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1028          if(loc)
1029            loc->incrRef();
1030          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1031        }
1032        
1033        PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1034        {
1035          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1036          if(loc)
1037            loc->incrRef();
1038          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1039        }
1040        
1041        PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1042        {
1043          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1044          return convertVecPairVecStToPy(ret);
1045        }
1046
1047        PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1048        {
1049          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1050          return convertVecPairVecStToPy(ret);
1051        }
1052
1053        void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1054        {
1055          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1056          self->changePflsNames(v);
1057        }
1058
1059        void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1060        {
1061          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1062          self->changePflsRefsNamesGen(v);
1063        }
1064
1065        void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1066        {
1067          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1068          self->changePflsNamesInStruct(v);
1069        }
1070
1071        void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1072        {
1073          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1074          self->changeLocsNames(v);
1075        }
1076
1077        void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1078        {
1079          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1080          self->changeLocsRefsNamesGen(v);
1081        }
1082        
1083        void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1084        {
1085          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1086          self->changeLocsNamesInStruct(v);
1087        }
1088
1089        std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1090        {
1091          std::ostringstream oss;
1092          self->simpleReprGlobs(oss);
1093          return oss.str();
1094        }
1095      }
1096   };
1097
1098   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1099   {
1100   public:
1101     static MEDFileAnyTypeField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1102     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1103     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1104     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1105     int getDimension() const throw(INTERP_KERNEL::Exception);
1106     int getIteration() const throw(INTERP_KERNEL::Exception);
1107     int getOrder() const throw(INTERP_KERNEL::Exception);
1108     std::string getName() throw(INTERP_KERNEL::Exception);
1109     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1110     std::string getMeshName() throw(INTERP_KERNEL::Exception);
1111     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1112     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1113     bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1114     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1115     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1116     void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1117     virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1118     MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1119     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1120     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1121     %extend
1122     {
1123       PyObject *getTime() throw(INTERP_KERNEL::Exception)
1124       {
1125         int tmp1,tmp2;
1126         double tmp0=self->getTime(tmp1,tmp2);
1127         PyObject *res = PyList_New(3);
1128         PyList_SetItem(res,0,SWIG_From_int(tmp1));
1129         PyList_SetItem(res,1,SWIG_From_int(tmp2));
1130         PyList_SetItem(res,2,SWIG_From_double(tmp0));
1131         return res;
1132       }
1133
1134       PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1135       {
1136         std::pair<int,int> res=self->getDtIt();
1137         PyObject *elt=PyTuple_New(2);
1138         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1139         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1140         return elt;
1141       }
1142
1143       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1144       {
1145         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1146       }
1147       
1148       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1149       {
1150         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1151       }
1152
1153       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1154       {
1155         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1156         return self->changeMeshNames(modifTab);
1157       }
1158       
1159       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1160       {
1161         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1162         PyObject *ret2=PyList_New(ret.size());
1163         for(int i=0;i<(int)ret.size();i++)
1164           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1165         return ret2;
1166       }
1167
1168       PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1169       {
1170         std::vector<int> ret1;
1171         int ret0=self->getNonEmptyLevels(mname,ret1);
1172         PyObject *elt=PyTuple_New(2);
1173         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1174         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1175         return elt;
1176       }
1177
1178       PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1179       {
1180         std::vector<INTERP_KERNEL::NormalizedCellType> types;
1181         std::vector< std::vector<TypeOfField> > typesF;
1182         std::vector< std::vector<std::string> > pfls;
1183         std::vector< std::vector<std::string> > locs;
1184         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1185         int sz=ret.size();
1186         PyObject *ret2=PyList_New(sz);
1187            for(int i=0;i<sz;i++)
1188              {
1189                const std::vector< std::pair<int,int> >& dadsI=ret[i];
1190                const std::vector<TypeOfField>& typesFI=typesF[i];
1191                const std::vector<std::string>& pflsI=pfls[i];
1192                const std::vector<std::string>& locsI=locs[i];
1193                PyObject *elt=PyTuple_New(2);
1194                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1195                int sz2=ret[i].size();
1196                PyObject *elt2=PyList_New(sz2);
1197                for(int j=0;j<sz2;j++)
1198                  {
1199                    PyObject *elt3=PyTuple_New(4);
1200                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1201                    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));
1202                    PyTuple_SetItem(elt3,1,elt4);
1203                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1204                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1205                    PyList_SetItem(elt2,j,elt3);
1206                  }
1207                PyTuple_SetItem(elt,1,elt2);
1208                PyList_SetItem(ret2,i,elt);
1209              }
1210            return ret2;
1211       }
1212
1213       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1214       {
1215         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1216         std::size_t sz=ret.size();
1217         PyObject *retPy=PyList_New(sz);
1218         for(std::size_t i=0;i<sz;i++)
1219           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1220         return retPy;
1221       }
1222     }
1223   };
1224
1225   class MEDFileField1TS : public MEDFileAnyTypeField1TS
1226   {
1227   public:
1228     static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1229     static MEDFileField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1230     static MEDFileField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1231     static MEDFileField1TS *New();
1232     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1233     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1234     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1235     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1236     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1237     //
1238     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1239     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1240     void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1241     void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1242     %extend
1243        {
1244          MEDFileField1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
1245          {
1246            return MEDFileField1TS::New(fileName);
1247          }
1248          
1249          MEDFileField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1250          {
1251            return MEDFileField1TS::New(fileName,fieldName);
1252          }
1253
1254          MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
1255          {
1256            return MEDFileField1TS::New(fileName,fieldName,iteration,order);
1257          }
1258
1259          MEDFileField1TS()
1260          {
1261            return MEDFileField1TS::New();
1262          }
1263
1264          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1265          {
1266            const DataArrayDouble *arr=0;
1267            if(field)
1268              arr=field->getArray();
1269            self->copyTinyInfoFrom(field,arr);
1270          }
1271          
1272          std::string __str__() const throw(INTERP_KERNEL::Exception)
1273          {
1274            return self->simpleRepr();
1275          }
1276          
1277          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1278          {
1279            DataArrayInt *ret1=0;
1280            DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1281            PyObject *ret=PyTuple_New(2);
1282            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1283            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1284            return ret;
1285          }
1286
1287          PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1288          {
1289            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1290            std::vector< std::vector<TypeOfField> > typesF;
1291            std::vector< std::vector<std::string> > pfls;
1292            std::vector< std::vector<std::string> > locs;
1293            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1294            int sz=ret.size();
1295            PyObject *ret2=PyList_New(sz);
1296            for(int i=0;i<sz;i++)
1297              {
1298                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1299                const std::vector<TypeOfField>& typesFI=typesF[i];
1300                const std::vector<std::string>& pflsI=pfls[i];
1301                const std::vector<std::string>& locsI=locs[i];
1302                PyObject *elt=PyTuple_New(2);
1303                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1304                int sz2=ret[i].size();
1305                PyObject *elt2=PyList_New(sz2);
1306                for(int j=0;j<sz2;j++)
1307                  {
1308                    PyObject *elt3=PyTuple_New(4);
1309                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1310                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1311                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1312                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1313                    PyList_SetItem(elt2,j,elt3);
1314                  }
1315                PyTuple_SetItem(elt,1,elt2);
1316                PyList_SetItem(ret2,i,elt);
1317              }
1318            return ret2;
1319          }
1320
1321          DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1322          {
1323            DataArrayDouble *ret=self->getUndergroundDataArray();
1324            if(ret)
1325              ret->incrRef();
1326            return ret;
1327          }
1328
1329          PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1330          {
1331            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1332            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1333            if(elt0)
1334              elt0->incrRef();
1335            PyObject *ret=PyTuple_New(2);
1336            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1337            std::size_t sz=elt1Cpp.size();
1338            PyObject *elt=PyList_New(sz);
1339            for(std::size_t i=0;i<sz;i++)
1340              {
1341                PyObject *elt1=PyTuple_New(2);
1342                PyObject *elt2=PyTuple_New(2);
1343                PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1344                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1345                PyObject *elt3=PyTuple_New(2);
1346                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1347                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1348                PyTuple_SetItem(elt1,0,elt2);
1349                PyTuple_SetItem(elt1,1,elt3);
1350                PyList_SetItem(elt,i,elt1);
1351              }
1352            PyTuple_SetItem(ret,1,elt);
1353            return ret;
1354          }
1355        }
1356   };
1357
1358   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1359   {
1360   public:
1361     static MEDFileIntField1TS *New();
1362     static MEDFileIntField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1363     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1364     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
1365     //
1366     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1367     void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1368     %extend
1369     {
1370       MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1371       {
1372         return MEDFileIntField1TS::New();
1373       }
1374
1375       MEDFileIntField1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
1376       {
1377         return MEDFileIntField1TS::New(fileName);
1378       }
1379
1380       MEDFileIntField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1381       {
1382         return MEDFileIntField1TS::New(fileName,fieldName);
1383       }
1384
1385       MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
1386       {
1387         return MEDFileIntField1TS::New(fileName,fieldName,iteration,order);
1388       }
1389
1390       std::string __str__() const throw(INTERP_KERNEL::Exception)
1391       {
1392         return self->simpleRepr();
1393       }
1394
1395       PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1396       {
1397         DataArrayInt *ret1=0;
1398         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1399         PyObject *ret=PyTuple_New(2);
1400         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1401         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1402         return ret;
1403       }
1404
1405       PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1406       {
1407         DataArrayInt *ret1=0;
1408         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1409         PyObject *ret=PyTuple_New(2);
1410         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1411         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1412         return ret;
1413       }
1414
1415       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1416       {
1417         DataArrayInt *ret1=0;
1418         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1419         PyObject *ret=PyTuple_New(2);
1420         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1421         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422         return ret;
1423       }
1424       
1425       PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1426       {
1427         DataArrayInt *ret1=0;
1428         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1429         PyObject *ret=PyTuple_New(2);
1430         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1431         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1432         return ret;
1433       }
1434       
1435       PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1436       {
1437         DataArrayInt *ret1=0;
1438         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1439         PyObject *ret=PyTuple_New(2);
1440         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1441         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1442         return ret;
1443       }
1444
1445       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1446       {
1447          DataArrayInt *ret1=0;
1448          DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1449          PyObject *ret=PyTuple_New(2);
1450          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1451          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1452          return ret;
1453       }
1454       
1455       DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1456       {
1457         DataArrayInt *ret=self->getUndergroundDataArray();
1458         if(ret)
1459           ret->incrRef();
1460         return ret;
1461       }
1462     }
1463   };
1464
1465   class MEDFileAnyTypeFieldMultiTSIterator
1466   {
1467   public:
1468     %extend
1469     {
1470       PyObject *next() throw(INTERP_KERNEL::Exception)
1471       {
1472         MEDFileAnyTypeField1TS *ret=self->nextt();
1473         if(ret)
1474           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1475         else
1476           {
1477             PyErr_SetString(PyExc_StopIteration,"No more data.");
1478             return 0;
1479           }
1480       }
1481     }
1482   };
1483
1484   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1485   {
1486   public:
1487     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1488     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1489     MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1490     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1491     std::string getName() const throw(INTERP_KERNEL::Exception);
1492     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1493     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1494     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1495     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1496     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1497     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1498     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1499     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1500     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1501     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1502     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1503     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1504     //
1505     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1506     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1507     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1508     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1509     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1510     %extend
1511     {
1512       int __len__() const throw(INTERP_KERNEL::Exception)
1513       {
1514         return self->getNumberOfTS();
1515       }
1516
1517       int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1518       {
1519         if(elt0 && PyInt_Check(elt0))
1520           {//fmts[3]
1521             int pos=PyInt_AS_LONG(elt0);
1522             return pos;
1523           }
1524         else if(elt0 && PyTuple_Check(elt0))
1525           {
1526             if(PyTuple_Size(elt0)==2)
1527               {
1528                 PyObject *o0=PyTuple_GetItem(elt0,0);
1529                 PyObject *o1=PyTuple_GetItem(elt0,1);
1530                 if(PyInt_Check(o0) && PyInt_Check(o1))
1531                   {//fmts(1,-1)
1532                     int iter=PyInt_AS_LONG(o0);
1533                     int order=PyInt_AS_LONG(o1);
1534                     return self->getPosOfTimeStep(iter,order);
1535                   }
1536                 else
1537                   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 !");
1538               }
1539             else
1540               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 !");
1541           }
1542         else if(elt0 && PyFloat_Check(elt0))
1543           {
1544             double val=PyFloat_AS_DOUBLE(elt0);
1545             return self->getPosGivenTime(val);
1546           }
1547         else
1548           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1549       }
1550       
1551       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1552       {
1553         std::vector< std::pair<int,int> > res=self->getIterations();
1554         PyObject *ret=PyList_New(res.size());
1555         int rk=0;
1556         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1557           {
1558             PyObject *elt=PyTuple_New(2);
1559             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1560             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1561             PyList_SetItem(ret,rk,elt);
1562           }
1563         return ret;
1564       }
1565       
1566       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1567       {
1568         std::vector<double> ret1;
1569         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1570         std::size_t sz=ret.size();
1571         PyObject *ret2=PyList_New(sz);
1572         for(std::size_t i=0;i<sz;i++)
1573           {
1574             PyObject *elt=PyTuple_New(3);
1575             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1576             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1577             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1578             PyList_SetItem(ret2,i,elt);
1579           }
1580         return ret2;
1581       }
1582       
1583       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1584       {
1585         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1586         PyObject *ret2=PyList_New(ret.size());
1587         for(int i=0;i<(int)ret.size();i++)
1588           {
1589             const std::vector<TypeOfField>& rett=ret[i];
1590             PyObject *ret3=PyList_New(rett.size());
1591             for(int j=0;j<(int)rett.size();j++)
1592               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1593             PyList_SetItem(ret2,i,ret3);
1594           }
1595         return ret2;
1596       }
1597       
1598       PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1599       {
1600         std::vector<int> ret1;
1601         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1602         PyObject *elt=PyTuple_New(2);
1603         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1604         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1605         return elt;
1606       }
1607       
1608       PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1609       {
1610         std::vector<INTERP_KERNEL::NormalizedCellType> types;
1611         std::vector< std::vector<TypeOfField> > typesF;
1612         std::vector< std::vector<std::string> > pfls;
1613         std::vector< std::vector<std::string> > locs;
1614         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1615         int sz=ret.size();
1616         PyObject *ret2=PyList_New(sz);
1617         for(int i=0;i<sz;i++)
1618           {
1619             const std::vector< std::pair<int,int> >& dadsI=ret[i];
1620             const std::vector<TypeOfField>& typesFI=typesF[i];
1621             const std::vector<std::string>& pflsI=pfls[i];
1622             const std::vector<std::string>& locsI=locs[i];
1623             PyObject *elt=PyTuple_New(2);
1624             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1625             int sz2=ret[i].size();
1626             PyObject *elt2=PyList_New(sz2);
1627             for(int j=0;j<sz2;j++)
1628               {
1629                 PyObject *elt3=PyTuple_New(4);
1630                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1631                 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));
1632                 PyTuple_SetItem(elt3,1,elt4);
1633                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1634                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1635                 PyList_SetItem(elt2,j,elt3);
1636               }
1637             PyTuple_SetItem(elt,1,elt2);
1638             PyList_SetItem(ret2,i,elt);
1639           }
1640         return ret2;
1641       }
1642
1643       std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1644       {
1645         if(PyList_Check(elts))
1646           {
1647             int sz=PyList_Size(elts);
1648             std::vector<int> ret(sz);
1649             for(int i=0;i<sz;i++)
1650               {
1651                 PyObject *elt=PyList_GetItem(elts,i);
1652                 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1653               }
1654             return ret;
1655           }
1656         else
1657           {
1658             std::vector<int> ret(1);
1659             ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1660             return ret;
1661           }
1662       }
1663       
1664       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1665       {
1666         if(PySlice_Check(elts))
1667           {
1668             Py_ssize_t strt=2,stp=2,step=2;
1669             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1670             if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1671               {
1672                 self->eraseTimeStepIds2(strt,stp,step);
1673               }
1674             else
1675               throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1676           }
1677         else
1678           {
1679             std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1680             if(!idsToRemove.empty())
1681               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1682           }
1683       }
1684       
1685       void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1686       {
1687         int sw;
1688         int pos1;
1689         std::vector<int> pos2;
1690         DataArrayInt *pos3=0;
1691         DataArrayIntTuple *pos4=0;
1692         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1693         switch(sw)
1694           {
1695           case 1:
1696             {
1697               self->eraseTimeStepIds(&pos1,&pos1+1);
1698               return;
1699             }
1700           case 2:
1701             {
1702               if(pos2.empty())
1703                 return;
1704               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1705               return ;
1706             }
1707           case 3:
1708             {
1709               self->eraseTimeStepIds(pos3->begin(),pos3->end());
1710               return ;
1711             }
1712           default:
1713             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1714           }
1715       }
1716
1717       MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1718       {
1719         return self->iterator();
1720       }
1721
1722       PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1723       {
1724         if(elt0 && PyList_Check(elt0))
1725           {
1726             int sz=PyList_Size(elt0);
1727             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1728             int *pt=da->getPointer();
1729             for(int i=0;i<sz;i++,pt++)
1730               {
1731                 PyObject *elt1=PyList_GetItem(elt0,i);
1732                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1733               }
1734             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1735           }
1736         else if(elt0 && PySlice_Check(elt0))
1737           {
1738             Py_ssize_t strt=2,stp=2,step=2;
1739             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1740             if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1741               return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1742             else
1743               throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1744           }
1745         else
1746           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1747       }
1748
1749       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1750       {
1751         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1752         return self->changeMeshNames(modifTab);
1753       }
1754
1755       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1756       {
1757         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1758         std::size_t sz=ret.size();
1759         PyObject *retPy=PyList_New(sz);
1760         for(std::size_t i=0;i<sz;i++)
1761           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1762         return retPy;
1763       }
1764
1765       void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1766       {
1767         std::vector<MEDFileAnyTypeField1TS *> tmp;
1768         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1769         self->pushBackTimeSteps(tmp);
1770       }
1771     }
1772   };
1773
1774   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1775   {
1776   public:
1777     static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1778     static MEDFileFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1779     static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1780     //
1781     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1782     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1783     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1784     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1785     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1786     //
1787     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1788     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1789     %extend
1790        {
1791          MEDFileFieldMultiTS()
1792          {
1793            return MEDFileFieldMultiTS::New();
1794          }
1795
1796          MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
1797          {
1798            return MEDFileFieldMultiTS::New(fileName);
1799          }
1800
1801          MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1802          {
1803            return MEDFileFieldMultiTS::New(fileName,fieldName);
1804          }
1805          
1806          std::string __str__() const throw(INTERP_KERNEL::Exception)
1807          {
1808            return self->simpleRepr();
1809          }
1810
1811          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1812          {
1813            DataArrayInt *ret1=0;
1814            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1815            PyObject *ret=PyTuple_New(2);
1816            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1817            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1818            return ret;
1819          }
1820
1821          PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1822          {
1823            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1824            std::vector< std::vector<TypeOfField> > typesF;
1825            std::vector< std::vector<std::string> > pfls;
1826            std::vector< std::vector<std::string> > locs;
1827            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1828            int sz=ret.size();
1829            PyObject *ret2=PyList_New(sz);
1830            for(int i=0;i<sz;i++)
1831              {
1832                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1833                const std::vector<TypeOfField>& typesFI=typesF[i];
1834                const std::vector<std::string>& pflsI=pfls[i];
1835                const std::vector<std::string>& locsI=locs[i];
1836                PyObject *elt=PyTuple_New(2);
1837                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1838                int sz2=ret[i].size();
1839                PyObject *elt2=PyList_New(sz2);
1840                for(int j=0;j<sz2;j++)
1841                  {
1842                    PyObject *elt3=PyTuple_New(4);
1843                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1844                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1845                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1846                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1847                    PyList_SetItem(elt2,j,elt3);
1848                  }
1849                PyTuple_SetItem(elt,1,elt2);
1850                PyList_SetItem(ret2,i,elt);
1851              }
1852            return ret2;
1853          }
1854          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1855          {
1856            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
1857            if(ret)
1858              ret->incrRef();
1859            return ret;
1860          }
1861          
1862          PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1863          {
1864            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1865            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
1866            if(elt0)
1867              elt0->incrRef();
1868            PyObject *ret=PyTuple_New(2);
1869            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1870            std::size_t sz=elt1Cpp.size();
1871            PyObject *elt=PyList_New(sz);
1872            for(std::size_t i=0;i<sz;i++)
1873              {
1874                PyObject *elt1=PyTuple_New(2);
1875                PyObject *elt2=PyTuple_New(2);
1876                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
1877                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1878                PyObject *elt3=PyTuple_New(2);
1879                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1880                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1881                PyTuple_SetItem(elt1,0,elt2);
1882                PyTuple_SetItem(elt1,1,elt3);
1883                PyList_SetItem(elt,i,elt1);
1884              }
1885            PyTuple_SetItem(ret,1,elt);
1886            return ret;
1887          }
1888        }
1889   };
1890
1891   class MEDFileFieldsIterator
1892   {
1893   public:
1894     %extend
1895     {
1896       PyObject *next() throw(INTERP_KERNEL::Exception)
1897       {
1898         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
1899         if(ret)
1900           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
1901         else
1902           {
1903             PyErr_SetString(PyExc_StopIteration,"No more data.");
1904             return 0;
1905           }
1906       }
1907     }
1908   };
1909
1910   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1911   {
1912   public:
1913     static MEDFileIntFieldMultiTS *New();
1914     static MEDFileIntFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1915     static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1916     //
1917     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1918     void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1919     %extend
1920     {
1921       MEDFileIntFieldMultiTS()
1922       {
1923         return MEDFileIntFieldMultiTS::New();
1924       }
1925       
1926       MEDFileIntFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
1927       {
1928         return MEDFileIntFieldMultiTS::New(fileName);
1929       }
1930       
1931       MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1932       {
1933         return MEDFileIntFieldMultiTS::New(fileName,fieldName);
1934       }
1935
1936       std::string __str__() const throw(INTERP_KERNEL::Exception)
1937       {
1938         return self->simpleRepr();
1939       }
1940
1941       PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1942       {
1943         DataArrayInt *ret1=0;
1944         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
1945         PyObject *ret=PyTuple_New(2);
1946         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1947         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1948         return ret;
1949       }
1950
1951       PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1952       {
1953         DataArrayInt *ret1=0;
1954         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
1955         PyObject *ret=PyTuple_New(2);
1956         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1957         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1958         return ret;
1959       }
1960
1961       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1962       {
1963         DataArrayInt *ret1=0;
1964         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
1965         PyObject *ret=PyTuple_New(2);
1966         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1967         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1968         return ret;
1969       }
1970       
1971       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1972       {
1973         DataArrayInt *ret1=0;
1974         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
1975         PyObject *ret=PyTuple_New(2);
1976         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1977         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1978         return ret;
1979       }
1980       
1981       PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1982       {
1983         DataArrayInt *ret1=0;
1984         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
1985         PyObject *ret=PyTuple_New(2);
1986         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1987         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1988         return ret;
1989       }
1990
1991       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1992       {
1993          DataArrayInt *ret1=0;
1994          DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1995          PyObject *ret=PyTuple_New(2);
1996          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1997          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1998          return ret;
1999       }
2000
2001       DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2002       {
2003         DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2004         if(ret)
2005           ret->incrRef();
2006         return ret;
2007       }
2008     }
2009   };
2010
2011   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2012   {
2013   public:
2014     static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2015     static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2016     MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2017     MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2018     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2019     int getNumberOfFields() const;
2020     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2021     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2022     //
2023     void resize(int newSize) throw(INTERP_KERNEL::Exception);
2024     void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2025     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2026     int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2027     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2028     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2029     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2030     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2031     %extend
2032        {
2033          MEDFileFields()
2034          {
2035            return MEDFileFields::New();
2036          }
2037
2038          MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception)
2039          {
2040            return MEDFileFields::New(fileName);
2041          }
2042          
2043          std::string __str__() const throw(INTERP_KERNEL::Exception)
2044          {
2045            return self->simpleRepr();
2046          }
2047
2048          PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2049          {
2050            bool ret1;
2051            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2052            PyObject *ret=PyTuple_New(2);
2053            PyObject *ret_0=PyList_New(ret0.size());
2054            int rk=0;
2055            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2056              {
2057                PyObject *elt=PyTuple_New(2);
2058                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2059                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2060                PyList_SetItem(ret_0,rk,elt);
2061              }
2062            PyTuple_SetItem(ret,0,ret_0);
2063            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2064            PyTuple_SetItem(ret,1,ret_1);
2065            return ret;
2066          }
2067
2068          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2069          {
2070            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2071            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2072          }
2073
2074          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2075          {
2076            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2077            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2078          }
2079          
2080          PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2081          {
2082            if(obj && PyList_Check(obj))
2083              {
2084                int sz=PyList_Size(obj);
2085                MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2086                int *pt=da->getPointer();
2087                for(int i=0;i<sz;i++,pt++)
2088                  {
2089                    PyObject *elt1=PyList_GetItem(obj,i);
2090                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2091                  }
2092                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2093              }
2094            else
2095              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2096          }
2097
2098          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2099          {
2100            self->setFieldAtPos(obj,field);
2101            return self;
2102          }
2103
2104          int __len__() const throw(INTERP_KERNEL::Exception)
2105          {
2106            return self->getNumberOfFields();
2107          }
2108
2109          MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2110          {
2111            return self->iterator();
2112          }
2113          
2114          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2115          {
2116            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2117            return self->changeMeshNames(modifTab);
2118          }
2119
2120          int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2121          {
2122            if(elt0 && PyInt_Check(elt0))
2123              {//fmts[3]
2124                return PyInt_AS_LONG(elt0);
2125              }
2126            else if(elt0 && PyString_Check(elt0))
2127              return self->getPosFromFieldName(PyString_AsString(elt0));
2128            else
2129              throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2130          }
2131          
2132          std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2133          {
2134            if(PyList_Check(elts))
2135              {
2136                int sz=PyList_Size(elts);
2137                std::vector<int> ret(sz);
2138                for(int i=0;i<sz;i++)
2139                  {
2140                    PyObject *elt=PyList_GetItem(elts,i);
2141                    ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2142                  }
2143                return ret;
2144              }
2145            else
2146              {
2147                std::vector<int> ret(1);
2148                ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2149                return ret;
2150              }
2151          }
2152
2153          void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2154          {
2155            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2156            convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2157            self->pushFields(tmp);
2158          }
2159          
2160          void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2161          {
2162            if(elts && PySlice_Check(elts))
2163              {
2164                Py_ssize_t strt=2,stp=2,step=2;
2165                PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2166                if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2167                  self->destroyFieldsAtPos2(strt,stp,step);
2168                else
2169                  throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2170              }
2171            else
2172              {
2173                std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2174                if(!idsToRemove.empty())
2175                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2176              }
2177          }
2178        }
2179   };
2180
2181   class MEDFileParameter1TS : public RefCountObject
2182   {
2183   public:
2184     void setIteration(int it);
2185     int getIteration() const;
2186     void setOrder(int order);
2187     int getOrder() const;
2188     void setTimeValue(double time);
2189     void setTime(int dt, int it, double time);
2190     double getTime(int& dt, int& it);
2191     double getTimeValue() const;
2192   };
2193
2194   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2195   {
2196   public:
2197     void setValue(double val) throw(INTERP_KERNEL::Exception);
2198     double getValue() const throw(INTERP_KERNEL::Exception);
2199     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2200     %extend
2201     {
2202       std::string __str__() const throw(INTERP_KERNEL::Exception)
2203       {
2204         return self->simpleRepr();
2205       }
2206     }
2207   };
2208
2209   class MEDFileParameterTinyInfo : public MEDFileWritable
2210   {
2211   public:
2212     void setDescription(const char *name);
2213     const char *getDescription() const;
2214     void setTimeUnit(const char *unit);
2215     const char *getTimeUnit() const;
2216   };
2217
2218   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2219   {
2220   public:
2221     static MEDFileParameterDouble1TS *New();
2222     static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2223     static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2224     static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2225     virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2226     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2227     void setName(const char *name) throw(INTERP_KERNEL::Exception);
2228     const char *getName() const throw(INTERP_KERNEL::Exception);
2229     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2230     %extend
2231     {
2232       MEDFileParameterDouble1TS()
2233       {
2234         return MEDFileParameterDouble1TS::New();
2235       }
2236       
2237       MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2238       {
2239         return MEDFileParameterDouble1TS::New(fileName);
2240       }
2241
2242       MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2243       {
2244         return MEDFileParameterDouble1TS::New(fileName,paramName);
2245       }
2246
2247       MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2248       {
2249         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2250       }
2251
2252       std::string __str__() const throw(INTERP_KERNEL::Exception)
2253       {
2254         return self->simpleRepr();
2255       }
2256
2257       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2258       {
2259         std::string what;
2260         bool ret0=self->isEqual(other,eps,what);
2261         PyObject *res=PyList_New(2);
2262         PyObject *ret0Py=ret0?Py_True:Py_False;
2263         Py_XINCREF(ret0Py);
2264         PyList_SetItem(res,0,ret0Py);
2265         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2266         return res;
2267       }
2268     }
2269   };
2270
2271   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2272   {
2273   public:
2274     static MEDFileParameterMultiTS *New();
2275     static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2276     static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2277     const char *getName() const;
2278     void setName(const char *name);
2279     MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2280     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2281     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2282     void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2283     double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2284     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2285     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2286     %extend
2287     {
2288       MEDFileParameterMultiTS()
2289       {
2290         return MEDFileParameterMultiTS::New();
2291       }
2292       
2293       MEDFileParameterMultiTS(const char *fileName)
2294       {
2295         return MEDFileParameterMultiTS::New(fileName);
2296       }
2297
2298       MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2299       {
2300         return MEDFileParameterMultiTS::New(fileName,paramName);
2301       }
2302
2303       std::string __str__() const throw(INTERP_KERNEL::Exception)
2304       {
2305         return self->simpleRepr();
2306       }
2307       
2308       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2309       {
2310         std::string what;
2311         bool ret0=self->isEqual(other,eps,what);
2312         PyObject *res=PyList_New(2);
2313         PyObject *ret0Py=ret0?Py_True:Py_False;
2314         Py_XINCREF(ret0Py);
2315         PyList_SetItem(res,0,ret0Py);
2316         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2317         return res;
2318       }
2319       
2320       void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2321       {
2322         int sw;
2323         int pos1;
2324         std::vector<int> pos2;
2325         DataArrayInt *pos3=0;
2326         DataArrayIntTuple *pos4=0;
2327         convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2328         switch(sw)
2329           {
2330           case 1:
2331             {
2332               self->eraseTimeStepIds(&pos1,&pos1+1);
2333               return;
2334             }
2335           case 2:
2336             {
2337               if(pos2.empty())
2338                 return;
2339               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2340               return ;
2341             }
2342           case 3:
2343             {
2344               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2345               return ;
2346             }
2347           default:
2348             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2349           }
2350       }
2351
2352       int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2353       {
2354         if(elt0 && PyInt_Check(elt0))
2355           {//fmts[3]
2356             int pos=PyInt_AS_LONG(elt0);
2357             return pos;
2358           }
2359         else if(elt0 && PyTuple_Check(elt0))
2360           {
2361             if(PyTuple_Size(elt0)==2)
2362               {
2363                 PyObject *o0=PyTuple_GetItem(elt0,0);
2364                 PyObject *o1=PyTuple_GetItem(elt0,1);
2365                 if(PyInt_Check(o0) && PyInt_Check(o1))
2366                   {//fmts(1,-1)
2367                     int iter=PyInt_AS_LONG(o0);
2368                     int order=PyInt_AS_LONG(o1);
2369                     return self->getPosOfTimeStep(iter,order);
2370                   }
2371                 else
2372                   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 !");
2373               }
2374             else
2375               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 !");
2376           }
2377         else if(elt0 && PyFloat_Check(elt0))
2378           {
2379             double val=PyFloat_AS_DOUBLE(elt0);
2380             return self->getPosGivenTime(val);
2381           }
2382         else
2383           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2384       }
2385
2386       MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2387       {
2388         MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2389         if(ret)
2390           ret->incrRef();
2391         return ret;
2392       }
2393
2394       std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2395       {
2396         if(PyList_Check(elts))
2397           {
2398             int sz=PyList_Size(elts);
2399             std::vector<int> ret(sz);
2400             for(int i=0;i<sz;i++)
2401               {
2402                 PyObject *elt=PyList_GetItem(elts,i);
2403                 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2404               }
2405             return ret;
2406           }
2407         else
2408           {
2409             std::vector<int> ret(1);
2410             ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2411             return ret;
2412           }
2413       }
2414
2415       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2416       {
2417         std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2418         if(!idsToRemove.empty())
2419           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2420       }
2421       
2422       MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2423       {
2424         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2425         if(ret)
2426           ret->incrRef();
2427         return ret;
2428       }
2429
2430       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2431       {
2432         std::vector< std::pair<int,int> > res=self->getIterations();
2433         PyObject *ret=PyList_New(res.size());
2434         int rk=0;
2435         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2436           {
2437             PyObject *elt=PyTuple_New(2);
2438             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2439             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2440             PyList_SetItem(ret,rk,elt);
2441           }
2442         return ret;
2443       }
2444
2445       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2446       {
2447         std::vector<double> res2;
2448         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2449         PyObject *ret=PyList_New(res.size());
2450         int rk=0;
2451         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2452           {
2453             PyObject *elt=PyTuple_New(3);
2454             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2455             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2456             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2457             PyList_SetItem(ret,rk,elt);
2458           }
2459         return ret;
2460       }
2461     }
2462   };
2463
2464   class MEDFileParameters : public RefCountObject, public MEDFileWritable
2465   {
2466   public:
2467     static MEDFileParameters *New();
2468     static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2469     MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2470     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2471     std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2472     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2473     void resize(int newSize) throw(INTERP_KERNEL::Exception);
2474     void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2475     void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2476     void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2477     int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2478     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2479     %extend
2480     {
2481       MEDFileParameters()
2482       {
2483         return MEDFileParameters::New();
2484       }
2485       
2486       MEDFileParameters(const char *fileName)
2487       {
2488         return MEDFileParameters::New(fileName);
2489       }
2490
2491       std::string __str__() const throw(INTERP_KERNEL::Exception)
2492       {
2493         return self->simpleRepr();
2494       }
2495
2496       MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2497       {
2498         if(PyInt_Check(obj))
2499           {
2500             MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2501             if(ret)
2502               ret->incrRef();
2503             return ret;
2504           }
2505         else if(PyString_Check(obj))
2506           {
2507             MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2508             if(ret)
2509               ret->incrRef();
2510             return ret;
2511           }
2512         else
2513           throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2514       }
2515
2516       int __len__() const throw(INTERP_KERNEL::Exception)
2517       {
2518         return self->getNumberOfParams();
2519       }
2520       
2521       MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2522       {
2523         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2524         if(ret)
2525           ret->incrRef();
2526         return ret;
2527       }
2528
2529       MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2530       {
2531         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2532         if(ret)
2533           ret->incrRef();
2534         return ret;
2535       }
2536       
2537       PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2538       {
2539         std::string what;
2540         bool ret0=self->isEqual(other,eps,what);
2541         PyObject *res=PyList_New(2);
2542         PyObject *ret0Py=ret0?Py_True:Py_False;
2543         Py_XINCREF(ret0Py);
2544         PyList_SetItem(res,0,ret0Py);
2545         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2546         return res;
2547       }
2548     }
2549   };
2550
2551   class MEDFileData : public RefCountObject, public MEDFileWritable
2552   {
2553   public:
2554     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2555     static MEDFileData *New();
2556     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2557     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2558     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2559     void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2560     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2561     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2562     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2563     //
2564     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2565     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2566     //
2567     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2568     %extend
2569        {
2570          MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2571          {
2572            return MEDFileData::New(fileName);
2573          }
2574
2575          MEDFileData()
2576          {
2577            return MEDFileData::New();
2578          }
2579
2580          std::string __str__() const throw(INTERP_KERNEL::Exception)
2581          {
2582            return self->simpleRepr();
2583          }
2584
2585          MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2586          {
2587            MEDFileMeshes *ret=self->getMeshes();
2588            if(ret)
2589              ret->incrRef();
2590            return ret;
2591          }
2592
2593          MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2594          {
2595            MEDFileParameters *ret=self->getParams();
2596            if(ret)
2597              ret->incrRef();
2598            return ret;
2599          }
2600
2601          MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2602          {
2603            MEDFileFields *ret=self->getFields();
2604            if(ret)
2605              ret->incrRef();
2606            return ret;
2607          }
2608
2609          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2610          {
2611            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2612            return self->changeMeshNames(modifTab);
2613          }
2614        }
2615   };
2616
2617   class SauvReader : public RefCountObject
2618   {
2619   public:
2620     static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2621     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2622   };
2623
2624   class SauvWriter : public RefCountObject
2625   {
2626   public:
2627     static SauvWriter * New();
2628     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2629     void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2630   };
2631
2632 }