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