20 #include "pism/stressbalance/blatter/verification/BlatterTestXZ.hh"
22 #include "pism/rheology/IsothermalGlen.hh"
24 #include "pism/stressbalance/blatter/verification/manufactured_solutions.hh"
27 namespace stressbalance {
30 int Mz,
int coarsening_factor)
31 :
Blatter(grid, Mz, coarsening_factor) {
58 m_g =
m_config->get_number(
"constants.standard_gravity");
63 const double *ice_bottom,
64 const double *sea_level) {
76 return (
I.i == 0 or
I.i == info.mx - 1);
86 const double *surface,
102 x_nodal[
n] = element.
x(
n);
103 z_nodal[
n] = element.
z(
n);
111 for (
int q = 0; q < element.
n_pts(); ++q) {
115 for (
int t = 0; t < element.
n_chi(); ++t) {
116 const auto &psi = element.
chi(q, t);
129 const double *tauc_nodal,
130 const double *f_nodal,
149 x_nodal[
n] = element.
x(
n);
150 z_nodal[
n] = element.
z(
n);
157 for (
int q = 0; q < face.
n_pts(); ++q) {
161 for (
int t = 0; t < element.
n_chi(); ++t) {
162 auto psi = face.
chi(q, t);
188 x_nodal[
n] = element.
x(
n);
189 z_nodal[
n] = element.
z(
n);
196 for (
int q = 0; q < face.
n_pts(); ++q) {
203 for (
int t = 0; t < element.
n_chi(); ++t) {
204 auto psi = face.
chi(q, t);
206 residual[t] += - W * psi *
F;
const units::System::Ptr m_sys
unit system used by this component
const Config::ConstPtr m_config
configuration database used by this component
const std::shared_ptr< const Grid > m_grid
grid used by this component
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
void evaluate(const T *x, T *vals, T *dx, T *dy, T *dz) const
Given nodal values, compute the values and partial derivatives at the quadrature points.
const Germ & chi(unsigned int q, unsigned int k) const
int n_pts() const
Number of quadrature points.
double weight(unsigned int q) const
Weight of the quadrature point q
double weight(unsigned int q) const
const double & chi(unsigned int q, unsigned int k) const
void evaluate(const T *x, T *result) const
int n_pts() const
Number of quadrature points.
Isothermal Glen ice allowing extra customization.
BlatterTestXZ(std::shared_ptr< const Grid > grid, int Mz, int coarsening_factor)
void residual_basal(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, const double *tauc_nodal, const double *f_nodal, const Vector2d *u_nodal, Vector2d *residual)
Vector2d u_bc(double x, double y, double z) const
bool marine_boundary(int face, const int *node_type, const double *ice_bottom, const double *sea_level)
void residual_source_term(const fem::Q1Element3 &element, const double *surface, const double *bed, Vector2d *residual)
void residual_surface(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, Vector2d *residual)
double m_A
constant ice hardness
bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex &I)
virtual void residual_basal(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, const double *tauc_nodal, const double *f_nodal, const Vector2d *u_nodal, Vector2d *residual)
double m_work[m_n_work][m_Nq]
std::shared_ptr< rheology::FlowLaw > m_flow_law
EnthalpyConverter::Ptr m_EC
const int n_chi
Number of shape functions on a Q1 element.
double convert(System::Ptr system, double input, const std::string &spec1, const std::string &spec2)
Convert a quantity from unit1 to unit2.
static double F(double SL, double B, double H, double alpha)
Vector2d blatter_xz_source_surface(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_source(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_exact(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_source_bed(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)