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