Salome HOME
debug EDF11911. For serialkiller users having families on mesh lying both on cells...
[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     std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
926     static std::string GetMagicFamilyStr();
927     void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
928     std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
929     void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
930     void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
931     std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
932     std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
933     void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
934     void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
935     void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
936     void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
937     void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
938     void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
939     void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
940     void setFamilyInfo(const std::map<std::string,int>& info);
941     void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
942     int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
943     int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
944     int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
945     int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
946     int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
947     int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
948     int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
949     virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
950     virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
951     virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
952     DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
953     DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
954     std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
955     std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
956     bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
957     void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
958     void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
959     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
960     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
961     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
962     //
963     virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
964     virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
965     virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
966     virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
967     virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
968     virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
969     virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
970     virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
971     virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
972     virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
973     virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
974     virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
975     virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
976     virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
977     int getNumberOfJoints();
978     MEDFileJoints *getJoints();
979     void setJoints( MEDFileJoints* joints );
980     void initializeEquivalences();
981     void killEquivalences();
982     %extend
983        {
984          std::string __str__() const throw(INTERP_KERNEL::Exception)
985          {
986            return self->simpleRepr();
987          }
988
989          MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
990          {
991            return self->getGenMeshAtLevel(meshDimRelToMaxExt,false);
992          }
993
994          PyObject *getTime() throw(INTERP_KERNEL::Exception)
995          {
996            int tmp1,tmp2;
997            double tmp0=self->getTime(tmp1,tmp2);
998            PyObject *res = PyList_New(3);
999            PyList_SetItem(res,0,SWIG_From_int(tmp1));
1000            PyList_SetItem(res,1,SWIG_From_int(tmp2));
1001            PyList_SetItem(res,2,SWIG_From_double(tmp0));
1002            return res;
1003          }
1004
1005          virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1006          {
1007            std::string what;
1008            bool ret0=self->isEqual(other,eps,what);
1009            PyObject *res=PyList_New(2);
1010            PyObject *ret0Py=ret0?Py_True:Py_False;
1011            Py_XINCREF(ret0Py);
1012            PyList_SetItem(res,0,ret0Py);
1013            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1014            return res;
1015          }
1016
1017          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1018          {
1019            std::vector<const DataArrayInt *> grps;
1020            convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
1021            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1022          }
1023          
1024          PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1025          {
1026            std::string what;
1027            bool ret0=self->areFamsEqual(other,what);
1028            PyObject *res=PyList_New(2);
1029            PyObject *ret0Py=ret0?Py_True:Py_False;
1030            Py_XINCREF(ret0Py);
1031            PyList_SetItem(res,0,ret0Py);
1032            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1033            return res;
1034          }
1035
1036          PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1037          {
1038            std::string what;
1039            bool ret0=self->areGrpsEqual(other,what);
1040            PyObject *res=PyList_New(2);
1041            PyObject *ret0Py=ret0?Py_True:Py_False;
1042            Py_XINCREF(ret0Py);
1043            PyList_SetItem(res,0,ret0Py);
1044            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1045            return res;
1046          }
1047
1048          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1049          {
1050            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1051            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1052            PyObject *res=PyList_New(result.size());
1053            for(int i=0;iL!=result.end(); i++, iL++)
1054              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1055            return res;
1056          }
1057
1058          PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1059          {
1060            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1061            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1062            PyObject *res=PyList_New(result.size());
1063            for(int i=0;iL!=result.end(); i++, iL++)
1064              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1065            return res;
1066          }
1067
1068          PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1069          {
1070            const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1071            if(tmp)
1072              tmp->incrRef();
1073            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1074          }
1075
1076          PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1077          {
1078            const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1079            if(tmp)
1080              tmp->incrRef();
1081            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1082          }
1083
1084          PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1085          {
1086            const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1087            if(tmp)
1088              tmp->incrRef();
1089            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1090          }
1091
1092          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1093          {
1094            const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1095            if(tmp)
1096              tmp->incrRef();
1097            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1098          }
1099          
1100          PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1101          {
1102            const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1103            if(tmp)
1104              tmp->incrRef();
1105            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1106          }
1107
1108          PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1109          {
1110            bool ret1;
1111            std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1112            PyObject *ret=PyTuple_New(2);
1113            PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1114            PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1115            return ret;
1116          }
1117          
1118          PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1119          {
1120            DataArrayInt *ret3=0;
1121            std::vector<int> ret1,ret2;
1122            bool ret0=self->unPolyze(ret1,ret2,ret3);
1123            PyObject *ret=PyTuple_New(4);
1124            PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1125            //
1126            PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1127            for(int j=0;j<(int)ret1.size()/3;j++)
1128              {
1129                PyObject *retLev2=PyList_New(3);
1130                PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1131                PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1132                PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1133                PyList_SetItem(retLev1_0,j,retLev2);
1134              }
1135            PyTuple_SetItem(ret,1,retLev1_0);
1136            //
1137            PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1138            for(int j=0;j<(int)ret2.size()/3;j++)
1139              {
1140                PyObject *retLev2=PyList_New(3);
1141                PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1142                PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1143                PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1144                PyList_SetItem(retLev1_1,j,retLev2);
1145              }
1146            PyTuple_SetItem(ret,2,retLev1_1);
1147            //
1148            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1149            return ret;
1150          }
1151
1152          MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1153          {
1154            MEDFileEquivalences *ret(self->getEquivalences());
1155            if(ret) ret->incrRef();
1156            return ret;
1157          }
1158        }
1159   };
1160
1161   class MEDFileUMesh : public MEDFileMesh
1162   {
1163   public:
1164     static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1165     static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1166     static MEDFileUMesh *New();
1167     ~MEDFileUMesh();
1168     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1169     int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1170     //
1171     std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1172     std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1173     std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1174     std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1175     std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1176     std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1177     std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1178     std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1179     std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1180     MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1181     MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1182     MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1183     MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1184     DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1185     MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1186     MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1187     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1188     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1189     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1190     void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1191     //
1192     void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1193     void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1194     void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1195     void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1196     void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1197     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1198     void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1199     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1200     DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1201     DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1202     MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1203     MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1204     MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1205     %extend
1206        { 
1207          MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1208          {
1209            return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1210          }
1211
1212          MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1213          {
1214            return MEDFileUMesh::New(fileName,mrs);
1215          }
1216
1217          MEDFileUMesh()
1218          {
1219            return MEDFileUMesh::New();
1220          }
1221
1222          // serialization
1223          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1224          {
1225            return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1226          }
1227
1228          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)
1229          {
1230            std::vector<int> typesCpp1;
1231            convertPyToNewIntArr3(types,typesCpp1);
1232            std::size_t sz(typesCpp1.size());
1233            std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1234            for(std::size_t ii=0;ii<sz;ii++)
1235              typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1236            return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1237          }
1238
1239          PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1240          {// put an empty dict in input to say to __new__ to call __init__...
1241            PyObject *ret(PyTuple_New(1));
1242            PyObject *ret0(PyDict_New());
1243            PyTuple_SetItem(ret,0,ret0);
1244            return ret;
1245          }
1246
1247          PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1248          {
1249            std::vector<double> a0;
1250            std::vector<int> a1;
1251            std::vector<std::string> a2;
1252            std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1253            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1254            self->serialize(a0,a1,a2,a3,a4);
1255            PyObject *ret(PyTuple_New(5));
1256            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1257            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1258            int sz(a2.size());
1259            PyObject *ret2(PyList_New(sz));
1260            for(int i=0;i<sz;i++)
1261              PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1262            PyTuple_SetItem(ret,2,ret2);
1263            sz=a3.size();
1264            PyObject *ret3(PyList_New(sz));
1265            for(int i=0;i<sz;i++)
1266              {
1267                DataArrayInt *elt(a3[i]);
1268                if(elt)
1269                  elt->incrRef();
1270                PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1271              }
1272            PyTuple_SetItem(ret,3,ret3);
1273            DataArrayDouble *ret4(a4);
1274            if(ret4)
1275              ret4->incrRef();
1276            PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1277            return ret;
1278          }
1279
1280          void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1281          {
1282            static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1283            if(!PyTuple_Check(inp))
1284              throw INTERP_KERNEL::Exception(MSG);
1285            int sz(PyTuple_Size(inp));
1286            if(sz!=5)
1287              throw INTERP_KERNEL::Exception(MSG);
1288            std::vector<double> a0;
1289            std::vector<int> a1;
1290            std::vector<std::string> a2;
1291            std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1292            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1293            //
1294            PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1295            int tmp(-1);
1296            fillArrayWithPyListDbl3(a0py,tmp,a0);
1297            convertPyToNewIntArr3(a1py,a1);
1298            fillStringVector(a2py,a2);
1299            //
1300            PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1301            void *argp(0);
1302            int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1303            if(!SWIG_IsOK(status))
1304              throw INTERP_KERNEL::Exception(MSG);
1305            a4=reinterpret_cast<DataArrayDouble *>(argp);
1306            if((DataArrayDouble *)a4)
1307              a4->incrRef();
1308            {
1309              std::vector< DataArrayInt * > a3Tmp;
1310              convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1311              std::size_t sz(a3Tmp.size());
1312              a3.resize(sz);
1313              for(std::size_t i=0;i<sz;i++)
1314                {
1315                  a3[i]=a3Tmp[i];
1316                  if(a3Tmp[i])
1317                    a3Tmp[i]->incrRef();
1318                }
1319              self->unserialize(a0,a1,a2,a3,a4);
1320            }
1321          }
1322
1323          void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1324          {
1325            if(!mesh)
1326              throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1327            MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1328            if(m0)
1329              {
1330                self->setMeshAtLevel(meshDimRelToMax,m0,false);
1331                return ;
1332              }
1333            MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1334            if(m1)
1335              {
1336                self->setMeshAtLevel(meshDimRelToMax,m1);
1337                return ;
1338              }
1339            throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1340          }
1341
1342          void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1343          {
1344            self->removeMeshAtLevel(meshDimRelToMax);
1345          }
1346
1347          void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1348          {
1349            std::vector<const MEDCouplingUMesh *> ms;
1350            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1351            self->setMeshes(ms,renum);
1352          }
1353
1354          void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1355          {
1356            std::vector<const MEDCouplingUMesh *> ms;
1357            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1358            self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1359          }
1360          
1361          void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1362          {
1363            std::vector<const MEDCouplingUMesh *> ms;
1364            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1365            self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1366          }
1367
1368          DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1369          {
1370            DataArrayDouble *ret=self->getCoords();
1371            if(ret)
1372              ret->incrRef();
1373            return ret;
1374          }
1375
1376          PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1377          {
1378            const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1379            if(ret)
1380              ret->incrRef();
1381            return const_cast<PartDefinition *>(ret);
1382          }
1383
1384          PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1385          {
1386            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1387            self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1388            PyObject *ret=PyTuple_New(3);
1389            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1390            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1391            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1392            return ret;
1393          }
1394          
1395          MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1396          {
1397            MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1398            if(ret)
1399              ret->incrRef();
1400            return ret;
1401          }
1402
1403          PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1404          {
1405            std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1406            std::size_t sz(tmp.size());
1407            PyObject *ret=PyList_New(sz);
1408            for(std::size_t i=0;i<sz;i++)
1409              {
1410                if(tmp[i])
1411                  tmp[i]->incrRef();
1412                PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1413              }
1414            return ret;
1415          }
1416        }
1417   };
1418
1419   class MEDFileStructuredMesh : public MEDFileMesh
1420   {
1421   public:
1422     %extend
1423     {
1424       MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1425       {
1426         MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1427         if(ret)
1428           ret->incrRef();
1429         return ret;
1430       }
1431     }
1432   };
1433
1434   class MEDFileCMesh : public MEDFileStructuredMesh
1435   {
1436   public:
1437     static MEDFileCMesh *New();
1438     static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1439     static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1440     void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1441     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1442     %extend
1443        {
1444          MEDFileCMesh()
1445          {
1446            return MEDFileCMesh::New();
1447          }
1448
1449          MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1450          {
1451            return MEDFileCMesh::New(fileName,mrs);
1452          }
1453
1454          MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1455          {
1456            return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1457          }
1458          
1459          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1460          {
1461            const MEDCouplingCMesh *tmp=self->getMesh();
1462            if(tmp)
1463              tmp->incrRef();
1464            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1465          }
1466        }
1467   };
1468
1469   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1470   {
1471   public:
1472     static MEDFileCurveLinearMesh *New();
1473     static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1474     static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1475     void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1476     %extend
1477        {
1478          MEDFileCurveLinearMesh()
1479          {
1480            return MEDFileCurveLinearMesh::New();
1481          }
1482
1483          MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1484          {
1485            return MEDFileCurveLinearMesh::New(fileName,mrs);
1486          }
1487
1488          MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1489          {
1490            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1491          }
1492          
1493          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1494          {
1495            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1496            if(tmp)
1497              tmp->incrRef();
1498            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1499          }
1500        }
1501   };
1502
1503   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1504   {
1505   public:
1506     static MEDFileMeshMultiTS *New();
1507     static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1508     static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1509     MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1510     std::string getName() const throw(INTERP_KERNEL::Exception);
1511     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1512     void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1513     %extend
1514        { 
1515          MEDFileMeshMultiTS()
1516          {
1517            return MEDFileMeshMultiTS::New();
1518          }
1519
1520          MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1521          {
1522            return MEDFileMeshMultiTS::New(fileName);
1523          }
1524
1525          MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1526          {
1527            return MEDFileMeshMultiTS::New(fileName,mName);
1528          }
1529
1530          MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1531            {
1532              MEDFileMesh *ret=self->getOneTimeStep();
1533              if(ret)
1534                ret->incrRef();
1535              return ret;
1536            }
1537        }
1538   };
1539
1540   class MEDFileMeshesIterator
1541   {
1542   public:
1543     %extend
1544     {
1545       PyObject *next() throw(INTERP_KERNEL::Exception)
1546       {
1547         MEDFileMesh *ret=self->nextt();
1548         if(ret)
1549           {
1550             ret->incrRef();
1551             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1552           }
1553         else
1554           {
1555             PyErr_SetString(PyExc_StopIteration,"No more data.");
1556             return 0;
1557           }
1558       }
1559     }
1560   };
1561
1562   class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1563   {
1564   public:
1565     static MEDFileMeshes *New();
1566     static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1567     MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1568     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1569     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1570     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1571     //
1572     void resize(int newSize) throw(INTERP_KERNEL::Exception);
1573     void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1574     void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1575     void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1576     %extend
1577        {
1578          MEDFileMeshes()
1579          {
1580            return MEDFileMeshes::New();
1581          }
1582
1583          MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1584          {
1585            return MEDFileMeshes::New(fileName);
1586          }
1587
1588          std::string __str__() const throw(INTERP_KERNEL::Exception)
1589            {
1590              return self->simpleRepr();
1591            }
1592
1593          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1594          {
1595            if(PyInt_Check(obj))
1596              {
1597                MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1598                if(ret)
1599                  ret->incrRef();
1600                return ret;
1601              }
1602            else if(PyString_Check(obj))
1603              {
1604                MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1605                if(ret)
1606                  ret->incrRef();
1607                return ret;
1608              }
1609            else
1610              throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1611          }
1612
1613          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1614          {
1615            self->setMeshAtPos(obj,mesh);
1616            return self;
1617          }
1618
1619          MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1620          {
1621            return self->iterator();
1622          }
1623
1624          int __len__() const throw(INTERP_KERNEL::Exception)
1625          {
1626            return self->getNumberOfMeshes();
1627          }
1628          
1629          MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1630            {
1631              MEDFileMesh *ret=self->getMeshAtPos(i);
1632              if(ret)
1633                ret->incrRef();
1634              return ret;
1635            }
1636          MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1637            {
1638              MEDFileMesh *ret=self->getMeshWithName(mname);
1639              if(ret)
1640                ret->incrRef();
1641              return ret;
1642            }
1643        }
1644   };
1645
1646   class MEDFileFieldLoc : public RefCountObject
1647   {
1648   public:
1649     std::string getName() const;
1650     int getDimension() const;
1651     int getNumberOfGaussPoints() const;
1652     int getNumberOfPointsInCells() const;
1653     const std::vector<double>& getRefCoords() const;
1654     const std::vector<double>& getGaussCoords() const;
1655     const std::vector<double>& getGaussWeights() const;
1656     bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1657   %extend
1658     {
1659       std::string __str__() const throw(INTERP_KERNEL::Exception)
1660       {
1661         return self->repr();
1662       }
1663     }
1664   };
1665
1666   class MEDFileFieldGlobsReal
1667   {
1668   public:
1669     void resetContent();
1670     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1671     void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1672     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1673     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1674     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1675     void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1676     void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1677     void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1678     std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1679     std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1680     bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1681     bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1682     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1683     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1684     std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1685     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1686     virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1687     virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1688     virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1689     virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1690     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1691     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1692     void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1693     void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1694     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1695     int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1696   %extend
1697      {
1698        PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1699        {
1700          const DataArrayInt *ret=self->getProfile(pflName);
1701          if(ret)
1702            ret->incrRef();
1703          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1704        }
1705
1706        PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1707        {
1708          const DataArrayInt *ret=self->getProfileFromId(pflId);
1709          if(ret)
1710            ret->incrRef();
1711          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1712        }
1713
1714        PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1715        {
1716          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1717          if(loc)
1718            loc->incrRef();
1719          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1720        }
1721        
1722        PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1723        {
1724          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1725          if(loc)
1726            loc->incrRef();
1727          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1728        }
1729        
1730        PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1731        {
1732          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1733          return convertVecPairVecStToPy(ret);
1734        }
1735
1736        PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1737        {
1738          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1739          return convertVecPairVecStToPy(ret);
1740        }
1741
1742        void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1743        {
1744          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1745          self->changePflsNames(v);
1746        }
1747
1748        void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1749        {
1750          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1751          self->changePflsRefsNamesGen(v);
1752        }
1753
1754        void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1755        {
1756          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1757          self->changePflsNamesInStruct(v);
1758        }
1759
1760        void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1761        {
1762          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1763          self->changeLocsNames(v);
1764        }
1765
1766        void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1767        {
1768          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1769          self->changeLocsRefsNamesGen(v);
1770        }
1771        
1772        void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1773        {
1774          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1775          self->changeLocsNamesInStruct(v);
1776        }
1777
1778        std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1779        {
1780          std::ostringstream oss;
1781          self->simpleReprGlobs(oss);
1782          return oss.str();
1783        }
1784      }
1785   };
1786
1787   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1788   {
1789   public:
1790     static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1791     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1792     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1793     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1794     void loadArrays() throw(INTERP_KERNEL::Exception);
1795     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1796     void unloadArrays() throw(INTERP_KERNEL::Exception);
1797     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1798     int getDimension() const throw(INTERP_KERNEL::Exception);
1799     int getIteration() const throw(INTERP_KERNEL::Exception);
1800     int getOrder() const throw(INTERP_KERNEL::Exception);
1801     std::string getName() throw(INTERP_KERNEL::Exception);
1802     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1803     std::string getMeshName() throw(INTERP_KERNEL::Exception);
1804     void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1805     int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1806     int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1807     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1808     bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1809     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1810     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1811     bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1812     void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1813     virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1814     MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1815     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1816     void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1817     %extend
1818     {
1819       PyObject *getTime() throw(INTERP_KERNEL::Exception)
1820       {
1821         int tmp1,tmp2;
1822         double tmp0=self->getTime(tmp1,tmp2);
1823         PyObject *res = PyList_New(3);
1824         PyList_SetItem(res,0,SWIG_From_int(tmp1));
1825         PyList_SetItem(res,1,SWIG_From_int(tmp2));
1826         PyList_SetItem(res,2,SWIG_From_double(tmp0));
1827         return res;
1828       }
1829
1830       PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1831       {
1832         std::pair<int,int> res=self->getDtIt();
1833         PyObject *elt=PyTuple_New(2);
1834         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1835         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1836         return elt;
1837       }
1838
1839       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1840       {
1841         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1842       }
1843       
1844       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1845       {
1846         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1847       }
1848
1849       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1850       {
1851         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1852         return self->changeMeshNames(modifTab);
1853       }
1854       
1855       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1856       {
1857         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1858         PyObject *ret2=PyList_New(ret.size());
1859         for(int i=0;i<(int)ret.size();i++)
1860           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1861         return ret2;
1862       }
1863
1864       PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1865       {
1866         std::vector<int> ret1;
1867         int ret0=self->getNonEmptyLevels(mname,ret1);
1868         PyObject *elt=PyTuple_New(2);
1869         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1870         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1871         return elt;
1872       }
1873
1874       PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1875       {
1876         std::vector<INTERP_KERNEL::NormalizedCellType> types;
1877         std::vector< std::vector<TypeOfField> > typesF;
1878         std::vector< std::vector<std::string> > pfls;
1879         std::vector< std::vector<std::string> > locs;
1880         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1881         int sz=ret.size();
1882         PyObject *ret2=PyList_New(sz);
1883            for(int i=0;i<sz;i++)
1884              {
1885                const std::vector< std::pair<int,int> >& dadsI=ret[i];
1886                const std::vector<TypeOfField>& typesFI=typesF[i];
1887                const std::vector<std::string>& pflsI=pfls[i];
1888                const std::vector<std::string>& locsI=locs[i];
1889                PyObject *elt=PyTuple_New(2);
1890                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1891                int sz2=ret[i].size();
1892                PyObject *elt2=PyList_New(sz2);
1893                for(int j=0;j<sz2;j++)
1894                  {
1895                    PyObject *elt3=PyTuple_New(4);
1896                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1897                    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));
1898                    PyTuple_SetItem(elt3,1,elt4);
1899                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1900                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1901                    PyList_SetItem(elt2,j,elt3);
1902                  }
1903                PyTuple_SetItem(elt,1,elt2);
1904                PyList_SetItem(ret2,i,elt);
1905              }
1906            return ret2;
1907       }
1908
1909       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1910       {
1911         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1912         std::size_t sz=ret.size();
1913         PyObject *retPy=PyList_New(sz);
1914         for(std::size_t i=0;i<sz;i++)
1915           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1916         return retPy;
1917       }
1918
1919       PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1920       {
1921         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1922         std::size_t sz=ret.size();
1923         PyObject *retPy=PyList_New(sz);
1924         for(std::size_t i=0;i<sz;i++)
1925           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1926         return retPy;
1927       }
1928
1929       PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1930       {
1931         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1932         std::size_t sz=ret.size();
1933         PyObject *retPy=PyList_New(sz);
1934         for(std::size_t i=0;i<sz;i++)
1935           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1936         return retPy;
1937       }
1938     }
1939   };
1940
1941   class MEDFileField1TS : public MEDFileAnyTypeField1TS
1942   {
1943   public:
1944     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1945     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1946     static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1947     static MEDFileField1TS *New();
1948     ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1949     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1950     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1951     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1952     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1953     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1954     //
1955     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1956     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1957     void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1958     void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1959     %extend
1960        {
1961          MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1962          {
1963            return MEDFileField1TS::New(fileName,loadAll);
1964          }
1965          
1966          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1967          {
1968            return MEDFileField1TS::New(fileName,fieldName,loadAll);
1969          }
1970
1971          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1972          {
1973            return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1974          }
1975
1976          MEDFileField1TS()
1977          {
1978            return MEDFileField1TS::New();
1979          }
1980
1981          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1982          {
1983            const DataArrayDouble *arr=0;
1984            if(field)
1985              arr=field->getArray();
1986            self->copyTinyInfoFrom(field,arr);
1987          }
1988          
1989          std::string __str__() const throw(INTERP_KERNEL::Exception)
1990          {
1991            return self->simpleRepr();
1992          }
1993          
1994          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1995          {
1996            DataArrayInt *ret1=0;
1997            DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1998            PyObject *ret=PyTuple_New(2);
1999            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2000            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2001            return ret;
2002          }
2003
2004          PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2005          {
2006            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2007            std::vector< std::vector<TypeOfField> > typesF;
2008            std::vector< std::vector<std::string> > pfls;
2009            std::vector< std::vector<std::string> > locs;
2010            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2011            int sz=ret.size();
2012            PyObject *ret2=PyList_New(sz);
2013            for(int i=0;i<sz;i++)
2014              {
2015                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2016                const std::vector<TypeOfField>& typesFI=typesF[i];
2017                const std::vector<std::string>& pflsI=pfls[i];
2018                const std::vector<std::string>& locsI=locs[i];
2019                PyObject *elt=PyTuple_New(2);
2020                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2021                int sz2=ret[i].size();
2022                PyObject *elt2=PyList_New(sz2);
2023                for(int j=0;j<sz2;j++)
2024                  {
2025                    PyObject *elt3=PyTuple_New(4);
2026                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2027                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2028                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2029                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2030                    PyList_SetItem(elt2,j,elt3);
2031                  }
2032                PyTuple_SetItem(elt,1,elt2);
2033                PyList_SetItem(ret2,i,elt);
2034              }
2035            return ret2;
2036          }
2037
2038          DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2039          {
2040            DataArrayDouble *ret=self->getUndergroundDataArray();
2041            if(ret)
2042              ret->incrRef();
2043            return ret;
2044          }
2045
2046          PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2047          {
2048            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2049            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2050            if(elt0)
2051              elt0->incrRef();
2052            PyObject *ret=PyTuple_New(2);
2053            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2054            std::size_t sz=elt1Cpp.size();
2055            PyObject *elt=PyList_New(sz);
2056            for(std::size_t i=0;i<sz;i++)
2057              {
2058                PyObject *elt1=PyTuple_New(2);
2059                PyObject *elt2=PyTuple_New(2);
2060                PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2061                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2062                PyObject *elt3=PyTuple_New(2);
2063                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2064                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2065                PyTuple_SetItem(elt1,0,elt2);
2066                PyTuple_SetItem(elt1,1,elt3);
2067                PyList_SetItem(elt,i,elt1);
2068              }
2069            PyTuple_SetItem(ret,1,elt);
2070            return ret;
2071          }
2072        }
2073   };
2074
2075   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2076   {
2077   public:
2078     static MEDFileIntField1TS *New();
2079     static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2080     static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2081     static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2082     ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2083     //
2084     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2085     void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2086     %extend
2087     {
2088       MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2089       {
2090         return MEDFileIntField1TS::New();
2091       }
2092
2093       MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2094       {
2095         return MEDFileIntField1TS::New(fileName,loadAll);
2096       }
2097
2098       MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2099       {
2100         return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2101       }
2102
2103       MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2104       {
2105         return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2106       }
2107
2108       std::string __str__() const throw(INTERP_KERNEL::Exception)
2109       {
2110         return self->simpleRepr();
2111       }
2112
2113       PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2114       {
2115         DataArrayInt *ret1=0;
2116         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2117         PyObject *ret=PyTuple_New(2);
2118         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2119         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2120         return ret;
2121       }
2122
2123       PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2124       {
2125         DataArrayInt *ret1=0;
2126         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2127         PyObject *ret=PyTuple_New(2);
2128         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2129         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2130         return ret;
2131       }
2132
2133       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2134       {
2135         DataArrayInt *ret1=0;
2136         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2137         PyObject *ret=PyTuple_New(2);
2138         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2139         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2140         return ret;
2141       }
2142       
2143       PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2144       {
2145         DataArrayInt *ret1=0;
2146         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2147         PyObject *ret=PyTuple_New(2);
2148         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2149         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2150         return ret;
2151       }
2152       
2153       PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2154       {
2155         DataArrayInt *ret1=0;
2156         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2157         PyObject *ret=PyTuple_New(2);
2158         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2159         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2160         return ret;
2161       }
2162
2163       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2164       {
2165          DataArrayInt *ret1=0;
2166          DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2167          PyObject *ret=PyTuple_New(2);
2168          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2170          return ret;
2171       }
2172       
2173       DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2174       {
2175         DataArrayInt *ret=self->getUndergroundDataArray();
2176         if(ret)
2177           ret->incrRef();
2178         return ret;
2179       }
2180     }
2181   };
2182
2183   class MEDFileAnyTypeFieldMultiTSIterator
2184   {
2185   public:
2186     %extend
2187     {
2188       PyObject *next() throw(INTERP_KERNEL::Exception)
2189       {
2190         MEDFileAnyTypeField1TS *ret=self->nextt();
2191         if(ret)
2192           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2193         else
2194           {
2195             PyErr_SetString(PyExc_StopIteration,"No more data.");
2196             return 0;
2197           }
2198       }
2199     }
2200   };
2201
2202   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2203   {
2204   public:
2205     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2206     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2207     MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2208     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2209     std::string getName() const throw(INTERP_KERNEL::Exception);
2210     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2211     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2212     void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2213     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2214     void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2215     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2216     bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2217     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2218     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2219     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2220     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2221     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2222     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2223     void loadArrays() throw(INTERP_KERNEL::Exception);
2224     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2225     void unloadArrays() throw(INTERP_KERNEL::Exception);
2226     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2227     //
2228     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2229     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2230     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2231     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2232     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2233     %extend
2234     {
2235       int __len__() const throw(INTERP_KERNEL::Exception)
2236       {
2237         return self->getNumberOfTS();
2238       }
2239
2240       int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2241       {
2242         if(elt0 && PyInt_Check(elt0))
2243           {//fmts[3]
2244             int pos=PyInt_AS_LONG(elt0);
2245             return pos;
2246           }
2247         else if(elt0 && PyTuple_Check(elt0))
2248           {
2249             if(PyTuple_Size(elt0)==2)
2250               {
2251                 PyObject *o0=PyTuple_GetItem(elt0,0);
2252                 PyObject *o1=PyTuple_GetItem(elt0,1);
2253                 if(PyInt_Check(o0) && PyInt_Check(o1))
2254                   {//fmts(1,-1)
2255                     int iter=PyInt_AS_LONG(o0);
2256                     int order=PyInt_AS_LONG(o1);
2257                     return self->getPosOfTimeStep(iter,order);
2258                   }
2259                 else
2260                   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 !");
2261               }
2262             else
2263               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 !");
2264           }
2265         else if(elt0 && PyFloat_Check(elt0))
2266           {
2267             double val=PyFloat_AS_DOUBLE(elt0);
2268             return self->getPosGivenTime(val);
2269           }
2270         else
2271           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2272       }
2273       
2274       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2275       {
2276         std::vector< std::pair<int,int> > res=self->getIterations();
2277         PyObject *ret=PyList_New(res.size());
2278         int rk=0;
2279         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2280           {
2281             PyObject *elt=PyTuple_New(2);
2282             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2283             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2284             PyList_SetItem(ret,rk,elt);
2285           }
2286         return ret;
2287       }
2288       
2289       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2290       {
2291         std::vector<double> ret1;
2292         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2293         std::size_t sz=ret.size();
2294         PyObject *ret2=PyList_New(sz);
2295         for(std::size_t i=0;i<sz;i++)
2296           {
2297             PyObject *elt=PyTuple_New(3);
2298             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2299             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2300             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2301             PyList_SetItem(ret2,i,elt);
2302           }
2303         return ret2;
2304       }
2305       
2306       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2307       {
2308         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2309         PyObject *ret2=PyList_New(ret.size());
2310         for(int i=0;i<(int)ret.size();i++)
2311           {
2312             const std::vector<TypeOfField>& rett=ret[i];
2313             PyObject *ret3=PyList_New(rett.size());
2314             for(int j=0;j<(int)rett.size();j++)
2315               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2316             PyList_SetItem(ret2,i,ret3);
2317           }
2318         return ret2;
2319       }
2320       
2321       PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2322       {
2323         std::vector<int> ret1;
2324         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2325         PyObject *elt=PyTuple_New(2);
2326         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2327         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2328         return elt;
2329       }
2330       
2331       PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2332       {
2333         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2334         std::vector< std::vector<TypeOfField> > typesF;
2335         std::vector< std::vector<std::string> > pfls;
2336         std::vector< std::vector<std::string> > locs;
2337         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2338         int sz=ret.size();
2339         PyObject *ret2=PyList_New(sz);
2340         for(int i=0;i<sz;i++)
2341           {
2342             const std::vector< std::pair<int,int> >& dadsI=ret[i];
2343             const std::vector<TypeOfField>& typesFI=typesF[i];
2344             const std::vector<std::string>& pflsI=pfls[i];
2345             const std::vector<std::string>& locsI=locs[i];
2346             PyObject *elt=PyTuple_New(2);
2347             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2348             int sz2=ret[i].size();
2349             PyObject *elt2=PyList_New(sz2);
2350             for(int j=0;j<sz2;j++)
2351               {
2352                 PyObject *elt3=PyTuple_New(4);
2353                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2354                 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));
2355                 PyTuple_SetItem(elt3,1,elt4);
2356                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2357                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2358                 PyList_SetItem(elt2,j,elt3);
2359               }
2360             PyTuple_SetItem(elt,1,elt2);
2361             PyList_SetItem(ret2,i,elt);
2362           }
2363         return ret2;
2364       }
2365
2366       std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2367       {
2368         if(PyList_Check(elts))
2369           {
2370             int sz=PyList_Size(elts);
2371             std::vector<int> ret(sz);
2372             for(int i=0;i<sz;i++)
2373               {
2374                 PyObject *elt=PyList_GetItem(elts,i);
2375                 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2376               }
2377             return ret;
2378           }
2379         else
2380           {
2381             std::vector<int> ret(1);
2382             ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2383             return ret;
2384           }
2385       }
2386       
2387       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2388       {
2389         if(PySlice_Check(elts))
2390           {
2391             Py_ssize_t strt=2,stp=2,step=2;
2392             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2393             GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2394             self->eraseTimeStepIds2(strt,stp,step);
2395           }
2396         else
2397           {
2398             std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2399             if(!idsToRemove.empty())
2400               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2401           }
2402       }
2403       
2404       void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2405       {
2406         int sw;
2407         int pos1;
2408         std::vector<int> pos2;
2409         DataArrayInt *pos3=0;
2410         DataArrayIntTuple *pos4=0;
2411         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2412         switch(sw)
2413           {
2414           case 1:
2415             {
2416               self->eraseTimeStepIds(&pos1,&pos1+1);
2417               return;
2418             }
2419           case 2:
2420             {
2421               if(pos2.empty())
2422                 return;
2423               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2424               return ;
2425             }
2426           case 3:
2427             {
2428               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2429               return ;
2430             }
2431           default:
2432             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2433           }
2434       }
2435
2436       MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2437       {
2438         return self->iterator();
2439       }
2440
2441       PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2442       {
2443         if(elt0 && PyList_Check(elt0))
2444           {
2445             int sz=PyList_Size(elt0);
2446             MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2447             int *pt=da->getPointer();
2448             for(int i=0;i<sz;i++,pt++)
2449               {
2450                 PyObject *elt1=PyList_GetItem(elt0,i);
2451                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2452               }
2453             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2454           }
2455         else if(elt0 && PySlice_Check(elt0))
2456           {
2457             Py_ssize_t strt=2,stp=2,step=2;
2458             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2459             GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2460             return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2461           }
2462         else
2463           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2464       }
2465
2466       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2467       {
2468         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2469         return self->changeMeshNames(modifTab);
2470       }
2471
2472       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2473       {
2474         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2475         std::size_t sz=ret.size();
2476         PyObject *retPy=PyList_New(sz);
2477         for(std::size_t i=0;i<sz;i++)
2478           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2479         return retPy;
2480       }
2481
2482       PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2483       {
2484         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2485         std::size_t sz=ret.size();
2486         PyObject *retPy=PyList_New(sz);
2487         for(std::size_t i=0;i<sz;i++)
2488           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2489         return retPy;
2490       }
2491
2492       PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2493       {
2494         std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2495         std::size_t sz=ret.size();
2496         PyObject *retPy=PyList_New(sz);
2497         for(std::size_t i=0;i<sz;i++)
2498           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2499         return retPy;
2500       }
2501
2502       void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2503       {
2504         void *argp(0);
2505         int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2506         if(SWIG_IsOK(status))
2507           {
2508             self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2509           }
2510         else
2511           {
2512             std::vector<MEDFileAnyTypeField1TS *> tmp;
2513             convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2514             self->pushBackTimeSteps(tmp);
2515           }
2516       }
2517
2518       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2519       {
2520         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2521         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2522         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2523         std::size_t sz=ret.size();
2524         PyObject *retPy=PyList_New(sz);
2525         for(std::size_t i=0;i<sz;i++)
2526           {
2527             std::size_t sz2=ret[i].size();
2528             PyObject *ret1Py=PyList_New(sz2);
2529             for(std::size_t j=0;j<sz2;j++)
2530               {
2531                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2532                 if(elt)
2533                   elt->incrRef();
2534                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2535               }
2536             PyList_SetItem(retPy,i,ret1Py);
2537           }
2538         return retPy;
2539       }
2540       
2541       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2542       {
2543         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2544         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2545         std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2546         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2547         if(ret2.size()!=ret.size())
2548           {
2549             std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2550             throw INTERP_KERNEL::Exception(oss.str().c_str());
2551           }
2552         std::size_t sz=ret.size();
2553         PyObject *retPy=PyList_New(sz);
2554         for(std::size_t i=0;i<sz;i++)
2555           {
2556             std::size_t sz2=ret[i].size();
2557             PyObject *ret0Py=PyTuple_New(2);
2558             PyObject *ret1Py=PyList_New(sz2);
2559             for(std::size_t j=0;j<sz2;j++)
2560               {
2561                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2562                 if(elt)
2563                   elt->incrRef();
2564                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2565               }
2566             PyTuple_SetItem(ret0Py,0,ret1Py);
2567             PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2568             PyList_SetItem(retPy,i,ret0Py);
2569           }
2570         return retPy;
2571       }
2572     }
2573   };
2574
2575   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2576   {
2577   public:
2578     static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2579     static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2580     static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2581     //
2582     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2583     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2584     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2585     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2586     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2587     //
2588     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2589     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2590     ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2591     %extend
2592        {
2593          MEDFileFieldMultiTS()
2594          {
2595            return MEDFileFieldMultiTS::New();
2596          }
2597
2598          MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2599          {
2600            return MEDFileFieldMultiTS::New(fileName,loadAll);
2601          }
2602
2603          MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2604          {
2605            return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2606          }
2607
2608          static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2609          {
2610            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2611            std::size_t sz(tmp.size());
2612            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2613            for(std::size_t i=0;i<sz;i++)
2614              {
2615                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2616                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2617              }
2618            return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2619          }
2620          
2621          std::string __str__() const throw(INTERP_KERNEL::Exception)
2622          {
2623            return self->simpleRepr();
2624          }
2625
2626          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2627          {
2628            DataArrayInt *ret1=0;
2629            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2630            PyObject *ret=PyTuple_New(2);
2631            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2632            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2633            return ret;
2634          }
2635
2636          PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2637          {
2638            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2639            std::vector< std::vector<TypeOfField> > typesF;
2640            std::vector< std::vector<std::string> > pfls;
2641            std::vector< std::vector<std::string> > locs;
2642            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2643            int sz=ret.size();
2644            PyObject *ret2=PyList_New(sz);
2645            for(int i=0;i<sz;i++)
2646              {
2647                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2648                const std::vector<TypeOfField>& typesFI=typesF[i];
2649                const std::vector<std::string>& pflsI=pfls[i];
2650                const std::vector<std::string>& locsI=locs[i];
2651                PyObject *elt=PyTuple_New(2);
2652                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2653                int sz2=ret[i].size();
2654                PyObject *elt2=PyList_New(sz2);
2655                for(int j=0;j<sz2;j++)
2656                  {
2657                    PyObject *elt3=PyTuple_New(4);
2658                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2659                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2660                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2661                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2662                    PyList_SetItem(elt2,j,elt3);
2663                  }
2664                PyTuple_SetItem(elt,1,elt2);
2665                PyList_SetItem(ret2,i,elt);
2666              }
2667            return ret2;
2668          }
2669          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2670          {
2671            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2672            if(ret)
2673              ret->incrRef();
2674            return ret;
2675          }
2676          
2677          PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2678          {
2679            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2680            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2681            if(elt0)
2682              elt0->incrRef();
2683            PyObject *ret=PyTuple_New(2);
2684            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2685            std::size_t sz=elt1Cpp.size();
2686            PyObject *elt=PyList_New(sz);
2687            for(std::size_t i=0;i<sz;i++)
2688              {
2689                PyObject *elt1=PyTuple_New(2);
2690                PyObject *elt2=PyTuple_New(2);
2691                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2692                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2693                PyObject *elt3=PyTuple_New(2);
2694                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2695                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2696                PyTuple_SetItem(elt1,0,elt2);
2697                PyTuple_SetItem(elt1,1,elt3);
2698                PyList_SetItem(elt,i,elt1);
2699              }
2700            PyTuple_SetItem(ret,1,elt);
2701            return ret;
2702          }
2703        }
2704   };
2705
2706   class MEDFileFieldsIterator
2707   {
2708   public:
2709     %extend
2710     {
2711       PyObject *next() throw(INTERP_KERNEL::Exception)
2712       {
2713         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2714         if(ret)
2715           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2716         else
2717           {
2718             PyErr_SetString(PyExc_StopIteration,"No more data.");
2719             return 0;
2720           }
2721       }
2722     }
2723   };
2724
2725   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2726   {
2727   public:
2728     static MEDFileIntFieldMultiTS *New();
2729     static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2730     static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2731     //
2732     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2733     void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2734     ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2735     %extend
2736     {
2737       MEDFileIntFieldMultiTS()
2738       {
2739         return MEDFileIntFieldMultiTS::New();
2740       }
2741       
2742       MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2743       {
2744         return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2745       }
2746       
2747       MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2748       {
2749         return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2750       }
2751
2752       static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2753       {
2754         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2755         std::size_t sz(tmp.size());
2756         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2757         for(std::size_t i=0;i<sz;i++)
2758           {
2759             entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2760             entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2761           }
2762         return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2763       }
2764
2765       std::string __str__() const throw(INTERP_KERNEL::Exception)
2766       {
2767         return self->simpleRepr();
2768       }
2769
2770       PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2771       {
2772         DataArrayInt *ret1=0;
2773         MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2774         PyObject *ret=PyTuple_New(2);
2775         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2776         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2777         return ret;
2778       }
2779
2780       PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2781       {
2782         DataArrayInt *ret1=0;
2783         MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2784         PyObject *ret=PyTuple_New(2);
2785         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2786         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2787         return ret;
2788       }
2789
2790       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2791       {
2792         DataArrayInt *ret1=0;
2793         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2794         PyObject *ret=PyTuple_New(2);
2795         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2796         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2797         return ret;
2798       }
2799       
2800       PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2801       {
2802         DataArrayInt *ret1=0;
2803         MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2804         PyObject *ret=PyTuple_New(2);
2805         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2806         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2807         return ret;
2808       }
2809       
2810       PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2811       {
2812         DataArrayInt *ret1=0;
2813         MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2814         PyObject *ret=PyTuple_New(2);
2815         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2816         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2817         return ret;
2818       }
2819
2820       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2821       {
2822          DataArrayInt *ret1=0;
2823          DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2824          PyObject *ret=PyTuple_New(2);
2825          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2826          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827          return ret;
2828       }
2829
2830       DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2831       {
2832         DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2833         if(ret)
2834           ret->incrRef();
2835         return ret;
2836       }
2837     }
2838   };
2839
2840   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2841   {
2842   public:
2843     static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2844     static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2845     static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2846     MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2847     MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2848     void loadArrays() throw(INTERP_KERNEL::Exception);
2849     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2850     void unloadArrays() throw(INTERP_KERNEL::Exception);
2851     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2852     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2853     int getNumberOfFields() const;
2854     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2855     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2856     //
2857     void resize(int newSize) throw(INTERP_KERNEL::Exception);
2858     void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2859     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2860     int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2861     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2862     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2863     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2864     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2865     bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2866     %extend
2867        {
2868          MEDFileFields()
2869          {
2870            return MEDFileFields::New();
2871          }
2872
2873          MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2874          {
2875            return MEDFileFields::New(fileName,loadAll);
2876          }
2877          
2878          std::string __str__() const throw(INTERP_KERNEL::Exception)
2879          {
2880            return self->simpleRepr();
2881          }
2882
2883          static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2884          {
2885            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2886            std::size_t sz(tmp.size());
2887            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2888            for(std::size_t i=0;i<sz;i++)
2889              {
2890                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2891                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2892              }
2893            return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2894          }
2895
2896          PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2897          {
2898            bool ret1;
2899            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2900            PyObject *ret=PyTuple_New(2);
2901            PyObject *ret_0=PyList_New(ret0.size());
2902            int rk=0;
2903            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2904              {
2905                PyObject *elt=PyTuple_New(2);
2906                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2907                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2908                PyList_SetItem(ret_0,rk,elt);
2909              }
2910            PyTuple_SetItem(ret,0,ret_0);
2911            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2912            PyTuple_SetItem(ret,1,ret_1);
2913            return ret;
2914          }
2915
2916          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2917          {
2918            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2919            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2920          }
2921
2922          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2923          {
2924            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2925            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2926          }
2927          
2928          PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2929          {
2930            if(obj && PyList_Check(obj))
2931              {
2932                int sz=PyList_Size(obj);
2933                MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2934                int *pt=da->getPointer();
2935                for(int i=0;i<sz;i++,pt++)
2936                  {
2937                    PyObject *elt1=PyList_GetItem(obj,i);
2938                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2939                  }
2940                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2941              }
2942            else
2943              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2944          }
2945
2946          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2947          {
2948            self->setFieldAtPos(obj,field);
2949            return self;
2950          }
2951
2952          int __len__() const throw(INTERP_KERNEL::Exception)
2953          {
2954            return self->getNumberOfFields();
2955          }
2956
2957          MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2958          {
2959            return self->iterator();
2960          }
2961          
2962          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2963          {
2964            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2965            return self->changeMeshNames(modifTab);
2966          }
2967
2968          int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2969          {
2970            if(elt0 && PyInt_Check(elt0))
2971              {//fmts[3]
2972                return PyInt_AS_LONG(elt0);
2973              }
2974            else if(elt0 && PyString_Check(elt0))
2975              return self->getPosFromFieldName(PyString_AsString(elt0));
2976            else
2977              throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2978          }
2979          
2980          std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2981          {
2982            if(PyList_Check(elts))
2983              {
2984                int sz=PyList_Size(elts);
2985                std::vector<int> ret(sz);
2986                for(int i=0;i<sz;i++)
2987                  {
2988                    PyObject *elt=PyList_GetItem(elts,i);
2989                    ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2990                  }
2991                return ret;
2992              }
2993            else
2994              {
2995                std::vector<int> ret(1);
2996                ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2997                return ret;
2998              }
2999          }
3000
3001          void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3002          {
3003            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3004            convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3005            self->pushFields(tmp);
3006          }
3007          
3008          void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3009          {
3010            if(elts && PySlice_Check(elts))
3011              {
3012                Py_ssize_t strt=2,stp=2,step=2;
3013                PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3014                GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3015                self->destroyFieldsAtPos2(strt,stp,step);
3016              }
3017            else
3018              {
3019                std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
3020                if(!idsToRemove.empty())
3021                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3022              }
3023          }
3024        }
3025   };
3026
3027   class MEDFileParameter1TS : public RefCountObject
3028   {
3029   public:
3030     void setIteration(int it);
3031     int getIteration() const;
3032     void setOrder(int order);
3033     int getOrder() const;
3034     void setTimeValue(double time);
3035     void setTime(int dt, int it, double time);
3036     double getTime(int& dt, int& it);
3037     double getTimeValue() const;
3038   };
3039
3040   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3041   {
3042   public:
3043     void setValue(double val) throw(INTERP_KERNEL::Exception);
3044     double getValue() const throw(INTERP_KERNEL::Exception);
3045     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3046     %extend
3047     {
3048       std::string __str__() const throw(INTERP_KERNEL::Exception)
3049       {
3050         return self->simpleRepr();
3051       }
3052     }
3053   };
3054
3055   class MEDFileParameterTinyInfo : public MEDFileWritable
3056   {
3057   public:
3058     void setDescription(const std::string& name);
3059     std::string getDescription() const;
3060     void setTimeUnit(const std::string& unit);
3061     std::string getTimeUnit() const;
3062   };
3063
3064   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3065   {
3066   public:
3067     static MEDFileParameterDouble1TS *New();
3068     static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3069     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3070     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3071     virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3072     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3073     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3074     std::string getName() const throw(INTERP_KERNEL::Exception);
3075     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3076     %extend
3077     {
3078       MEDFileParameterDouble1TS()
3079       {
3080         return MEDFileParameterDouble1TS::New();
3081       }
3082       
3083       MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3084       {
3085         return MEDFileParameterDouble1TS::New(fileName);
3086       }
3087
3088       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3089       {
3090         return MEDFileParameterDouble1TS::New(fileName,paramName);
3091       }
3092
3093       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3094       {
3095         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3096       }
3097
3098       std::string __str__() const throw(INTERP_KERNEL::Exception)
3099       {
3100         return self->simpleRepr();
3101       }
3102
3103       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3104       {
3105         std::string what;
3106         bool ret0=self->isEqual(other,eps,what);
3107         PyObject *res=PyList_New(2);
3108         PyObject *ret0Py=ret0?Py_True:Py_False;
3109         Py_XINCREF(ret0Py);
3110         PyList_SetItem(res,0,ret0Py);
3111         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3112         return res;
3113       }
3114     }
3115   };
3116
3117   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3118   {
3119   public:
3120     static MEDFileParameterMultiTS *New();
3121     static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3122     static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3123     std::string getName() const;
3124     void setName(const std::string& name);
3125     MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3126     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3127     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3128     void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3129     double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3130     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3131     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3132     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3133     %extend
3134     {
3135       MEDFileParameterMultiTS()
3136       {
3137         return MEDFileParameterMultiTS::New();
3138       }
3139       
3140       MEDFileParameterMultiTS(const std::string& fileName)
3141       {
3142         return MEDFileParameterMultiTS::New(fileName);
3143       }
3144
3145       MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3146       {
3147         return MEDFileParameterMultiTS::New(fileName,paramName);
3148       }
3149
3150       std::string __str__() const throw(INTERP_KERNEL::Exception)
3151       {
3152         return self->simpleRepr();
3153       }
3154       
3155       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3156       {
3157         std::string what;
3158         bool ret0=self->isEqual(other,eps,what);
3159         PyObject *res=PyList_New(2);
3160         PyObject *ret0Py=ret0?Py_True:Py_False;
3161         Py_XINCREF(ret0Py);
3162         PyList_SetItem(res,0,ret0Py);
3163         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3164         return res;
3165       }
3166       
3167       void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3168       {
3169         int sw;
3170         int pos1;
3171         std::vector<int> pos2;
3172         DataArrayInt *pos3=0;
3173         DataArrayIntTuple *pos4=0;
3174         convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3175         switch(sw)
3176           {
3177           case 1:
3178             {
3179               self->eraseTimeStepIds(&pos1,&pos1+1);
3180               return;
3181             }
3182           case 2:
3183             {
3184               if(pos2.empty())
3185                 return;
3186               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3187               return ;
3188             }
3189           case 3:
3190             {
3191               self->eraseTimeStepIds(pos3->begin(),pos3->end());
3192               return ;
3193             }
3194           default:
3195             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3196           }
3197       }
3198
3199       int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3200       {
3201         if(elt0 && PyInt_Check(elt0))
3202           {//fmts[3]
3203             int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3204             return pos;
3205           }
3206         else if(elt0 && PyTuple_Check(elt0))
3207           {
3208             if(PyTuple_Size(elt0)==2)
3209               {
3210                 PyObject *o0=PyTuple_GetItem(elt0,0);
3211                 PyObject *o1=PyTuple_GetItem(elt0,1);
3212                 if(PyInt_Check(o0) && PyInt_Check(o1))
3213                   {//fmts(1,-1)
3214                     int iter=PyInt_AS_LONG(o0);
3215                     int order=PyInt_AS_LONG(o1);
3216                     return self->getPosOfTimeStep(iter,order);
3217                   }
3218                 else
3219                   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 !");
3220               }
3221             else
3222               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 !");
3223           }
3224         else if(elt0 && PyFloat_Check(elt0))
3225           {
3226             double val=PyFloat_AS_DOUBLE(elt0);
3227             return self->getPosGivenTime(val);
3228           }
3229         else
3230           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3231       }
3232
3233       MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3234       {
3235         MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3236         if(ret)
3237           ret->incrRef();
3238         return ret;
3239       }
3240
3241       std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3242       {
3243         if(PyList_Check(elts))
3244           {
3245             int sz=PyList_Size(elts);
3246             std::vector<int> ret(sz);
3247             for(int i=0;i<sz;i++)
3248               {
3249                 PyObject *elt=PyList_GetItem(elts,i);
3250                 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3251               }
3252             return ret;
3253           }
3254         else
3255           {
3256             std::vector<int> ret(1);
3257             ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3258             return ret;
3259           }
3260       }
3261
3262       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3263       {
3264         std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3265         if(!idsToRemove.empty())
3266           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3267       }
3268       
3269       MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3270       {
3271         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3272         if(ret)
3273           ret->incrRef();
3274         return ret;
3275       }
3276
3277       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3278       {
3279         std::vector< std::pair<int,int> > res=self->getIterations();
3280         PyObject *ret=PyList_New(res.size());
3281         int rk=0;
3282         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3283           {
3284             PyObject *elt=PyTuple_New(2);
3285             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3286             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3287             PyList_SetItem(ret,rk,elt);
3288           }
3289         return ret;
3290       }
3291
3292       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3293       {
3294         std::vector<double> res2;
3295         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3296         PyObject *ret=PyList_New(res.size());
3297         int rk=0;
3298         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3299           {
3300             PyObject *elt=PyTuple_New(3);
3301             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3302             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3303             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3304             PyList_SetItem(ret,rk,elt);
3305           }
3306         return ret;
3307       }
3308     }
3309   };
3310
3311   class MEDFileParameters : public RefCountObject, public MEDFileWritable
3312   {
3313   public:
3314     static MEDFileParameters *New();
3315     static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3316     MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3317     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3318     std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3319     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3320     void resize(int newSize) throw(INTERP_KERNEL::Exception);
3321     void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3322     void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3323     void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3324     int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3325     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3326     %extend
3327     {
3328       MEDFileParameters()
3329       {
3330         return MEDFileParameters::New();
3331       }
3332       
3333       MEDFileParameters(const std::string& fileName)
3334       {
3335         return MEDFileParameters::New(fileName);
3336       }
3337
3338       std::string __str__() const throw(INTERP_KERNEL::Exception)
3339       {
3340         return self->simpleRepr();
3341       }
3342
3343       MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3344       {
3345         if(PyInt_Check(obj))
3346           {
3347             MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3348             if(ret)
3349               ret->incrRef();
3350             return ret;
3351           }
3352         else if(PyString_Check(obj))
3353           {
3354             MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3355             if(ret)
3356               ret->incrRef();
3357             return ret;
3358           }
3359         else
3360           throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3361       }
3362
3363       int __len__() const throw(INTERP_KERNEL::Exception)
3364       {
3365         return self->getNumberOfParams();
3366       }
3367       
3368       MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3369       {
3370         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3371         if(ret)
3372           ret->incrRef();
3373         return ret;
3374       }
3375
3376       MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3377       {
3378         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3379         if(ret)
3380           ret->incrRef();
3381         return ret;
3382       }
3383       
3384       PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3385       {
3386         std::string what;
3387         bool ret0=self->isEqual(other,eps,what);
3388         PyObject *res=PyList_New(2);
3389         PyObject *ret0Py=ret0?Py_True:Py_False;
3390         Py_XINCREF(ret0Py);
3391         PyList_SetItem(res,0,ret0Py);
3392         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3393         return res;
3394       }
3395     }
3396   };
3397
3398   class MEDFileData : public RefCountObject, public MEDFileWritable
3399   {
3400   public:
3401     static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3402     static MEDFileData *New();
3403     MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3404     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3405     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3406     void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3407     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3408     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3409     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3410     //
3411     bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3412     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3413     //
3414     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3415     %extend
3416        {
3417          MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3418          {
3419            return MEDFileData::New(fileName);
3420          }
3421
3422          MEDFileData()
3423          {
3424            return MEDFileData::New();
3425          }
3426
3427          std::string __str__() const throw(INTERP_KERNEL::Exception)
3428          {
3429            return self->simpleRepr();
3430          }
3431
3432          MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3433          {
3434            MEDFileMeshes *ret=self->getMeshes();
3435            if(ret)
3436              ret->incrRef();
3437            return ret;
3438          }
3439
3440          MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3441          {
3442            MEDFileParameters *ret=self->getParams();
3443            if(ret)
3444              ret->incrRef();
3445            return ret;
3446          }
3447
3448          MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3449          {
3450            MEDFileFields *ret=self->getFields();
3451            if(ret)
3452              ret->incrRef();
3453            return ret;
3454          }
3455
3456          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3457          {
3458            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3459            return self->changeMeshNames(modifTab);
3460          }
3461        }
3462   };
3463
3464   class SauvReader : public RefCountObject
3465   {
3466   public:
3467     static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3468     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3469     %extend
3470     {
3471       SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3472       {
3473         return SauvReader::New(fileName);
3474       }
3475     }
3476   };
3477
3478   class SauvWriter : public RefCountObject
3479   {
3480   public:
3481     static SauvWriter * New();
3482     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3483     void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3484     void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3485     bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3486     %extend
3487     {
3488       SauvWriter() throw(INTERP_KERNEL::Exception)
3489       {
3490         return SauvWriter::New();
3491       }
3492     }
3493   };
3494   
3495   ///////////////
3496
3497   class MEDFileMeshStruct;
3498
3499   class MEDFileField1TSStructItem
3500   {
3501   public:
3502     static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3503   };
3504
3505   class MEDFileMeshStruct : public RefCountObject
3506   {
3507   public:
3508     static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3509   protected:
3510     ~MEDFileMeshStruct();
3511   };
3512   
3513   class MEDMeshMultiLev : public RefCountObject
3514   {
3515   public:
3516     virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3517     DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3518   protected:
3519     ~MEDMeshMultiLev();
3520   public:
3521     %extend
3522     {
3523       PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3524       {
3525         DataArrayInt *famIds(0);
3526         bool isWithoutCopy(false);
3527         self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3528         PyObject *ret=PyTuple_New(2);
3529         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3530         Py_XINCREF(ret1Py);
3531         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3532         PyTuple_SetItem(ret,1,ret1Py);
3533         return ret;
3534       }
3535
3536       PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3537       {
3538         DataArrayInt *numIds(0);
3539         bool isWithoutCopy(false);
3540         self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3541         PyObject *ret=PyTuple_New(2);
3542         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3543         Py_XINCREF(ret1Py);
3544         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3545         PyTuple_SetItem(ret,1,ret1Py);
3546         return ret;
3547       }
3548       
3549       PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3550       {
3551         DataArrayInt *famIds(0);
3552         bool isWithoutCopy(false);
3553         self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3554         PyObject *ret=PyTuple_New(2);
3555         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3556         Py_XINCREF(ret1Py);
3557         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3558         PyTuple_SetItem(ret,1,ret1Py);
3559         return ret;
3560       }
3561
3562       PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3563       {
3564         DataArrayInt *numIds(0);
3565         bool isWithoutCopy(false);
3566         self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3567         PyObject *ret=PyTuple_New(2);
3568         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3569         Py_XINCREF(ret1Py);
3570         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3571         PyTuple_SetItem(ret,1,ret1Py);
3572         return ret;
3573       }
3574
3575       PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3576       {
3577         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3578         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3579         PyObject *res(PyList_New(result.size()));
3580         for(int i=0;iL!=result.end(); i++, iL++)
3581           PyList_SetItem(res,i,PyInt_FromLong(*iL));
3582         return res;
3583       }
3584     }
3585   };
3586
3587   class MEDUMeshMultiLev : public MEDMeshMultiLev
3588   {
3589   protected:
3590     ~MEDUMeshMultiLev();
3591   public:
3592     %extend
3593      {
3594        PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3595        {
3596          DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3597          bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3598          PyObject *ret0Py=ncc?Py_True:Py_False;
3599          Py_XINCREF(ret0Py);
3600          PyObject *ret=PyTuple_New(7);
3601          PyTuple_SetItem(ret,0,ret0Py);
3602          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3603          PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3604          PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3605          PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3606          PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3607          PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3608          return ret;
3609        }
3610      }
3611   };
3612
3613   class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3614   {
3615   protected:
3616     ~MEDStructuredMeshMultiLev();
3617   };
3618
3619   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3620   {
3621   protected:
3622     ~MEDCMeshMultiLev();
3623   public:
3624     %extend
3625     {
3626       PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3627       {
3628         bool isInternal;
3629         std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3630         std::size_t sz(objs.size());
3631         PyObject *ret(PyTuple_New(2));
3632         PyObject *ret0=PyList_New(sz);
3633         for(std::size_t i=0;i<sz;i++)
3634           PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3635         PyTuple_SetItem(ret,0,ret0);
3636         PyObject *ret1Py(isInternal?Py_True:Py_False);
3637         Py_XINCREF(ret1Py);
3638         PyTuple_SetItem(ret,1,ret1Py);
3639         return ret;
3640       }
3641     }
3642   };
3643
3644   class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3645   {
3646   protected:
3647     ~MEDCurveLinearMeshMultiLev();
3648   public:
3649     %extend
3650     {
3651       PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3652       {
3653         DataArrayDouble *ret0(0);
3654         std::vector<int> ret1;
3655         bool ret2;
3656         self->buildVTUArrays(ret0,ret1,ret2);
3657         std::size_t sz(ret1.size());
3658         PyObject *ret=PyTuple_New(3);
3659         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3660         PyObject *ret1Py=PyList_New(sz);
3661         for(std::size_t i=0;i<sz;i++)
3662           PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3663         PyTuple_SetItem(ret,1,ret1Py);
3664         PyObject *ret2Py(ret2?Py_True:Py_False);
3665         Py_XINCREF(ret2Py);
3666         PyTuple_SetItem(ret,2,ret2Py);
3667         return ret;
3668       }
3669     }
3670   };
3671
3672   class MEDFileFastCellSupportComparator : public RefCountObject
3673   {
3674   public:
3675     static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3676     MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3677     bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3678     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3679   protected:
3680     ~MEDFileFastCellSupportComparator();
3681   public:
3682     %extend
3683     {
3684       PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3685       {
3686         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3687         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3688         PyObject *res(PyList_New(result.size()));
3689         for(int i=0;iL!=result.end(); i++, iL++)
3690           PyList_SetItem(res,i,PyInt_FromLong(*iL));
3691         return res;
3692       }
3693     }
3694   };
3695 }