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