2 # Copyright (C) 2012-2014 CEA/DEN, EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # This script illustrates the basic features of MEDLoader
22 # (gboulant, 17 nov 2012)
24 filename = "timeseries.med"
25 filepath = os.path.join(os.path.abspath(os.path.dirname(__file__)),filename)
28 from MEDLoader import MEDLoader
29 meshNames = MEDLoader.GetMeshNames(filepath)
33 fieldNames = MEDLoader.GetAllFieldNamesOnMesh(filepath,meshName)
35 fieldName=fieldNames[0]
37 listOfTypes = MEDLoader.GetTypesOfField(filepath,meshName,fieldName)
39 typeOfDiscretization=listOfTypes[0]
41 fieldIterations = MEDLoader.GetFieldIterations(typeOfDiscretization,
47 iteration = fieldIterations[0]
48 iterationNumber = iteration[0]
49 iterationOrder = iteration[1]
53 mesh = MEDLoader.ReadUMeshFromFile(filepath, meshName, dimrestriction)
56 field = MEDLoader.ReadField(typeOfDiscretization,
57 filepath, meshName, dimrestriction,
58 fieldName, iterationNumber, iterationOrder)