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