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