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