Module esys.escript.esysXML
A simple tool to handle parameters for a simulation in easy way.
The idea is that all parameters are stored in a single object in a
hierachical form and can accessed using python's attribute notation. For
instance:
parm.parm2.alpha=814.
parm.parm1.gamma=0.
parm.parm1.dim=2
parm.parm1.tol_v=0.001
parm.parm1.output_file="/tmp/u.%3.3d.dx"
parm.parm1.runFlag=True
parm.parm1.T=1.
parm.parm1.x1=[-1.,2]
parm.parm1.x2=(10.,11)
parm.parm1.x3=(-10.,)
parm.parm1.parm11.gamma1=1.
parm.parm1.parm11.gamma2=2.
parm.parm1.parm11.gamma3=3.
This structure can be stored/defined through an XML file parm.xml:
<?xml version="1.0"?>
<ESyS>
<Component type="Geodynamics">
<Name>parm1</Name>
<Description>
a few examples of parameters
</Description>
<Parameter><Item>gamma</Item><Value>0.</Value></Parameter>
<Parameter type="int"><Item>dim</Item><Value>2</Value></Parameter>
<Parameter type="real"><Item>tol_v</Item><Value>0.001</Value></Parameter>
<Parameter type="string"><Item>output_file</Item><Value>/tmp/u.%3.3d.dx</Value></Parameter>
<Parameter type="bool"><Item>runFlag</Item><Value>true</Value></Parameter>
<Parameter type="real" sequence="single"><Item>T</Item><Value>1.</Value><Value>2</Value></Parameter>
<Parameter type="real" sequence="list"><Item>x1</Item><Value>-1.</Value><Value>2</Value></Parameter>
<Parameter type="real" sequence="tuple"><Item>x2</Item><Value>10</Value><Value>11</Value></Parameter>
<Parameter sequence="tuple"><Item>x3</Item><Value>-10.</Value></Parameter>
<Component>
<Name>parm11</Name>
<Description>
a sub compoment
</Description>
<Parameter><Item>gamma1</Item><Value>1.</Value></Parameter>
<Parameter><Item>gamma2</Item><Value>2.</Value></Parameter>
<Parameter><Item>gamma3</Item><Value>3.</Value></Parameter>
</Component>
<Component type="Geodynamics">
<Name>parm2</Name>
<Description>
another component
</Description>
<Parameter><Item>alpha</Item><Value>0814</Value></Parameter>
</Component>
</ESyS>
| Classes |
ESySParameters |
Is an object to store simulation parameters in the form of a tree and
access their values in an easy form |
| Function Summary |
| |
readESySXMLFile(filename)
Reads an ESyS XML file and returns it as a ESySParameter object. |
| Variable Summary |
str |
__copyright__ = ' Copyright (c) 2006 by ACcESS MNRF\n ...
|
str |
__license__ = 'Licensed under the Open Software License ...
|
readESySXMLFile(filename)
Reads an ESyS XML file and returns it as a ESySParameter object.
-
|
__copyright__
-
- Type:
-
str
- Value:
''' Copyright (c) 2006 by ACcESS MNRF
http://www.access.edu.au
Primary Business: Queensland, Australia'''
|
|
__license__
-
- Type:
-
str
- Value:
'''Licensed under the Open Software License version 3.0
http://www.opensource.org/licenses/osl-3.0.php'''
|
|