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