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