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