20 #include "pism/regional/SIAFD_Regional.hh"
21 #include "pism/stressbalance/StressBalance.hh"
22 #include "pism/geometry/Geometry.hh"
26 namespace 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");
59 for (
auto p =
m_grid->points(1); p; p.next()) {
60 const int i = p.i(), j = p.j();
62 auto M = no_model.
box(i, j);
65 if (M.c > 0.5 or M.e > 0.5) {
67 if (i < 0 or i + 1 > Mx - 1) {
75 if (M.nw > 0.5 or M.ne > 0.5 or M.w > 0.5 or M.e > 0.5) {
77 if (i - 1 < 0 or j + 1 > My - 1 or i + 1 > Mx - 1) {
86 if (M.n > 0.5 or M.ne > 0.5 or M.s > 0.5 or M.se > 0.5) {
88 if (i < 0 or j + 1 > My - 1 or i + 1 > Mx - 1 or j - 1 < 0) {
97 if (M.c > 0.5 or M.n > 0.5) {
99 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
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.