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