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