20 #include "pism/stressbalance/blatter/verification/BlatterTestCFBC.hh"
22 #include "pism/rheology/FlowLaw.hh"
23 #include "pism/stressbalance/StressBalance.hh"
24 #include "pism/geometry/Geometry.hh"
25 #include "pism/stressbalance/blatter/verification/manufactured_solutions.hh"
28 namespace stressbalance {
31 :
Blatter(grid, Mz, coarsening_factor) {
37 m_g =
m_config->get_number(
"constants.standard_gravity");
59 const double *surface,
75 x_nodal[
n] = element.
x(
n);
76 z_nodal[
n] = element.
z(
n);
84 for (
int q = 0; q < element.
n_pts(); ++q) {
90 for (
int t = 0; t < element.
n_chi(); ++t) {
91 const auto &psi = element.
chi(q, t);
93 residual[t] += W * psi.val *
F;
104 double *x_nodal =
m_work[1];
107 x_nodal[
n] = element.
x(
n);
113 for (
int q = 0; q < face.
n_pts(); ++q) {
119 for (
int t = 0; t < element.
n_chi(); ++t) {
120 auto psi = face.
chi(q, t);
122 residual[t] += - W * psi *
F;
130 const double *tauc_nodal,
131 const double *f_nodal,
141 double *x_nodal =
m_work[1];
144 x_nodal[
n] = element.
x(
n);
150 for (
int q = 0; q < face.
n_pts(); ++q) {
156 for (
int t = 0; t < element.
n_chi(); ++t) {
157 auto psi = face.
chi(q, t);
159 residual[t] += - W * psi *
F;
165 const double *tauc_nodal,
166 const double *f_nodal,
189 for (
auto p =
m_grid->points(); p; p.next()) {
190 const int i = p.i(), j = p.j();
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 bed_elevation
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.
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.
void residual_source_term(const fem::Q1Element3 &element, const double *surface, const double *bed, Vector2d *residual)
BlatterTestCFBC(std::shared_ptr< const Grid > grid, int Mz, int coarsening_factor)
void jacobian_basal(const fem::Q1Element3Face &face, const double *tauc_nodal, const double *f_nodal, const Vector2d *u_nodal, double K[2 *fem::q13d::n_chi][2 *fem::q13d::n_chi])
void init_2d_parameters(const Inputs &inputs)
Vector2d u_bc(double x, double y, double z) const
bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex &I)
void residual_surface(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, Vector2d *residual)
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)
virtual void init_2d_parameters(const Inputs &inputs)
double m_work[m_n_work][m_Nq]
array::Array2D< Parameters > m_parameters
std::shared_ptr< rheology::FlowLaw > m_flow_law
const int n_chi
Number of shape functions on a Q1 element.
static double K(double psi_x, double psi_y, double speed, double epsilon)
Vector2d blatter_xz_cfbc_source(double x, double z, double L, double rho_i, double rho_w, double g)
static double F(double SL, double B, double H, double alpha)
Vector2d blatter_xz_cfbc_base(double x, double L, double rho_i, double rho_w, double g)
Vector2d blatter_xz_cfbc_exact(double x, double z, double B, double L, double rho_i, double rho_w, double g)
Vector2d blatter_xz_cfbc_surface(double x, double L, double rho_i, double rho_w, double g)