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