22#include "pism/stressbalance/blatter/BlatterMod.hh"
24#include "pism/rheology/FlowLawFactory.hh"
26#include "pism/geometry/Geometry.hh"
27#include "pism/stressbalance/StressBalance.hh"
28#include "pism/util/pism_utilities.hh"
31namespace stressbalance {
40 m_config->get_number(
"stress_balance.blatter.Glen_exponent"));
57 (void) sliding_velocity;
78 auto u_sigma =
m_solver->velocity_u_sigma();
79 auto v_sigma =
m_solver->velocity_v_sigma();
82 int Mz = zlevels.size();
86 for (
auto p :
m_grid->points()) {
87 const int i = p.i(), j = p.j();
92 double H = ice_thickness(i, j);
95 for (
int k = 0;
k < Mz; ++
k) {
96 double sigma = std::min(zlevels[
k] / H, 1.0);
98 u[
k] = u_sigma->interpolate(i, j, sigma);
99 v[
k] = v_sigma->interpolate(i, j, sigma);
117 const double eps = 1e-3;
125 for (
auto p :
m_grid->points()) {
126 const int i = p.i(), j = p.j();
128 auto h = surface.
star(i, j);
129 auto H = ice_thickness(i, j);
132 Vector2d grad_h = {(h.e - h.w) / (2.0 * dx),
133 (h.n - h.s) / (2.0 * dy)};
135 double D = H * velocity(i, j).magnitude() / (grad_h.
magnitude() + eps);
#define ICE_GOLDSBY_KOHLSTEDT
std::shared_ptr< const Config > m_config
configuration database used by this component
const std::shared_ptr< const Grid > m_grid
grid used by this component
array::Scalar2 ice_surface_elevation
array::Scalar2 ice_thickness
double magnitude() const
Magnitude.
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
stencils::Star< T > star(int i, int j) const
void set_column(int i, int j, double c)
Set all values of scalar quantity to given a single value in a particular column.
double * get_column(int i, int j)
const std::vector< double > & levels() const
void set(double c)
Result: v[j] <- c for all j.
void update_ghosts()
Updates ghost points.
void remove(const std::string &name)
std::shared_ptr< FlowLaw > create(const std::string &type_name, double exponent)
std::shared_ptr< Blatter > m_solver
void update(const array::Vector &sliding_velocity, const Inputs &inputs, bool full_update)
void transfer(const array::Scalar &ice_thickness)
BlatterMod(std::shared_ptr< Blatter > solver)
void compute_max_diffusivity(const array::Vector &velocity, const array::Scalar &ice_thickness, const array::Scalar1 &surface)
std::shared_ptr< EnthalpyConverter > m_EC
std::shared_ptr< rheology::FlowLaw > m_flow_law
array::Staggered1 m_diffusive_flux
Shallow stress balance modifier (such as the non-sliding SIA).
void GlobalMax(MPI_Comm comm, double *local, double *result, int count)