20#include "pism/regional/SIAFD_Regional.hh"
21#include "pism/stressbalance/StressBalance.hh"
22#include "pism/geometry/Geometry.hh"
26namespace stressbalance {
30 m_h_x_no_model(grid,
"h_x_no_model"),
31 m_h_y_no_model(grid,
"h_y_no_model") {
39 m_log->message(2,
" using the regional version of the SIA solver...\n");
50 "no_model surface elevation was not provided to SIAFD_Regional");
64 for (
auto p =
m_grid->points(1); p; p.next()) {
65 const int i = p.i(), j = p.j();
67 auto M = no_model.
box(i, j);
70 if (M.c > 0.5 or M.e > 0.5) {
72 if (i < 0 or i + 1 > Mx - 1) {
80 if (M.nw > 0.5 or M.ne > 0.5 or M.w > 0.5 or M.e > 0.5) {
82 if (i - 1 < 0 or j + 1 > My - 1 or i + 1 > Mx - 1) {
91 if (M.n > 0.5 or M.ne > 0.5 or M.s > 0.5 or M.se > 0.5) {
93 if (i < 0 or j + 1 > My - 1 or i + 1 > Mx - 1 or j - 1 < 0) {
102 if (M.c > 0.5 or M.n > 0.5) {
104 if (j < 0 or j + 1 > My - 1) {
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
array::CellType2 cell_type
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
stencils::Box< T > box(int i, int j) const
array::Staggered1 m_h_y_no_model
void compute_surface_gradient(const Inputs &inputs, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient for the SIA.
SIAFD_Regional(std::shared_ptr< const Grid > g)
void init()
Initialize the SIA module.
array::Staggered1 m_h_x_no_model
virtual void compute_surface_gradient(const Inputs &inputs, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient for the SIA.
virtual void surface_gradient_haseloff(const array::Scalar2 &ice_surface_elevation, const array::CellType2 &cell_type, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient using a modification of Marianne Haseloff's approach.
virtual void init()
Initialize the SIA module.
#define PISM_ERROR_LOCATION