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