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 ParaMEDMEM;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) ParaMEDMEM::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject MEDLoader::ReadUMeshFromFamilies;
79 %newobject MEDLoader::ReadUMeshFromGroups;
80 %newobject MEDLoader::ReadUMeshFromFile;
81 %newobject MEDLoader::ReadMeshFromFile;
82 %newobject MEDLoader::ReadField;
83 %newobject MEDLoader::ReadFieldCell;
84 %newobject MEDLoader::ReadFieldNode;
85 %newobject MEDLoader::ReadFieldGauss;
86 %newobject MEDLoader::ReadFieldGaussNE;
87 %newobject ParaMEDMEM::MEDFileMesh::New;
88 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
89 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
90 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
91 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
92 %newobject ParaMEDMEM::MEDFileMesh::__getitem__;
93 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
95 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
96 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
97 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
98 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
99 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
100 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
101 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject ParaMEDMEM::MEDFileMesh::getEquivalences;
104 %newobject ParaMEDMEM::MEDFileMesh::cartesianize;
105 %newobject ParaMEDMEM::MEDFileData::getJoints;
106 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::New;
108 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
109 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
110 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
111 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
112 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
113 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
114 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
115 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
116 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
117 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
118 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
119 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
120 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
121 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
122 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
123 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
124 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
125 %newobject ParaMEDMEM::MEDFileUMesh::linearToQuadratic;
126 %newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
127 %newobject ParaMEDMEM::MEDFileCMesh::New;
128 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
129 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
130 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
131 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
132 %newobject ParaMEDMEM::MEDFileMeshes::New;
133 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
134 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
135 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
136 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
137 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
139 %newobject ParaMEDMEM::MEDFileFields::New;
140 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
141 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
142 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
143 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
144 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
145 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
146 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
147 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
148 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
149 %newobject ParaMEDMEM::MEDFileFields::__iter__;
151 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
152 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
153 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
154 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
155 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
156 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
157 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
158 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
159 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
160 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
161 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
162 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
163 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
164 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
165 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
166 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
167 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
168 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
169 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
171 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
172 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
173 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
174 %newobject ParaMEDMEM::MEDFileField1TS::New;
175 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
176 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
177 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
178 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
179 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
180 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
181 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
182 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
183 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
185 %newobject ParaMEDMEM::MEDFileData::New;
186 %newobject ParaMEDMEM::MEDFileData::deepCpy;
187 %newobject ParaMEDMEM::MEDFileData::getMeshes;
188 %newobject ParaMEDMEM::MEDFileData::getFields;
189 %newobject ParaMEDMEM::MEDFileData::getParams;
191 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
192 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
193 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
194 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
195 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
196 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
197 %newobject ParaMEDMEM::MEDFileParameters::New;
198 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
199 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
200 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
201 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
203 %newobject ParaMEDMEM::MEDFileJointCorrespondence::New;
204 %newobject ParaMEDMEM::MEDFileJointCorrespondence::deepCpy;
205 %newobject ParaMEDMEM::MEDFileJointCorrespondence::shallowCpy;
206 %newobject ParaMEDMEM::MEDFileJointOneStep::New;
207 %newobject ParaMEDMEM::MEDFileJointOneStep::deepCpy;
208 %newobject ParaMEDMEM::MEDFileJointOneStep::shallowCpy;
209 %newobject ParaMEDMEM::MEDFileJoint::New;
210 %newobject ParaMEDMEM::MEDFileJoint::deepCpy;
211 %newobject ParaMEDMEM::MEDFileJoint::shallowCpy;
212 %newobject ParaMEDMEM::MEDFileJoints::New;
213 %newobject ParaMEDMEM::MEDFileJoints::deepCpy;
214 %newobject ParaMEDMEM::MEDFileJoints::getJointAtPos;
215 %newobject ParaMEDMEM::MEDFileJoints::getJointWithName;
216 %newobject ParaMEDMEM::MEDFileJoints::__getitem__;
217 %newobject ParaMEDMEM::MEDFileEquivalences::getEquivalence;
218 %newobject ParaMEDMEM::MEDFileEquivalences::getEquivalenceWithName;
219 %newobject ParaMEDMEM::MEDFileEquivalences::appendEmptyEquivalenceWithName;
220 %newobject ParaMEDMEM::MEDFileEquivalencePair::initCell;
221 %newobject ParaMEDMEM::MEDFileEquivalencePair::initNode;
222 %newobject ParaMEDMEM::MEDFileEquivalencePair::getCell;
223 %newobject ParaMEDMEM::MEDFileEquivalencePair::getNode;
224 %newobject ParaMEDMEM::MEDFileEquivalenceData::getArray;
225 %newobject ParaMEDMEM::MEDFileEquivalenceCell::getArray;
227 %newobject ParaMEDMEM::SauvWriter::New;
228 %newobject ParaMEDMEM::SauvReader::New;
229 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
231 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
232 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
233 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
234 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
235 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
237 %feature("unref") MEDFileMesh "$this->decrRef();"
238 %feature("unref") MEDFileUMesh "$this->decrRef();"
239 %feature("unref") MEDFileCMesh "$this->decrRef();"
240 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
241 %feature("unref") MEDFileMeshes "$this->decrRef();"
242 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
243 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
244 %feature("unref") MEDFileField1TS "$this->decrRef();"
245 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
246 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
247 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
248 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
249 %feature("unref") MEDFileFields "$this->decrRef();"
250 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
251 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
252 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
253 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
254 %feature("unref") MEDFileParameters "$this->decrRef();"
255 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
256 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
257 %feature("unref") MEDFileJoint "$this->decrRef();"
258 %feature("unref") MEDFileJoints "$this->decrRef();"
259 %feature("unref") MEDFileEquivalences "$this->decrRef();"
260 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
261 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
262 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
263 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
264 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
265 %feature("unref") MEDFileData "$this->decrRef();"
266 %feature("unref") SauvReader "$this->decrRef();"
267 %feature("unref") SauvWriter "$this->decrRef();"
268 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
269 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
270 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
271 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
272 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
273 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
278 static bool HasXDR();
279 static std::string MEDFileVersionStr();
280 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
281 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
282 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
283 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
284 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
285 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
286 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
287 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
288 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
289 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
290 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
291 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
292 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
293 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
294 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
295 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
296 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
299 static PyObject *MEDFileVersion()
301 int major,minor,release;
302 MEDLoader::MEDFileVersion(major,minor,release);
303 PyObject *ret(PyTuple_New(3));
304 PyTuple_SetItem(ret,0,SWIG_From_int(major));
305 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
306 PyTuple_SetItem(ret,2,SWIG_From_int(release));
310 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
312 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
313 PyObject *ret=PyList_New(res.size());
315 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
317 PyObject *elt=PyTuple_New(2);
318 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
319 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
320 PyList_SetItem(ret,rk,elt);
325 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
327 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
328 PyObject *ret=PyList_New(res.size());
330 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
332 PyObject *elt=PyTuple_New(3);
333 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
334 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
335 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
336 PyList_SetItem(ret,rk,elt);
341 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
343 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(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);
355 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
357 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
358 PyObject *ret=PyList_New(res.size());
360 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
362 PyObject *elt=PyTuple_New(2);
363 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
364 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
365 PyList_SetItem(ret,rk,elt);
369 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
371 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
372 PyObject *ret=PyList_New(res.size());
374 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
376 PyObject *elt=PyTuple_New(2);
377 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
378 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
379 PyList_SetItem(ret,rk,elt);
383 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
385 int meshDim,spaceDim,numberOfNodes;
386 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
387 PyObject *ret=PyTuple_New(4);
388 PyObject *elt0=PyList_New(res.size());
390 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
392 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
394 PyObject *elt1=PyList_New(obj2.size());
395 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
397 PyObject *elt2=PyTuple_New(2);
398 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
399 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
400 PyList_SetItem(elt1,j,elt2);
402 PyList_SetItem(elt0,i,elt1);
404 PyTuple_SetItem(ret,0,elt0);
405 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
406 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
407 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
410 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
411 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
413 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
414 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
415 return convertFieldDoubleVecToPy(res);
417 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
419 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
420 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
421 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
423 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
425 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
426 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
427 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
429 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
431 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
432 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
433 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
435 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
437 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
439 PyObject *ret=PyList_New(size);
440 for(int i=0;i<size;i++)
441 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
444 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
446 std::vector<std::string> grps;
447 converPyListToVecString(li,grps);
448 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
450 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
452 std::vector<std::string> fams;
453 converPyListToVecString(li,fams);
454 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
457 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
458 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
459 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
460 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
461 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
462 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
463 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
464 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
465 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
466 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
467 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
468 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
469 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
470 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
471 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
472 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
477 class MEDFileWritable
480 void copyOptionsFrom(const MEDFileWritable& other) const;
481 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
482 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
483 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
484 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
487 class MEDFileMeshReadSelector
490 MEDFileMeshReadSelector();
491 MEDFileMeshReadSelector(unsigned int code);
492 unsigned int getCode() const;
493 void setCode(unsigned int newCode);
494 bool isCellFamilyFieldReading() const;
495 bool isNodeFamilyFieldReading() const;
496 bool isCellNameFieldReading() const;
497 bool isNodeNameFieldReading() const;
498 bool isCellNumFieldReading() const;
499 bool isNodeNumFieldReading() const;
500 void setCellFamilyFieldReading(bool b);
501 void setNodeFamilyFieldReading(bool b);
502 void setCellNameFieldReading(bool b);
503 void setNodeNameFieldReading(bool b);
504 void setCellNumFieldReading(bool b);
505 void setNodeNumFieldReading(bool b);
508 std::string __str__() const throw(INTERP_KERNEL::Exception)
510 std::ostringstream oss;
515 std::string __repr__() const throw(INTERP_KERNEL::Exception)
517 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
523 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
526 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
527 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
528 throw(INTERP_KERNEL::Exception);
529 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
530 INTERP_KERNEL::NormalizedCellType loc_geo_type,
531 INTERP_KERNEL::NormalizedCellType rem_geo_type)
532 throw(INTERP_KERNEL::Exception);
533 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
534 MEDFileJointCorrespondence *deepCpy() const;
535 MEDFileJointCorrespondence *shallowCpy() const;
536 void setIsNodal(bool isNodal);
537 bool getIsNodal() const;
538 bool isEqual(const MEDFileJointCorrespondence *other) const;
539 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
540 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
541 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
542 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
543 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
544 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
545 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);
546 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
549 MEDFileJointCorrespondence()
551 return MEDFileJointCorrespondence::New();
553 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
555 return MEDFileJointCorrespondence::New(correspondence);
557 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
558 INTERP_KERNEL::NormalizedCellType loc_geo_type,
559 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
561 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
564 std::string __str__() const throw(INTERP_KERNEL::Exception)
566 return self->simpleRepr();
571 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
574 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
575 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
576 MEDFileJointOneStep *deepCpy() const;
577 MEDFileJointOneStep *shallowCpy() const;
578 bool isEqual(const MEDFileJointOneStep *other) const;
579 void setOrder(int order);
580 int getOrder() const;
581 void setIteration(int it);
582 int getIteration() const;
583 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
584 int getNumberOfCorrespondences() const;
585 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
586 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
587 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
590 MEDFileJointOneStep()
592 return MEDFileJointOneStep::New();
595 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
597 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
600 std::string __str__() const throw(INTERP_KERNEL::Exception)
602 return self->simpleRepr();
607 class MEDFileJoint : public RefCountObject, public MEDFileWritable
610 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
611 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
612 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
613 MEDFileJoint *deepCpy() const;
614 MEDFileJoint *shallowCpy() const;
615 bool isEqual(const MEDFileJoint *other) const;
616 void setLocalMeshName(const std::string& name);
617 std::string getLocalMeshName() const;
618 void setRemoteMeshName(const std::string& name);
619 std::string getRemoteMeshName() const;
620 void setDescription(const std::string& name);
621 std::string getDescription() const;
622 void setJointName(const std::string& name);
623 std::string getJointName() const;
624 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
625 void setDomainNumber(const int& number);
626 int getDomainNumber() const;
627 void pushStep(MEDFileJointOneStep* step);
628 int getNumberOfSteps() const;
629 MEDFileJointOneStep *getStepAtPos(int i) const;
630 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
631 std::string simpleRepr() const;
636 return MEDFileJoint::New();
639 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
641 return MEDFileJoint::New(fileName,mName,num);
644 std::string __str__() const throw(INTERP_KERNEL::Exception)
646 return self->simpleRepr();
651 class MEDFileJoints : public RefCountObject, public MEDFileWritable
654 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
655 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
656 MEDFileJoints *deepCpy() const;
657 std::string simpleRepr() const;
658 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
659 std::string getMeshName() const;
660 int getNumberOfJoints() const;
661 std::vector<std::string> getJointsNames() const;
662 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
663 void resize(int newSize) throw(INTERP_KERNEL::Exception);
664 void pushJoint(MEDFileJoint *joint);
665 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
666 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
671 return MEDFileJoints::New();
674 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
676 return MEDFileJoints::New(fileName,meshName);
679 std::string __str__() const throw(INTERP_KERNEL::Exception)
681 return self->simpleRepr();
684 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
688 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
693 else if(PyString_Check(obj))
695 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
701 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
704 int __len__() const throw(INTERP_KERNEL::Exception)
706 return self->getNumberOfJoints();
709 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
711 MEDFileJoint *ret=self->getJointAtPos(i);
717 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
719 MEDFileJoint *ret=self->getJointWithName(paramName);
727 class MEDFileEquivalenceBase : public RefCountObject
730 MEDFileEquivalenceBase();
733 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
736 MEDFileEquivalenceData();
738 void setArray(DataArrayInt *data);
741 DataArrayInt *getArray()
743 DataArrayInt *ret(self->getArray());
744 if(ret) ret->incrRef();
750 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
753 MEDFileEquivalenceNode();
756 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
759 MEDFileEquivalenceCell();
762 std::size_t size() const;
763 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
764 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
767 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
769 DataArrayInt *ret(self->getArray(type));
770 if(ret) ret->incrRef();
774 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
776 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
777 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
778 PyObject *res=PyList_New(result.size());
779 for(int i=0;iL!=result.end(); i++, iL++)
780 PyList_SetItem(res,i,PyInt_FromLong(*iL));
786 class MEDFileEquivalencePair : public RefCountObject
789 MEDFileEquivalencePair();
791 std::string getName() const;
792 void setName(const std::string& name);
793 std::string getDescription() const;
794 void setDescription(const std::string& descr);
795 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
798 MEDFileEquivalenceCell *initCell()
800 MEDFileEquivalenceCell *ret(self->initCell());
801 if(ret) ret->incrRef();
805 MEDFileEquivalenceNode *initNode()
807 MEDFileEquivalenceNode *ret(self->initNode());
808 if(ret) ret->incrRef();
812 MEDFileEquivalenceCell *getCell()
814 MEDFileEquivalenceCell *ret(self->getCell());
815 if(ret) ret->incrRef();
819 MEDFileEquivalenceNode *getNode()
821 MEDFileEquivalenceNode *ret(self->getNode());
822 if(ret) ret->incrRef();
828 class MEDFileEquivalences : public RefCountObject
831 MEDFileEquivalences();
834 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
835 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
836 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
840 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
842 MEDFileEquivalencePair *ret(self->getEquivalence(i));
843 if(ret) ret->incrRef();
846 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
848 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
849 if(ret) ret->incrRef();
853 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
855 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
856 if(ret) ret->incrRef();
862 class MEDFileMesh : public RefCountObject, public MEDFileWritable
865 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
866 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
867 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
868 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
869 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
870 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
871 void setName(const std::string& name);
872 std::string getName();
873 std::string getUnivName() const;
874 bool getUnivNameWrStatus() const;
875 void setUnivNameWrStatus(bool newStatus);
876 void setDescription(const std::string& name);
877 std::string getDescription() const;
878 void setOrder(int order);
879 int getOrder() const;
880 void setIteration(int it);
882 void setTimeValue(double time);
883 void setTime(int dt, int it, double time);
884 double getTimeValue() const;
885 void setTimeUnit(const std::string& unit);
886 std::string getTimeUnit() const;
887 void setAxType(MEDCouplingAxisType at);
888 MEDCouplingAxisType getAxType() const;
889 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
890 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
891 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
892 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
893 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
894 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
895 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
896 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
897 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
898 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
899 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
900 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
901 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
902 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
903 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
905 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
906 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
907 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
908 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
909 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
910 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
911 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
912 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
913 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
914 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
915 void clearGrpMap() throw(INTERP_KERNEL::Exception);
916 void clearFamMap() throw(INTERP_KERNEL::Exception);
917 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
918 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
919 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
920 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
921 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
922 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
923 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
924 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
925 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
926 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
927 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
928 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
929 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
930 static std::string GetMagicFamilyStr();
931 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
932 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
933 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
934 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
935 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
936 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
937 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
938 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
939 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
940 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
941 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
942 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
943 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
944 void setFamilyInfo(const std::map<std::string,int>& info);
945 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
946 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
947 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
948 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
949 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
950 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
951 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
952 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
953 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
954 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
955 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
956 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
957 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
958 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
959 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
960 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
961 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
962 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
963 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
964 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
965 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
967 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
968 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
969 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
970 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
971 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
972 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
973 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
974 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
975 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
976 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
977 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
978 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
979 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
980 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
981 int getNumberOfJoints();
982 MEDFileJoints *getJoints();
983 void setJoints( MEDFileJoints* joints );
984 void initializeEquivalences();
985 void killEquivalences();
988 std::string __str__() const throw(INTERP_KERNEL::Exception)
990 return self->simpleRepr();
993 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
995 return self->getGenMeshAtLevel(meshDimRelToMaxExt,false);
998 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1001 double tmp0=self->getTime(tmp1,tmp2);
1002 PyObject *res = PyList_New(3);
1003 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1004 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1005 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1009 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1012 bool ret0=self->isEqual(other,eps,what);
1013 PyObject *res=PyList_New(2);
1014 PyObject *ret0Py=ret0?Py_True:Py_False;
1016 PyList_SetItem(res,0,ret0Py);
1017 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1021 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1023 std::vector<const DataArrayInt *> grps;
1024 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
1025 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1028 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1031 bool ret0=self->areFamsEqual(other,what);
1032 PyObject *res=PyList_New(2);
1033 PyObject *ret0Py=ret0?Py_True:Py_False;
1035 PyList_SetItem(res,0,ret0Py);
1036 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1040 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1043 bool ret0=self->areGrpsEqual(other,what);
1044 PyObject *res=PyList_New(2);
1045 PyObject *ret0Py=ret0?Py_True:Py_False;
1047 PyList_SetItem(res,0,ret0Py);
1048 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1052 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1054 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1055 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1056 PyObject *res=PyList_New(result.size());
1057 for(int i=0;iL!=result.end(); i++, iL++)
1058 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1062 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1064 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1065 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1066 PyObject *res=PyList_New(result.size());
1067 for(int i=0;iL!=result.end(); i++, iL++)
1068 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1072 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1074 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1077 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1080 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1082 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1085 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1088 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1090 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1093 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1096 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1098 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1101 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1104 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1106 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1109 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1112 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1115 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1116 PyObject *ret=PyTuple_New(2);
1117 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1118 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1122 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1124 DataArrayInt *ret3=0;
1125 std::vector<int> ret1,ret2;
1126 bool ret0=self->unPolyze(ret1,ret2,ret3);
1127 PyObject *ret=PyTuple_New(4);
1128 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1130 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1131 for(int j=0;j<(int)ret1.size()/3;j++)
1133 PyObject *retLev2=PyList_New(3);
1134 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1135 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1136 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1137 PyList_SetItem(retLev1_0,j,retLev2);
1139 PyTuple_SetItem(ret,1,retLev1_0);
1141 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1142 for(int j=0;j<(int)ret2.size()/3;j++)
1144 PyObject *retLev2=PyList_New(3);
1145 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1146 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1147 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1148 PyList_SetItem(retLev1_1,j,retLev2);
1150 PyTuple_SetItem(ret,2,retLev1_1);
1152 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1156 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1158 MEDFileEquivalences *ret(self->getEquivalences());
1159 if(ret) ret->incrRef();
1165 class MEDFileUMesh : public MEDFileMesh
1168 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1169 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1170 static MEDFileUMesh *New();
1172 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1173 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1175 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1176 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1177 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1178 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1179 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1180 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1181 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1182 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1183 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1184 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1185 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1186 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1187 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1188 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1189 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1190 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1191 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1192 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1193 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1194 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1196 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1197 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1198 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1199 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1200 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1201 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1202 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1203 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1204 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1205 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1206 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1207 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1208 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1211 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1213 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1216 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1218 return MEDFileUMesh::New(fileName,mrs);
1223 return MEDFileUMesh::New();
1227 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1229 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1232 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)
1234 std::vector<int> typesCpp1;
1235 convertPyToNewIntArr3(types,typesCpp1);
1236 std::size_t sz(typesCpp1.size());
1237 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1238 for(std::size_t ii=0;ii<sz;ii++)
1239 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1240 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1243 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1244 {// put an empty dict in input to say to __new__ to call __init__...
1245 PyObject *ret(PyTuple_New(1));
1246 PyObject *ret0(PyDict_New());
1247 PyTuple_SetItem(ret,0,ret0);
1251 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1253 std::vector<double> a0;
1254 std::vector<int> a1;
1255 std::vector<std::string> a2;
1256 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1257 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1258 self->serialize(a0,a1,a2,a3,a4);
1259 PyObject *ret(PyTuple_New(5));
1260 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1261 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1263 PyObject *ret2(PyList_New(sz));
1264 for(int i=0;i<sz;i++)
1265 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1266 PyTuple_SetItem(ret,2,ret2);
1268 PyObject *ret3(PyList_New(sz));
1269 for(int i=0;i<sz;i++)
1271 DataArrayInt *elt(a3[i]);
1274 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1276 PyTuple_SetItem(ret,3,ret3);
1277 DataArrayDouble *ret4(a4);
1280 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1284 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1286 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1287 if(!PyTuple_Check(inp))
1288 throw INTERP_KERNEL::Exception(MSG);
1289 int sz(PyTuple_Size(inp));
1291 throw INTERP_KERNEL::Exception(MSG);
1292 std::vector<double> a0;
1293 std::vector<int> a1;
1294 std::vector<std::string> a2;
1295 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1296 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1298 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1300 fillArrayWithPyListDbl3(a0py,tmp,a0);
1301 convertPyToNewIntArr3(a1py,a1);
1302 fillStringVector(a2py,a2);
1304 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1306 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1307 if(!SWIG_IsOK(status))
1308 throw INTERP_KERNEL::Exception(MSG);
1309 a4=reinterpret_cast<DataArrayDouble *>(argp);
1310 if((DataArrayDouble *)a4)
1313 std::vector< DataArrayInt * > a3Tmp;
1314 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1315 std::size_t sz(a3Tmp.size());
1317 for(std::size_t i=0;i<sz;i++)
1321 a3Tmp[i]->incrRef();
1323 self->unserialize(a0,a1,a2,a3,a4);
1327 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1330 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1331 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1334 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1337 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1340 self->setMeshAtLevel(meshDimRelToMax,m1);
1343 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1346 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1348 self->removeMeshAtLevel(meshDimRelToMax);
1351 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1353 std::vector<const MEDCouplingUMesh *> ms;
1354 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1355 self->setMeshes(ms,renum);
1358 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1360 std::vector<const MEDCouplingUMesh *> ms;
1361 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1362 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1365 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1367 std::vector<const MEDCouplingUMesh *> ms;
1368 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1369 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1372 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1374 DataArrayDouble *ret=self->getCoords();
1380 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1382 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1385 return const_cast<PartDefinition *>(ret);
1388 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1390 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1391 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1392 PyObject *ret=PyTuple_New(3);
1393 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1394 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1395 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1399 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1401 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1407 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1409 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1410 std::size_t sz(tmp.size());
1411 PyObject *ret=PyList_New(sz);
1412 for(std::size_t i=0;i<sz;i++)
1416 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1423 class MEDFileStructuredMesh : public MEDFileMesh
1428 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1430 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1438 class MEDFileCMesh : public MEDFileStructuredMesh
1441 static MEDFileCMesh *New();
1442 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1443 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1444 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1445 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1450 return MEDFileCMesh::New();
1453 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1455 return MEDFileCMesh::New(fileName,mrs);
1458 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1460 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1463 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1465 const MEDCouplingCMesh *tmp=self->getMesh();
1468 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1473 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1476 static MEDFileCurveLinearMesh *New();
1477 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1478 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1479 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1482 MEDFileCurveLinearMesh()
1484 return MEDFileCurveLinearMesh::New();
1487 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1489 return MEDFileCurveLinearMesh::New(fileName,mrs);
1492 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1494 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1497 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1499 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1502 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1507 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1510 static MEDFileMeshMultiTS *New();
1511 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1512 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1513 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1514 std::string getName() const throw(INTERP_KERNEL::Exception);
1515 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1516 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1517 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1520 MEDFileMeshMultiTS()
1522 return MEDFileMeshMultiTS::New();
1525 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1527 return MEDFileMeshMultiTS::New(fileName);
1530 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1532 return MEDFileMeshMultiTS::New(fileName,mName);
1535 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1537 MEDFileMesh *ret=self->getOneTimeStep();
1545 class MEDFileMeshesIterator
1550 PyObject *next() throw(INTERP_KERNEL::Exception)
1552 MEDFileMesh *ret=self->nextt();
1556 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1560 PyErr_SetString(PyExc_StopIteration,"No more data.");
1567 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1570 static MEDFileMeshes *New();
1571 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1572 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1573 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1574 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1575 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1577 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1578 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1579 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1580 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1581 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1586 return MEDFileMeshes::New();
1589 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1591 return MEDFileMeshes::New(fileName);
1594 std::string __str__() const throw(INTERP_KERNEL::Exception)
1596 return self->simpleRepr();
1599 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1601 if(PyInt_Check(obj))
1603 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1608 else if(PyString_Check(obj))
1610 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1616 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1619 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1621 self->setMeshAtPos(obj,mesh);
1625 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1627 return self->iterator();
1630 int __len__() const throw(INTERP_KERNEL::Exception)
1632 return self->getNumberOfMeshes();
1635 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1637 MEDFileMesh *ret=self->getMeshAtPos(i);
1642 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1644 MEDFileMesh *ret=self->getMeshWithName(mname);
1652 class MEDFileFieldLoc : public RefCountObject
1655 std::string getName() const;
1656 int getDimension() const;
1657 int getNumberOfGaussPoints() const;
1658 int getNumberOfPointsInCells() const;
1659 const std::vector<double>& getRefCoords() const;
1660 const std::vector<double>& getGaussCoords() const;
1661 const std::vector<double>& getGaussWeights() const;
1662 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1665 std::string __str__() const throw(INTERP_KERNEL::Exception)
1667 return self->repr();
1672 class MEDFileFieldGlobsReal
1675 void resetContent();
1676 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1677 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1678 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1679 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1680 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1681 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1682 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1683 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1684 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1685 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1686 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1687 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1688 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1689 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1690 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1691 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1692 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1693 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1694 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1695 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1696 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1697 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1698 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1699 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1700 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1701 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1704 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1706 const DataArrayInt *ret=self->getProfile(pflName);
1709 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1712 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1714 const DataArrayInt *ret=self->getProfileFromId(pflId);
1717 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1720 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1722 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1725 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1728 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1730 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1733 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1736 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1738 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1739 return convertVecPairVecStToPy(ret);
1742 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1744 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1745 return convertVecPairVecStToPy(ret);
1748 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1750 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1751 self->changePflsNames(v);
1754 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1756 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1757 self->changePflsRefsNamesGen(v);
1760 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1762 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1763 self->changePflsNamesInStruct(v);
1766 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1768 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1769 self->changeLocsNames(v);
1772 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1774 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1775 self->changeLocsRefsNamesGen(v);
1778 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1780 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1781 self->changeLocsNamesInStruct(v);
1784 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1786 std::ostringstream oss;
1787 self->simpleReprGlobs(oss);
1793 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1796 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1797 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1798 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1799 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1800 void loadArrays() throw(INTERP_KERNEL::Exception);
1801 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1802 void unloadArrays() throw(INTERP_KERNEL::Exception);
1803 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1804 int getDimension() const throw(INTERP_KERNEL::Exception);
1805 int getIteration() const throw(INTERP_KERNEL::Exception);
1806 int getOrder() const throw(INTERP_KERNEL::Exception);
1807 std::string getName() throw(INTERP_KERNEL::Exception);
1808 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1809 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1810 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1811 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1812 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1813 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1814 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1815 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1816 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1817 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1818 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1819 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1820 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1821 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1822 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1825 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1828 double tmp0=self->getTime(tmp1,tmp2);
1829 PyObject *res = PyList_New(3);
1830 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1831 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1832 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1836 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1838 std::pair<int,int> res=self->getDtIt();
1839 PyObject *elt=PyTuple_New(2);
1840 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1841 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1845 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1847 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1850 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1852 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1855 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1857 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1858 return self->changeMeshNames(modifTab);
1861 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1863 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1864 PyObject *ret2=PyList_New(ret.size());
1865 for(int i=0;i<(int)ret.size();i++)
1866 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1870 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1872 std::vector<int> ret1;
1873 int ret0=self->getNonEmptyLevels(mname,ret1);
1874 PyObject *elt=PyTuple_New(2);
1875 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1876 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1880 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1882 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1883 std::vector< std::vector<TypeOfField> > typesF;
1884 std::vector< std::vector<std::string> > pfls;
1885 std::vector< std::vector<std::string> > locs;
1886 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1888 PyObject *ret2=PyList_New(sz);
1889 for(int i=0;i<sz;i++)
1891 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1892 const std::vector<TypeOfField>& typesFI=typesF[i];
1893 const std::vector<std::string>& pflsI=pfls[i];
1894 const std::vector<std::string>& locsI=locs[i];
1895 PyObject *elt=PyTuple_New(2);
1896 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1897 int sz2=ret[i].size();
1898 PyObject *elt2=PyList_New(sz2);
1899 for(int j=0;j<sz2;j++)
1901 PyObject *elt3=PyTuple_New(4);
1902 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1903 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));
1904 PyTuple_SetItem(elt3,1,elt4);
1905 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1906 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1907 PyList_SetItem(elt2,j,elt3);
1909 PyTuple_SetItem(elt,1,elt2);
1910 PyList_SetItem(ret2,i,elt);
1915 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1917 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1918 std::size_t sz=ret.size();
1919 PyObject *retPy=PyList_New(sz);
1920 for(std::size_t i=0;i<sz;i++)
1921 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1925 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1927 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1928 std::size_t sz=ret.size();
1929 PyObject *retPy=PyList_New(sz);
1930 for(std::size_t i=0;i<sz;i++)
1931 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1935 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1937 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1938 std::size_t sz=ret.size();
1939 PyObject *retPy=PyList_New(sz);
1940 for(std::size_t i=0;i<sz;i++)
1941 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1947 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1950 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1951 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1952 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1953 static MEDFileField1TS *New();
1954 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1955 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1956 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1957 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1958 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1959 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1961 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1962 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1963 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1964 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1967 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1969 return MEDFileField1TS::New(fileName,loadAll);
1972 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1974 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1977 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1979 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1984 return MEDFileField1TS::New();
1987 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1989 const DataArrayDouble *arr=0;
1991 arr=field->getArray();
1992 self->copyTinyInfoFrom(field,arr);
1995 std::string __str__() const throw(INTERP_KERNEL::Exception)
1997 return self->simpleRepr();
2000 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2002 DataArrayInt *ret1=0;
2003 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2004 PyObject *ret=PyTuple_New(2);
2005 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2006 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2010 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2012 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2013 std::vector< std::vector<TypeOfField> > typesF;
2014 std::vector< std::vector<std::string> > pfls;
2015 std::vector< std::vector<std::string> > locs;
2016 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2018 PyObject *ret2=PyList_New(sz);
2019 for(int i=0;i<sz;i++)
2021 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2022 const std::vector<TypeOfField>& typesFI=typesF[i];
2023 const std::vector<std::string>& pflsI=pfls[i];
2024 const std::vector<std::string>& locsI=locs[i];
2025 PyObject *elt=PyTuple_New(2);
2026 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2027 int sz2=ret[i].size();
2028 PyObject *elt2=PyList_New(sz2);
2029 for(int j=0;j<sz2;j++)
2031 PyObject *elt3=PyTuple_New(4);
2032 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2033 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2034 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2035 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2036 PyList_SetItem(elt2,j,elt3);
2038 PyTuple_SetItem(elt,1,elt2);
2039 PyList_SetItem(ret2,i,elt);
2044 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2046 DataArrayDouble *ret=self->getUndergroundDataArray();
2052 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2054 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2055 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2058 PyObject *ret=PyTuple_New(2);
2059 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2060 std::size_t sz=elt1Cpp.size();
2061 PyObject *elt=PyList_New(sz);
2062 for(std::size_t i=0;i<sz;i++)
2064 PyObject *elt1=PyTuple_New(2);
2065 PyObject *elt2=PyTuple_New(2);
2066 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2067 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2068 PyObject *elt3=PyTuple_New(2);
2069 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2070 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2071 PyTuple_SetItem(elt1,0,elt2);
2072 PyTuple_SetItem(elt1,1,elt3);
2073 PyList_SetItem(elt,i,elt1);
2075 PyTuple_SetItem(ret,1,elt);
2081 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2084 static MEDFileIntField1TS *New();
2085 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2086 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2087 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2088 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2090 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2091 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2094 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2096 return MEDFileIntField1TS::New();
2099 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2101 return MEDFileIntField1TS::New(fileName,loadAll);
2104 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2106 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2109 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2111 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2114 std::string __str__() const throw(INTERP_KERNEL::Exception)
2116 return self->simpleRepr();
2119 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2121 DataArrayInt *ret1=0;
2122 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2123 PyObject *ret=PyTuple_New(2);
2124 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2125 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2129 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2131 DataArrayInt *ret1=0;
2132 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2133 PyObject *ret=PyTuple_New(2);
2134 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2135 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2139 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2141 DataArrayInt *ret1=0;
2142 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2143 PyObject *ret=PyTuple_New(2);
2144 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2145 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2149 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2151 DataArrayInt *ret1=0;
2152 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2153 PyObject *ret=PyTuple_New(2);
2154 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2155 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2159 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2161 DataArrayInt *ret1=0;
2162 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2163 PyObject *ret=PyTuple_New(2);
2164 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2165 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2171 DataArrayInt *ret1=0;
2172 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2173 PyObject *ret=PyTuple_New(2);
2174 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2179 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2181 DataArrayInt *ret=self->getUndergroundDataArray();
2189 class MEDFileAnyTypeFieldMultiTSIterator
2194 PyObject *next() throw(INTERP_KERNEL::Exception)
2196 MEDFileAnyTypeField1TS *ret=self->nextt();
2198 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2201 PyErr_SetString(PyExc_StopIteration,"No more data.");
2208 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2211 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2212 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2213 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2214 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2215 std::string getName() const throw(INTERP_KERNEL::Exception);
2216 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2217 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2218 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2219 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2220 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2221 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2222 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2223 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2224 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2225 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2226 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2227 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2228 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2229 void loadArrays() throw(INTERP_KERNEL::Exception);
2230 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2231 void unloadArrays() throw(INTERP_KERNEL::Exception);
2232 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2234 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2235 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2236 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2237 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2238 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2241 int __len__() const throw(INTERP_KERNEL::Exception)
2243 return self->getNumberOfTS();
2246 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2248 if(elt0 && PyInt_Check(elt0))
2250 int pos=PyInt_AS_LONG(elt0);
2253 else if(elt0 && PyTuple_Check(elt0))
2255 if(PyTuple_Size(elt0)==2)
2257 PyObject *o0=PyTuple_GetItem(elt0,0);
2258 PyObject *o1=PyTuple_GetItem(elt0,1);
2259 if(PyInt_Check(o0) && PyInt_Check(o1))
2261 int iter=PyInt_AS_LONG(o0);
2262 int order=PyInt_AS_LONG(o1);
2263 return self->getPosOfTimeStep(iter,order);
2266 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 !");
2269 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 !");
2271 else if(elt0 && PyFloat_Check(elt0))
2273 double val=PyFloat_AS_DOUBLE(elt0);
2274 return self->getPosGivenTime(val);
2277 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2280 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2282 std::vector< std::pair<int,int> > res=self->getIterations();
2283 PyObject *ret=PyList_New(res.size());
2285 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2287 PyObject *elt=PyTuple_New(2);
2288 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2289 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2290 PyList_SetItem(ret,rk,elt);
2295 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2297 std::vector<double> ret1;
2298 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2299 std::size_t sz=ret.size();
2300 PyObject *ret2=PyList_New(sz);
2301 for(std::size_t i=0;i<sz;i++)
2303 PyObject *elt=PyTuple_New(3);
2304 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2305 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2306 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2307 PyList_SetItem(ret2,i,elt);
2312 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2314 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2315 PyObject *ret2=PyList_New(ret.size());
2316 for(int i=0;i<(int)ret.size();i++)
2318 const std::vector<TypeOfField>& rett=ret[i];
2319 PyObject *ret3=PyList_New(rett.size());
2320 for(int j=0;j<(int)rett.size();j++)
2321 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2322 PyList_SetItem(ret2,i,ret3);
2327 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2329 std::vector<int> ret1;
2330 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2331 PyObject *elt=PyTuple_New(2);
2332 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2333 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2337 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2339 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2340 std::vector< std::vector<TypeOfField> > typesF;
2341 std::vector< std::vector<std::string> > pfls;
2342 std::vector< std::vector<std::string> > locs;
2343 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2345 PyObject *ret2=PyList_New(sz);
2346 for(int i=0;i<sz;i++)
2348 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2349 const std::vector<TypeOfField>& typesFI=typesF[i];
2350 const std::vector<std::string>& pflsI=pfls[i];
2351 const std::vector<std::string>& locsI=locs[i];
2352 PyObject *elt=PyTuple_New(2);
2353 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2354 int sz2=ret[i].size();
2355 PyObject *elt2=PyList_New(sz2);
2356 for(int j=0;j<sz2;j++)
2358 PyObject *elt3=PyTuple_New(4);
2359 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2360 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));
2361 PyTuple_SetItem(elt3,1,elt4);
2362 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2363 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2364 PyList_SetItem(elt2,j,elt3);
2366 PyTuple_SetItem(elt,1,elt2);
2367 PyList_SetItem(ret2,i,elt);
2372 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2374 if(PyList_Check(elts))
2376 int sz=PyList_Size(elts);
2377 std::vector<int> ret(sz);
2378 for(int i=0;i<sz;i++)
2380 PyObject *elt=PyList_GetItem(elts,i);
2381 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2387 std::vector<int> ret(1);
2388 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2393 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2395 if(PySlice_Check(elts))
2397 Py_ssize_t strt=2,stp=2,step=2;
2398 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2399 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2400 self->eraseTimeStepIds2(strt,stp,step);
2404 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2405 if(!idsToRemove.empty())
2406 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2410 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2414 std::vector<int> pos2;
2415 DataArrayInt *pos3=0;
2416 DataArrayIntTuple *pos4=0;
2417 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2422 self->eraseTimeStepIds(&pos1,&pos1+1);
2429 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2434 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2438 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2442 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2444 return self->iterator();
2447 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2449 if(elt0 && PyList_Check(elt0))
2451 int sz=PyList_Size(elt0);
2452 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2453 int *pt=da->getPointer();
2454 for(int i=0;i<sz;i++,pt++)
2456 PyObject *elt1=PyList_GetItem(elt0,i);
2457 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2459 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2461 else if(elt0 && PySlice_Check(elt0))
2463 Py_ssize_t strt=2,stp=2,step=2;
2464 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2465 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2466 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2469 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2472 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2474 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2475 return self->changeMeshNames(modifTab);
2478 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2480 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2481 std::size_t sz=ret.size();
2482 PyObject *retPy=PyList_New(sz);
2483 for(std::size_t i=0;i<sz;i++)
2484 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2488 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2490 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2491 std::size_t sz=ret.size();
2492 PyObject *retPy=PyList_New(sz);
2493 for(std::size_t i=0;i<sz;i++)
2494 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2498 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2500 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2501 std::size_t sz=ret.size();
2502 PyObject *retPy=PyList_New(sz);
2503 for(std::size_t i=0;i<sz;i++)
2504 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2508 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2511 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2512 if(SWIG_IsOK(status))
2514 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2518 std::vector<MEDFileAnyTypeField1TS *> tmp;
2519 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2520 self->pushBackTimeSteps(tmp);
2524 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2526 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2527 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2528 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2529 std::size_t sz=ret.size();
2530 PyObject *retPy=PyList_New(sz);
2531 for(std::size_t i=0;i<sz;i++)
2533 std::size_t sz2=ret[i].size();
2534 PyObject *ret1Py=PyList_New(sz2);
2535 for(std::size_t j=0;j<sz2;j++)
2537 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2540 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2542 PyList_SetItem(retPy,i,ret1Py);
2547 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2549 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2550 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2551 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2552 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2553 if(ret2.size()!=ret.size())
2555 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2556 throw INTERP_KERNEL::Exception(oss.str().c_str());
2558 std::size_t sz=ret.size();
2559 PyObject *retPy=PyList_New(sz);
2560 for(std::size_t i=0;i<sz;i++)
2562 std::size_t sz2=ret[i].size();
2563 PyObject *ret0Py=PyTuple_New(2);
2564 PyObject *ret1Py=PyList_New(sz2);
2565 for(std::size_t j=0;j<sz2;j++)
2567 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2570 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2572 PyTuple_SetItem(ret0Py,0,ret1Py);
2573 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2574 PyList_SetItem(retPy,i,ret0Py);
2581 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2584 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2585 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2586 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2588 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2589 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2590 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2591 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2592 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2594 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2595 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2596 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2599 MEDFileFieldMultiTS()
2601 return MEDFileFieldMultiTS::New();
2604 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2606 return MEDFileFieldMultiTS::New(fileName,loadAll);
2609 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2611 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2614 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2616 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2617 std::size_t sz(tmp.size());
2618 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2619 for(std::size_t i=0;i<sz;i++)
2621 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2622 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2624 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2627 std::string __str__() const throw(INTERP_KERNEL::Exception)
2629 return self->simpleRepr();
2632 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2634 DataArrayInt *ret1=0;
2635 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2636 PyObject *ret=PyTuple_New(2);
2637 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2638 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2642 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2644 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2645 std::vector< std::vector<TypeOfField> > typesF;
2646 std::vector< std::vector<std::string> > pfls;
2647 std::vector< std::vector<std::string> > locs;
2648 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2650 PyObject *ret2=PyList_New(sz);
2651 for(int i=0;i<sz;i++)
2653 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2654 const std::vector<TypeOfField>& typesFI=typesF[i];
2655 const std::vector<std::string>& pflsI=pfls[i];
2656 const std::vector<std::string>& locsI=locs[i];
2657 PyObject *elt=PyTuple_New(2);
2658 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2659 int sz2=ret[i].size();
2660 PyObject *elt2=PyList_New(sz2);
2661 for(int j=0;j<sz2;j++)
2663 PyObject *elt3=PyTuple_New(4);
2664 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2665 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2666 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2667 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2668 PyList_SetItem(elt2,j,elt3);
2670 PyTuple_SetItem(elt,1,elt2);
2671 PyList_SetItem(ret2,i,elt);
2675 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2677 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2683 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2685 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2686 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2689 PyObject *ret=PyTuple_New(2);
2690 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2691 std::size_t sz=elt1Cpp.size();
2692 PyObject *elt=PyList_New(sz);
2693 for(std::size_t i=0;i<sz;i++)
2695 PyObject *elt1=PyTuple_New(2);
2696 PyObject *elt2=PyTuple_New(2);
2697 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2698 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2699 PyObject *elt3=PyTuple_New(2);
2700 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2701 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2702 PyTuple_SetItem(elt1,0,elt2);
2703 PyTuple_SetItem(elt1,1,elt3);
2704 PyList_SetItem(elt,i,elt1);
2706 PyTuple_SetItem(ret,1,elt);
2712 class MEDFileFieldsIterator
2717 PyObject *next() throw(INTERP_KERNEL::Exception)
2719 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2721 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2724 PyErr_SetString(PyExc_StopIteration,"No more data.");
2731 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2734 static MEDFileIntFieldMultiTS *New();
2735 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2736 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2738 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2739 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2740 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2743 MEDFileIntFieldMultiTS()
2745 return MEDFileIntFieldMultiTS::New();
2748 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2750 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2753 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2755 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2758 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2760 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2761 std::size_t sz(tmp.size());
2762 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2763 for(std::size_t i=0;i<sz;i++)
2765 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2766 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2768 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2771 std::string __str__() const throw(INTERP_KERNEL::Exception)
2773 return self->simpleRepr();
2776 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2778 DataArrayInt *ret1=0;
2779 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2780 PyObject *ret=PyTuple_New(2);
2781 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2782 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2786 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2788 DataArrayInt *ret1=0;
2789 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2790 PyObject *ret=PyTuple_New(2);
2791 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2792 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2796 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2798 DataArrayInt *ret1=0;
2799 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2800 PyObject *ret=PyTuple_New(2);
2801 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2802 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2806 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2808 DataArrayInt *ret1=0;
2809 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2810 PyObject *ret=PyTuple_New(2);
2811 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2812 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2816 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2818 DataArrayInt *ret1=0;
2819 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2820 PyObject *ret=PyTuple_New(2);
2821 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2822 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2826 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2828 DataArrayInt *ret1=0;
2829 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2830 PyObject *ret=PyTuple_New(2);
2831 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2832 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2836 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2838 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2846 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2849 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2850 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2851 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2852 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2853 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2854 void loadArrays() throw(INTERP_KERNEL::Exception);
2855 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2856 void unloadArrays() throw(INTERP_KERNEL::Exception);
2857 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2858 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2859 int getNumberOfFields() const;
2860 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2861 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2863 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2864 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2865 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2866 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2867 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2868 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2869 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2870 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2871 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2876 return MEDFileFields::New();
2879 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2881 return MEDFileFields::New(fileName,loadAll);
2884 std::string __str__() const throw(INTERP_KERNEL::Exception)
2886 return self->simpleRepr();
2889 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2891 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2892 std::size_t sz(tmp.size());
2893 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2894 for(std::size_t i=0;i<sz;i++)
2896 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2897 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2899 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2902 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2905 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2906 PyObject *ret=PyTuple_New(2);
2907 PyObject *ret_0=PyList_New(ret0.size());
2909 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2911 PyObject *elt=PyTuple_New(2);
2912 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2913 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2914 PyList_SetItem(ret_0,rk,elt);
2916 PyTuple_SetItem(ret,0,ret_0);
2917 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2918 PyTuple_SetItem(ret,1,ret_1);
2922 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2924 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2925 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2928 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2930 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2931 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2934 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2936 if(obj && PyList_Check(obj))
2938 int sz=PyList_Size(obj);
2939 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2940 int *pt=da->getPointer();
2941 for(int i=0;i<sz;i++,pt++)
2943 PyObject *elt1=PyList_GetItem(obj,i);
2944 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2946 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2949 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2952 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2954 self->setFieldAtPos(obj,field);
2958 int __len__() const throw(INTERP_KERNEL::Exception)
2960 return self->getNumberOfFields();
2963 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2965 return self->iterator();
2968 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2970 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2971 return self->changeMeshNames(modifTab);
2974 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2976 if(elt0 && PyInt_Check(elt0))
2978 return PyInt_AS_LONG(elt0);
2980 else if(elt0 && PyString_Check(elt0))
2981 return self->getPosFromFieldName(PyString_AsString(elt0));
2983 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2986 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2988 if(PyList_Check(elts))
2990 int sz=PyList_Size(elts);
2991 std::vector<int> ret(sz);
2992 for(int i=0;i<sz;i++)
2994 PyObject *elt=PyList_GetItem(elts,i);
2995 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
3001 std::vector<int> ret(1);
3002 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
3007 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3009 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3010 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3011 self->pushFields(tmp);
3014 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3016 if(elts && PySlice_Check(elts))
3018 Py_ssize_t strt=2,stp=2,step=2;
3019 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3020 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3021 self->destroyFieldsAtPos2(strt,stp,step);
3025 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
3026 if(!idsToRemove.empty())
3027 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3033 class MEDFileParameter1TS : public RefCountObject
3036 void setIteration(int it);
3037 int getIteration() const;
3038 void setOrder(int order);
3039 int getOrder() const;
3040 void setTimeValue(double time);
3041 void setTime(int dt, int it, double time);
3042 double getTime(int& dt, int& it);
3043 double getTimeValue() const;
3046 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3049 void setValue(double val) throw(INTERP_KERNEL::Exception);
3050 double getValue() const throw(INTERP_KERNEL::Exception);
3051 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3054 std::string __str__() const throw(INTERP_KERNEL::Exception)
3056 return self->simpleRepr();
3061 class MEDFileParameterTinyInfo : public MEDFileWritable
3064 void setDescription(const std::string& name);
3065 std::string getDescription() const;
3066 void setTimeUnit(const std::string& unit);
3067 std::string getTimeUnit() const;
3070 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3073 static MEDFileParameterDouble1TS *New();
3074 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3075 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3076 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3077 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3078 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3079 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3080 std::string getName() const throw(INTERP_KERNEL::Exception);
3081 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3084 MEDFileParameterDouble1TS()
3086 return MEDFileParameterDouble1TS::New();
3089 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3091 return MEDFileParameterDouble1TS::New(fileName);
3094 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3096 return MEDFileParameterDouble1TS::New(fileName,paramName);
3099 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3101 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3104 std::string __str__() const throw(INTERP_KERNEL::Exception)
3106 return self->simpleRepr();
3109 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3112 bool ret0=self->isEqual(other,eps,what);
3113 PyObject *res=PyList_New(2);
3114 PyObject *ret0Py=ret0?Py_True:Py_False;
3116 PyList_SetItem(res,0,ret0Py);
3117 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3123 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3126 static MEDFileParameterMultiTS *New();
3127 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3128 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3129 std::string getName() const;
3130 void setName(const std::string& name);
3131 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3132 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3133 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3134 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3135 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3136 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3137 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3138 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3141 MEDFileParameterMultiTS()
3143 return MEDFileParameterMultiTS::New();
3146 MEDFileParameterMultiTS(const std::string& fileName)
3148 return MEDFileParameterMultiTS::New(fileName);
3151 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3153 return MEDFileParameterMultiTS::New(fileName,paramName);
3156 std::string __str__() const throw(INTERP_KERNEL::Exception)
3158 return self->simpleRepr();
3161 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3164 bool ret0=self->isEqual(other,eps,what);
3165 PyObject *res=PyList_New(2);
3166 PyObject *ret0Py=ret0?Py_True:Py_False;
3168 PyList_SetItem(res,0,ret0Py);
3169 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3173 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3177 std::vector<int> pos2;
3178 DataArrayInt *pos3=0;
3179 DataArrayIntTuple *pos4=0;
3180 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3185 self->eraseTimeStepIds(&pos1,&pos1+1);
3192 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3197 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3201 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3205 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3207 if(elt0 && PyInt_Check(elt0))
3209 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3212 else if(elt0 && PyTuple_Check(elt0))
3214 if(PyTuple_Size(elt0)==2)
3216 PyObject *o0=PyTuple_GetItem(elt0,0);
3217 PyObject *o1=PyTuple_GetItem(elt0,1);
3218 if(PyInt_Check(o0) && PyInt_Check(o1))
3220 int iter=PyInt_AS_LONG(o0);
3221 int order=PyInt_AS_LONG(o1);
3222 return self->getPosOfTimeStep(iter,order);
3225 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 !");
3228 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 !");
3230 else if(elt0 && PyFloat_Check(elt0))
3232 double val=PyFloat_AS_DOUBLE(elt0);
3233 return self->getPosGivenTime(val);
3236 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3239 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3241 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3247 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3249 if(PyList_Check(elts))
3251 int sz=PyList_Size(elts);
3252 std::vector<int> ret(sz);
3253 for(int i=0;i<sz;i++)
3255 PyObject *elt=PyList_GetItem(elts,i);
3256 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3262 std::vector<int> ret(1);
3263 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3268 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3270 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3271 if(!idsToRemove.empty())
3272 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3275 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3277 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3283 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3285 std::vector< std::pair<int,int> > res=self->getIterations();
3286 PyObject *ret=PyList_New(res.size());
3288 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3290 PyObject *elt=PyTuple_New(2);
3291 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3292 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3293 PyList_SetItem(ret,rk,elt);
3298 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3300 std::vector<double> res2;
3301 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3302 PyObject *ret=PyList_New(res.size());
3304 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3306 PyObject *elt=PyTuple_New(3);
3307 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3308 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3309 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3310 PyList_SetItem(ret,rk,elt);
3317 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3320 static MEDFileParameters *New();
3321 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3322 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3323 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3324 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3325 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3326 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3327 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3328 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3329 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3330 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3331 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3336 return MEDFileParameters::New();
3339 MEDFileParameters(const std::string& fileName)
3341 return MEDFileParameters::New(fileName);
3344 std::string __str__() const throw(INTERP_KERNEL::Exception)
3346 return self->simpleRepr();
3349 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3351 if(PyInt_Check(obj))
3353 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3358 else if(PyString_Check(obj))
3360 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3366 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3369 int __len__() const throw(INTERP_KERNEL::Exception)
3371 return self->getNumberOfParams();
3374 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3376 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3382 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3384 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3390 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3393 bool ret0=self->isEqual(other,eps,what);
3394 PyObject *res=PyList_New(2);
3395 PyObject *ret0Py=ret0?Py_True:Py_False;
3397 PyList_SetItem(res,0,ret0Py);
3398 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3404 class MEDFileData : public RefCountObject, public MEDFileWritable
3407 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3408 static MEDFileData *New();
3409 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3410 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3411 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3412 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3413 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3414 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3415 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3417 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3418 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3420 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3423 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3425 return MEDFileData::New(fileName);
3430 return MEDFileData::New();
3433 std::string __str__() const throw(INTERP_KERNEL::Exception)
3435 return self->simpleRepr();
3438 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3440 MEDFileMeshes *ret=self->getMeshes();
3446 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3448 MEDFileParameters *ret=self->getParams();
3454 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3456 MEDFileFields *ret=self->getFields();
3462 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3464 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3465 return self->changeMeshNames(modifTab);
3470 class SauvReader : public RefCountObject
3473 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3474 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3477 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3479 return SauvReader::New(fileName);
3484 class SauvWriter : public RefCountObject
3487 static SauvWriter * New();
3488 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3489 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3490 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3491 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3494 SauvWriter() throw(INTERP_KERNEL::Exception)
3496 return SauvWriter::New();
3503 class MEDFileMeshStruct;
3505 class MEDFileField1TSStructItem
3508 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3511 class MEDFileMeshStruct : public RefCountObject
3514 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3516 ~MEDFileMeshStruct();
3519 class MEDMeshMultiLev : public RefCountObject
3522 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3523 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3529 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3531 DataArrayInt *famIds(0);
3532 bool isWithoutCopy(false);
3533 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3534 PyObject *ret=PyTuple_New(2);
3535 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3537 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3538 PyTuple_SetItem(ret,1,ret1Py);
3542 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3544 DataArrayInt *numIds(0);
3545 bool isWithoutCopy(false);
3546 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3547 PyObject *ret=PyTuple_New(2);
3548 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3550 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3551 PyTuple_SetItem(ret,1,ret1Py);
3555 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3557 DataArrayInt *famIds(0);
3558 bool isWithoutCopy(false);
3559 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3560 PyObject *ret=PyTuple_New(2);
3561 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3563 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3564 PyTuple_SetItem(ret,1,ret1Py);
3568 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3570 DataArrayInt *numIds(0);
3571 bool isWithoutCopy(false);
3572 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3573 PyObject *ret=PyTuple_New(2);
3574 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3577 PyTuple_SetItem(ret,1,ret1Py);
3581 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3583 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3584 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3585 PyObject *res(PyList_New(result.size()));
3586 for(int i=0;iL!=result.end(); i++, iL++)
3587 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3593 class MEDUMeshMultiLev : public MEDMeshMultiLev
3596 ~MEDUMeshMultiLev();
3600 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3602 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3603 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3604 PyObject *ret0Py=ncc?Py_True:Py_False;
3606 PyObject *ret=PyTuple_New(7);
3607 PyTuple_SetItem(ret,0,ret0Py);
3608 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3609 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3610 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3611 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3612 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3613 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3619 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3622 ~MEDStructuredMeshMultiLev();
3625 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3628 ~MEDCMeshMultiLev();
3632 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3635 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3636 std::size_t sz(objs.size());
3637 PyObject *ret(PyTuple_New(2));
3638 PyObject *ret0=PyList_New(sz);
3639 for(std::size_t i=0;i<sz;i++)
3640 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3641 PyTuple_SetItem(ret,0,ret0);
3642 PyObject *ret1Py(isInternal?Py_True:Py_False);
3644 PyTuple_SetItem(ret,1,ret1Py);
3650 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3653 ~MEDCurveLinearMeshMultiLev();
3657 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3659 DataArrayDouble *ret0(0);
3660 std::vector<int> ret1;
3662 self->buildVTUArrays(ret0,ret1,ret2);
3663 std::size_t sz(ret1.size());
3664 PyObject *ret=PyTuple_New(3);
3665 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3666 PyObject *ret1Py=PyList_New(sz);
3667 for(std::size_t i=0;i<sz;i++)
3668 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3669 PyTuple_SetItem(ret,1,ret1Py);
3670 PyObject *ret2Py(ret2?Py_True:Py_False);
3672 PyTuple_SetItem(ret,2,ret2Py);
3678 class MEDFileFastCellSupportComparator : public RefCountObject
3681 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3682 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3683 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3684 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3686 ~MEDFileFastCellSupportComparator();
3690 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3692 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3693 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3694 PyObject *res(PyList_New(result.size()));
3695 for(int i=0;iL!=result.end(); i++, iL++)
3696 PyList_SetItem(res,i,PyInt_FromLong(*iL));