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