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