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