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