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