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