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

PythonInterface::PythonIBC, a PhysIBC-derived class which allows the bedrock and topography to be set by a user-defined python function f(x,y) . More...

#include <PythonInterface.H>

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

Public Member Functions

 PythonIBC (const std::string &a_pyModuleName, const std::string &a_pyFuncThckName, const std::string &a_pyFuncTopgName, const std::string &a_pyFuncRhsName, const std::string &a_pyFuncFaceVelName)
 
 PythonIBC ()
 
virtual ~PythonIBC ()
 
virtual void define (const ProblemDomain &a_domain, const Real &a_dx)
 Define the object. More...
 
virtual IceThicknessIBCnew_thicknessIBC ()
 Factory method - this object is its own factory. More...
 
virtual void initialize (LevelData< FArrayBox > &a_U)
 Set up initial conditions. More...
 
bool regridIceGeometry (LevelSigmaCS &a_coords, const RealVect &a_dx, const RealVect &a_domainSize, const Real &a_time, const LevelSigmaCS *a_crseCoords, const int a_refRatio)
 set up topography, etc at regrid time More...
 
virtual void initializeIceGeometry (LevelSigmaCS &a_coords, const RealVect &a_dx, const RealVect &a_domainSize, const Real &a_time, const LevelSigmaCS *a_crseCoords, const int a_refRatio)
 set up initial ice state More...
 
virtual void modifyVelocityRHS (LevelData< FArrayBox > &a_rhs, LevelSigmaCS &a_coords, const ProblemDomain &a_domain, Real a_time, Real a_dt)
 if appropriate, modify velocity solve RHS in a problem-dependent way. More...
 
virtual void modifyFaceVelocity (LevelData< FluxBox > &a_faceVel, const LevelSigmaCS &a_coords, const ProblemDomain &a_domain) const
 if appropriate, modify face velocities in a problem-dependent way. More...
 
virtual void primBC (FArrayBox &a_WGdnv, const FArrayBox &a_Wextrap, const FArrayBox &a_W, const int &a_dir, const Side::LoHiSide &a_side, const Real &a_time)
 Set boundary fluxes. More...
 
virtual void setBdrySlopes (FArrayBox &a_dW, const FArrayBox &a_W, const int &a_dir, const Real &a_time)
 Set boundary slopes. More...
 
virtual void artViscBC (FArrayBox &a_F, const FArrayBox &a_U, const FArrayBox &a_divVel, const int &a_dir, const Real &a_time)
 Adjust boundary fluxes to account for artificial viscosity. More...
 
virtual RefCountedPtr< CompGridVTOBC > velocitySolveBC ()
 return boundary condition for Ice velocity solve More...
 
virtual void setSurfaceHeightBCs (LevelData< FArrayBox > &a_zSurface, LevelSigmaCS &a_coords, const ProblemDomain &a_domain, const RealVect &a_dx, Real a_time, Real a_dt)
 set non-periodic ghost cells for surface height z_s. More...
 
virtual void setGeometryBCs (LevelSigmaCS &a_coords, const ProblemDomain &a_domain, const RealVect &a_dx, Real a_time, Real a_dt)
 set non-periodic geometry (thickness, topography) ghost cells More...
 
virtual void setIceFractionBCs (LevelData< FArrayBox > &a_fraction, const ProblemDomain &a_domain, const RealVect &a_dx, Real a_time, Real a_dt)
 set non-periodic ghost cells for ice fraction More...
 
- Public Member Functions inherited from IceThicknessIBC
 IceThicknessIBC ()
 Constructor. More...
 
virtual ~IceThicknessIBC ()
 Destructor. More...
 
virtual PhysIBC * new_physIBC ()
 Factory method - this object is its own factory. More...
 
virtual void velocityGhostBC (LevelData< FArrayBox > &a_velocity, const LevelSigmaCS &a_coords, const ProblemDomain &a_domain, Real a_time)
 fill ghost cells on velocity More...
 
