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