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