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