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