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