Salome HOME
Merge from V6_main 11/02/2013
[tools/medcoupling.git] / src / MEDLoader / Swig / MEDLoaderCommon.i
1 // Copyright (C) 2007-2012  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 "MEDFileData.hxx"
33 #include "MEDLoaderTypemaps.i"
34 #include "SauvReader.hxx"
35 #include "SauvWriter.hxx"
36
37 using namespace ParaMEDMEM;
38 %}
39
40 #if SWIG_VERSION >= 0x010329
41 %template()  std::vector<std::string>;
42 #endif
43
44 %typemap(out) ParaMEDMEM::MEDFileMesh*
45 {
46   $result=convertMEDFileMesh($1,$owner);
47 }
48
49 %newobject MEDLoader::ReadUMeshFromFamilies;
50 %newobject MEDLoader::ReadUMeshFromGroups;
51 %newobject MEDLoader::ReadUMeshFromFile;
52 %newobject MEDLoader::ReadField;
53 %newobject MEDLoader::ReadFieldCell;
54 %newobject MEDLoader::ReadFieldNode;
55 %newobject MEDLoader::ReadFieldGauss;
56 %newobject MEDLoader::ReadFieldGaussNE;
57 %newobject ParaMEDMEM::MEDFileMesh::New;
58 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
59 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
60 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
61 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
62 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
63 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
64 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
65 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
66 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
67 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
68 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
69 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
70 %newobject ParaMEDMEM::MEDFileUMesh::New;
71 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
72 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
73 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
74 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
75 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
76 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
77 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
78 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
79 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
80 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
81 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
82 %newobject ParaMEDMEM::MEDFileCMesh::New;
83 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
84 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
85 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
86 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
87 %newobject ParaMEDMEM::MEDFileMeshes::New;
88 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
89 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
90 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
91 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
92 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
93
94 %newobject ParaMEDMEM::MEDFileFields::New;
95 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
96 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
97 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
98 %newobject ParaMEDMEM::MEDFileFields::__getitem__;
99 %newobject ParaMEDMEM::MEDFileFields::__iter__;
100 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
101 %newobject ParaMEDMEM::MEDFileFieldMultiTS::deepCpy;
102 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getTimeStepAtPos;
103 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getTimeStep;
104 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getTimeStepGivenTime;
105 %newobject ParaMEDMEM::MEDFileFieldMultiTS::__getitem__;
106 %newobject ParaMEDMEM::MEDFileFieldMultiTS::__iter__;
107 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
108 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
109 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
110 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
111 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
112 %newobject ParaMEDMEM::MEDFileField1TS::New;
113 %newobject ParaMEDMEM::MEDFileField1TS::deepCpy;
114 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
115 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
116 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
117 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
118 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
119
120 %newobject ParaMEDMEM::MEDFileData::New;
121 %newobject ParaMEDMEM::MEDFileData::deepCpy;
122 %newobject ParaMEDMEM::MEDFileData::getMeshes;
123 %newobject ParaMEDMEM::MEDFileData::getFields;
124
125 %newobject ParaMEDMEM::SauvWriter::New;
126 %newobject ParaMEDMEM::SauvReader::New;
127 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
128
129 %feature("unref") MEDFileMesh "$this->decrRef();"
130 %feature("unref") MEDFileUMesh "$this->decrRef();"
131 %feature("unref") MEDFileCMesh "$this->decrRef();"
132 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
133 %feature("unref") MEDFileMeshes "$this->decrRef();"
134 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
135 %feature("unref") MEDFileField1TS "$this->decrRef();"
136 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
137 %feature("unref") MEDFileFields "$this->decrRef();"
138 %feature("unref") MEDFileData "$this->decrRef();"
139 %feature("unref") SauvReader "$this->decrRef();"
140 %feature("unref") SauvWriter "$this->decrRef();"
141
142 class MEDLoader
143 {
144 public:
145   static void setEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
146   static void setCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
147   static void setTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
148   static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
149   static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
150   static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
151   static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
152   static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
153   static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
154   static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
155   static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
156   static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
157   static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
158   static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
159   static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
160   static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
161   %extend
162      {
163        static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
164        {
165          std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
166          PyObject *ret=PyList_New(res.size());
167          int rk=0;
168          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
169            {
170              PyObject *elt=PyTuple_New(2);
171              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
172              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
173              PyList_SetItem(ret,rk,elt);
174            }
175          return ret;
176        }
177
178        static PyObject *GetAllFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
179        {
180          std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,meshName,fieldName);
181          PyObject *ret=PyList_New(res.size());
182          int rk=0;
183          for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
184            {
185              PyObject *elt=PyTuple_New(3);
186              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
187              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
188              PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
189              PyList_SetItem(ret,rk,elt);
190            }
191          return ret;
192        }
193
194        static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
195        {
196          std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
197          PyObject *ret=PyList_New(res.size());
198          int rk=0;
199          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
200            {
201              PyObject *elt=PyTuple_New(2);
202              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
203              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
204              PyList_SetItem(ret,rk,elt);
205            }
206          return ret;
207        }
208        static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
209        {
210          std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
211          PyObject *ret=PyList_New(res.size());
212          int rk=0;
213          for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
214            {
215              PyObject *elt=PyTuple_New(2);
216              PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
217              PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
218              PyList_SetItem(ret,rk,elt);
219            }
220          return ret;
221        }
222        static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
223        {
224          std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
225          PyObject *ret=PyList_New(res.size());
226          int rk=0;
227          for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
228            {
229              PyObject *elt=PyTuple_New(2);
230              PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
231              PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
232              PyList_SetItem(ret,rk,elt);
233            }
234          return ret;
235        }
236        static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
237        {
238          int meshDim,spaceDim,numberOfNodes;
239          std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
240          PyObject *ret=PyTuple_New(4);
241          PyObject *elt0=PyList_New(res.size());
242          int i=0;
243          for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
244            {
245              const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
246              int j=0;
247              PyObject *elt1=PyList_New(obj2.size());
248              for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
249                {
250                  PyObject *elt2=PyTuple_New(2);
251                  PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
252                  PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
253                  PyList_SetItem(elt1,j,elt2);
254                }
255              PyList_SetItem(elt0,i,elt1);
256            }
257          PyTuple_SetItem(ret,0,elt0);
258          PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
259          PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
260          PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
261          return ret;
262        }
263        static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
264                                              const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
265        {
266          std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
267          std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
268          return convertFieldDoubleVecToPy(res);
269        }
270        static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
271        {
272          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
273          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
274          MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
275        }
276        static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
277        {
278          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
279          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
280          MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
281        }
282        static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
283        {
284          std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
285          convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
286          MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
287        }
288        static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
289        {
290          std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
291          int size=v.size();
292          PyObject *ret=PyList_New(size);
293          for(int i=0;i<size;i++)
294            PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
295          return ret;
296        }
297        static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
298        {
299          std::vector<std::string> grps;
300          converPyListToVecString(li,grps);
301          return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
302        }
303        static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
304        {
305          std::vector<std::string> fams;
306          converPyListToVecString(li,fams);
307          return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
308        }
309      }
310   static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
311   static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
312   static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
313   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);
314   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
315   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
316   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
317   static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
318   static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
319   static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
320   static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
321   static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
322   static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
323 };
324
325 namespace ParaMEDMEM
326 {
327   class MEDFileWritable
328   {
329   public:
330     void copyOptionsFrom(const MEDFileWritable& other) const;
331     int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
332     void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
333     int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
334     void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
335   };
336
337   class MEDFileMesh : public RefCountObject, public MEDFileWritable
338   {
339   public:
340     static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
341     static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1);
342     virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
343     virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
344     virtual void clearNonDiscrAttributes() const;
345     void setName(const char *name);
346     const char *getName();
347     void setUnivName(const char *name);
348     const char *getUnivName() const;
349     void setDescription(const char *name);
350     const char *getDescription() const;
351     void setOrder(int order);
352     int getOrder() const;
353     void setIteration(int it);
354     int getIteration();
355     void setTimeValue(double time);
356     void setTime(int dt, int it, double time);
357     double getTimeValue() const;
358     void setTimeUnit(const char *unit);
359     const char *getTimeUnit() const;
360     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
361     std::vector<int> getNonEmptyLevels() const;
362     std::vector<int> getNonEmptyLevelsExt() const;
363     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
364     int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
365     //
366     bool existsGroup(const char *groupName) const;
367     bool existsFamily(int famId) const;
368     bool existsFamily(const char *familyName) const;
369     void setFamilyId(const char *familyName, int id);
370     void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
371     void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
372     void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
373     virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
374     virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
375     void copyFamGrpMapsFrom(const MEDFileMesh& other);
376     const std::map<std::string,int>& getFamilyInfo() const;
377     const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
378     std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
379     std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
380     std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
381     void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
382     void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
383     std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
384     void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
385     std::vector<std::string> getGroupsNames() const;
386     std::vector<std::string> getFamiliesNames() const;
387     void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
388     void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
389     void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
390     void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
391     void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
392     void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
393     void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
394     void setFamilyInfo(const std::map<std::string,int>& info);
395     void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
396     int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
397     int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
398     int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
399     int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
400     int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
401     virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
402     virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
403     DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
404     std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
405     std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
406     bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
407     void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
408     void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
409     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
410     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
411     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
412     //
413     virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
414     virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
415     virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
416     virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
417     virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
418     virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
419     virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
420     virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
421     virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
422     virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
423     virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
424     %extend
425        {
426          MEDFileMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
427          {
428            return MEDFileMesh::New(fileName);
429          }
430
431          MEDFileMesh(const char *fileName, const char *mName, int dt=-1, int it=-1)
432          {
433            return MEDFileMesh::New(fileName,mName,dt,it);
434          }
435          
436          std::string __str__() const throw(INTERP_KERNEL::Exception)
437          {
438            return self->simpleRepr();
439          }
440
441          PyObject *getTime() throw(INTERP_KERNEL::Exception)
442          {
443            int tmp1,tmp2;
444            double tmp0=self->getTime(tmp1,tmp2);
445            PyObject *res = PyList_New(3);
446            PyList_SetItem(res,0,SWIG_From_int(tmp1));
447            PyList_SetItem(res,1,SWIG_From_int(tmp2));
448            PyList_SetItem(res,2,SWIG_From_double(tmp0));
449            return res;
450          }
451
452          virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
453          {
454            std::string what;
455            bool ret0=self->isEqual(other,eps,what);
456            PyObject *res=PyList_New(2);
457            PyObject *ret0Py=ret0?Py_True:Py_False;
458            Py_XINCREF(ret0Py);
459            PyList_SetItem(res,0,ret0Py);
460            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
461            return res;
462          }
463          
464          PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
465          {
466            std::string what;
467            bool ret0=self->areFamsEqual(other,what);
468            PyObject *res=PyList_New(2);
469            PyObject *ret0Py=ret0?Py_True:Py_False;
470            Py_XINCREF(ret0Py);
471            PyList_SetItem(res,0,ret0Py);
472            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
473            return res;
474          }
475
476          PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
477          {
478            std::string what;
479            bool ret0=self->areGrpsEqual(other,what);
480            PyObject *res=PyList_New(2);
481            PyObject *ret0Py=ret0?Py_True:Py_False;
482            Py_XINCREF(ret0Py);
483            PyList_SetItem(res,0,ret0Py);
484            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
485            return res;
486          }
487
488          PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
489          {
490            const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
491            if(tmp)
492              tmp->incrRef();
493            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
494          }
495
496          PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
497          {
498            const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
499            if(tmp)
500              tmp->incrRef();
501            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
502          }
503
504          PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
505          {
506            bool ret1;
507            std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
508            PyObject *ret=PyTuple_New(2);
509            PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
510            PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
511            return ret;
512          }
513          
514          PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
515          {
516            DataArrayInt *ret3=0;
517            std::vector<int> ret1,ret2;
518            bool ret0=self->unPolyze(ret1,ret2,ret3);
519            PyObject *ret=PyTuple_New(4);
520            PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
521            //
522            PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
523            for(int j=0;j<(int)ret1.size()/3;j++)
524              {
525                PyObject *retLev2=PyList_New(3);
526                PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
527                PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
528                PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
529                PyList_SetItem(retLev1_0,j,retLev2);
530              }
531            PyTuple_SetItem(ret,1,retLev1_0);
532            //
533            PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
534            for(int j=0;j<(int)ret2.size()/3;j++)
535              {
536                PyObject *retLev2=PyList_New(3);
537                PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
538                PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
539                PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
540                PyList_SetItem(retLev1_1,j,retLev2);
541              }
542            PyTuple_SetItem(ret,2,retLev1_1);
543            //
544            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
545            return ret;
546          }
547        }
548   };
549
550   class MEDFileUMesh : public MEDFileMesh
551   {
552   public:
553     static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
554     static MEDFileUMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
555     static MEDFileUMesh *New();
556     ~MEDFileUMesh();
557     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
558     //
559     std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
560     std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
561     std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
562     std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
563     std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
564     std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
565     std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
566     std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
567     std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
568     MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
569     DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
570     MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
571     DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
572     MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
573     DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
574     MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
575     DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
576     DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
577     DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
578     DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
579     DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
580     MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
581     MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
582     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
583     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
584     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
585     //
586     void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
587     void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
588     void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
589     void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
590     void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
591     void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
592     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
593     void setMeshAtLevelGen(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception);
594     void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
595     void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception);
596     void optimizeFamilies() throw(INTERP_KERNEL::Exception);
597     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
598     %extend
599        { 
600          MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
601          {
602            return MEDFileUMesh::New(fileName,mName,dt,it);
603          }
604
605          MEDFileUMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
606          {
607            return MEDFileUMesh::New(fileName);
608          }
609
610          MEDFileUMesh()
611          {
612            return MEDFileUMesh::New();
613          }
614          
615          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
616          {
617            const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
618            if(tmp)
619              tmp->incrRef();
620            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
621          }
622          
623          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
624          {
625            std::vector<const DataArrayInt *> grps;
626            convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
627            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
628          }
629
630          DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
631          {
632            DataArrayDouble *ret=self->getCoords();
633            if(ret)
634              ret->incrRef();
635            return ret;
636          }
637
638          PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
639          {
640            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
641            self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
642            PyObject *ret=PyTuple_New(3);
643            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
644            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
645            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
646            return ret;
647          }
648        }
649   };
650
651   class MEDFileStructuredMesh : public MEDFileMesh
652   {
653   };
654
655   class MEDFileCMesh : public MEDFileStructuredMesh
656   {
657   public:
658     static MEDFileCMesh *New();
659     static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
660     static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
661     void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
662     %extend
663        {
664          MEDFileCMesh()
665          {
666            return MEDFileCMesh::New();
667          }
668
669          MEDFileCMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
670          {
671            return MEDFileCMesh::New(fileName);
672          }
673
674          MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
675          {
676            return MEDFileCMesh::New(fileName,mName,dt,it);
677          }
678          
679          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
680          {
681            const MEDCouplingCMesh *tmp=self->getMesh();
682            if(tmp)
683              tmp->incrRef();
684            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
685          }
686        }
687   };
688
689   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
690   {
691   public:
692     static MEDFileCurveLinearMesh *New();
693     static MEDFileCurveLinearMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
694     static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
695     void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
696     %extend
697        {
698          MEDFileCurveLinearMesh()
699          {
700            return MEDFileCurveLinearMesh::New();
701          }
702
703          MEDFileCurveLinearMesh(const char *fileName) throw(INTERP_KERNEL::Exception)
704          {
705            return MEDFileCurveLinearMesh::New(fileName);
706          }
707
708          MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception)
709          {
710            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it);
711          }
712          
713          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
714          {
715            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
716            if(tmp)
717              tmp->incrRef();
718            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
719          }
720        }
721   };
722
723   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
724   {
725   public:
726     static MEDFileMeshMultiTS *New();
727     static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
728     static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
729     MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
730     const char *getName() const throw(INTERP_KERNEL::Exception);
731     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
732     void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
733     %extend
734        { 
735          MEDFileMeshMultiTS()
736          {
737            return MEDFileMeshMultiTS::New();
738          }
739
740          MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
741          {
742            return MEDFileMeshMultiTS::New(fileName);
743          }
744
745          MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
746          {
747            return MEDFileMeshMultiTS::New(fileName,mName);
748          }
749
750          MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
751            {
752              MEDFileMesh *ret=self->getOneTimeStep();
753              if(ret)
754                ret->incrRef();
755              return ret;
756            }
757        }
758   };
759
760   class MEDFileMeshesIterator
761   {
762   public:
763     %extend
764     {
765       PyObject *next() throw(INTERP_KERNEL::Exception)
766       {
767         MEDFileMesh *ret=self->nextt();
768         if(ret)
769           {
770             ret->incrRef();
771             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
772           }
773         else
774           {
775             PyErr_SetString(PyExc_StopIteration,"No more data.");
776             return 0;
777           }
778       }
779     }
780   };
781
782   class MEDFileMeshes : public RefCountObject, public MEDFileWritable
783   {
784   public:
785     static MEDFileMeshes *New();
786     static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
787     MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
788     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
789     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
790     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
791     //
792     void resize(int newSize) throw(INTERP_KERNEL::Exception);
793     void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
794     void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
795     void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
796     %extend
797        {
798          MEDFileMeshes()
799          {
800            return MEDFileMeshes::New();
801          }
802
803          MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
804          {
805            return MEDFileMeshes::New(fileName);
806          }
807
808          std::string __str__() const
809            {
810              return self->simpleRepr();
811            }
812
813          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
814          {
815            if(PyInt_Check(obj))
816              {
817                MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
818                if(ret)
819                  ret->incrRef();
820                return ret;
821              }
822            else if(PyString_Check(obj))
823              {
824                MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
825                if(ret)
826                  ret->incrRef();
827                return ret;
828              }
829            else
830              throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
831          }
832
833          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
834          {
835            self->setMeshAtPos(obj,mesh);
836            return self;
837          }
838
839          MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
840          {
841            return self->iterator();
842          }
843          
844          MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
845            {
846              MEDFileMesh *ret=self->getMeshAtPos(i);
847              if(ret)
848                ret->incrRef();
849              return ret;
850            }
851          MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
852            {
853              MEDFileMesh *ret=self->getMeshWithName(mname);
854              if(ret)
855                ret->incrRef();
856              return ret;
857            }
858        }
859   };
860
861   class MEDFileFieldLoc : public RefCountObject
862   {
863   public:
864     const std::string& getName() const;
865     int getDimension() const;
866     int getNumberOfGaussPoints() const;
867     int getNumberOfPointsInCells() const;
868     const std::vector<double>& getRefCoords() const;
869     const std::vector<double>& getGaussCoords() const;
870     const std::vector<double>& getGaussWeights() const;
871     bool isEqual(const MEDFileFieldLoc& other, double eps) const;
872   %extend
873     {
874       std::string __str__() const throw(INTERP_KERNEL::Exception)
875       {
876         return self->repr();
877       }
878     }
879   };
880
881   class MEDFileFieldGlobsReal
882   {
883   public:
884     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
885     void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
886     std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
887     std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
888     bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
889     bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
890     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
891     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
892     std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
893     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
894     virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
895     virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
896     virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
897     virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
898     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
899     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
900     void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
901     void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
902     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
903     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
904   %extend
905      {
906        PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
907        {
908          const DataArrayInt *ret=self->getProfile(pflName);
909          if(ret)
910            ret->incrRef();
911          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
912        }
913
914        PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
915        {
916          const DataArrayInt *ret=self->getProfileFromId(pflId);
917          if(ret)
918            ret->incrRef();
919          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
920        }
921
922        PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
923        {
924          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
925          loc->incrRef();
926          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
927        }
928        
929        PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
930        {
931          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
932          loc->incrRef();
933          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
934        }
935        
936        PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
937        {
938          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
939          return convertVecPairVecStToPy(ret);
940        }
941
942        PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
943        {
944          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
945          return convertVecPairVecStToPy(ret);
946        }
947
948        void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
949        {
950          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
951          self->changePflsNames(v);
952        }
953
954        void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
955        {
956          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
957          self->changePflsRefsNamesGen(v);
958        }
959
960        void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
961        {
962          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
963          self->changePflsNamesInStruct(v);
964        }
965
966        void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
967        {
968          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
969          self->changeLocsNames(v);
970        }
971
972        void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
973        {
974          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
975          self->changeLocsRefsNamesGen(v);
976        }
977        
978        void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
979        {
980          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
981          self->changeLocsNamesInStruct(v);
982        }
983      }
984   };
985
986   class MEDFileField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
987   {
988   public:
989     static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
990     static MEDFileField1TS *New();
991     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
992     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
993     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
994     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
995     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
996     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
997     //
998     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
999     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1000     void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1001     void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1002     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1003     MEDFileField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1004     //
1005     int getDimension() const throw(INTERP_KERNEL::Exception);
1006     int getIteration() const throw(INTERP_KERNEL::Exception);
1007     int getOrder() const throw(INTERP_KERNEL::Exception);
1008     std::string getName() throw(INTERP_KERNEL::Exception);
1009     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1010     std::string getMeshName() throw(INTERP_KERNEL::Exception);
1011     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1012     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1013     bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1014     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1015     void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1016     %extend
1017        {
1018          MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
1019          {
1020            return MEDFileField1TS::New(fileName,fieldName,iteration,order);
1021          }
1022
1023          MEDFileField1TS()
1024          {
1025            return MEDFileField1TS::New();
1026          }
1027          
1028          std::string __str__() const throw(INTERP_KERNEL::Exception)
1029            {
1030              return self->simpleRepr();
1031            }
1032
1033          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1034            {
1035              DataArrayInt *ret1=0;
1036              DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1037              PyObject *ret=PyTuple_New(2);
1038              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1039              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1040              return ret;
1041            }
1042
1043          void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1044            {
1045              self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1046            }
1047          
1048          void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1049            {
1050              self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1051            }
1052
1053          PyObject *getTime() throw(INTERP_KERNEL::Exception)
1054          {
1055            int tmp1,tmp2;
1056            double tmp0=self->getTime(tmp1,tmp2);
1057            PyObject *res = PyList_New(3);
1058            PyList_SetItem(res,0,SWIG_From_int(tmp1));
1059            PyList_SetItem(res,1,SWIG_From_int(tmp2));
1060            PyList_SetItem(res,2,SWIG_From_double(tmp0));
1061            return res;
1062          }
1063          
1064          PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1065          {
1066            std::pair<int,int> res=self->getDtIt();
1067            PyObject *elt=PyTuple_New(2);
1068            PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1069            PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1070            return elt;
1071          }
1072          
1073          PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1074          {
1075            std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1076            PyObject *ret2=PyList_New(ret.size());
1077            for(int i=0;i<(int)ret.size();i++)
1078              PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1079            return ret2;
1080          }
1081          
1082          PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1083          {
1084            std::vector<int> ret1;
1085            int ret0=self->getNonEmptyLevels(mname,ret1);
1086            PyObject *elt=PyTuple_New(2);
1087            PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1088            PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1089            return elt;
1090          }
1091          
1092          PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1093          {
1094            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1095            std::vector< std::vector<TypeOfField> > typesF;
1096            std::vector< std::vector<std::string> > pfls;
1097            std::vector< std::vector<std::string> > locs;
1098            std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1099            int sz=ret.size();
1100            PyObject *ret2=PyList_New(sz);
1101            for(int i=0;i<sz;i++)
1102              {
1103                const std::vector< std::pair<int,int> >& dadsI=ret[i];
1104                const std::vector<TypeOfField>& typesFI=typesF[i];
1105                const std::vector<std::string>& pflsI=pfls[i];
1106                const std::vector<std::string>& locsI=locs[i];
1107                PyObject *elt=PyTuple_New(2);
1108                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1109                int sz2=ret[i].size();
1110                PyObject *elt2=PyList_New(sz2);
1111                for(int j=0;j<sz2;j++)
1112                  {
1113                    PyObject *elt3=PyTuple_New(4);
1114                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1115                    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));
1116                    PyTuple_SetItem(elt3,1,elt4);
1117                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1118                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1119                    PyList_SetItem(elt2,j,elt3);
1120                  }
1121                PyTuple_SetItem(elt,1,elt2);
1122                PyList_SetItem(ret2,i,elt);
1123              }
1124            return ret2;
1125          }
1126
1127          PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1128          {
1129            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1130            std::vector< std::vector<TypeOfField> > typesF;
1131            std::vector< std::vector<std::string> > pfls;
1132            std::vector< std::vector<std::string> > locs;
1133            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1134            int sz=ret.size();
1135            PyObject *ret2=PyList_New(sz);
1136            for(int i=0;i<sz;i++)
1137              {
1138                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1139                const std::vector<TypeOfField>& typesFI=typesF[i];
1140                const std::vector<std::string>& pflsI=pfls[i];
1141                const std::vector<std::string>& locsI=locs[i];
1142                PyObject *elt=PyTuple_New(2);
1143                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1144                int sz2=ret[i].size();
1145                PyObject *elt2=PyList_New(sz2);
1146                for(int j=0;j<sz2;j++)
1147                  {
1148                    PyObject *elt3=PyTuple_New(4);
1149                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1150                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1151                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1152                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1153                    PyList_SetItem(elt2,j,elt3);
1154                  }
1155                PyTuple_SetItem(elt,1,elt2);
1156                PyList_SetItem(ret2,i,elt);
1157              }
1158            return ret2;
1159          }
1160
1161          DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1162          {
1163            DataArrayDouble *ret=self->getUndergroundDataArray();
1164            if(ret)
1165              ret->incrRef();
1166            return ret;
1167          }
1168
1169          PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1170          {
1171            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1172            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1173            if(elt0)
1174              elt0->incrRef();
1175            PyObject *ret=PyTuple_New(2);
1176            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1177            std::size_t sz=elt1Cpp.size();
1178            PyObject *elt=PyList_New(sz);
1179            for(std::size_t i=0;i<sz;i++)
1180              {
1181                PyObject *elt1=PyTuple_New(2);
1182                PyObject *elt2=PyTuple_New(2);
1183                PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1184                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1185                PyObject *elt3=PyTuple_New(2);
1186                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1187                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1188                PyTuple_SetItem(elt1,0,elt2);
1189                PyTuple_SetItem(elt1,1,elt3);
1190                PyList_SetItem(elt,i,elt1);
1191              }
1192            PyTuple_SetItem(ret,1,elt);
1193            return ret;
1194          }
1195          
1196          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1197          {
1198            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1199            return self->changeMeshNames(modifTab);
1200          }
1201        }
1202   };
1203
1204   class MEDFileFieldMultiTSIterator
1205   {
1206   public:
1207     %extend
1208     {
1209       PyObject *next() throw(INTERP_KERNEL::Exception)
1210       {
1211         MEDFileField1TS *ret=self->nextt();
1212         if(ret)
1213           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDFileField1TS,SWIG_POINTER_OWN | 0);
1214         else
1215           {
1216             PyErr_SetString(PyExc_StopIteration,"No more data.");
1217             return 0;
1218           }
1219       }
1220     }
1221   };
1222
1223   class MEDFileFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1224   {
1225   public:
1226     static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1227     static MEDFileFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1228     static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
1229     MEDFileFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1230     //
1231     MEDFileField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1232     MEDFileField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1233     MEDFileField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1234     //
1235     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1236     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1237     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1238     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1239     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1240     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1241     //
1242     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1243     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1244     //
1245     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1246     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1247     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1248     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1249     std::string getName() const throw(INTERP_KERNEL::Exception);
1250     void setName(const char *name) throw(INTERP_KERNEL::Exception);
1251     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1252     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1253     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1254     %extend
1255        {
1256          MEDFileFieldMultiTS()
1257          {
1258            return MEDFileFieldMultiTS::New();
1259          }
1260
1261          MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
1262          {
1263            return MEDFileFieldMultiTS::New(fileName);
1264          }
1265
1266          MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
1267          {
1268            return MEDFileFieldMultiTS::New(fileName,fieldName);
1269          }
1270          
1271          std::string __str__() const throw(INTERP_KERNEL::Exception)
1272          {
1273            return self->simpleRepr();
1274          }
1275
1276          int __len__() const throw(INTERP_KERNEL::Exception)
1277          {
1278            return self->getNumberOfTS();
1279          }
1280
1281          MEDFileField1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1282          {
1283            if(elt0 && PyInt_Check(elt0))
1284              {//fmts[3]
1285                int pos=PyInt_AS_LONG(elt0);
1286                return self->getTimeStepAtPos(pos);
1287              }
1288            else if(elt0 && PyTuple_Check(elt0))
1289              {
1290                if(PyTuple_Size(elt0)==2)
1291                  {
1292                    PyObject *o0=PyTuple_GetItem(elt0,0);
1293                    PyObject *o1=PyTuple_GetItem(elt0,1);
1294                    if(PyInt_Check(o0) && PyInt_Check(o1))
1295                      {//fmts(1,-1)
1296                        int iter=PyInt_AS_LONG(o0);
1297                        int order=PyInt_AS_LONG(o1);
1298                        return self->getTimeStep(iter,order);
1299                      }
1300                    else
1301                      throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
1302                  }
1303                else
1304                  throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
1305              }
1306            else if(elt0 && PyFloat_Check(elt0))
1307              {
1308                double val=PyFloat_AS_DOUBLE(elt0);
1309                return self->getTimeStepGivenTime(val);
1310              }
1311            else
1312              throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1313          }
1314
1315          MEDFileFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1316          {
1317            return self->iterator();
1318          }
1319
1320          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1321            {
1322              DataArrayInt *ret1=0;
1323              DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1324              PyObject *ret=PyTuple_New(2);
1325              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1326              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1327              return ret;
1328            }
1329
1330          PyObject *getIterations() const
1331          {
1332            std::vector< std::pair<int,int> > res=self->getIterations();
1333            PyObject *ret=PyList_New(res.size());
1334            int rk=0;
1335            for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1336              {
1337                PyObject *elt=PyTuple_New(2);
1338                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1339                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1340                PyList_SetItem(ret,rk,elt);
1341              }
1342            return ret;
1343          }
1344
1345          PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1346            {
1347              std::vector<double> ret1;
1348              std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1349              std::size_t sz=ret.size();
1350              PyObject *ret2=PyList_New(sz);
1351              for(std::size_t i=0;i<sz;i++)
1352                {
1353                  PyObject *elt=PyTuple_New(3);
1354                  PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1355                  PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1356                  PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1357                  PyList_SetItem(ret2,i,elt);
1358                }
1359              return ret2;
1360            }
1361
1362          PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1363          {
1364            std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1365            PyObject *ret2=PyList_New(ret.size());
1366            for(int i=0;i<(int)ret.size();i++)
1367              {
1368                const std::vector<TypeOfField>& rett=ret[i];
1369                PyObject *ret3=PyList_New(rett.size());
1370                for(int j=0;j<(int)rett.size();j++)
1371                  PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1372                PyList_SetItem(ret2,i,ret3);
1373              }
1374            return ret2;
1375          }
1376
1377          PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1378          {
1379            std::vector<int> ret1;
1380            int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1381            PyObject *elt=PyTuple_New(2);
1382            PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1383            PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1384            return elt;
1385          }
1386
1387          PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1388          {
1389            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1390            std::vector< std::vector<TypeOfField> > typesF;
1391            std::vector< std::vector<std::string> > pfls;
1392            std::vector< std::vector<std::string> > locs;
1393            std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1394            int sz=ret.size();
1395            PyObject *ret2=PyList_New(sz);
1396            for(int i=0;i<sz;i++)
1397              {
1398                const std::vector< std::pair<int,int> >& dadsI=ret[i];
1399                const std::vector<TypeOfField>& typesFI=typesF[i];
1400                const std::vector<std::string>& pflsI=pfls[i];
1401                const std::vector<std::string>& locsI=locs[i];
1402                PyObject *elt=PyTuple_New(2);
1403                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1404                int sz2=ret[i].size();
1405                PyObject *elt2=PyList_New(sz2);
1406                for(int j=0;j<sz2;j++)
1407                  {
1408                    PyObject *elt3=PyTuple_New(4);
1409                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1410                    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));
1411                    PyTuple_SetItem(elt3,1,elt4);
1412                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1413                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1414                    PyList_SetItem(elt2,j,elt3);
1415                  }
1416                PyTuple_SetItem(elt,1,elt2);
1417                PyList_SetItem(ret2,i,elt);
1418              }
1419            return ret2;
1420          }
1421
1422          PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1423          {
1424            std::vector<INTERP_KERNEL::NormalizedCellType> types;
1425            std::vector< std::vector<TypeOfField> > typesF;
1426            std::vector< std::vector<std::string> > pfls;
1427            std::vector< std::vector<std::string> > locs;
1428            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1429            int sz=ret.size();
1430            PyObject *ret2=PyList_New(sz);
1431            for(int i=0;i<sz;i++)
1432              {
1433                const std::vector<DataArrayDouble *>& dadsI=ret[i];
1434                const std::vector<TypeOfField>& typesFI=typesF[i];
1435                const std::vector<std::string>& pflsI=pfls[i];
1436                const std::vector<std::string>& locsI=locs[i];
1437                PyObject *elt=PyTuple_New(2);
1438                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1439                int sz2=ret[i].size();
1440                PyObject *elt2=PyList_New(sz2);
1441                for(int j=0;j<sz2;j++)
1442                  {
1443                    PyObject *elt3=PyTuple_New(4);
1444                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1445                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1446                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1447                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1448                    PyList_SetItem(elt2,j,elt3);
1449                  }
1450                PyTuple_SetItem(elt,1,elt2);
1451                PyList_SetItem(ret2,i,elt);
1452              }
1453            return ret2;
1454          }
1455          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1456          {
1457            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
1458            if(ret)
1459              ret->incrRef();
1460            return ret;
1461          }
1462          PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1463          {
1464            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1465            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
1466            if(elt0)
1467              elt0->incrRef();
1468            PyObject *ret=PyTuple_New(2);
1469            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1470            std::size_t sz=elt1Cpp.size();
1471            PyObject *elt=PyList_New(sz);
1472            for(std::size_t i=0;i<sz;i++)
1473              {
1474                PyObject *elt1=PyTuple_New(2);
1475                PyObject *elt2=PyTuple_New(2);
1476                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
1477                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1478                PyObject *elt3=PyTuple_New(2);
1479                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1480                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1481                PyTuple_SetItem(elt1,0,elt2);
1482                PyTuple_SetItem(elt1,1,elt3);
1483                PyList_SetItem(elt,i,elt1);
1484              }
1485            PyTuple_SetItem(ret,1,elt);
1486            return ret;
1487          }
1488
1489          int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1490          {
1491            if(elt0 && PyInt_Check(elt0))
1492              {//fmts[3]
1493                int pos=PyInt_AS_LONG(elt0);
1494                return pos;
1495              }
1496            else if(elt0 && PyTuple_Check(elt0))
1497              {
1498                if(PyTuple_Size(elt0)==2)
1499                  {
1500                    PyObject *o0=PyTuple_GetItem(elt0,0);
1501                    PyObject *o1=PyTuple_GetItem(elt0,1);
1502                    if(PyInt_Check(o0) && PyInt_Check(o1))
1503                      {//fmts(1,-1)
1504                        int iter=PyInt_AS_LONG(o0);
1505                        int order=PyInt_AS_LONG(o1);
1506                        return self->getPosOfTimeStep(iter,order);
1507                      }
1508                    else
1509                      throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
1510                  }
1511                else
1512                  throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
1513              }
1514            else if(elt0 && PyFloat_Check(elt0))
1515              {
1516                double val=PyFloat_AS_DOUBLE(elt0);
1517                return self->getPosGivenTime(val);
1518              }
1519            else
1520              throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1521          }
1522
1523          std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1524          {
1525            if(PyList_Check(elts))
1526              {
1527                int sz=PyList_Size(elts);
1528                std::vector<int> ret(sz);
1529                for(int i=0;i<sz;i++)
1530                  {
1531                    PyObject *elt=PyList_GetItem(elts,i);
1532                    ret[i]=ParaMEDMEM_MEDFileFieldMultiTS_getTimeId(self,elt);
1533                  }
1534                return ret;
1535              }
1536            else
1537              {
1538                std::vector<int> ret(1);
1539                ret[0]=ParaMEDMEM_MEDFileFieldMultiTS_getTimeId(self,elts);
1540                return ret;
1541              }
1542          }
1543
1544          void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1545          {
1546            std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFieldMultiTS_getTimeIds(self,elts);
1547            if(!idsToRemove.empty())
1548              self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1549          }
1550
1551          void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1552          {
1553            int sw;
1554            int pos1;
1555            std::vector<int> pos2;
1556            DataArrayInt *pos3=0;
1557            DataArrayIntTuple *pos4=0;
1558            convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1559            switch(sw)
1560              {
1561              case 1:
1562                {
1563                  self->eraseTimeStepIds(&pos1,&pos1+1);
1564                  return;
1565                }
1566              case 2:
1567                {
1568                  if(pos2.empty())
1569                    return;
1570                  self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1571                  return ;
1572                }
1573              case 3:
1574                {
1575                  self->eraseTimeStepIds(pos3->begin(),pos3->end());
1576                  return ;
1577                }
1578              default:
1579                throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1580              }
1581          }
1582
1583          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1584          {
1585            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1586            return self->changeMeshNames(modifTab);
1587          }
1588        }
1589   };
1590
1591   class MEDFileFieldsIterator
1592   {
1593   public:
1594     %extend
1595     {
1596       PyObject *next() throw(INTERP_KERNEL::Exception)
1597       {
1598         MEDFileFieldMultiTS *ret=self->nextt();
1599         if(ret)
1600           return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldMultiTS,SWIG_POINTER_OWN | 0);
1601         else
1602           {
1603             PyErr_SetString(PyExc_StopIteration,"No more data.");
1604             return 0;
1605           }
1606       }
1607     }
1608   };
1609
1610   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1611   {
1612   public:
1613     static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
1614     static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1615     MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
1616     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1617     int getNumberOfFields() const;
1618     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
1619     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1620     //
1621     void resize(int newSize) throw(INTERP_KERNEL::Exception);
1622     void pushField(MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
1623     void setFieldAtPos(int i, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
1624     MEDFileFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
1625     MEDFileFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
1626     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
1627     %extend
1628        {
1629          MEDFileFields()
1630          {
1631            return MEDFileFields::New();
1632          }
1633
1634          MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception)
1635          {
1636            return MEDFileFields::New(fileName);
1637          }
1638          
1639          std::string __str__() const throw(INTERP_KERNEL::Exception)
1640          {
1641            return self->simpleRepr();
1642          }
1643          
1644          MEDFileFieldMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1645          {
1646            if(PyInt_Check(obj))
1647              {
1648                return self->getFieldAtPos((int)PyInt_AS_LONG(obj));
1649              }
1650            else if(PyString_Check(obj))
1651              {
1652                return self->getFieldWithName(PyString_AsString(obj));
1653              }
1654            else
1655              throw INTERP_KERNEL::Exception("MEDFileFields::__getitem__ : only integer or string with fieldname supported !");
1656          }
1657
1658          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
1659          {
1660            self->setFieldAtPos(obj,field);
1661            return self;
1662          }
1663
1664          MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
1665          {
1666            return self->iterator();
1667          }
1668          
1669          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1670          {
1671            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1672            return self->changeMeshNames(modifTab);
1673          }
1674        }
1675   };
1676
1677   class MEDFileData : public RefCountObject, public MEDFileWritable
1678   {
1679   public:
1680     static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
1681     static MEDFileData *New();
1682     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
1683     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
1684     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
1685     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
1686     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1687     //
1688     bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
1689     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
1690     //
1691     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1692     %extend
1693        {
1694          MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
1695          {
1696            return MEDFileData::New(fileName);
1697          }
1698
1699          MEDFileData()
1700          {
1701            return MEDFileData::New();
1702          }
1703
1704          std::string __str__() const throw(INTERP_KERNEL::Exception)
1705          {
1706            return self->simpleRepr();
1707          }
1708
1709          MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
1710          {
1711            MEDFileMeshes *ret=self->getMeshes();
1712            if(ret)
1713              ret->incrRef();
1714            return ret;
1715          }
1716
1717          MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
1718          {
1719            MEDFileFields *ret=self->getFields();
1720            if(ret)
1721              ret->incrRef();
1722            return ret;
1723          }
1724
1725          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1726          {
1727            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1728            return self->changeMeshNames(modifTab);
1729          }
1730        }
1731   };
1732
1733   class SauvReader : public RefCountObject
1734   {
1735   public:
1736     static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
1737     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
1738   };
1739
1740   class SauvWriter : public RefCountObject
1741   {
1742   public:
1743     static SauvWriter * New();
1744     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
1745     void write(const char* fileName) throw(INTERP_KERNEL::Exception);
1746   };
1747
1748 }