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