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