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