1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
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 "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCpy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
124 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
125 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
126 %newobject MEDCoupling::MEDFileCMesh::New;
127 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
128 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
129 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCpy;
130 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
131 %newobject MEDCoupling::MEDFileMeshes::New;
132 %newobject MEDCoupling::MEDFileMeshes::deepCpy;
133 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
134 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
135 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
136 %newobject MEDCoupling::MEDFileMeshes::__iter__;
138 %newobject MEDCoupling::MEDFileFields::New;
139 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
140 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
141 %newobject MEDCoupling::MEDFileFields::deepCpy;
142 %newobject MEDCoupling::MEDFileFields::shallowCpy;
143 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
144 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
145 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
146 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
147 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
148 %newobject MEDCoupling::MEDFileFields::__iter__;
150 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
151 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCpy;
152 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
153 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
154 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
157 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
158 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
159 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
160 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
161 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
165 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
166 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
167 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
168 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
170 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
171 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
172 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCpy;
173 %newobject MEDCoupling::MEDFileField1TS::New;
174 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
175 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
176 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
177 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
178 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
179 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
180 %newobject MEDCoupling::MEDFileIntField1TS::New;
181 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
182 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
184 %newobject MEDCoupling::MEDFileData::New;
185 %newobject MEDCoupling::MEDFileData::deepCpy;
186 %newobject MEDCoupling::MEDFileData::getMeshes;
187 %newobject MEDCoupling::MEDFileData::getFields;
188 %newobject MEDCoupling::MEDFileData::getParams;
190 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
191 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCpy;
192 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
193 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCpy;
194 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
195 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
196 %newobject MEDCoupling::MEDFileParameters::New;
197 %newobject MEDCoupling::MEDFileParameters::deepCpy;
198 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
199 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
200 %newobject MEDCoupling::MEDFileParameters::__getitem__;
202 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
203 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCpy;
204 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
205 %newobject MEDCoupling::MEDFileJointOneStep::New;
206 %newobject MEDCoupling::MEDFileJointOneStep::deepCpy;
207 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
208 %newobject MEDCoupling::MEDFileJoint::New;
209 %newobject MEDCoupling::MEDFileJoint::deepCpy;
210 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
211 %newobject MEDCoupling::MEDFileJoints::New;
212 %newobject MEDCoupling::MEDFileJoints::deepCpy;
213 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
214 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
215 %newobject MEDCoupling::MEDFileJoints::__getitem__;
216 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
217 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
218 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
219 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
220 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
221 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
222 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
223 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
224 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
226 %newobject MEDCoupling::SauvWriter::New;
227 %newobject MEDCoupling::SauvReader::New;
228 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
230 %newobject MEDCoupling::MEDFileMeshStruct::New;
231 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
232 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
233 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
234 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
236 %feature("unref") MEDFileMesh "$this->decrRef();"
237 %feature("unref") MEDFileUMesh "$this->decrRef();"
238 %feature("unref") MEDFileCMesh "$this->decrRef();"
239 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
240 %feature("unref") MEDFileMeshes "$this->decrRef();"
241 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
242 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
243 %feature("unref") MEDFileField1TS "$this->decrRef();"
244 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
245 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
246 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
247 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
248 %feature("unref") MEDFileFields "$this->decrRef();"
249 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
250 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
251 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
252 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
253 %feature("unref") MEDFileParameters "$this->decrRef();"
254 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
255 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
256 %feature("unref") MEDFileJoint "$this->decrRef();"
257 %feature("unref") MEDFileJoints "$this->decrRef();"
258 %feature("unref") MEDFileEquivalences "$this->decrRef();"
259 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
260 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
261 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
262 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
263 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
264 %feature("unref") MEDFileData "$this->decrRef();"
265 %feature("unref") SauvReader "$this->decrRef();"
266 %feature("unref") SauvWriter "$this->decrRef();"
267 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
268 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
269 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
270 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
271 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
272 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
274 namespace MEDCoupling
277 std::string MEDFileVersionStr();
278 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
279 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
280 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
281 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
282 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
283 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
284 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
285 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
286 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
287 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
288 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
289 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
290 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
291 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
292 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
293 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
294 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
295 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
296 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
297 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
298 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
299 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
300 MEDCoupling::MEDCouplingFieldDouble *ReadField(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);
301 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);
302 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);
303 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);
304 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);
305 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
306 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
307 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
308 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
309 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
310 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
313 %rename (MEDFileVersion) MEDFileVersionSwig;
314 %rename (GetFieldIterations) GetFieldIterationsSwig;
315 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
316 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
317 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
318 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
319 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
320 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
321 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
322 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
323 %rename (WriteUMeshes) WriteUMeshesSwig;
324 %rename (GetTypesOfField) GetTypesOfFieldSwig;
325 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
326 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
330 PyObject *MEDFileVersionSwig()
332 int major,minor,release;
333 MEDCoupling::MEDFileVersion(major,minor,release);
334 PyObject *ret(PyTuple_New(3));
335 PyTuple_SetItem(ret,0,SWIG_From_int(major));
336 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
337 PyTuple_SetItem(ret,2,SWIG_From_int(release));
341 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
343 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
344 PyObject *ret=PyList_New(res.size());
346 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
348 PyObject *elt=PyTuple_New(2);
349 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
350 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
351 PyList_SetItem(ret,rk,elt);
356 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
358 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
359 PyObject *ret=PyList_New(res.size());
361 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
363 PyObject *elt=PyTuple_New(3);
364 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
365 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
366 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
367 PyList_SetItem(ret,rk,elt);
372 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
374 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
375 PyObject *ret=PyList_New(res.size());
377 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
379 PyObject *elt=PyTuple_New(2);
380 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
381 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
382 PyList_SetItem(ret,rk,elt);
387 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
389 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
390 PyObject *ret=PyList_New(res.size());
392 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
394 PyObject *elt=PyTuple_New(2);
395 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
396 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
397 PyList_SetItem(ret,rk,elt);
402 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
404 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
405 PyObject *ret=PyList_New(res.size());
407 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
409 PyObject *elt=PyTuple_New(2);
410 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
411 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
412 PyList_SetItem(ret,rk,elt);
417 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
419 int meshDim,spaceDim,numberOfNodes;
420 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
421 PyObject *ret=PyTuple_New(4);
422 PyObject *elt0=PyList_New(res.size());
424 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
426 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
428 PyObject *elt1=PyList_New(obj2.size());
429 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
431 PyObject *elt2=PyTuple_New(2);
432 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
433 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
434 PyList_SetItem(elt1,j,elt2);
436 PyList_SetItem(elt0,i,elt1);
438 PyTuple_SetItem(ret,0,elt0);
439 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
440 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
441 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
445 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
446 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
448 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
449 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
450 return convertFieldDoubleVecToPy(res);
453 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
455 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
456 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
457 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
460 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
462 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
463 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
464 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
467 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
469 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
470 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
471 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
474 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
476 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
478 PyObject *ret=PyList_New(size);
479 for(int i=0;i<size;i++)
480 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
484 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
486 std::vector<std::string> grps;
487 converPyListToVecString(li,grps);
488 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
491 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
493 std::vector<std::string> fams;
494 converPyListToVecString(li,fams);
495 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
499 namespace MEDCoupling
501 class MEDFileWritable
504 void copyOptionsFrom(const MEDFileWritable& other) const;
505 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
506 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
507 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
508 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
511 class MEDFileMeshReadSelector
514 MEDFileMeshReadSelector();
515 MEDFileMeshReadSelector(unsigned int code);
516 unsigned int getCode() const;
517 void setCode(unsigned int newCode);
518 bool isCellFamilyFieldReading() const;
519 bool isNodeFamilyFieldReading() const;
520 bool isCellNameFieldReading() const;
521 bool isNodeNameFieldReading() const;
522 bool isCellNumFieldReading() const;
523 bool isNodeNumFieldReading() const;
524 void setCellFamilyFieldReading(bool b);
525 void setNodeFamilyFieldReading(bool b);
526 void setCellNameFieldReading(bool b);
527 void setNodeNameFieldReading(bool b);
528 void setCellNumFieldReading(bool b);
529 void setNodeNumFieldReading(bool b);
532 std::string __str__() const throw(INTERP_KERNEL::Exception)
534 std::ostringstream oss;
539 std::string __repr__() const throw(INTERP_KERNEL::Exception)
541 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
547 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
550 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
551 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
552 throw(INTERP_KERNEL::Exception);
553 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
554 INTERP_KERNEL::NormalizedCellType loc_geo_type,
555 INTERP_KERNEL::NormalizedCellType rem_geo_type)
556 throw(INTERP_KERNEL::Exception);
557 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
558 MEDFileJointCorrespondence *deepCpy() const;
559 MEDFileJointCorrespondence *shallowCpy() const;
560 void setIsNodal(bool isNodal);
561 bool getIsNodal() const;
562 bool isEqual(const MEDFileJointCorrespondence *other) const;
563 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
564 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
565 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
566 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
567 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
568 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
569 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);
570 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
573 MEDFileJointCorrespondence()
575 return MEDFileJointCorrespondence::New();
577 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
579 return MEDFileJointCorrespondence::New(correspondence);
581 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
582 INTERP_KERNEL::NormalizedCellType loc_geo_type,
583 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
585 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
588 std::string __str__() const throw(INTERP_KERNEL::Exception)
590 return self->simpleRepr();
595 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
598 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
599 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
600 MEDFileJointOneStep *deepCpy() const;
601 MEDFileJointOneStep *shallowCpy() const;
602 bool isEqual(const MEDFileJointOneStep *other) const;
603 void setOrder(int order);
604 int getOrder() const;
605 void setIteration(int it);
606 int getIteration() const;
607 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
608 int getNumberOfCorrespondences() const;
609 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
610 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
611 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
614 MEDFileJointOneStep()
616 return MEDFileJointOneStep::New();
619 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
621 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
624 std::string __str__() const throw(INTERP_KERNEL::Exception)
626 return self->simpleRepr();
631 class MEDFileJoint : public RefCountObject, public MEDFileWritable
634 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
635 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
636 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
637 MEDFileJoint *deepCpy() const;
638 MEDFileJoint *shallowCpy() const;
639 bool isEqual(const MEDFileJoint *other) const;
640 void setLocalMeshName(const std::string& name);
641 std::string getLocalMeshName() const;
642 void setRemoteMeshName(const std::string& name);
643 std::string getRemoteMeshName() const;
644 void setDescription(const std::string& name);
645 std::string getDescription() const;
646 void setJointName(const std::string& name);
647 std::string getJointName() const;
648 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
649 void setDomainNumber(const int& number);
650 int getDomainNumber() const;
651 void pushStep(MEDFileJointOneStep* step);
652 int getNumberOfSteps() const;
653 MEDFileJointOneStep *getStepAtPos(int i) const;
654 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
655 std::string simpleRepr() const;
660 return MEDFileJoint::New();
663 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
665 return MEDFileJoint::New(fileName,mName,num);
668 std::string __str__() const throw(INTERP_KERNEL::Exception)
670 return self->simpleRepr();
675 class MEDFileJoints : public RefCountObject, public MEDFileWritable
678 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
679 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
680 MEDFileJoints *deepCpy() const;
681 std::string simpleRepr() const;
682 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
683 std::string getMeshName() const;
684 int getNumberOfJoints() const;
685 std::vector<std::string> getJointsNames() const;
686 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
687 void resize(int newSize) throw(INTERP_KERNEL::Exception);
688 void pushJoint(MEDFileJoint *joint);
689 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
690 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
695 return MEDFileJoints::New();
698 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
700 return MEDFileJoints::New(fileName,meshName);
703 std::string __str__() const throw(INTERP_KERNEL::Exception)
705 return self->simpleRepr();
708 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
712 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
717 else if(PyString_Check(obj))
719 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
725 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
728 int __len__() const throw(INTERP_KERNEL::Exception)
730 return self->getNumberOfJoints();
733 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
735 MEDFileJoint *ret=self->getJointAtPos(i);
741 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
743 MEDFileJoint *ret=self->getJointWithName(paramName);
751 class MEDFileEquivalenceBase : public RefCountObject
754 MEDFileEquivalenceBase();
757 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
760 MEDFileEquivalenceData();
762 void setArray(DataArrayInt *data);
765 DataArrayInt *getArray()
767 DataArrayInt *ret(self->getArray());
768 if(ret) ret->incrRef();
774 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
777 MEDFileEquivalenceNode();
780 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
783 MEDFileEquivalenceCell();
786 std::size_t size() const;
787 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
788 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
791 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
793 DataArrayInt *ret(self->getArray(type));
794 if(ret) ret->incrRef();
798 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
800 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
801 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
802 PyObject *res=PyList_New(result.size());
803 for(int i=0;iL!=result.end(); i++, iL++)
804 PyList_SetItem(res,i,PyInt_FromLong(*iL));
810 class MEDFileEquivalencePair : public RefCountObject
813 MEDFileEquivalencePair();
815 std::string getName() const;
816 void setName(const std::string& name);
817 std::string getDescription() const;
818 void setDescription(const std::string& descr);
819 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
822 MEDFileEquivalenceCell *initCell()
824 MEDFileEquivalenceCell *ret(self->initCell());
825 if(ret) ret->incrRef();
829 MEDFileEquivalenceNode *initNode()
831 MEDFileEquivalenceNode *ret(self->initNode());
832 if(ret) ret->incrRef();
836 MEDFileEquivalenceCell *getCell()
838 MEDFileEquivalenceCell *ret(self->getCell());
839 if(ret) ret->incrRef();
843 MEDFileEquivalenceNode *getNode()
845 MEDFileEquivalenceNode *ret(self->getNode());
846 if(ret) ret->incrRef();
852 class MEDFileEquivalences : public RefCountObject
855 MEDFileEquivalences();
858 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
859 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
860 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
864 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
866 MEDFileEquivalencePair *ret(self->getEquivalence(i));
867 if(ret) ret->incrRef();
870 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
872 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
873 if(ret) ret->incrRef();
877 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
879 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
880 if(ret) ret->incrRef();
886 class MEDFileMesh : public RefCountObject, public MEDFileWritable
889 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
890 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
891 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
892 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
893 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
894 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
895 void setName(const std::string& name);
896 std::string getName();
897 std::string getUnivName() const;
898 bool getUnivNameWrStatus() const;
899 void setUnivNameWrStatus(bool newStatus);
900 void setDescription(const std::string& name);
901 std::string getDescription() const;
902 void setOrder(int order);
903 int getOrder() const;
904 void setIteration(int it);
906 void setTimeValue(double time);
907 void setTime(int dt, int it, double time);
908 double getTimeValue() const;
909 void setTimeUnit(const std::string& unit);
910 std::string getTimeUnit() const;
911 void setAxType(MEDCouplingAxisType at);
912 MEDCouplingAxisType getAxType() const;
913 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
914 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
915 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
916 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
917 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
918 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
919 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
920 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
921 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
922 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
923 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
924 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
925 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
926 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
927 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
929 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
930 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
931 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
932 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
933 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
934 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
935 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
936 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
937 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
938 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
939 void clearGrpMap() throw(INTERP_KERNEL::Exception);
940 void clearFamMap() throw(INTERP_KERNEL::Exception);
941 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
942 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
943 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
944 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
945 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
946 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
947 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
948 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
949 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
950 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
951 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
952 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
953 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
954 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
955 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
956 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
957 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
958 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
959 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
960 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
961 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
962 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
963 static std::string GetMagicFamilyStr();
964 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
965 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
966 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
967 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
968 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
969 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
970 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
971 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
972 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
973 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
974 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
975 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
976 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
977 void setFamilyInfo(const std::map<std::string,int>& info);
978 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
979 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
980 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
981 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
982 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
983 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
984 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
985 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
986 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
987 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
988 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
989 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
990 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
991 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
992 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
993 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
994 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
995 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
996 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
997 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
998 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1000 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1001 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1002 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1003 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1004 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1005 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1006 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1007 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1008 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1009 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1010 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1011 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1012 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1013 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1014 int getNumberOfJoints();
1015 MEDFileJoints *getJoints();
1016 void setJoints( MEDFileJoints* joints );
1017 void initializeEquivalences();
1018 void killEquivalences();
1021 std::string __str__() const throw(INTERP_KERNEL::Exception)
1023 return self->simpleRepr();
1026 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1028 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1031 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1034 double tmp0=self->getTime(tmp1,tmp2);
1035 PyObject *res = PyList_New(3);
1036 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1037 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1038 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1042 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1045 bool ret0=self->isEqual(other,eps,what);
1046 PyObject *res=PyList_New(2);
1047 PyObject *ret0Py=ret0?Py_True:Py_False;
1049 PyList_SetItem(res,0,ret0Py);
1050 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1054 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1056 std::vector<const DataArrayInt *> grps;
1057 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1058 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1061 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1064 bool ret0=self->areFamsEqual(other,what);
1065 PyObject *res=PyList_New(2);
1066 PyObject *ret0Py=ret0?Py_True:Py_False;
1068 PyList_SetItem(res,0,ret0Py);
1069 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1073 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1076 bool ret0=self->areGrpsEqual(other,what);
1077 PyObject *res=PyList_New(2);
1078 PyObject *ret0Py=ret0?Py_True:Py_False;
1080 PyList_SetItem(res,0,ret0Py);
1081 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1085 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1087 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1088 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1089 PyObject *res=PyList_New(result.size());
1090 for(int i=0;iL!=result.end(); i++, iL++)
1091 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1095 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1097 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1098 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1099 PyObject *res=PyList_New(result.size());
1100 for(int i=0;iL!=result.end(); i++, iL++)
1101 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1105 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1107 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1110 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1113 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1115 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1118 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1121 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1123 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1126 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1129 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1131 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1134 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1137 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1139 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1142 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1145 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1148 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1149 PyObject *ret=PyTuple_New(2);
1150 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1151 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1155 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1157 DataArrayInt *ret3=0;
1158 std::vector<int> ret1,ret2;
1159 bool ret0=self->unPolyze(ret1,ret2,ret3);
1160 PyObject *ret=PyTuple_New(4);
1161 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1163 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1164 for(int j=0;j<(int)ret1.size()/3;j++)
1166 PyObject *retLev2=PyList_New(3);
1167 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1168 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1169 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1170 PyList_SetItem(retLev1_0,j,retLev2);
1172 PyTuple_SetItem(ret,1,retLev1_0);
1174 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1175 for(int j=0;j<(int)ret2.size()/3;j++)
1177 PyObject *retLev2=PyList_New(3);
1178 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1179 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1180 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1181 PyList_SetItem(retLev1_1,j,retLev2);
1183 PyTuple_SetItem(ret,2,retLev1_1);
1185 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1189 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1191 MEDFileEquivalences *ret(self->getEquivalences());
1192 if(ret) ret->incrRef();
1198 class MEDFileUMesh : public MEDFileMesh
1201 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1202 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1203 static MEDFileUMesh *New();
1205 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1206 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1208 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1209 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1210 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1211 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1212 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1213 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1214 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1215 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1216 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1217 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1219 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1220 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1221 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1222 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1223 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1224 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1225 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1226 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1227 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1228 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1229 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1230 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1231 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1234 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1236 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1239 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1241 return MEDFileUMesh::New(fileName,mrs);
1246 return MEDFileUMesh::New();
1250 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1252 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1255 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)
1257 std::vector<int> typesCpp1;
1258 convertPyToNewIntArr3(types,typesCpp1);
1259 std::size_t sz(typesCpp1.size());
1260 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1261 for(std::size_t ii=0;ii<sz;ii++)
1262 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1263 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1266 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1267 {// put an empty dict in input to say to __new__ to call __init__...
1268 PyObject *ret(PyTuple_New(1));
1269 PyObject *ret0(PyDict_New());
1270 PyTuple_SetItem(ret,0,ret0);
1274 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1276 std::vector<double> a0;
1277 std::vector<int> a1;
1278 std::vector<std::string> a2;
1279 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1280 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1281 self->serialize(a0,a1,a2,a3,a4);
1282 PyObject *ret(PyTuple_New(5));
1283 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1284 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1286 PyObject *ret2(PyList_New(sz));
1287 for(int i=0;i<sz;i++)
1288 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1289 PyTuple_SetItem(ret,2,ret2);
1291 PyObject *ret3(PyList_New(sz));
1292 for(int i=0;i<sz;i++)
1294 DataArrayInt *elt(a3[i]);
1297 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1299 PyTuple_SetItem(ret,3,ret3);
1300 DataArrayDouble *ret4(a4);
1303 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1307 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1309 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1310 if(!PyTuple_Check(inp))
1311 throw INTERP_KERNEL::Exception(MSG);
1312 int sz(PyTuple_Size(inp));
1314 throw INTERP_KERNEL::Exception(MSG);
1315 std::vector<double> a0;
1316 std::vector<int> a1;
1317 std::vector<std::string> a2;
1318 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1319 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1321 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1323 fillArrayWithPyListDbl3(a0py,tmp,a0);
1324 convertPyToNewIntArr3(a1py,a1);
1325 fillStringVector(a2py,a2);
1327 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1329 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1330 if(!SWIG_IsOK(status))
1331 throw INTERP_KERNEL::Exception(MSG);
1332 a4=reinterpret_cast<DataArrayDouble *>(argp);
1333 if((DataArrayDouble *)a4)
1336 std::vector< DataArrayInt * > a3Tmp;
1337 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1338 std::size_t sz(a3Tmp.size());
1340 for(std::size_t i=0;i<sz;i++)
1344 a3Tmp[i]->incrRef();
1346 self->unserialize(a0,a1,a2,a3,a4);
1350 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1353 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1354 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1357 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1360 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1363 self->setMeshAtLevel(meshDimRelToMax,m1);
1366 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1369 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1371 self->removeMeshAtLevel(meshDimRelToMax);
1374 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1376 std::vector<const MEDCouplingUMesh *> ms;
1377 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1378 self->setMeshes(ms,renum);
1381 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1383 std::vector<const MEDCouplingUMesh *> ms;
1384 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1385 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1388 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1390 std::vector<const MEDCouplingUMesh *> ms;
1391 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1392 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1395 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1397 DataArrayDouble *ret=self->getCoords();
1403 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1405 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1408 return const_cast<PartDefinition *>(ret);
1411 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1413 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1414 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1415 PyObject *ret=PyTuple_New(3);
1416 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1417 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1418 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1424 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1430 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1432 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1433 std::size_t sz(tmp.size());
1434 PyObject *ret=PyList_New(sz);
1435 for(std::size_t i=0;i<sz;i++)
1439 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1446 class MEDFileStructuredMesh : public MEDFileMesh
1451 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1453 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1461 class MEDFileCMesh : public MEDFileStructuredMesh
1464 static MEDFileCMesh *New();
1465 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1466 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1467 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1468 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1473 return MEDFileCMesh::New();
1476 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1478 return MEDFileCMesh::New(fileName,mrs);
1481 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1483 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1486 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1488 const MEDCouplingCMesh *tmp=self->getMesh();
1491 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1496 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1499 static MEDFileCurveLinearMesh *New();
1500 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1501 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1502 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1505 MEDFileCurveLinearMesh()
1507 return MEDFileCurveLinearMesh::New();
1510 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1512 return MEDFileCurveLinearMesh::New(fileName,mrs);
1515 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1517 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1520 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1522 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1525 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1530 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1533 static MEDFileMeshMultiTS *New();
1534 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1535 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1536 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1537 std::string getName() const throw(INTERP_KERNEL::Exception);
1538 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1539 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1540 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1543 MEDFileMeshMultiTS()
1545 return MEDFileMeshMultiTS::New();
1548 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1550 return MEDFileMeshMultiTS::New(fileName);
1553 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1555 return MEDFileMeshMultiTS::New(fileName,mName);
1558 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1560 MEDFileMesh *ret=self->getOneTimeStep();
1568 class MEDFileMeshesIterator
1573 PyObject *next() throw(INTERP_KERNEL::Exception)
1575 MEDFileMesh *ret=self->nextt();
1579 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1583 PyErr_SetString(PyExc_StopIteration,"No more data.");
1590 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1593 static MEDFileMeshes *New();
1594 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1595 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1596 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1597 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1598 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1600 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1601 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1602 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1603 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1604 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1609 return MEDFileMeshes::New();
1612 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1614 return MEDFileMeshes::New(fileName);
1617 std::string __str__() const throw(INTERP_KERNEL::Exception)
1619 return self->simpleRepr();
1622 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1624 if(PyInt_Check(obj))
1626 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1631 else if(PyString_Check(obj))
1633 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1639 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1642 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1644 self->setMeshAtPos(obj,mesh);
1648 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1650 return self->iterator();
1653 int __len__() const throw(INTERP_KERNEL::Exception)
1655 return self->getNumberOfMeshes();
1658 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1660 MEDFileMesh *ret=self->getMeshAtPos(i);
1665 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1667 MEDFileMesh *ret=self->getMeshWithName(mname);
1675 class MEDFileFieldLoc : public RefCountObject
1678 std::string getName() const;
1679 int getDimension() const;
1680 int getNumberOfGaussPoints() const;
1681 int getNumberOfPointsInCells() const;
1682 const std::vector<double>& getRefCoords() const;
1683 const std::vector<double>& getGaussCoords() const;
1684 const std::vector<double>& getGaussWeights() const;
1685 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1688 std::string __str__() const throw(INTERP_KERNEL::Exception)
1690 return self->repr();
1695 class MEDFileFieldGlobsReal
1698 void resetContent();
1699 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1700 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1701 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1702 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1703 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1704 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1705 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1706 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1707 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1708 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1709 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1710 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1711 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1712 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1713 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1714 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1715 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1716 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1717 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1718 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1719 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1720 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1721 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1722 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1723 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1724 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1727 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1729 const DataArrayInt *ret=self->getProfile(pflName);
1732 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1735 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1737 const DataArrayInt *ret=self->getProfileFromId(pflId);
1740 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1743 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1745 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1748 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1751 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1753 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1756 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1759 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1761 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1762 return convertVecPairVecStToPy(ret);
1765 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1767 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1768 return convertVecPairVecStToPy(ret);
1771 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1773 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1774 self->changePflsNames(v);
1777 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1779 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1780 self->changePflsRefsNamesGen(v);
1783 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1785 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1786 self->changePflsNamesInStruct(v);
1789 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1791 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1792 self->changeLocsNames(v);
1795 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1797 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1798 self->changeLocsRefsNamesGen(v);
1801 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1803 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1804 self->changeLocsNamesInStruct(v);
1807 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1809 std::ostringstream oss;
1810 self->simpleReprGlobs(oss);
1816 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1819 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1820 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1821 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1822 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1823 void loadArrays() throw(INTERP_KERNEL::Exception);
1824 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1825 void unloadArrays() throw(INTERP_KERNEL::Exception);
1826 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1827 int getDimension() const throw(INTERP_KERNEL::Exception);
1828 int getIteration() const throw(INTERP_KERNEL::Exception);
1829 int getOrder() const throw(INTERP_KERNEL::Exception);
1830 std::string getName() throw(INTERP_KERNEL::Exception);
1831 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1832 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1833 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1834 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1835 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1836 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1837 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1838 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1839 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1840 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1841 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1842 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1843 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1844 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1845 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1848 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1851 double tmp0=self->getTime(tmp1,tmp2);
1852 PyObject *res = PyList_New(3);
1853 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1854 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1855 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1859 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1861 std::pair<int,int> res=self->getDtIt();
1862 PyObject *elt=PyTuple_New(2);
1863 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1864 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1868 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1870 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1873 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1875 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1878 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1880 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1881 return self->changeMeshNames(modifTab);
1884 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1886 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1887 PyObject *ret2=PyList_New(ret.size());
1888 for(int i=0;i<(int)ret.size();i++)
1889 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1893 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1895 std::vector<int> ret1;
1896 int ret0=self->getNonEmptyLevels(mname,ret1);
1897 PyObject *elt=PyTuple_New(2);
1898 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1899 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1903 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1905 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1906 std::vector< std::vector<TypeOfField> > typesF;
1907 std::vector< std::vector<std::string> > pfls;
1908 std::vector< std::vector<std::string> > locs;
1909 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1911 PyObject *ret2=PyList_New(sz);
1912 for(int i=0;i<sz;i++)
1914 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1915 const std::vector<TypeOfField>& typesFI=typesF[i];
1916 const std::vector<std::string>& pflsI=pfls[i];
1917 const std::vector<std::string>& locsI=locs[i];
1918 PyObject *elt=PyTuple_New(2);
1919 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1920 int sz2=ret[i].size();
1921 PyObject *elt2=PyList_New(sz2);
1922 for(int j=0;j<sz2;j++)
1924 PyObject *elt3=PyTuple_New(4);
1925 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1926 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));
1927 PyTuple_SetItem(elt3,1,elt4);
1928 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1929 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1930 PyList_SetItem(elt2,j,elt3);
1932 PyTuple_SetItem(elt,1,elt2);
1933 PyList_SetItem(ret2,i,elt);
1938 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1940 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1941 std::size_t sz=ret.size();
1942 PyObject *retPy=PyList_New(sz);
1943 for(std::size_t i=0;i<sz;i++)
1944 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1948 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1950 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1951 std::size_t sz=ret.size();
1952 PyObject *retPy=PyList_New(sz);
1953 for(std::size_t i=0;i<sz;i++)
1954 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1958 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1960 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1961 std::size_t sz=ret.size();
1962 PyObject *retPy=PyList_New(sz);
1963 for(std::size_t i=0;i<sz;i++)
1964 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1970 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1973 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1974 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1975 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1976 static MEDFileField1TS *New();
1977 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1978 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1979 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1980 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1981 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1982 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1984 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1985 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1986 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1987 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1990 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1992 return MEDFileField1TS::New(fileName,loadAll);
1995 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1997 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2000 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2002 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2007 return MEDFileField1TS::New();
2010 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2012 const DataArrayDouble *arr=0;
2014 arr=field->getArray();
2015 self->copyTinyInfoFrom(field,arr);
2018 std::string __str__() const throw(INTERP_KERNEL::Exception)
2020 return self->simpleRepr();
2023 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2025 DataArrayInt *ret1=0;
2026 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2027 PyObject *ret=PyTuple_New(2);
2028 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2029 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2033 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2035 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2036 std::vector< std::vector<TypeOfField> > typesF;
2037 std::vector< std::vector<std::string> > pfls;
2038 std::vector< std::vector<std::string> > locs;
2039 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2041 PyObject *ret2=PyList_New(sz);
2042 for(int i=0;i<sz;i++)
2044 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2045 const std::vector<TypeOfField>& typesFI=typesF[i];
2046 const std::vector<std::string>& pflsI=pfls[i];
2047 const std::vector<std::string>& locsI=locs[i];
2048 PyObject *elt=PyTuple_New(2);
2049 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2050 int sz2=ret[i].size();
2051 PyObject *elt2=PyList_New(sz2);
2052 for(int j=0;j<sz2;j++)
2054 PyObject *elt3=PyTuple_New(4);
2055 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2056 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2057 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2058 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2059 PyList_SetItem(elt2,j,elt3);
2061 PyTuple_SetItem(elt,1,elt2);
2062 PyList_SetItem(ret2,i,elt);
2067 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2069 DataArrayDouble *ret=self->getUndergroundDataArray();
2075 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2077 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2078 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2081 PyObject *ret=PyTuple_New(2);
2082 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2083 std::size_t sz=elt1Cpp.size();
2084 PyObject *elt=PyList_New(sz);
2085 for(std::size_t i=0;i<sz;i++)
2087 PyObject *elt1=PyTuple_New(2);
2088 PyObject *elt2=PyTuple_New(2);
2089 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2090 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2091 PyObject *elt3=PyTuple_New(2);
2092 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2093 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2094 PyTuple_SetItem(elt1,0,elt2);
2095 PyTuple_SetItem(elt1,1,elt3);
2096 PyList_SetItem(elt,i,elt1);
2098 PyTuple_SetItem(ret,1,elt);
2104 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2107 static MEDFileIntField1TS *New();
2108 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2109 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2110 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2111 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2113 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2114 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2117 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2119 return MEDFileIntField1TS::New();
2122 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2124 return MEDFileIntField1TS::New(fileName,loadAll);
2127 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2129 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2132 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2134 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2137 std::string __str__() const throw(INTERP_KERNEL::Exception)
2139 return self->simpleRepr();
2142 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2144 DataArrayInt *ret1=0;
2145 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2146 PyObject *ret=PyTuple_New(2);
2147 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2148 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2154 DataArrayInt *ret1=0;
2155 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2156 PyObject *ret=PyTuple_New(2);
2157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2164 DataArrayInt *ret1=0;
2165 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2166 PyObject *ret=PyTuple_New(2);
2167 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2168 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2172 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2174 DataArrayInt *ret1=0;
2175 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2176 PyObject *ret=PyTuple_New(2);
2177 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2178 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2182 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2184 DataArrayInt *ret1=0;
2185 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2186 PyObject *ret=PyTuple_New(2);
2187 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2188 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2194 DataArrayInt *ret1=0;
2195 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2196 PyObject *ret=PyTuple_New(2);
2197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *ret=self->getUndergroundDataArray();
2212 class MEDFileAnyTypeFieldMultiTSIterator
2217 PyObject *next() throw(INTERP_KERNEL::Exception)
2219 MEDFileAnyTypeField1TS *ret=self->nextt();
2221 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2224 PyErr_SetString(PyExc_StopIteration,"No more data.");
2231 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2234 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2235 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2236 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2237 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2238 std::string getName() const throw(INTERP_KERNEL::Exception);
2239 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2240 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2241 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2242 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2243 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2244 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2245 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2246 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2247 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2248 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2249 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2250 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2251 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2252 void loadArrays() throw(INTERP_KERNEL::Exception);
2253 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2254 void unloadArrays() throw(INTERP_KERNEL::Exception);
2255 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2257 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2258 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2259 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2260 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2261 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2264 int __len__() const throw(INTERP_KERNEL::Exception)
2266 return self->getNumberOfTS();
2269 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2271 if(elt0 && PyInt_Check(elt0))
2273 int pos=PyInt_AS_LONG(elt0);
2276 else if(elt0 && PyTuple_Check(elt0))
2278 if(PyTuple_Size(elt0)==2)
2280 PyObject *o0=PyTuple_GetItem(elt0,0);
2281 PyObject *o1=PyTuple_GetItem(elt0,1);
2282 if(PyInt_Check(o0) && PyInt_Check(o1))
2284 int iter=PyInt_AS_LONG(o0);
2285 int order=PyInt_AS_LONG(o1);
2286 return self->getPosOfTimeStep(iter,order);
2289 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 !");
2292 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 !");
2294 else if(elt0 && PyFloat_Check(elt0))
2296 double val=PyFloat_AS_DOUBLE(elt0);
2297 return self->getPosGivenTime(val);
2300 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2303 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2305 std::vector< std::pair<int,int> > res=self->getIterations();
2306 PyObject *ret=PyList_New(res.size());
2308 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2310 PyObject *elt=PyTuple_New(2);
2311 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2312 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2313 PyList_SetItem(ret,rk,elt);
2318 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2320 std::vector<double> ret1;
2321 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2322 std::size_t sz=ret.size();
2323 PyObject *ret2=PyList_New(sz);
2324 for(std::size_t i=0;i<sz;i++)
2326 PyObject *elt=PyTuple_New(3);
2327 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2328 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2329 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2330 PyList_SetItem(ret2,i,elt);
2335 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2337 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2338 PyObject *ret2=PyList_New(ret.size());
2339 for(int i=0;i<(int)ret.size();i++)
2341 const std::vector<TypeOfField>& rett=ret[i];
2342 PyObject *ret3=PyList_New(rett.size());
2343 for(int j=0;j<(int)rett.size();j++)
2344 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2345 PyList_SetItem(ret2,i,ret3);
2350 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2352 std::vector<int> ret1;
2353 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2354 PyObject *elt=PyTuple_New(2);
2355 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2356 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2360 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2362 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2363 std::vector< std::vector<TypeOfField> > typesF;
2364 std::vector< std::vector<std::string> > pfls;
2365 std::vector< std::vector<std::string> > locs;
2366 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2368 PyObject *ret2=PyList_New(sz);
2369 for(int i=0;i<sz;i++)
2371 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2372 const std::vector<TypeOfField>& typesFI=typesF[i];
2373 const std::vector<std::string>& pflsI=pfls[i];
2374 const std::vector<std::string>& locsI=locs[i];
2375 PyObject *elt=PyTuple_New(2);
2376 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2377 int sz2=ret[i].size();
2378 PyObject *elt2=PyList_New(sz2);
2379 for(int j=0;j<sz2;j++)
2381 PyObject *elt3=PyTuple_New(4);
2382 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2383 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));
2384 PyTuple_SetItem(elt3,1,elt4);
2385 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2386 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2387 PyList_SetItem(elt2,j,elt3);
2389 PyTuple_SetItem(elt,1,elt2);
2390 PyList_SetItem(ret2,i,elt);
2395 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2397 if(PyList_Check(elts))
2399 int sz=PyList_Size(elts);
2400 std::vector<int> ret(sz);
2401 for(int i=0;i<sz;i++)
2403 PyObject *elt=PyList_GetItem(elts,i);
2404 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2410 std::vector<int> ret(1);
2411 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2416 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2418 if(PySlice_Check(elts))
2420 Py_ssize_t strt=2,stp=2,step=2;
2421 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2422 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2423 self->eraseTimeStepIds2(strt,stp,step);
2427 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2428 if(!idsToRemove.empty())
2429 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2433 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2437 std::vector<int> pos2;
2438 DataArrayInt *pos3=0;
2439 DataArrayIntTuple *pos4=0;
2440 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2445 self->eraseTimeStepIds(&pos1,&pos1+1);
2452 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2457 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2461 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2465 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2467 return self->iterator();
2470 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2472 if(elt0 && PyList_Check(elt0))
2474 int sz=PyList_Size(elt0);
2475 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2476 int *pt=da->getPointer();
2477 for(int i=0;i<sz;i++,pt++)
2479 PyObject *elt1=PyList_GetItem(elt0,i);
2480 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2482 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2484 else if(elt0 && PySlice_Check(elt0))
2486 Py_ssize_t strt=2,stp=2,step=2;
2487 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2488 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2489 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2492 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2495 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2497 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2498 return self->changeMeshNames(modifTab);
2501 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2503 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2504 std::size_t sz=ret.size();
2505 PyObject *retPy=PyList_New(sz);
2506 for(std::size_t i=0;i<sz;i++)
2507 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2511 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2513 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2514 std::size_t sz=ret.size();
2515 PyObject *retPy=PyList_New(sz);
2516 for(std::size_t i=0;i<sz;i++)
2517 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2521 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2523 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2524 std::size_t sz=ret.size();
2525 PyObject *retPy=PyList_New(sz);
2526 for(std::size_t i=0;i<sz;i++)
2527 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2531 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2534 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2535 if(SWIG_IsOK(status))
2537 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2541 std::vector<MEDFileAnyTypeField1TS *> tmp;
2542 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2543 self->pushBackTimeSteps(tmp);
2547 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2549 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2550 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2551 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2552 std::size_t sz=ret.size();
2553 PyObject *retPy=PyList_New(sz);
2554 for(std::size_t i=0;i<sz;i++)
2556 std::size_t sz2=ret[i].size();
2557 PyObject *ret1Py=PyList_New(sz2);
2558 for(std::size_t j=0;j<sz2;j++)
2560 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2563 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2565 PyList_SetItem(retPy,i,ret1Py);
2570 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2572 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2573 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2574 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2575 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2576 if(ret2.size()!=ret.size())
2578 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2579 throw INTERP_KERNEL::Exception(oss.str().c_str());
2581 std::size_t sz=ret.size();
2582 PyObject *retPy=PyList_New(sz);
2583 for(std::size_t i=0;i<sz;i++)
2585 std::size_t sz2=ret[i].size();
2586 PyObject *ret0Py=PyTuple_New(2);
2587 PyObject *ret1Py=PyList_New(sz2);
2588 for(std::size_t j=0;j<sz2;j++)
2590 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2593 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2595 PyTuple_SetItem(ret0Py,0,ret1Py);
2596 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2597 PyList_SetItem(retPy,i,ret0Py);
2604 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2607 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2608 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2609 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2611 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2612 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2613 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2614 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2615 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2617 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2618 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2619 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2622 MEDFileFieldMultiTS()
2624 return MEDFileFieldMultiTS::New();
2627 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2629 return MEDFileFieldMultiTS::New(fileName,loadAll);
2632 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2634 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2637 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2639 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2640 std::size_t sz(tmp.size());
2641 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2642 for(std::size_t i=0;i<sz;i++)
2644 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2645 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2647 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2650 std::string __str__() const throw(INTERP_KERNEL::Exception)
2652 return self->simpleRepr();
2655 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2657 DataArrayInt *ret1=0;
2658 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2659 PyObject *ret=PyTuple_New(2);
2660 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2665 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2667 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2668 std::vector< std::vector<TypeOfField> > typesF;
2669 std::vector< std::vector<std::string> > pfls;
2670 std::vector< std::vector<std::string> > locs;
2671 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2673 PyObject *ret2=PyList_New(sz);
2674 for(int i=0;i<sz;i++)
2676 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2677 const std::vector<TypeOfField>& typesFI=typesF[i];
2678 const std::vector<std::string>& pflsI=pfls[i];
2679 const std::vector<std::string>& locsI=locs[i];
2680 PyObject *elt=PyTuple_New(2);
2681 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2682 int sz2=ret[i].size();
2683 PyObject *elt2=PyList_New(sz2);
2684 for(int j=0;j<sz2;j++)
2686 PyObject *elt3=PyTuple_New(4);
2687 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2688 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2689 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2690 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2691 PyList_SetItem(elt2,j,elt3);
2693 PyTuple_SetItem(elt,1,elt2);
2694 PyList_SetItem(ret2,i,elt);
2698 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2700 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2706 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2708 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2709 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2712 PyObject *ret=PyTuple_New(2);
2713 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2714 std::size_t sz=elt1Cpp.size();
2715 PyObject *elt=PyList_New(sz);
2716 for(std::size_t i=0;i<sz;i++)
2718 PyObject *elt1=PyTuple_New(2);
2719 PyObject *elt2=PyTuple_New(2);
2720 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2721 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2722 PyObject *elt3=PyTuple_New(2);
2723 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2724 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2725 PyTuple_SetItem(elt1,0,elt2);
2726 PyTuple_SetItem(elt1,1,elt3);
2727 PyList_SetItem(elt,i,elt1);
2729 PyTuple_SetItem(ret,1,elt);
2735 class MEDFileFieldsIterator
2740 PyObject *next() throw(INTERP_KERNEL::Exception)
2742 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2744 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2747 PyErr_SetString(PyExc_StopIteration,"No more data.");
2754 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2757 static MEDFileIntFieldMultiTS *New();
2758 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2759 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2761 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2762 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2763 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2766 MEDFileIntFieldMultiTS()
2768 return MEDFileIntFieldMultiTS::New();
2771 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2773 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2776 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2778 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2781 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2783 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2784 std::size_t sz(tmp.size());
2785 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2786 for(std::size_t i=0;i<sz;i++)
2788 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2789 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2791 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2794 std::string __str__() const throw(INTERP_KERNEL::Exception)
2796 return self->simpleRepr();
2799 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2801 DataArrayInt *ret1=0;
2802 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2803 PyObject *ret=PyTuple_New(2);
2804 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2805 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2811 DataArrayInt *ret1=0;
2812 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2813 PyObject *ret=PyTuple_New(2);
2814 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2821 DataArrayInt *ret1=0;
2822 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2823 PyObject *ret=PyTuple_New(2);
2824 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2825 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2829 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2831 DataArrayInt *ret1=0;
2832 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2833 PyObject *ret=PyTuple_New(2);
2834 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2835 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2841 DataArrayInt *ret1=0;
2842 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2843 PyObject *ret=PyTuple_New(2);
2844 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2845 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2849 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2851 DataArrayInt *ret1=0;
2852 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2853 PyObject *ret=PyTuple_New(2);
2854 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2855 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2859 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2861 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2869 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2872 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2873 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2874 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2875 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2876 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2877 void loadArrays() throw(INTERP_KERNEL::Exception);
2878 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2879 void unloadArrays() throw(INTERP_KERNEL::Exception);
2880 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2881 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2882 int getNumberOfFields() const;
2883 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2884 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2886 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2887 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2888 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2889 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2890 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2891 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2892 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2893 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2894 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2899 return MEDFileFields::New();
2902 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2904 return MEDFileFields::New(fileName,loadAll);
2907 std::string __str__() const throw(INTERP_KERNEL::Exception)
2909 return self->simpleRepr();
2912 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2914 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2915 std::size_t sz(tmp.size());
2916 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2917 for(std::size_t i=0;i<sz;i++)
2919 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2920 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2922 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2925 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2928 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2929 PyObject *ret=PyTuple_New(2);
2930 PyObject *ret_0=PyList_New(ret0.size());
2932 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2934 PyObject *elt=PyTuple_New(2);
2935 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2936 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2937 PyList_SetItem(ret_0,rk,elt);
2939 PyTuple_SetItem(ret,0,ret_0);
2940 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2941 PyTuple_SetItem(ret,1,ret_1);
2945 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2947 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2948 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2951 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2953 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2954 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2957 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2959 if(obj && PyList_Check(obj))
2961 int sz=PyList_Size(obj);
2962 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2963 int *pt=da->getPointer();
2964 for(int i=0;i<sz;i++,pt++)
2966 PyObject *elt1=PyList_GetItem(obj,i);
2967 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2969 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2972 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2975 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2977 self->setFieldAtPos(obj,field);
2981 int __len__() const throw(INTERP_KERNEL::Exception)
2983 return self->getNumberOfFields();
2986 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2988 return self->iterator();
2991 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2993 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2994 return self->changeMeshNames(modifTab);
2997 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2999 if(elt0 && PyInt_Check(elt0))
3001 return PyInt_AS_LONG(elt0);
3003 else if(elt0 && PyString_Check(elt0))
3004 return self->getPosFromFieldName(PyString_AsString(elt0));
3006 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3009 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3011 if(PyList_Check(elts))
3013 int sz=PyList_Size(elts);
3014 std::vector<int> ret(sz);
3015 for(int i=0;i<sz;i++)
3017 PyObject *elt=PyList_GetItem(elts,i);
3018 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3024 std::vector<int> ret(1);
3025 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3030 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3032 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3033 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3034 self->pushFields(tmp);
3037 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3039 if(elts && PySlice_Check(elts))
3041 Py_ssize_t strt=2,stp=2,step=2;
3042 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3043 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3044 self->destroyFieldsAtPos2(strt,stp,step);
3048 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3049 if(!idsToRemove.empty())
3050 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3056 class MEDFileParameter1TS : public RefCountObject
3059 void setIteration(int it);
3060 int getIteration() const;
3061 void setOrder(int order);
3062 int getOrder() const;
3063 void setTimeValue(double time);
3064 void setTime(int dt, int it, double time);
3065 double getTime(int& dt, int& it);
3066 double getTimeValue() const;
3069 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3072 void setValue(double val) throw(INTERP_KERNEL::Exception);
3073 double getValue() const throw(INTERP_KERNEL::Exception);
3074 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3077 std::string __str__() const throw(INTERP_KERNEL::Exception)
3079 return self->simpleRepr();
3084 class MEDFileParameterTinyInfo : public MEDFileWritable
3087 void setDescription(const std::string& name);
3088 std::string getDescription() const;
3089 void setTimeUnit(const std::string& unit);
3090 std::string getTimeUnit() const;
3093 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3096 static MEDFileParameterDouble1TS *New();
3097 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3098 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3099 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3100 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3101 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3102 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3103 std::string getName() const throw(INTERP_KERNEL::Exception);
3104 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3107 MEDFileParameterDouble1TS()
3109 return MEDFileParameterDouble1TS::New();
3112 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3114 return MEDFileParameterDouble1TS::New(fileName);
3117 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3119 return MEDFileParameterDouble1TS::New(fileName,paramName);
3122 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3124 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3127 std::string __str__() const throw(INTERP_KERNEL::Exception)
3129 return self->simpleRepr();
3132 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3135 bool ret0=self->isEqual(other,eps,what);
3136 PyObject *res=PyList_New(2);
3137 PyObject *ret0Py=ret0?Py_True:Py_False;
3139 PyList_SetItem(res,0,ret0Py);
3140 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3146 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3149 static MEDFileParameterMultiTS *New();
3150 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3151 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3152 std::string getName() const;
3153 void setName(const std::string& name);
3154 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3155 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3156 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3157 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3158 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3159 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3160 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3161 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3164 MEDFileParameterMultiTS()
3166 return MEDFileParameterMultiTS::New();
3169 MEDFileParameterMultiTS(const std::string& fileName)
3171 return MEDFileParameterMultiTS::New(fileName);
3174 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3176 return MEDFileParameterMultiTS::New(fileName,paramName);
3179 std::string __str__() const throw(INTERP_KERNEL::Exception)
3181 return self->simpleRepr();
3184 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3187 bool ret0=self->isEqual(other,eps,what);
3188 PyObject *res=PyList_New(2);
3189 PyObject *ret0Py=ret0?Py_True:Py_False;
3191 PyList_SetItem(res,0,ret0Py);
3192 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3196 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3200 std::vector<int> pos2;
3201 DataArrayInt *pos3=0;
3202 DataArrayIntTuple *pos4=0;
3203 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3208 self->eraseTimeStepIds(&pos1,&pos1+1);
3215 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3220 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3224 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3228 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3230 if(elt0 && PyInt_Check(elt0))
3232 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3235 else if(elt0 && PyTuple_Check(elt0))
3237 if(PyTuple_Size(elt0)==2)
3239 PyObject *o0=PyTuple_GetItem(elt0,0);
3240 PyObject *o1=PyTuple_GetItem(elt0,1);
3241 if(PyInt_Check(o0) && PyInt_Check(o1))
3243 int iter=PyInt_AS_LONG(o0);
3244 int order=PyInt_AS_LONG(o1);
3245 return self->getPosOfTimeStep(iter,order);
3248 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 !");
3251 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 !");
3253 else if(elt0 && PyFloat_Check(elt0))
3255 double val=PyFloat_AS_DOUBLE(elt0);
3256 return self->getPosGivenTime(val);
3259 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3262 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3264 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3270 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3272 if(PyList_Check(elts))
3274 int sz=PyList_Size(elts);
3275 std::vector<int> ret(sz);
3276 for(int i=0;i<sz;i++)
3278 PyObject *elt=PyList_GetItem(elts,i);
3279 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3285 std::vector<int> ret(1);
3286 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3291 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3293 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3294 if(!idsToRemove.empty())
3295 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3298 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3300 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3306 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3308 std::vector< std::pair<int,int> > res=self->getIterations();
3309 PyObject *ret=PyList_New(res.size());
3311 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3313 PyObject *elt=PyTuple_New(2);
3314 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3315 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3316 PyList_SetItem(ret,rk,elt);
3321 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3323 std::vector<double> res2;
3324 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3325 PyObject *ret=PyList_New(res.size());
3327 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3329 PyObject *elt=PyTuple_New(3);
3330 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3331 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3332 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3333 PyList_SetItem(ret,rk,elt);
3340 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3343 static MEDFileParameters *New();
3344 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3345 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3346 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3347 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3348 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3349 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3350 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3351 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3352 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3353 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3354 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3359 return MEDFileParameters::New();
3362 MEDFileParameters(const std::string& fileName)
3364 return MEDFileParameters::New(fileName);
3367 std::string __str__() const throw(INTERP_KERNEL::Exception)
3369 return self->simpleRepr();
3372 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3374 if(PyInt_Check(obj))
3376 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3381 else if(PyString_Check(obj))
3383 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3389 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3392 int __len__() const throw(INTERP_KERNEL::Exception)
3394 return self->getNumberOfParams();
3397 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3399 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3405 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3407 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3413 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3416 bool ret0=self->isEqual(other,eps,what);
3417 PyObject *res=PyList_New(2);
3418 PyObject *ret0Py=ret0?Py_True:Py_False;
3420 PyList_SetItem(res,0,ret0Py);
3421 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3427 class MEDFileData : public RefCountObject, public MEDFileWritable
3430 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3431 static MEDFileData *New();
3432 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3433 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3434 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3435 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3436 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3437 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3438 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3440 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3441 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3443 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3446 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3448 return MEDFileData::New(fileName);
3453 return MEDFileData::New();
3456 std::string __str__() const throw(INTERP_KERNEL::Exception)
3458 return self->simpleRepr();
3461 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3463 MEDFileMeshes *ret=self->getMeshes();
3469 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3471 MEDFileParameters *ret=self->getParams();
3477 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3479 MEDFileFields *ret=self->getFields();
3485 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3487 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3488 return self->changeMeshNames(modifTab);
3493 class SauvReader : public RefCountObject
3496 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3497 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3500 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3502 return SauvReader::New(fileName);
3507 class SauvWriter : public RefCountObject
3510 static SauvWriter * New();
3511 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3512 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3513 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3514 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3517 SauvWriter() throw(INTERP_KERNEL::Exception)
3519 return SauvWriter::New();
3526 class MEDFileMeshStruct;
3528 class MEDFileField1TSStructItem
3531 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3534 class MEDFileMeshStruct : public RefCountObject
3537 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3539 ~MEDFileMeshStruct();
3542 class MEDMeshMultiLev : public RefCountObject
3545 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3546 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3552 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3554 DataArrayInt *famIds(0);
3555 bool isWithoutCopy(false);
3556 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3557 PyObject *ret=PyTuple_New(2);
3558 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3560 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3561 PyTuple_SetItem(ret,1,ret1Py);
3565 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3567 DataArrayInt *numIds(0);
3568 bool isWithoutCopy(false);
3569 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3570 PyObject *ret=PyTuple_New(2);
3571 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3574 PyTuple_SetItem(ret,1,ret1Py);
3578 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3580 DataArrayInt *famIds(0);
3581 bool isWithoutCopy(false);
3582 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3583 PyObject *ret=PyTuple_New(2);
3584 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3587 PyTuple_SetItem(ret,1,ret1Py);
3591 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3593 DataArrayInt *numIds(0);
3594 bool isWithoutCopy(false);
3595 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3596 PyObject *ret=PyTuple_New(2);
3597 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3599 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3600 PyTuple_SetItem(ret,1,ret1Py);
3604 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3606 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3607 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3608 PyObject *res(PyList_New(result.size()));
3609 for(int i=0;iL!=result.end(); i++, iL++)
3610 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3616 class MEDUMeshMultiLev : public MEDMeshMultiLev
3619 ~MEDUMeshMultiLev();
3623 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3625 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3626 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3627 PyObject *ret0Py=ncc?Py_True:Py_False;
3629 PyObject *ret=PyTuple_New(7);
3630 PyTuple_SetItem(ret,0,ret0Py);
3631 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3632 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3633 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3634 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3635 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3636 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3642 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3645 ~MEDStructuredMeshMultiLev();
3648 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3651 ~MEDCMeshMultiLev();
3655 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3658 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3659 std::size_t sz(objs.size());
3660 PyObject *ret(PyTuple_New(2));
3661 PyObject *ret0=PyList_New(sz);
3662 for(std::size_t i=0;i<sz;i++)
3663 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3664 PyTuple_SetItem(ret,0,ret0);
3665 PyObject *ret1Py(isInternal?Py_True:Py_False);
3667 PyTuple_SetItem(ret,1,ret1Py);
3673 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3676 ~MEDCurveLinearMeshMultiLev();
3680 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3682 DataArrayDouble *ret0(0);
3683 std::vector<int> ret1;
3685 self->buildVTUArrays(ret0,ret1,ret2);
3686 std::size_t sz(ret1.size());
3687 PyObject *ret=PyTuple_New(3);
3688 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3689 PyObject *ret1Py=PyList_New(sz);
3690 for(std::size_t i=0;i<sz;i++)
3691 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3692 PyTuple_SetItem(ret,1,ret1Py);
3693 PyObject *ret2Py(ret2?Py_True:Py_False);
3695 PyTuple_SetItem(ret,2,ret2Py);
3701 class MEDFileFastCellSupportComparator : public RefCountObject
3704 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3705 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3706 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3707 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3709 ~MEDFileFastCellSupportComparator();
3713 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3715 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3716 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3717 PyObject *res(PyList_New(result.size()));
3718 for(int i=0;iL!=result.end(); i++, iL++)
3719 PyList_SetItem(res,i,PyInt_FromLong(*iL));