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