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