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