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