20#include "pism/regional/SIAFD_Regional.hh"
21#include "pism/stressbalance/StressBalance.hh"
22#include "pism/geometry/Geometry.hh"
23#include "pism/util/Logger.hh"
27namespace stressbalance {
31 m_h_x_no_model(grid,
"h_x_no_model"),
32 m_h_y_no_model(grid,
"h_y_no_model") {
40 m_log->message(2,
" using the regional version of the SIA solver...\n");
51 "no_model surface elevation was not provided to SIAFD_Regional");
65 for (
auto p :
m_grid->points_with_ghosts(1)) {
66 const int i = p.i(), j = p.j();
68 auto M = no_model.
box(i, j);
71 if (M.c > 0.5 or M.e > 0.5) {
73 if (i < 0 or i + 1 > Mx - 1) {
81 if (M.nw > 0.5 or M.ne > 0.5 or M.w > 0.5 or M.e > 0.5) {
83 if (i - 1 < 0 or j + 1 > My - 1 or i + 1 > Mx - 1) {
92 if (M.n > 0.5 or M.ne > 0.5 or M.s > 0.5 or M.se > 0.5) {
94 if (i < 0 or j + 1 > My - 1 or i + 1 > Mx - 1 or j - 1 < 0) {
103 if (M.c > 0.5 or M.n > 0.5) {
105 if (j < 0 or j + 1 > My - 1) {
const std::shared_ptr< const Grid > m_grid
grid used by this component
std::shared_ptr< const Logger > m_log
logger (for easy access)
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