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