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