Diff of /trunk/modellib/py_src/materials.py

revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC revision 148 by jgs, Tue Aug 23 01:24:31 2005 UTC
# Line 1  Line 1
1  # \$Id\$  # \$Id\$
2
3  from escript.modelframe import Model  from escript.modelframe import Model,ParameterSet
4  from escript.util import exp  from escript.util import exp
5  import numarray  import numarray
6
7  class GravityForce(Model):  class GravityForce(ParameterSet):
8         """@brief sets a gravity force of given direction in given domain:         """@brief sets a gravity force of given direction in given domain:
9
10                @param domain (in) - domain of interest                @param domain (in) - domain of interest
# Line 14  class GravityForce(Model): Line 14  class GravityForce(Model):
14
15         """         """
16         def __init__(self,debug=False):         def __init__(self,debug=False):
17             Model.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
18             self.declareParameter(domain=None,             self.declareParameter(domain=None,
19                                   gravity=9.81, \                                   gravity=9.81, \
20                                   density=1., \                                   density=1., \
# Line 29  class GravityForce(Model): Line 29  class GravityForce(Model):
29
30
31
32  class MaterialTable(Model):  class MaterialTable(ParameterSet):
33         """@brief a simple matrial table which allows setting physical parameters of a model         """@brief a simple matrial table which allows setting physical parameters of a model
34
35                @param density (in/out) - density                @param density (in/out) - density
# Line 40  class MaterialTable(Model): Line 40  class MaterialTable(Model):
40
41         """         """
42         def __init__(self,debug=False):         def __init__(self,debug=False):
43             Model.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
44             self.declareParameter(gravity=9.81, \             self.declareParameter(gravity=9.81, \
45                                   density=1., \                                   density=1., \
46                                   heat_capacity=1., \                                   heat_capacity=1., \
47                                   thermal_permabilty=1., \                                   thermal_permabilty=1., \
49
50  class SimpleEarthModel(Model):  class SimpleEarthModel(ParameterSet):
51         """@brief a simple matrial table run convection models:         """@brief a simple matrial table run convection models:
52
53                density=density0*(1-rayleigh_number*(temperature-reference_temperature))                density=density0*(1-rayleigh_number*(temperature-reference_temperature))
# Line 67  class SimpleEarthModel(Model): Line 67  class SimpleEarthModel(Model):
67
68         """         """
69         def __init__(self,debug=False):         def __init__(self,debug=False):
70             Model.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
71             self.declareParameter(reference_temperature=1.,             self.declareParameter(reference_temperature=1.,
72                                   gravity=9.81, \                                   gravity=9.81, \
73                                   density0=1., \                                   density0=1., \

Legend:
 Removed from v.147 changed lines Added in v.148