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