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