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