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