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