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