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