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