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