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