Salome HOME
39cc415f69139a8e8d54e35b76366dd05155d42f
[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 setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1112     virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1113     virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1114     virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1115     virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1116     virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1117     virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1118     virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1119     virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1120     virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1121     virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1122     int getNumberOfJoints();
1123     MEDFileJoints *getJoints();
1124     void setJoints( MEDFileJoints* joints );
1125     void initializeEquivalences();
1126     void killEquivalences();
1127     bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1128     void killStructureElements() throw(INTERP_KERNEL::Exception);
1129     %extend
1130        {
1131          std::string __str__() const throw(INTERP_KERNEL::Exception)
1132          {
1133            return self->simpleRepr();
1134          }
1135
1136          MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1137          {
1138            return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1139          }
1140
1141          PyObject *getTime() throw(INTERP_KERNEL::Exception)
1142          {
1143            int tmp1,tmp2;
1144            double tmp0=self->getTime(tmp1,tmp2);
1145            PyObject *res = PyList_New(3);
1146            PyList_SetItem(res,0,SWIG_From_int(tmp1));
1147            PyList_SetItem(res,1,SWIG_From_int(tmp2));
1148            PyList_SetItem(res,2,SWIG_From_double(tmp0));
1149            return res;
1150          }
1151
1152          virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1153          {
1154            std::string what;
1155            bool ret0=self->isEqual(other,eps,what);
1156            PyObject *res=PyList_New(2);
1157            PyObject *ret0Py=ret0?Py_True:Py_False;
1158            Py_XINCREF(ret0Py);
1159            PyList_SetItem(res,0,ret0Py);
1160            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1161            return res;
1162          }
1163
1164          void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1165          {
1166            std::vector<const DataArrayInt *> grps;
1167            convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1168            self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1169          }
1170          
1171          PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1172          {
1173            std::string what;
1174            bool ret0=self->areFamsEqual(other,what);
1175            PyObject *res=PyList_New(2);
1176            PyObject *ret0Py=ret0?Py_True:Py_False;
1177            Py_XINCREF(ret0Py);
1178            PyList_SetItem(res,0,ret0Py);
1179            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1180            return res;
1181          }
1182
1183          PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1184          {
1185            std::string what;
1186            bool ret0=self->areGrpsEqual(other,what);
1187            PyObject *res=PyList_New(2);
1188            PyObject *ret0Py=ret0?Py_True:Py_False;
1189            Py_XINCREF(ret0Py);
1190            PyList_SetItem(res,0,ret0Py);
1191            PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1192            return res;
1193          }
1194
1195          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1196          {
1197            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1198            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1199            PyObject *res=PyList_New(result.size());
1200            for(int i=0;iL!=result.end(); i++, iL++)
1201              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1202            return res;
1203          }
1204
1205          PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1206          {
1207            std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1208            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1209            PyObject *res=PyList_New(result.size());
1210            for(int i=0;iL!=result.end(); i++, iL++)
1211              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1212            return res;
1213          }
1214
1215          PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1216          {
1217            const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1218            if(tmp)
1219              tmp->incrRef();
1220            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1221          }
1222
1223          PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1224          {
1225            const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1226            if(tmp)
1227              tmp->incrRef();
1228            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1229          }
1230
1231          PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1232          {
1233            const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1234            if(tmp)
1235              tmp->incrRef();
1236            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1237          }
1238
1239          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1240          {
1241            const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1242            if(tmp)
1243              tmp->incrRef();
1244            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1245          }
1246          
1247          PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1248          {
1249            const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1250            if(tmp)
1251              tmp->incrRef();
1252            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1253          }
1254
1255          PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1256          {
1257            bool ret1;
1258            std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1259            PyObject *ret=PyTuple_New(2);
1260            PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1261            PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1262            return ret;
1263          }
1264          
1265          PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1266          {
1267            DataArrayInt *ret3=0;
1268            std::vector<int> ret1,ret2;
1269            bool ret0=self->unPolyze(ret1,ret2,ret3);
1270            PyObject *ret=PyTuple_New(4);
1271            PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1272            //
1273            PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1274            for(int j=0;j<(int)ret1.size()/3;j++)
1275              {
1276                PyObject *retLev2=PyList_New(3);
1277                PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1278                PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1279                PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1280                PyList_SetItem(retLev1_0,j,retLev2);
1281              }
1282            PyTuple_SetItem(ret,1,retLev1_0);
1283            //
1284            PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1285            for(int j=0;j<(int)ret2.size()/3;j++)
1286              {
1287                PyObject *retLev2=PyList_New(3);
1288                PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1289                PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1290                PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1291                PyList_SetItem(retLev1_1,j,retLev2);
1292              }
1293            PyTuple_SetItem(ret,2,retLev1_1);
1294            //
1295            PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1296            return ret;
1297          }
1298
1299          MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1300          {
1301            MEDFileEquivalences *ret(self->getEquivalences());
1302            if(ret) ret->incrRef();
1303            return ret;
1304          }
1305        }
1306   };
1307
1308   class MEDFileUMesh : public MEDFileMesh
1309   {
1310   public:
1311     static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1312     static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1313     static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1314     static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1315     static MEDFileUMesh *New();
1316     static const char *GetSpeStr4ExtMesh();
1317     ~MEDFileUMesh();
1318     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1319     int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1320     void checkConsistency() const throw(INTERP_KERNEL::Exception);
1321     void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1322     void clearNodeAndCellNumbers();
1323     //
1324     MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1325     MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1326     MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1327     MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1328     DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1329     MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1330     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1331     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1332     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1333     void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1334     //
1335     void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1336     void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1337     void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1338     void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1339     void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1340     void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1341     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1342     void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1343     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1344     DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1345     DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1346     MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1347     MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1348     MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1349     MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1350     %extend
1351        { 
1352          MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1353          {
1354            return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1355          }
1356
1357          MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1358          {
1359            return MEDFileUMesh::New(fileName,mrs);
1360          }
1361
1362          MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1363          {
1364            return MEDFileUMesh::New(mem);
1365          }
1366
1367          MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1368          {
1369            return MEDFileUMesh::New(db);
1370          }
1371
1372          MEDFileUMesh()
1373          {
1374            return MEDFileUMesh::New();
1375          }
1376
1377          // serialization
1378          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1379          {
1380            return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1381          }
1382
1383          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)
1384          {
1385            std::vector<int> typesCpp1;
1386            convertPyToNewIntArr3(types,typesCpp1);
1387            std::size_t sz(typesCpp1.size());
1388            std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1389            for(std::size_t ii=0;ii<sz;ii++)
1390              typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1391            return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1392          }
1393
1394          PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1395          {// put an empty dict in input to say to __new__ to call __init__...
1396            PyObject *ret(PyTuple_New(1));
1397            PyObject *ret0(PyDict_New());
1398            PyTuple_SetItem(ret,0,ret0);
1399            return ret;
1400          }
1401
1402          PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1403          {
1404            std::vector<double> a0;
1405            std::vector<int> a1;
1406            std::vector<std::string> a2;
1407            std::vector< MCAuto<DataArrayInt> > a3;
1408            MCAuto<DataArrayDouble> a4;
1409            self->serialize(a0,a1,a2,a3,a4);
1410            PyObject *ret(PyTuple_New(5));
1411            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1412            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1413            int sz(a2.size());
1414            PyObject *ret2(PyList_New(sz));
1415            for(int i=0;i<sz;i++)
1416              PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1417            PyTuple_SetItem(ret,2,ret2);
1418            sz=a3.size();
1419            PyObject *ret3(PyList_New(sz));
1420            for(int i=0;i<sz;i++)
1421              {
1422                DataArrayInt *elt(a3[i]);
1423                if(elt)
1424                  elt->incrRef();
1425                PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426              }
1427            PyTuple_SetItem(ret,3,ret3);
1428            DataArrayDouble *ret4(a4);
1429            if(ret4)
1430              ret4->incrRef();
1431            PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1432            return ret;
1433          }
1434
1435          void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1436          {
1437            static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1438            if(!PyTuple_Check(inp))
1439              throw INTERP_KERNEL::Exception(MSG);
1440            int sz(PyTuple_Size(inp));
1441            if(sz!=5)
1442              throw INTERP_KERNEL::Exception(MSG);
1443            std::vector<double> a0;
1444            std::vector<int> a1;
1445            std::vector<std::string> a2;
1446            std::vector< MCAuto<DataArrayInt> > a3;
1447            MCAuto<DataArrayDouble> a4;
1448            //
1449            PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1450            int tmp(-1);
1451            fillArrayWithPyListDbl3(a0py,tmp,a0);
1452            convertPyToNewIntArr3(a1py,a1);
1453            fillStringVector(a2py,a2);
1454            //
1455            PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1456            void *argp(0);
1457            int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1458            if(!SWIG_IsOK(status))
1459              throw INTERP_KERNEL::Exception(MSG);
1460            a4=reinterpret_cast<DataArrayDouble *>(argp);
1461            if((DataArrayDouble *)a4)
1462              a4->incrRef();
1463            {
1464              std::vector< DataArrayInt * > a3Tmp;
1465              convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1466              std::size_t sz(a3Tmp.size());
1467              a3.resize(sz);
1468              for(std::size_t i=0;i<sz;i++)
1469                {
1470                  a3[i]=a3Tmp[i];
1471                  if(a3Tmp[i])
1472                    a3Tmp[i]->incrRef();
1473                }
1474              self->unserialize(a0,a1,a2,a3,a4);
1475            }
1476          }
1477
1478          void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1479          {
1480            if(!mesh)
1481              throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1482            MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1483            if(m0)
1484              {
1485                self->setMeshAtLevel(meshDimRelToMax,m0,false);
1486                return ;
1487              }
1488            MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1489            if(m1)
1490              {
1491                self->setMeshAtLevel(meshDimRelToMax,m1);
1492                return ;
1493              }
1494            throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1495          }
1496
1497          void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1498          {
1499            self->removeMeshAtLevel(meshDimRelToMax);
1500          }
1501
1502          MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1503          {
1504            const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1505            double val,val2;
1506            DataArrayDouble *a,*a2;
1507            DataArrayDoubleTuple *aa,*aa2;
1508            std::vector<double> bb,bb2;
1509            int sw;
1510            const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1511            const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1512            MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1513            return ret.retn();
1514          }
1515
1516          static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1517          {
1518            std::vector<const MEDFileUMesh *> meshesCpp;
1519            convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1520            MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1521            return ret.retn();
1522          }
1523
1524          PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1525          {
1526            std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1527            return convertVecPairIntToPy(ret);
1528          }
1529          
1530          DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1531          {
1532            std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1533            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1534            return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1535          }
1536
1537          MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1538          {
1539            std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1540            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1541            return self->extractPart(extractDefCpp);
1542          }
1543
1544          void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1545          {
1546            std::vector<const MEDCouplingUMesh *> ms;
1547            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1548            self->setMeshes(ms,renum);
1549          }
1550
1551          void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1552          {
1553            std::vector<const MEDCouplingUMesh *> ms;
1554            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1555            self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1556          }
1557          
1558          void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1559          {
1560            std::vector<const MEDCouplingUMesh *> ms;
1561            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1562            self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1563          }
1564
1565          DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1566          {
1567            DataArrayDouble *ret=self->getCoords();
1568            if(ret)
1569              ret->incrRef();
1570            return ret;
1571          }
1572
1573          PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1574          {
1575            const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1576            if(ret)
1577              ret->incrRef();
1578            return const_cast<PartDefinition *>(ret);
1579          }
1580
1581          PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1582          {
1583            DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1584            self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1585            PyObject *ret=PyTuple_New(3);
1586            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1587            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1588            PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1589            return ret;
1590          }
1591          
1592          MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1593          {
1594            MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1595            if(ret)
1596              ret->incrRef();
1597            return ret;
1598          }
1599
1600          PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1601          {
1602            std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1603            std::size_t sz(tmp.size());
1604            PyObject *ret=PyList_New(sz);
1605            for(std::size_t i=0;i<sz;i++)
1606              {
1607                if(tmp[i])
1608                  tmp[i]->incrRef();
1609                PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1610              }
1611            return ret;
1612          }
1613        }
1614   };
1615
1616   class MEDFileStructuredMesh : public MEDFileMesh
1617   {
1618   public:
1619     %extend
1620     {
1621       MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1622       {
1623         MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1624         if(ret)
1625           ret->incrRef();
1626         return ret;
1627       }
1628     }
1629   };
1630
1631   class MEDFileCMesh : public MEDFileStructuredMesh
1632   {
1633   public:
1634     static MEDFileCMesh *New();
1635     static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1636     static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1637     static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1638     void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1639     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1640     %extend
1641        {
1642          MEDFileCMesh()
1643          {
1644            return MEDFileCMesh::New();
1645          }
1646
1647          MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1648          {
1649            return MEDFileCMesh::New(fileName,mrs);
1650          }
1651
1652          MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1653          {
1654            return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1655          }
1656
1657          MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1658          {
1659            return MEDFileCMesh::New(db);
1660          }
1661
1662          // serialization
1663          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1664          {
1665            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1666          }
1667          
1668          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1669          {
1670            const MEDCouplingCMesh *tmp=self->getMesh();
1671            if(tmp)
1672              tmp->incrRef();
1673            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1674          }
1675        }
1676   };
1677
1678   class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1679   {
1680   public:
1681     static MEDFileCurveLinearMesh *New();
1682     static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1683     static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1684     static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1685     void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1686     %extend
1687        {
1688          MEDFileCurveLinearMesh()
1689          {
1690            return MEDFileCurveLinearMesh::New();
1691          }
1692
1693          MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1694          {
1695            return MEDFileCurveLinearMesh::New(fileName,mrs);
1696          }
1697
1698          MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1699          {
1700            return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1701          }
1702
1703          MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1704          {
1705            return MEDFileCurveLinearMesh::New(db);
1706          }
1707
1708          // serialization
1709          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1710          {
1711            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1712          }
1713          
1714          PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1715          {
1716            const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1717            if(tmp)
1718              tmp->incrRef();
1719            return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1720          }
1721        }
1722   };
1723
1724   class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1725   {
1726   public:
1727     static MEDFileMeshMultiTS *New();
1728     static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1729     static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1730     MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1731     std::string getName() const throw(INTERP_KERNEL::Exception);
1732     void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1733     void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1734     %extend
1735        { 
1736          MEDFileMeshMultiTS()
1737          {
1738            return MEDFileMeshMultiTS::New();
1739          }
1740
1741          MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1742          {
1743            return MEDFileMeshMultiTS::New(fileName);
1744          }
1745
1746          MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1747          {
1748            return MEDFileMeshMultiTS::New(fileName,mName);
1749          }
1750
1751          MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1752            {
1753              MEDFileMesh *ret=self->getOneTimeStep();
1754              if(ret)
1755                ret->incrRef();
1756              return ret;
1757            }
1758        }
1759   };
1760
1761   class MEDFileMeshesIterator
1762   {
1763   public:
1764     %extend
1765     {
1766       PyObject *next() throw(INTERP_KERNEL::Exception)
1767       {
1768         MEDFileMesh *ret=self->nextt();
1769         if(ret)
1770           {
1771             ret->incrRef();
1772             return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1773           }
1774         else
1775           {
1776             PyErr_SetString(PyExc_StopIteration,"No more data.");
1777             return 0;
1778           }
1779       }
1780     }
1781   };
1782
1783   class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1784   {
1785   public:
1786     static MEDFileMeshes *New();
1787     static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1788     MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1789     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1790     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1791     //
1792     void resize(int newSize) throw(INTERP_KERNEL::Exception);
1793     void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1794     void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1795     void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1796     void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1797     bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1798     void killStructureElements() throw(INTERP_KERNEL::Exception);
1799     %extend
1800        {
1801          MEDFileMeshes()
1802          {
1803            return MEDFileMeshes::New();
1804          }
1805
1806          MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1807          {
1808            return MEDFileMeshes::New(fileName);
1809          }
1810
1811          MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1812          {
1813            return MEDFileMeshes::New(db);
1814          }
1815
1816          // serialization
1817          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1818          {
1819            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1820          }
1821
1822          std::string __str__() const throw(INTERP_KERNEL::Exception)
1823            {
1824              return self->simpleRepr();
1825            }
1826
1827          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1828          {
1829            if(PyInt_Check(obj))
1830              {
1831                MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1832                if(ret)
1833                  ret->incrRef();
1834                return ret;
1835              }
1836            else if(PyString_Check(obj))
1837              {
1838                MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1839                if(ret)
1840                  ret->incrRef();
1841                return ret;
1842              }
1843            else
1844              throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1845          }
1846
1847          MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1848          {
1849            self->setMeshAtPos(obj,mesh);
1850            return self;
1851          }
1852
1853          MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1854          {
1855            return self->iterator();
1856          }
1857
1858          int __len__() const throw(INTERP_KERNEL::Exception)
1859          {
1860            return self->getNumberOfMeshes();
1861          }
1862          
1863          MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1864            {
1865              MEDFileMesh *ret=self->getMeshAtPos(i);
1866              if(ret)
1867                ret->incrRef();
1868              return ret;
1869            }
1870          MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1871            {
1872              MEDFileMesh *ret=self->getMeshWithName(mname);
1873              if(ret)
1874                ret->incrRef();
1875              return ret;
1876            }
1877        }
1878   };
1879
1880   class MEDFileFieldLoc : public RefCountObject
1881   {
1882   public:
1883     std::string getName() const;
1884     int getDimension() const;
1885     int getNumberOfGaussPoints() const;
1886     int getNumberOfPointsInCells() const;
1887     const std::vector<double>& getRefCoords() const;
1888     const std::vector<double>& getGaussCoords() const;
1889     const std::vector<double>& getGaussWeights() const;
1890     bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1891   %extend
1892     {
1893       std::string __str__() const throw(INTERP_KERNEL::Exception)
1894       {
1895         return self->repr();
1896       }
1897     }
1898   };
1899
1900   class MEDFileFieldGlobsReal
1901   {
1902   public:
1903     void resetContent();
1904     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1905     void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1906     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1907     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1908     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1909     void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1910     void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1911     void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1912     std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1913     std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1914     bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1915     bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1916     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1917     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1918     std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1919     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1920     virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1921     virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1922     virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1923     virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1924     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1925     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1926     void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1927     void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1928     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1929     int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1930     void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1931   %extend
1932      {
1933        PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1934        {
1935          const DataArrayInt *ret=self->getProfile(pflName);
1936          if(ret)
1937            ret->incrRef();
1938          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1939        }
1940
1941        PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1942        {
1943          const DataArrayInt *ret=self->getProfileFromId(pflId);
1944          if(ret)
1945            ret->incrRef();
1946          return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1947        }
1948
1949        PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1950        {
1951          const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1952          if(loc)
1953            loc->incrRef();
1954          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1955        }
1956        
1957        PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1958        {
1959          const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1960          if(loc)
1961            loc->incrRef();
1962          return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1963        }
1964        
1965        PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1966        {
1967          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1968          return convertVecPairVecStToPy(ret);
1969        }
1970
1971        PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1972        {
1973          std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1974          return convertVecPairVecStToPy(ret);
1975        }
1976
1977        void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1978        {
1979          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1980          self->changePflsNames(v);
1981        }
1982
1983        void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1984        {
1985          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1986          self->changePflsRefsNamesGen(v);
1987        }
1988
1989        void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1990        {
1991          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1992          self->changePflsNamesInStruct(v);
1993        }
1994
1995        void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1996        {
1997          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1998          self->changeLocsNames(v);
1999        }
2000
2001        void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2002        {
2003          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2004          self->changeLocsRefsNamesGen(v);
2005        }
2006        
2007        void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2008        {
2009          std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2010          self->changeLocsNamesInStruct(v);
2011        }
2012
2013        std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2014        {
2015          std::ostringstream oss;
2016          self->simpleReprGlobs(oss);
2017          return oss.str();
2018        }
2019      }
2020   };
2021
2022   class MEDFileEntities
2023   {
2024   public:
2025     %extend
2026       {
2027         static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2028         {
2029           std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2030           std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2031           {
2032             std::size_t sz(inp0.size());
2033             inp.resize(sz);
2034             for(std::size_t i=0;i<sz;i++)
2035               inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2036           }
2037           return MEDFileEntities::BuildFrom(&inp);
2038         }
2039       }
2040   private:
2041     MEDFileEntities();
2042   };
2043
2044   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2045   {
2046   public:
2047     static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2048     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2049     static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2050     static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2051     void loadArrays() throw(INTERP_KERNEL::Exception);
2052     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2053     void unloadArrays() throw(INTERP_KERNEL::Exception);
2054     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2055     int getDimension() const throw(INTERP_KERNEL::Exception);
2056     int getIteration() const throw(INTERP_KERNEL::Exception);
2057     int getOrder() const throw(INTERP_KERNEL::Exception);
2058     std::string getName() throw(INTERP_KERNEL::Exception);
2059     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2060     std::string getMeshName() throw(INTERP_KERNEL::Exception);
2061     void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2062     int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2063     int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2064     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2065     bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2066     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2067     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2068     bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2069     void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2070     virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2071     MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2072     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2073     void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2074     %extend
2075     {
2076       PyObject *getTime() throw(INTERP_KERNEL::Exception)
2077       {
2078         int tmp1,tmp2;
2079         double tmp0=self->getTime(tmp1,tmp2);
2080         PyObject *res = PyList_New(3);
2081         PyList_SetItem(res,0,SWIG_From_int(tmp1));
2082         PyList_SetItem(res,1,SWIG_From_int(tmp2));
2083         PyList_SetItem(res,2,SWIG_From_double(tmp0));
2084         return res;
2085       }
2086
2087       PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2088       {
2089         std::pair<int,int> res=self->getDtIt();
2090         PyObject *elt=PyTuple_New(2);
2091         PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2092         PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2093         return elt;
2094       }
2095
2096       void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2097       {
2098         self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2099       }
2100       
2101       void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2102       {
2103         self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2104       }
2105
2106       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2107       {
2108         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2109         return self->changeMeshNames(modifTab);
2110       }
2111       
2112       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2113       {
2114         std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2115         PyObject *ret2=PyList_New(ret.size());
2116         for(int i=0;i<(int)ret.size();i++)
2117           PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2118         return ret2;
2119       }
2120
2121       PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2122       {
2123         std::vector<int> ret1;
2124         int ret0=self->getNonEmptyLevels(mname,ret1);
2125         PyObject *elt=PyTuple_New(2);
2126         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2127         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2128         return elt;
2129       }
2130
2131       PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2132       {
2133         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2134         std::vector< std::vector<TypeOfField> > typesF;
2135         std::vector< std::vector<std::string> > pfls;
2136         std::vector< std::vector<std::string> > locs;
2137         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2138         int sz=ret.size();
2139         PyObject *ret2=PyList_New(sz);
2140            for(int i=0;i<sz;i++)
2141              {
2142                const std::vector< std::pair<int,int> >& dadsI=ret[i];
2143                const std::vector<TypeOfField>& typesFI=typesF[i];
2144                const std::vector<std::string>& pflsI=pfls[i];
2145                const std::vector<std::string>& locsI=locs[i];
2146                PyObject *elt=PyTuple_New(2);
2147                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2148                int sz2=ret[i].size();
2149                PyObject *elt2=PyList_New(sz2);
2150                for(int j=0;j<sz2;j++)
2151                  {
2152                    PyObject *elt3=PyTuple_New(4);
2153                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2154                    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));
2155                    PyTuple_SetItem(elt3,1,elt4);
2156                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2157                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2158                    PyList_SetItem(elt2,j,elt3);
2159                  }
2160                PyTuple_SetItem(elt,1,elt2);
2161                PyList_SetItem(ret2,i,elt);
2162              }
2163            return ret2;
2164       }
2165
2166       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2167       {
2168         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2169         std::size_t sz=ret.size();
2170         PyObject *retPy=PyList_New(sz);
2171         for(std::size_t i=0;i<sz;i++)
2172           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2173         return retPy;
2174       }
2175
2176       PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2177       {
2178         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2179         std::size_t sz=ret.size();
2180         PyObject *retPy=PyList_New(sz);
2181         for(std::size_t i=0;i<sz;i++)
2182           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2183         return retPy;
2184       }
2185
2186       PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2187       {
2188         std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2189         std::size_t sz=ret.size();
2190         PyObject *retPy=PyList_New(sz);
2191         for(std::size_t i=0;i<sz;i++)
2192           PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2193         return retPy;
2194       }
2195
2196       MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2197       {
2198         std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2199         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2200         return self->extractPart(extractDefCpp,mm);
2201       }
2202     }
2203   };
2204
2205   class MEDFileField1TS : public MEDFileAnyTypeField1TS
2206   {
2207   public:
2208     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2209     static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2210     static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2211     static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2212     static MEDFileField1TS *New();
2213     MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2214     MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2215     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2216     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2217     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2218     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2219     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2220     //
2221     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2222     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2223     void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2224     void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2225     %extend
2226        {
2227          MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2228          {
2229            return MEDFileField1TS::New(fileName,loadAll);
2230          }
2231          
2232          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2233          {
2234            return MEDFileField1TS::New(fileName,fieldName,loadAll);
2235          }
2236
2237          MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2238          {
2239            return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2240          }
2241
2242          MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2243          {
2244            return MEDFileField1TS::New(db);
2245          }
2246
2247          MEDFileField1TS()
2248          {
2249            return MEDFileField1TS::New();
2250          }
2251
2252          // serialization
2253          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2254          {
2255            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2256          }
2257          
2258          void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2259          {
2260            const DataArrayDouble *arr=0;
2261            if(field)
2262              arr=field->getArray();
2263            self->copyTinyInfoFrom(field,arr);
2264          }
2265          
2266          std::string __str__() const throw(INTERP_KERNEL::Exception)
2267          {
2268            return self->simpleRepr();
2269          }
2270          
2271          PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2272          {
2273            DataArrayInt *ret1=0;
2274            DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2275            PyObject *ret=PyTuple_New(2);
2276            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2277            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278            return ret;
2279          }
2280
2281          PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2282          {
2283            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2284            std::vector< std::vector<TypeOfField> > typesF;
2285            std::vector< std::vector<std::string> > pfls;
2286            std::vector< std::vector<std::string> > locs;
2287            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2288            int sz=ret.size();
2289            PyObject *ret2=PyList_New(sz);
2290            for(int i=0;i<sz;i++)
2291              {
2292                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2293                const std::vector<TypeOfField>& typesFI=typesF[i];
2294                const std::vector<std::string>& pflsI=pfls[i];
2295                const std::vector<std::string>& locsI=locs[i];
2296                PyObject *elt=PyTuple_New(2);
2297                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2298                int sz2=ret[i].size();
2299                PyObject *elt2=PyList_New(sz2);
2300                for(int j=0;j<sz2;j++)
2301                  {
2302                    PyObject *elt3=PyTuple_New(4);
2303                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2304                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2305                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2306                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2307                    PyList_SetItem(elt2,j,elt3);
2308                  }
2309                PyTuple_SetItem(elt,1,elt2);
2310                PyList_SetItem(ret2,i,elt);
2311              }
2312            return ret2;
2313          }
2314
2315          DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2316          {
2317            DataArrayDouble *ret=self->getUndergroundDataArray();
2318            if(ret)
2319              ret->incrRef();
2320            return ret;
2321          }
2322
2323          PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2324          {
2325            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2326            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2327            if(elt0)
2328              elt0->incrRef();
2329            PyObject *ret=PyTuple_New(2);
2330            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2331            std::size_t sz=elt1Cpp.size();
2332            PyObject *elt=PyList_New(sz);
2333            for(std::size_t i=0;i<sz;i++)
2334              {
2335                PyObject *elt1=PyTuple_New(2);
2336                PyObject *elt2=PyTuple_New(2);
2337                PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2338                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2339                PyObject *elt3=PyTuple_New(2);
2340                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2341                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2342                PyTuple_SetItem(elt1,0,elt2);
2343                PyTuple_SetItem(elt1,1,elt3);
2344                PyList_SetItem(elt,i,elt1);
2345              }
2346            PyTuple_SetItem(ret,1,elt);
2347            return ret;
2348          }
2349        }
2350   };
2351
2352   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2353   {
2354   public:
2355     static MEDFileIntField1TS *New();
2356     static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2357     static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2358     static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2359     static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2360     MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2361     //
2362     void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2363     void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2364     MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2365     MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2366     MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2367     MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2368     MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2369     MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2370     %extend
2371     {
2372       MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2373       {
2374         return MEDFileIntField1TS::New();
2375       }
2376
2377       MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2378       {
2379         return MEDFileIntField1TS::New(fileName,loadAll);
2380       }
2381
2382       MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2383       {
2384         return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2385       }
2386
2387       MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2388       {
2389         return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2390       }
2391
2392       MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2393       {
2394         return MEDFileIntField1TS::New(db);
2395       }
2396
2397       // serialization
2398       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2399       {
2400         return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2401       }
2402
2403       std::string __str__() const throw(INTERP_KERNEL::Exception)
2404       {
2405         return self->simpleRepr();
2406       }
2407
2408       PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2409       {
2410          DataArrayInt *ret1=0;
2411          DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2412          PyObject *ret=PyTuple_New(2);
2413          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2415          return ret;
2416       }
2417       
2418       DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2419       {
2420         DataArrayInt *ret=self->getUndergroundDataArray();
2421         if(ret)
2422           ret->incrRef();
2423         return ret;
2424       }
2425     }
2426   };
2427
2428   class MEDFileAnyTypeFieldMultiTSIterator
2429   {
2430   public:
2431     %extend
2432     {
2433       PyObject *next() throw(INTERP_KERNEL::Exception)
2434       {
2435         MEDFileAnyTypeField1TS *ret=self->nextt();
2436         if(ret)
2437           return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2438         else
2439           {
2440             PyErr_SetString(PyExc_StopIteration,"No more data.");
2441             return 0;
2442           }
2443       }
2444     }
2445   };
2446
2447   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2448   {
2449   public:
2450     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2451     static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2452     MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2453     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2454     std::string getName() const throw(INTERP_KERNEL::Exception);
2455     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2456     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2457     void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2458     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2459     void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2460     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2461     bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2462     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2463     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2464     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2465     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2466     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2467     void loadArrays() throw(INTERP_KERNEL::Exception);
2468     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2469     void unloadArrays() throw(INTERP_KERNEL::Exception);
2470     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2471     //
2472     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2473     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2474     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2475     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2476     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2477     MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2478     %extend
2479     {
2480       int __len__() const throw(INTERP_KERNEL::Exception)
2481       {
2482         return self->getNumberOfTS();
2483       }
2484
2485       int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2486       {
2487         if(elt0 && PyInt_Check(elt0))
2488           {//fmts[3]
2489             int pos=PyInt_AS_LONG(elt0);
2490             return pos;
2491           }
2492         else if(elt0 && PyTuple_Check(elt0))
2493           {
2494             if(PyTuple_Size(elt0)==2)
2495               {
2496                 PyObject *o0=PyTuple_GetItem(elt0,0);
2497                 PyObject *o1=PyTuple_GetItem(elt0,1);
2498                 if(PyInt_Check(o0) && PyInt_Check(o1))
2499                   {//fmts(1,-1)
2500                     int iter=PyInt_AS_LONG(o0);
2501                     int order=PyInt_AS_LONG(o1);
2502                     return self->getPosOfTimeStep(iter,order);
2503                   }
2504                 else
2505                   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 !");
2506               }
2507             else
2508               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 !");
2509           }
2510         else if(elt0 && PyFloat_Check(elt0))
2511           {
2512             double val=PyFloat_AS_DOUBLE(elt0);
2513             return self->getPosGivenTime(val);
2514           }
2515         else
2516           throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2517       }
2518       
2519       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2520       {
2521         std::vector< std::pair<int,int> > res(self->getIterations());
2522         return convertVecPairIntToPy(res);
2523       }
2524       
2525       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2526       {
2527         std::vector<double> ret1;
2528         std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2529         std::size_t sz=ret.size();
2530         PyObject *ret2=PyList_New(sz);
2531         for(std::size_t i=0;i<sz;i++)
2532           {
2533             PyObject *elt=PyTuple_New(3);
2534             PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2535             PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2536             PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2537             PyList_SetItem(ret2,i,elt);
2538           }
2539         return ret2;
2540       }
2541       
2542       PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2543       {
2544         std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2545         PyObject *ret2=PyList_New(ret.size());
2546         for(int i=0;i<(int)ret.size();i++)
2547           {
2548             const std::vector<TypeOfField>& rett=ret[i];
2549             PyObject *ret3=PyList_New(rett.size());
2550             for(int j=0;j<(int)rett.size();j++)
2551               PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2552             PyList_SetItem(ret2,i,ret3);
2553           }
2554         return ret2;
2555       }
2556       
2557       PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2558       {
2559         std::vector<int> ret1;
2560         int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2561         PyObject *elt=PyTuple_New(2);
2562         PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2563         PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2564         return elt;
2565       }
2566       
2567       PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2568       {
2569         std::vector<INTERP_KERNEL::NormalizedCellType> types;
2570         std::vector< std::vector<TypeOfField> > typesF;
2571         std::vector< std::vector<std::string> > pfls;
2572         std::vector< std::vector<std::string> > locs;
2573         std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2574         int sz=ret.size();
2575         PyObject *ret2=PyList_New(sz);
2576         for(int i=0;i<sz;i++)
2577           {
2578             const std::vector< std::pair<int,int> >& dadsI=ret[i];
2579             const std::vector<TypeOfField>& typesFI=typesF[i];
2580             const std::vector<std::string>& pflsI=pfls[i];
2581             const std::vector<std::string>& locsI=locs[i];
2582             PyObject *elt=PyTuple_New(2);
2583             PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2584             int sz2=ret[i].size();
2585             PyObject *elt2=PyList_New(sz2);
2586             for(int j=0;j<sz2;j++)
2587               {
2588                 PyObject *elt3=PyTuple_New(4);
2589                 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2590                 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));
2591                 PyTuple_SetItem(elt3,1,elt4);
2592                 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2593                 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2594                 PyList_SetItem(elt2,j,elt3);
2595               }
2596             PyTuple_SetItem(elt,1,elt2);
2597             PyList_SetItem(ret2,i,elt);
2598           }
2599         return ret2;
2600       }
2601
2602       std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2603       {
2604         if(PyList_Check(elts))
2605           {
2606             int sz=PyList_Size(elts);
2607             std::vector<int> ret(sz);
2608             for(int i=0;i<sz;i++)
2609               {
2610                 PyObject *elt=PyList_GetItem(elts,i);
2611                 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2612               }
2613             return ret;
2614           }
2615         else
2616           {
2617             std::vector<int> ret(1);
2618             ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2619             return ret;
2620           }
2621       }
2622       
2623       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2624       {
2625         if(PySlice_Check(elts))
2626           {
2627             Py_ssize_t strt=2,stp=2,step=2;
2628             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2629             GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2630             self->eraseTimeStepIds2(strt,stp,step);
2631           }
2632         else
2633           {
2634             std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2635             if(!idsToRemove.empty())
2636               self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2637           }
2638       }
2639       
2640       void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2641       {
2642         int sw;
2643         int pos1;
2644         std::vector<int> pos2;
2645         DataArrayInt *pos3=0;
2646         DataArrayIntTuple *pos4=0;
2647         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2648         switch(sw)
2649           {
2650           case 1:
2651             {
2652               self->eraseTimeStepIds(&pos1,&pos1+1);
2653               return;
2654             }
2655           case 2:
2656             {
2657               if(pos2.empty())
2658                 return;
2659               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2660               return ;
2661             }
2662           case 3:
2663             {
2664               self->eraseTimeStepIds(pos3->begin(),pos3->end());
2665               return ;
2666             }
2667           default:
2668             throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2669           }
2670       }
2671
2672       MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2673       {
2674         return self->iterator();
2675       }
2676
2677       PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2678       {
2679         if(elt0 && PyList_Check(elt0))
2680           {
2681             int sz=PyList_Size(elt0);
2682             MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2683             int *pt=da->getPointer();
2684             for(int i=0;i<sz;i++,pt++)
2685               {
2686                 PyObject *elt1=PyList_GetItem(elt0,i);
2687                 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2688               }
2689             return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2690           }
2691         else if(elt0 && PySlice_Check(elt0))
2692           {
2693             Py_ssize_t strt=2,stp=2,step=2;
2694             PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2695             GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2696             return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2697           }
2698         else
2699           return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2700       }
2701
2702       bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2703       {
2704         std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2705         return self->changeMeshNames(modifTab);
2706       }
2707
2708       PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2709       {
2710         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2711         std::size_t sz=ret.size();
2712         PyObject *retPy=PyList_New(sz);
2713         for(std::size_t i=0;i<sz;i++)
2714           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2715         return retPy;
2716       }
2717
2718       PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2719       {
2720         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2721         std::size_t sz=ret.size();
2722         PyObject *retPy=PyList_New(sz);
2723         for(std::size_t i=0;i<sz;i++)
2724           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2725         return retPy;
2726       }
2727
2728       PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2729       {
2730         std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2731         std::size_t sz=ret.size();
2732         PyObject *retPy=PyList_New(sz);
2733         for(std::size_t i=0;i<sz;i++)
2734           PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2735         return retPy;
2736       }
2737
2738       void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2739       {
2740         void *argp(0);
2741         int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2742         if(SWIG_IsOK(status))
2743           {
2744             self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2745           }
2746         else
2747           {
2748             std::vector<MEDFileAnyTypeField1TS *> tmp;
2749             convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2750             self->pushBackTimeSteps(tmp);
2751           }
2752       }
2753
2754       MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2755       {
2756         std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2757         convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2758         return self->extractPart(extractDefCpp,mm);
2759       }
2760
2761       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2762       {
2763         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2764         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2765         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2766         std::size_t sz=ret.size();
2767         PyObject *retPy=PyList_New(sz);
2768         for(std::size_t i=0;i<sz;i++)
2769           {
2770             std::size_t sz2=ret[i].size();
2771             PyObject *ret1Py=PyList_New(sz2);
2772             for(std::size_t j=0;j<sz2;j++)
2773               {
2774                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2775                 if(elt)
2776                   elt->incrRef();
2777                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2778               }
2779             PyList_SetItem(retPy,i,ret1Py);
2780           }
2781         return retPy;
2782       }
2783       
2784       static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2785       {
2786         std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2787         convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2788         std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2789         std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2790         if(ret2.size()!=ret.size())
2791           {
2792             std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2793             throw INTERP_KERNEL::Exception(oss.str().c_str());
2794           }
2795         std::size_t sz=ret.size();
2796         PyObject *retPy=PyList_New(sz);
2797         for(std::size_t i=0;i<sz;i++)
2798           {
2799             std::size_t sz2=ret[i].size();
2800             PyObject *ret0Py=PyTuple_New(2);
2801             PyObject *ret1Py=PyList_New(sz2);
2802             for(std::size_t j=0;j<sz2;j++)
2803               {
2804                 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2805                 if(elt)
2806                   elt->incrRef();
2807                 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2808               }
2809             PyTuple_SetItem(ret0Py,0,ret1Py);
2810             PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2811             PyList_SetItem(retPy,i,ret0Py);
2812           }
2813         return retPy;
2814       }
2815     }
2816   };
2817
2818   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2819   {
2820   public:
2821     static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2822     static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2823     static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2824     static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2825     //
2826     MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2827     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2828     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2829     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2830     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2831     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2832     //
2833     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2834     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2835     MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2836     %extend
2837        {
2838          MEDFileFieldMultiTS()
2839          {
2840            return MEDFileFieldMultiTS::New();
2841          }
2842
2843          MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2844          {
2845            return MEDFileFieldMultiTS::New(fileName,loadAll);
2846          }
2847
2848          MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2849          {
2850            return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2851          }
2852          
2853          MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2854          {
2855            return MEDFileFieldMultiTS::New(db);
2856          }
2857          
2858          // serialization
2859          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2860          {
2861            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2862          }
2863
2864          static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2865          {
2866            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2867            std::size_t sz(tmp.size());
2868            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2869            for(std::size_t i=0;i<sz;i++)
2870              {
2871                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2872                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2873              }
2874            return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2875          }
2876          
2877          std::string __str__() const throw(INTERP_KERNEL::Exception)
2878          {
2879            return self->simpleRepr();
2880          }
2881
2882          PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2883          {
2884            DataArrayInt *ret1=0;
2885            DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2886            PyObject *ret=PyTuple_New(2);
2887            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2888            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2889            return ret;
2890          }
2891
2892          PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2893          {
2894            std::vector<INTERP_KERNEL::NormalizedCellType> types;
2895            std::vector< std::vector<TypeOfField> > typesF;
2896            std::vector< std::vector<std::string> > pfls;
2897            std::vector< std::vector<std::string> > locs;
2898            std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2899            int sz=ret.size();
2900            PyObject *ret2=PyList_New(sz);
2901            for(int i=0;i<sz;i++)
2902              {
2903                const std::vector<DataArrayDouble *>& dadsI=ret[i];
2904                const std::vector<TypeOfField>& typesFI=typesF[i];
2905                const std::vector<std::string>& pflsI=pfls[i];
2906                const std::vector<std::string>& locsI=locs[i];
2907                PyObject *elt=PyTuple_New(2);
2908                PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2909                int sz2=ret[i].size();
2910                PyObject *elt2=PyList_New(sz2);
2911                for(int j=0;j<sz2;j++)
2912                  {
2913                    PyObject *elt3=PyTuple_New(4);
2914                    PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2915                    PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2916                    PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2917                    PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2918                    PyList_SetItem(elt2,j,elt3);
2919                  }
2920                PyTuple_SetItem(elt,1,elt2);
2921                PyList_SetItem(ret2,i,elt);
2922              }
2923            return ret2;
2924          }
2925          DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2926          {
2927            DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2928            if(ret)
2929              ret->incrRef();
2930            return ret;
2931          }
2932          
2933          PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2934          {
2935            std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2936            DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2937            if(elt0)
2938              elt0->incrRef();
2939            PyObject *ret=PyTuple_New(2);
2940            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2941            std::size_t sz=elt1Cpp.size();
2942            PyObject *elt=PyList_New(sz);
2943            for(std::size_t i=0;i<sz;i++)
2944              {
2945                PyObject *elt1=PyTuple_New(2);
2946                PyObject *elt2=PyTuple_New(2);
2947                PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2948                PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2949                PyObject *elt3=PyTuple_New(2);
2950                PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2951                PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2952                PyTuple_SetItem(elt1,0,elt2);
2953                PyTuple_SetItem(elt1,1,elt3);
2954                PyList_SetItem(elt,i,elt1);
2955              }
2956            PyTuple_SetItem(ret,1,elt);
2957            return ret;
2958          }
2959        }
2960   };
2961
2962   class MEDFileFieldsIterator
2963   {
2964   public:
2965     %extend
2966     {
2967       PyObject *next() throw(INTERP_KERNEL::Exception)
2968       {
2969         MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2970         if(ret)
2971           return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2972         else
2973           {
2974             PyErr_SetString(PyExc_StopIteration,"No more data.");
2975             return 0;
2976           }
2977       }
2978     }
2979   };
2980
2981   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2982   {
2983   public:
2984     static MEDFileIntFieldMultiTS *New();
2985     static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2986     static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2987     static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2988     //
2989     void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2990     void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2991     MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2992     MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2993     MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2994     MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2995     MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2996     MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2997     MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2998     %extend
2999     {
3000       MEDFileIntFieldMultiTS()
3001       {
3002         return MEDFileIntFieldMultiTS::New();
3003       }
3004       
3005       MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3006       {
3007         return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3008       }
3009       
3010       MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3011       {
3012         return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3013       }
3014
3015       MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3016       {
3017         return MEDFileIntFieldMultiTS::New(db);
3018       }
3019       
3020       // serialization
3021       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3022       {
3023         return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3024       }
3025       
3026       static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3027       {
3028         std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3029         std::size_t sz(tmp.size());
3030         std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3031         for(std::size_t i=0;i<sz;i++)
3032           {
3033             entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3034             entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3035           }
3036         return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3037       }
3038
3039       std::string __str__() const throw(INTERP_KERNEL::Exception)
3040       {
3041         return self->simpleRepr();
3042       }
3043
3044       PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3045       {
3046          DataArrayInt *ret1=0;
3047          DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3048          PyObject *ret=PyTuple_New(2);
3049          PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3050          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3051          return ret;
3052       }
3053
3054       DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3055       {
3056         DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3057         if(ret)
3058           ret->incrRef();
3059         return ret;
3060       }
3061     }
3062   };
3063   
3064   class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3065   {
3066   public:
3067     static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3068     std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3069     %extend
3070        {
3071          MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3072          {
3073            const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3074            MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3075            if(ret2)
3076              ret2->incrRef();
3077            return ret2;
3078          }
3079        }
3080   };
3081  
3082   class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3083   {
3084   public:
3085     static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3086   private:
3087     MEDFileStructureElements();
3088   };
3089
3090   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3091   {
3092   public:
3093     static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3094     static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3095     static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3096     static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3097     static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3098     static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3099     MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3100     MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3101     void loadArrays() throw(INTERP_KERNEL::Exception);
3102     void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3103     void unloadArrays() throw(INTERP_KERNEL::Exception);
3104     void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3105     int getNumberOfFields() const;
3106     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3107     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3108     //
3109     void resize(int newSize) throw(INTERP_KERNEL::Exception);
3110     void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3111     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3112     int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3113     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3114     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3115     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3116     bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3117     void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3118     void killStructureElements() throw(INTERP_KERNEL::Exception);
3119     void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3120     void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3121     void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3122     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3123     bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3124     %extend
3125        {
3126          MEDFileFields()
3127          {
3128            return MEDFileFields::New();
3129          }
3130
3131          MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3132          {
3133            return MEDFileFields::New(fileName,loadAll);
3134          }
3135
3136          MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3137          {
3138            return MEDFileFields::New(db);
3139          }
3140
3141          MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3142          {
3143            return MEDFileFields::NewAdv(fileName,loadAll,entities);
3144          }
3145          
3146          // serialization
3147          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3148          {
3149            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3150          }
3151          
3152          std::string __str__() const throw(INTERP_KERNEL::Exception)
3153          {
3154            return self->simpleRepr();
3155          }
3156          
3157          MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3158          {
3159            MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3160            return ret.retn();
3161          }
3162
3163          MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3164          {
3165            MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3166            return ret.retn();
3167          }
3168          
3169          static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3170          {
3171            std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3172            std::size_t sz(tmp.size());
3173            std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3174            for(std::size_t i=0;i<sz;i++)
3175              {
3176                entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3177                entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3178              }
3179            return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3180          }
3181
3182          PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3183          {
3184            std::vector< std::pair<std::string,std::string> > ps;
3185            self->getMeshSENames(ps);
3186            return convertVectPairStToPy(ps);
3187          }
3188
3189          PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3190          {
3191            bool ret1;
3192            std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3193            PyObject *ret=PyTuple_New(2);
3194            PyObject *ret_0=PyList_New(ret0.size());
3195            int rk=0;
3196            for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3197              {
3198                PyObject *elt=PyTuple_New(2);
3199                PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3200                PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3201                PyList_SetItem(ret_0,rk,elt);
3202              }
3203            PyTuple_SetItem(ret,0,ret_0);
3204            PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3205            PyTuple_SetItem(ret,1,ret_1);
3206            return ret;
3207          }
3208
3209          MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3210          {
3211            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3212            return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3213          }
3214
3215          MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3216          {
3217            std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3218            return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3219          }
3220          
3221          PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3222          {
3223            if(obj && PyList_Check(obj))
3224              {
3225                int sz=PyList_Size(obj);
3226                MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3227                int *pt=da->getPointer();
3228                for(int i=0;i<sz;i++,pt++)
3229                  {
3230                    PyObject *elt1=PyList_GetItem(obj,i);
3231                    *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3232                  }
3233                return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3234              }
3235            else
3236              return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3237          }
3238
3239          MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3240          {
3241            self->setFieldAtPos(obj,field);
3242            return self;
3243          }
3244
3245          int __len__() const throw(INTERP_KERNEL::Exception)
3246          {
3247            return self->getNumberOfFields();
3248          }
3249
3250          MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3251          {
3252            return self->iterator();
3253          }
3254          
3255          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3256          {
3257            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3258            return self->changeMeshNames(modifTab);
3259          }
3260
3261          int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3262          {
3263            if(elt0 && PyInt_Check(elt0))
3264              {//fmts[3]
3265                return PyInt_AS_LONG(elt0);
3266              }
3267            else if(elt0 && PyString_Check(elt0))
3268              return self->getPosFromFieldName(PyString_AsString(elt0));
3269            else
3270              throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3271          }
3272          
3273          std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3274          {
3275            if(PyList_Check(elts))
3276              {
3277                int sz=PyList_Size(elts);
3278                std::vector<int> ret(sz);
3279                for(int i=0;i<sz;i++)
3280                  {
3281                    PyObject *elt=PyList_GetItem(elts,i);
3282                    ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3283                  }
3284                return ret;
3285              }
3286            else
3287              {
3288                std::vector<int> ret(1);
3289                ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3290                return ret;
3291              }
3292          }
3293
3294          void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3295          {
3296            std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3297            convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3298            self->pushFields(tmp);
3299          }
3300          
3301          void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3302          {
3303            if(elts && PySlice_Check(elts))
3304              {
3305                Py_ssize_t strt=2,stp=2,step=2;
3306                PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3307                GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3308                self->destroyFieldsAtPos2(strt,stp,step);
3309              }
3310            else
3311              {
3312                std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3313                if(!idsToRemove.empty())
3314                  self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3315              }
3316          }
3317
3318          MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3319          {
3320            std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3321            convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3322            return self->extractPart(extractDefCpp,mm);
3323          }
3324        }
3325   };
3326
3327   class MEDFileParameter1TS : public RefCountObject
3328   {
3329   public:
3330     void setIteration(int it);
3331     int getIteration() const;
3332     void setOrder(int order);
3333     int getOrder() const;
3334     void setTimeValue(double time);
3335     void setTime(int dt, int it, double time);
3336     double getTime(int& dt, int& it);
3337     double getTimeValue() const;
3338   };
3339
3340   class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3341   {
3342   public:
3343     void setValue(double val) throw(INTERP_KERNEL::Exception);
3344     double getValue() const throw(INTERP_KERNEL::Exception);
3345     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3346     %extend
3347     {
3348       std::string __str__() const throw(INTERP_KERNEL::Exception)
3349       {
3350         return self->simpleRepr();
3351       }
3352     }
3353   };
3354
3355   class MEDFileParameterTinyInfo : public MEDFileWritable
3356   {
3357   public:
3358     void setDescription(const std::string& name);
3359     std::string getDescription() const;
3360     void setTimeUnit(const std::string& unit);
3361     std::string getTimeUnit() const;
3362   };
3363
3364   class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3365   {
3366   public:
3367     static MEDFileParameterDouble1TS *New();
3368     static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3369     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3370     static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3371     virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3372     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3373     void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3374     std::string getName() const throw(INTERP_KERNEL::Exception);
3375     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3376     %extend
3377     {
3378       MEDFileParameterDouble1TS()
3379       {
3380         return MEDFileParameterDouble1TS::New();
3381       }
3382       
3383       MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3384       {
3385         return MEDFileParameterDouble1TS::New(fileName);
3386       }
3387
3388       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3389       {
3390         return MEDFileParameterDouble1TS::New(fileName,paramName);
3391       }
3392
3393       MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3394       {
3395         return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3396       }
3397
3398       std::string __str__() const throw(INTERP_KERNEL::Exception)
3399       {
3400         return self->simpleRepr();
3401       }
3402
3403       PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3404       {
3405         std::string what;
3406         bool ret0=self->isEqual(other,eps,what);
3407         PyObject *res=PyList_New(2);
3408         PyObject *ret0Py=ret0?Py_True:Py_False;
3409         Py_XINCREF(ret0Py);
3410         PyList_SetItem(res,0,ret0Py);
3411         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3412         return res;
3413       }
3414     }
3415   };
3416
3417   class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3418   {
3419   public:
3420     static MEDFileParameterMultiTS *New();
3421     static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3422     static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3423     std::string getName() const;
3424     void setName(const std::string& name);
3425     MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3426     void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3427     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3428     void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3429     double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3430     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3431     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3432     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3433     %extend
3434     {
3435       MEDFileParameterMultiTS()
3436       {
3437         return MEDFileParameterMultiTS::New();
3438       }
3439       
3440       MEDFileParameterMultiTS(const std::string& fileName)
3441       {
3442         return MEDFileParameterMultiTS::New(fileName);
3443       }
3444
3445       MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3446       {
3447         return MEDFileParameterMultiTS::New(fileName,paramName);
3448       }
3449
3450       std::string __str__() const throw(INTERP_KERNEL::Exception)
3451       {
3452         return self->simpleRepr();
3453       }
3454       
3455       PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3456       {
3457         std::string what;
3458         bool ret0=self->isEqual(other,eps,what);
3459         PyObject *res=PyList_New(2);
3460         PyObject *ret0Py=ret0?Py_True:Py_False;
3461         Py_XINCREF(ret0Py);
3462         PyList_SetItem(res,0,ret0Py);
3463         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3464         return res;
3465       }
3466       
3467       void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3468       {
3469         int sw;
3470         int pos1;
3471         std::vector<int> pos2;
3472         DataArrayInt *pos3=0;
3473         DataArrayIntTuple *pos4=0;
3474         convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3475         switch(sw)
3476           {
3477           case 1:
3478             {
3479               self->eraseTimeStepIds(&pos1,&pos1+1);
3480               return;
3481             }
3482           case 2:
3483             {
3484               if(pos2.empty())
3485                 return;
3486               self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3487               return ;
3488             }
3489           case 3:
3490             {
3491               self->eraseTimeStepIds(pos3->begin(),pos3->end());
3492               return ;
3493             }
3494           default:
3495             throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3496           }
3497       }
3498
3499       int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3500       {
3501         if(elt0 && PyInt_Check(elt0))
3502           {//fmts[3]
3503             int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3504             return pos;
3505           }
3506         else if(elt0 && PyTuple_Check(elt0))
3507           {
3508             if(PyTuple_Size(elt0)==2)
3509               {
3510                 PyObject *o0=PyTuple_GetItem(elt0,0);
3511                 PyObject *o1=PyTuple_GetItem(elt0,1);
3512                 if(PyInt_Check(o0) && PyInt_Check(o1))
3513                   {//fmts(1,-1)
3514                     int iter=PyInt_AS_LONG(o0);
3515                     int order=PyInt_AS_LONG(o1);
3516                     return self->getPosOfTimeStep(iter,order);
3517                   }
3518                 else
3519                   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 !");
3520               }
3521             else
3522               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 !");
3523           }
3524         else if(elt0 && PyFloat_Check(elt0))
3525           {
3526             double val=PyFloat_AS_DOUBLE(elt0);
3527             return self->getPosGivenTime(val);
3528           }
3529         else
3530           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3531       }
3532
3533       MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3534       {
3535         MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3536         if(ret)
3537           ret->incrRef();
3538         return ret;
3539       }
3540
3541       std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3542       {
3543         if(PyList_Check(elts))
3544           {
3545             int sz=PyList_Size(elts);
3546             std::vector<int> ret(sz);
3547             for(int i=0;i<sz;i++)
3548               {
3549                 PyObject *elt=PyList_GetItem(elts,i);
3550                 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3551               }
3552             return ret;
3553           }
3554         else
3555           {
3556             std::vector<int> ret(1);
3557             ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3558             return ret;
3559           }
3560       }
3561
3562       void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3563       {
3564         std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3565         if(!idsToRemove.empty())
3566           self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3567       }
3568       
3569       MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3570       {
3571         MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3572         if(ret)
3573           ret->incrRef();
3574         return ret;
3575       }
3576
3577       PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3578       {
3579         std::vector< std::pair<int,int> > res=self->getIterations();
3580         PyObject *ret=PyList_New(res.size());
3581         int rk=0;
3582         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3583           {
3584             PyObject *elt=PyTuple_New(2);
3585             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3586             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3587             PyList_SetItem(ret,rk,elt);
3588           }
3589         return ret;
3590       }
3591
3592       PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3593       {
3594         std::vector<double> res2;
3595         std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3596         PyObject *ret=PyList_New(res.size());
3597         int rk=0;
3598         for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3599           {
3600             PyObject *elt=PyTuple_New(3);
3601             PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3602             PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3603             PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3604             PyList_SetItem(ret,rk,elt);
3605           }
3606         return ret;
3607       }
3608     }
3609   };
3610
3611   class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3612   {
3613   public:
3614     static MEDFileParameters *New();
3615     static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3616     static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3617     MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3618     std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3619     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3620     void resize(int newSize) throw(INTERP_KERNEL::Exception);
3621     void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3622     void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3623     void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3624     int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3625     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3626     %extend
3627     {
3628       MEDFileParameters()
3629       {
3630         return MEDFileParameters::New();
3631       }
3632       
3633       MEDFileParameters(const std::string& fileName)
3634       {
3635         return MEDFileParameters::New(fileName);
3636       }
3637
3638       MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3639       {
3640         return MEDFileParameters::New(db);
3641       }
3642
3643       // serialization
3644       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3645       {
3646         return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3647       }
3648       
3649       std::string __str__() const throw(INTERP_KERNEL::Exception)
3650       {
3651         return self->simpleRepr();
3652       }
3653
3654       MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3655       {
3656         if(PyInt_Check(obj))
3657           {
3658             MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3659             if(ret)
3660               ret->incrRef();
3661             return ret;
3662           }
3663         else if(PyString_Check(obj))
3664           {
3665             MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3666             if(ret)
3667               ret->incrRef();
3668             return ret;
3669           }
3670         else
3671           throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3672       }
3673
3674       int __len__() const throw(INTERP_KERNEL::Exception)
3675       {
3676         return self->getNumberOfParams();
3677       }
3678       
3679       MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3680       {
3681         MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3682         if(ret)
3683           ret->incrRef();
3684         return ret;
3685       }
3686
3687       MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3688       {
3689         MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3690         if(ret)
3691           ret->incrRef();
3692         return ret;
3693       }
3694       
3695       PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3696       {
3697         std::string what;
3698         bool ret0=self->isEqual(other,eps,what);
3699         PyObject *res=PyList_New(2);
3700         PyObject *ret0Py=ret0?Py_True:Py_False;
3701         Py_XINCREF(ret0Py);
3702         PyList_SetItem(res,0,ret0Py);
3703         PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3704         return res;
3705       }
3706     }
3707   };
3708
3709   class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3710   {
3711   public:
3712     static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3713     static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3714     static MEDFileData *New();
3715     MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3716     void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3717     void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3718     void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3719     int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3720     int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3721     int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3722     //
3723     bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3724     bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3725     void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3726     std::string getHeader() const throw(INTERP_KERNEL::Exception);
3727     void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3728     //
3729     %extend
3730        {
3731          MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3732          {
3733            return MEDFileData::New(fileName);
3734          }
3735
3736          MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3737          {
3738            return MEDFileData::New(db);
3739          }
3740
3741          MEDFileData()
3742          {
3743            return MEDFileData::New();
3744          }
3745
3746          std::string __str__() const throw(INTERP_KERNEL::Exception)
3747          {
3748            return self->simpleRepr();
3749          }
3750
3751          MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3752          {
3753            MEDFileMeshes *ret=self->getMeshes();
3754            if(ret)
3755              ret->incrRef();
3756            return ret;
3757          }
3758
3759          MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3760          {
3761            MEDFileParameters *ret=self->getParams();
3762            if(ret)
3763              ret->incrRef();
3764            return ret;
3765          }
3766
3767          MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3768          {
3769            MEDFileFields *ret=self->getFields();
3770            if(ret)
3771              ret->incrRef();
3772            return ret;
3773          }
3774
3775          bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3776          {
3777            std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3778            return self->changeMeshNames(modifTab);
3779          }
3780
3781          static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3782          {
3783            std::vector<const MEDFileData *> mfdsCpp;
3784            convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3785            MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3786            return ret.retn();
3787          }
3788
3789          // serialization
3790          static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3791          {
3792            return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3793          }
3794        }
3795   };
3796
3797   class SauvReader : public RefCountObject
3798   {
3799   public:
3800     static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3801     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3802     %extend
3803     {
3804       SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3805       {
3806         return SauvReader::New(fileName);
3807       }
3808     }
3809   };
3810
3811   class SauvWriter : public RefCountObject
3812   {
3813   public:
3814     static SauvWriter * New();
3815     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3816     void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3817     void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3818     bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3819     %extend
3820     {
3821       SauvWriter() throw(INTERP_KERNEL::Exception)
3822       {
3823         return SauvWriter::New();
3824       }
3825     }
3826   };
3827   
3828   ///////////////
3829
3830   class MEDFileMeshStruct;
3831
3832   class MEDFileField1TSStructItem
3833   {
3834   public:
3835     static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3836   };
3837
3838   class MEDFileMeshStruct : public RefCountObject
3839   {
3840   public:
3841     static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3842   protected:
3843     ~MEDFileMeshStruct();
3844   };
3845   
3846   class MEDMeshMultiLev : public RefCountObject
3847   {
3848   public:
3849     virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3850     DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3851     DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3852   protected:
3853     ~MEDMeshMultiLev();
3854   public:
3855     %extend
3856     {
3857       PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3858       {
3859         DataArrayInt *famIds(0);
3860         bool isWithoutCopy(false);
3861         self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3862         PyObject *ret=PyTuple_New(2);
3863         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3864         Py_XINCREF(ret1Py);
3865         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3866         PyTuple_SetItem(ret,1,ret1Py);
3867         return ret;
3868       }
3869
3870       PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3871       {
3872         DataArrayInt *numIds(0);
3873         bool isWithoutCopy(false);
3874         self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3875         PyObject *ret=PyTuple_New(2);
3876         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3877         Py_XINCREF(ret1Py);
3878         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3879         PyTuple_SetItem(ret,1,ret1Py);
3880         return ret;
3881       }
3882       
3883       PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3884       {
3885         DataArrayInt *famIds(0);
3886         bool isWithoutCopy(false);
3887         self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3888         PyObject *ret=PyTuple_New(2);
3889         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3890         Py_XINCREF(ret1Py);
3891         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3892         PyTuple_SetItem(ret,1,ret1Py);
3893         return ret;
3894       }
3895
3896       PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3897       {
3898         DataArrayInt *numIds(0);
3899         bool isWithoutCopy(false);
3900         self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3901         PyObject *ret=PyTuple_New(2);
3902         PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3903         Py_XINCREF(ret1Py);
3904         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3905         PyTuple_SetItem(ret,1,ret1Py);
3906         return ret;
3907       }
3908
3909       PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3910       {
3911         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3912         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3913         PyObject *res(PyList_New(result.size()));
3914         for(int i=0;iL!=result.end(); i++, iL++)
3915           PyList_SetItem(res,i,PyInt_FromLong(*iL));
3916         return res;
3917       }
3918     }
3919   };
3920
3921   class MEDUMeshMultiLev : public MEDMeshMultiLev
3922   {
3923   protected:
3924     ~MEDUMeshMultiLev();
3925   public:
3926     %extend
3927      {
3928        PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3929        {
3930          DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3931          bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3932          PyObject *ret0Py=ncc?Py_True:Py_False;
3933          Py_XINCREF(ret0Py);
3934          PyObject *ret=PyTuple_New(7);
3935          PyTuple_SetItem(ret,0,ret0Py);
3936          PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3937          PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3938          PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3939          PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3940          PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3941          PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3942          return ret;
3943        }
3944      }
3945   };
3946
3947   class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3948   {
3949   protected:
3950     ~MEDStructuredMeshMultiLev();
3951   };
3952
3953   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3954   {
3955   protected:
3956     ~MEDCMeshMultiLev();
3957   public:
3958     %extend
3959     {
3960       PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3961       {
3962         bool isInternal;
3963         std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3964         std::size_t sz(objs.size());
3965         PyObject *ret(PyTuple_New(2));
3966         PyObject *ret0=PyList_New(sz);
3967         for(std::size_t i=0;i<sz;i++)
3968           PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3969         PyTuple_SetItem(ret,0,ret0);
3970         PyObject *ret1Py(isInternal?Py_True:Py_False);
3971         Py_XINCREF(ret1Py);
3972         PyTuple_SetItem(ret,1,ret1Py);
3973         return ret;
3974       }
3975     }
3976   };
3977
3978   class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3979   {
3980   protected:
3981     ~MEDCurveLinearMeshMultiLev();
3982   public:
3983     %extend
3984     {
3985       PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3986       {
3987         DataArrayDouble *ret0(0);
3988         std::vector<int> ret1;
3989         bool ret2;
3990         self->buildVTUArrays(ret0,ret1,ret2);
3991         std::size_t sz(ret1.size());
3992         PyObject *ret=PyTuple_New(3);
3993         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3994         PyObject *ret1Py=PyList_New(sz);
3995         for(std::size_t i=0;i<sz;i++)
3996           PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3997         PyTuple_SetItem(ret,1,ret1Py);
3998         PyObject *ret2Py(ret2?Py_True:Py_False);
3999         Py_XINCREF(ret2Py);
4000         PyTuple_SetItem(ret,2,ret2Py);
4001         return ret;
4002       }
4003     }
4004   };
4005
4006   class MEDFileFastCellSupportComparator : public RefCountObject
4007   {
4008   public:
4009     static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4010     MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4011     bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4012     int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4013   protected:
4014     ~MEDFileFastCellSupportComparator();
4015   public:
4016     %extend
4017     {
4018       PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4019       {
4020         std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4021         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4022         PyObject *res(PyList_New(result.size()));
4023         for(int i=0;iL!=result.end(); i++, iL++)
4024           PyList_SetItem(res,i,PyInt_FromLong(*iL));
4025         return res;
4026       }
4027     }
4028   };
4029 }