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