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