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