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