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