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