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