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