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