virtual void setGridHierarchy (Vector< RefCountedPtr< LevelSigmaCS > > &a_vectCS, Vector< ProblemDomain > &a_vectDomain)
 set AMR grid hierarchy (for the BC's which need this) More...
 
virtual void checkOK () const
 

Detailed Description

PythonInterface::PythonIBC, a PhysIBC-derived class which allows the bedrock and topography to be set by a user-defined python function f(x,y) .

Reflection boundary conditions are imposed on each edge.

Constructor & Destructor Documentation

◆ PythonIBC() [1/2]

PythonInterface::PythonIBC::PythonIBC ( const std::string &  a_pyModuleName,
const std::string &  a_pyFuncThckName,
const std::string &  a_pyFuncTopgName,
const std::string &  a_pyFuncRhsName,
const std::string &  a_pyFuncFaceVelName 
)

◆ PythonIBC() [2/2]

PythonInterface::PythonIBC::PythonIBC ( )

Referenced by new_thicknessIBC().

◆ ~PythonIBC()

PythonInterface::PythonIBC::~PythonIBC ( )
virtual

Member Function Documentation

◆ artViscBC()

void PythonInterface::PythonIBC::artViscBC ( FArrayBox &  a_F,
const FArrayBox &  a_U,
const FArrayBox &  a_divVel,
const int &  a_dir,
const Real &  a_time 
)
virtual

Adjust boundary fluxes to account for artificial viscosity.

Implements IceThicknessIBC.

◆ define()

void PythonInterface::PythonIBC::define ( const ProblemDomain &  a_domain,
const Real &  a_dx 
)
virtual

Define the object.

Set the problem domain index space and the grid spacing for this initial and boundary condition object.

Reimplemented from IceThicknessIBC.

◆ initialize()

void PythonInterface::PythonIBC::initialize ( LevelData< FArrayBox > &  a_U)
virtual

Set up initial conditions.

shouldn't be here...

Implements IceThicknessIBC.

◆ initializeIceGeometry()

void PythonInterface::PythonIBC::initializeIceGeometry ( LevelSigmaCS a_coords,
const RealVect &  a_dx,
const RealVect &  a_domainSize,
const Real &  a_time,
const LevelSigmaCS a_crseCoords,
const int  a_refRatio 
)
virtual

set up initial ice state

reads info from ParmParse and sets up ice sheet geometry

Implements IceThicknessIBC.

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

◆ modifyFaceVelocity()

void PythonInterface::PythonIBC::modifyFaceVelocity ( LevelData< FluxBox > &  a_faceVel,
const LevelSigmaCS a_coords,
const ProblemDomain &  a_domain 
) const
virtual

if appropriate, modify face velocities in a problem-dependent way.

default is to do nothing

Reimplemented from IceThicknessIBC.

References LevelSigmaCS::dx(), LevelSigmaCS::grids(), modifyVelocityRHS(), and PythonInterface::PythonEval().

Referenced by regridIceGeometry().

◆ modifyVelocityRHS()

void PythonInterface::PythonIBC::modifyVelocityRHS ( LevelData< FArrayBox > &  a_rhs,
LevelSigmaCS a_coords,
const ProblemDomain &  a_domain,
Real  a_time,
Real  a_dt 
)
virtual

if appropriate, modify velocity solve RHS in a problem-dependent way.

default is to do nothing

Reimplemented from IceThicknessIBC.

References LevelSigmaCS::dx(), LevelSigmaCS::getH(), LevelSigmaCS::getSurfaceHeight(), LevelSigmaCS::gravity(), LevelSigmaCS::grids(), LevelSigmaCS::iceDensity(), and PythonInterface::PythonEval().

Referenced by modifyFaceVelocity().

◆ new_thicknessIBC()

IceThicknessIBC * PythonInterface::PythonIBC::new_thicknessIBC ( )
virtual

Factory method - this object is its own factory.

Return a pointer to a new IceThicknessIBC object with m_isDefined = false (i.e., its define() must be called before it is used).

Implements IceThicknessIBC.

References PythonIBC().

◆ primBC()

void PythonInterface::PythonIBC::primBC ( FArrayBox &  a_WGdnv,
const FArrayBox &  a_Wextrap,
const FArrayBox &  a_W,
const int &  a_dir,
const Side::LoHiSide &  a_side,
const Real &  a_time 
)
virtual

Set boundary fluxes.

Implements IceThicknessIBC.

◆ regridIceGeometry()

bool PythonInterface::PythonIBC::regridIceGeometry ( LevelSigmaCS a_coords,
const RealVect &  a_dx,
const RealVect &  a_domainSize,
const Real &  a_time,
const LevelSigmaCS a_crseCoords,
const int  a_refRatio 
)
virtual

◆ setBdrySlopes()

void PythonInterface::PythonIBC::setBdrySlopes ( FArrayBox &  a_dW,
const FArrayBox &  a_W,
const int &  a_dir,
const Real &  a_time 
)
virtual

Set boundary slopes.

The boundary slopes in a_dW are already set to one sided difference approximations. If this function doesn't change them they will be used for the slopes at the boundaries.

Implements IceThicknessIBC.

◆ setGeometryBCs()

void PythonInterface::PythonIBC::setGeometryBCs ( LevelSigmaCS a_coords,
const ProblemDomain &  a_domain,
const RealVect &  a_dx,
Real  a_time,
Real  a_dt 
)
virtual

set non-periodic geometry (thickness, topography) ghost cells

set non-periodic ghost cells for thickness & topography

Reimplemented from IceThicknessIBC.

References LevelSigmaCS::getH(), LevelSigmaCS::getTopography(), and ReflectGhostCells().

Referenced by initializeIceGeometry().

◆ setIceFractionBCs()

void PythonInterface::PythonIBC::setIceFractionBCs ( LevelData< FArrayBox > &  a_fraction,
const ProblemDomain &  a_domain,
const RealVect &  a_dx,
Real  a_time,
Real  a_dt 
)
virtual

set non-periodic ghost cells for ice fraction

Reimplemented from IceThicknessIBC.

References ReflectGhostCells().

◆ setSurfaceHeightBCs()

void PythonInterface::PythonIBC::setSurfaceHeightBCs ( LevelData< FArrayBox > &  a_zSurface,
LevelSigmaCS a_coords,
const ProblemDomain &  a_domain,
const RealVect &  a_dx,
Real  a_time,
Real  a_dt 
)
virtual

set non-periodic ghost cells for surface height z_s.

Reimplemented from IceThicknessIBC.

References ReflectGhostCells().

◆ velocitySolveBC()

RefCountedPtr< CompGridVTOBC > PythonInterface::PythonIBC::velocitySolveBC ( )
virtual

return boundary condition for Ice velocity solve

eventually would like this to be a BCHolder

Implements IceThicknessIBC.


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