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