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