BISICLES AMR ice sheet model  0.9
Public Member Functions | List of all members
PythonInterface::PythonBasalFriction Class Reference

BasalFriction that calls a python function to compute $ \beta^2 $. More...

#include <PythonInterface.H>

Inheritance diagram for PythonInterface::PythonBasalFriction:
Inheritance graph
[legend]
Collaboration diagram for PythonInterface::PythonBasalFriction:
Collaboration graph
[legend]

Public Member Functions

 PythonBasalFriction (const std::string &a_pyModule, const std::string &a_pyFunc)
 Construct a PythonBasalFriction from module and function names. More...
 
virtual ~PythonBasalFriction ()
 
virtual BasalFrictionnew_basalFriction () const
 factory method More...
 
virtual void setBasalFriction (LevelData< FArrayBox > &a_C, LevelSigmaCS &a_coordSys, Real a_time, Real a_dt)
 compute basal friction coefficient beta^2 and place in a_betaSqr More...
 
- Public Member Functions inherited from BasalFriction
virtual ~BasalFriction ()
 virtual destructor More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BasalFriction
static BasalFrictionparse (const char *a_prefix, const RealVect &a_domainSize)
 

Detailed Description

BasalFriction that calls a python function to compute $ \beta^2 $.

The user needs to provide a python function foo that takes x,y,thickness,topography as args, and returns a single scalar

def foo(x,y,t,thickness,topography):
...
return betasqr

Run time configuration is carried out in BasalFriction::parse(A, ... ) If the option A.beta_type = Python is found, then the expected form is:

Constructor & Destructor Documentation

◆ PythonBasalFriction()

PythonInterface::PythonBasalFriction::PythonBasalFriction ( const std::string &  a_pyModule,
const std::string &  a_pyFunc 
)

Construct a PythonBasalFriction from module and function names.

Parameters
a_pyModulethe python module name
a_pyFuncthe python function name

References PythonInterface::InitializePythonFunction(), and PythonInterface::InitializePythonModule().

◆ ~PythonBasalFriction()

PythonInterface::PythonBasalFriction::~PythonBasalFriction ( )
virtual

Member Function Documentation

◆ new_basalFriction()

BasalFriction * PythonInterface::PythonBasalFriction::new_basalFriction ( ) const
virtual

factory method

Returns
a pointer to a new BasalFriction object

Implements BasalFriction.

References setBasalFriction().

◆ setBasalFriction()

void PythonInterface::PythonBasalFriction::setBasalFriction ( LevelData< FArrayBox > &  a_betaSqr,
LevelSigmaCS a_coordSys,
Real  a_time,
Real  a_dt 
)
virtual

compute basal friction coefficient beta^2 and place in a_betaSqr

time and dt are included in case this is time-dependent. Units should usually be chosen so that the basal traction $\tau_b(\beta^2, u) $ is measured in Pascals when $u $ is measured in meters per year.

Parameters
a_betaSqrbasal friction coefficient beta^2 data
a_coordSysice sheet geometry
a_timecurrent time
a_dtcurrent time step

Implements BasalFriction.

References LevelSigmaCS::dx(), LevelSigmaCS::getH(), LevelSigmaCS::getTopography(), and PythonInterface::PythonEval().

Referenced by new_basalFriction().


The documentation for this class was generated from the following files: