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"
31 namespace stressbalance {
56 (void) sliding_velocity;
77 auto u_sigma =
m_solver->velocity_u_sigma();
78 auto v_sigma =
m_solver->velocity_v_sigma();
81 int Mz = zlevels.size();
85 for (
auto p =
m_grid->points(); p; p.next()) {
86 const int i = p.i(), j = p.j();
91 double H = ice_thickness(i, j);
94 for (
int k = 0;
k < Mz; ++
k) {
95 double sigma =
std::min(zlevels[
k] / H, 1.0);
97 u[
k] = u_sigma->interpolate(i, j, sigma);
98 v[
k] = v_sigma->interpolate(i, j, sigma);
116 const double eps = 1e-3;
124 for (
auto p =
m_grid->points(); p; p.next()) {
125 const int i = p.i(), j = p.j();
127 auto h = surface.
star(i, j);
128 auto H = ice_thickness(i, j);
131 Vector2d grad_h = {(h.e - h.w) / (2.0 * dx),
132 (h.n - h.s) / (2.0 * dy)};
134 double D = H * velocity(i, j).magnitude() / (grad_h.
magnitude() + eps);
#define ICE_GOLDSBY_KOHLSTEDT
const Config::ConstPtr 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.
std::shared_ptr< FlowLaw > create()
void remove(const std::string &name)
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)
EnthalpyConverter::Ptr 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).
double max(const array::Scalar &input)
Finds maximum over all the values in an array::Scalar object. Ignores ghosts.
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
void GlobalMax(MPI_Comm comm, double *local, double *result, int count)