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