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