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