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