BISICLES AMR ice sheet model
0.9
|
Use a python function to evaluate the surface flux. More...
#include <PythonInterface.H>
Public Member Functions | |
PythonSurfaceFlux (const std::string &a_pyModule, const std::string &a_pyFunc, std::map< std::string, Real > &a_kwarg) | |
Construct a PythonSurfaceFlux from module, function, and kwargs list. More... | |
virtual | ~PythonSurfaceFlux () |
virtual SurfaceFlux * | new_surfaceFlux () |
factory method: return a pointer to a new SurfaceFlux object More... | |
virtual void | surfaceThicknessFlux (LevelData< FArrayBox > &a_flux, const AmrIceBase &a_amrIce, int a_level, Real a_dt) |
define source term for thickness evolution and place it in flux More... | |
![]() | |
virtual | ~SurfaceFlux () |
virtual destructor More... | |
virtual void | evaluate (LevelData< FArrayBox > &a_data, const AmrIceBase &a_amrIce, int a_level, Real a_dt) |
Sub-classes of this class turned out to be useful for various data apart from thickness fluxes... More... | |
Additional Inherited Members | |
![]() | |
static SurfaceFlux * | parse (const char *a_prefix) |
assemble a SurfaceFlux* object from ParmParse inputs More... | |
Use a python function to evaluate the surface flux.
The user needs to provide a python function foo
that takes x,y,thickness,topography as args, plus some kwargs and returns a single scalar (the flux)
Run-time configuration is carried out in SurfaceFlux::parse. If the string A.B.C.type = pythonFlux
is found, then the expected form is:
A.B.C.module = <string>
(the name of the python module, eg. foo
(not foo.py
)A.B.C.function = <string>
(the name of the python function in foo
)A.B.C.n_kwargs = <int>
(the number of keyword arguments)A.B.C.kwargs = <string> <string> ...
(the keywords)Keywords supported are: gl_proximity, gl_proximity_scale. In each case, BISICLES supplies a known value, serived from the ice sheet state, if a known keyword is supplied
PythonInterface::PythonSurfaceFlux::PythonSurfaceFlux | ( | const std::string & | a_pyModule, |
const std::string & | a_pyFunc, | ||
std::map< std::string, Real > & | a_kwarg | ||
) |
Construct a PythonSurfaceFlux from module, function, and kwargs list.
a_pyModule | the python module name |
a_pyFunc | the python function name |
a_kwarg | a list of kwarg names |
References PythonInterface::InitializePythonFunction(), PythonInterface::InitializePythonModule(), and PythonSurfaceFlux().
Referenced by PythonSurfaceFlux().
|
virtual |
|
virtual |
factory method: return a pointer to a new SurfaceFlux object
Implements SurfaceFlux.
Referenced by SurfaceFlux::parse().
|
virtual |
define source term for thickness evolution and place it in flux
a_flux | output flux data |
a_amrIce | reference to the ice sheet state |
a_level | mesh level of a_flux |
a_dt | current timestep |
a_dt is included in case one needs integrals or averages over a timestep. flux should be defined in meters per year in the current implementation.
Implements SurfaceFlux.
References PythonInterface::FillKwargs(), AmrIceBase::geometry(), PythonInterface::PythonEval(), and AmrIceBase::time().