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