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