-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathMaterial_PYB11.py
More file actions
52 lines (46 loc) · 2.29 KB
/
Material_PYB11.py
File metadata and controls
52 lines (46 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
Spheral Material module.
Provides the interfaces and basic fluid material models.
"""
from PYB11Generator import *
from SpheralCommon import *
from spheralDimensions import *
dims = spheralDimensions()
#-------------------------------------------------------------------------------
# Includes
#-------------------------------------------------------------------------------
PYB11includes += ['"Material/PhysicalConstants.hh"',
'"Material/UnitConversion.hh"',
'"Material/EquationOfState.hh"',
'"Material/GammaLawGas.hh"',
'"Material/PolytropicEquationOfState.hh"',
'"Material/IsothermalEquationOfState.hh"',
'"Material/StiffenedGas.hh"',
'"Field/Field.hh"']
#-------------------------------------------------------------------------------
# Namespaces
#-------------------------------------------------------------------------------
PYB11namespaces = ["Spheral"]
#-------------------------------------------------------------------------------
# Enums
#-------------------------------------------------------------------------------
MaterialPressureMinType = PYB11enum(("PressureFloor", "ZeroPressure"), export_values=True,
doc="Choices for how to apply minimum pressure threshold")
#-------------------------------------------------------------------------------
# Instantiate our types
#-------------------------------------------------------------------------------
from PhysicalConstants import *
from UnitConversion import *
from EquationOfState import *
from GammaLawGas import *
from PolytropicEquationOfState import *
from IsothermalEquationOfState import *
from StiffenedGas import *
for ndim in dims:
exec('''
EquationOfState%(ndim)id = PYB11TemplateClass(EquationOfState, template_parameters="Dim<%(ndim)i>")
GammaLawGas%(ndim)id = PYB11TemplateClass(GammaLawGas, template_parameters="Dim<%(ndim)i>")
PolytropicEquationOfState%(ndim)id = PYB11TemplateClass(PolytropicEquationOfState, template_parameters="Dim<%(ndim)i>")
IsothermalEquationOfState%(ndim)id = PYB11TemplateClass(IsothermalEquationOfState, template_parameters="Dim<%(ndim)i>")
StiffenedGas%(ndim)id = PYB11TemplateClass(StiffenedGas, template_parameters="Dim<%(ndim)i>")
''' % {"ndim" : ndim})