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