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