21#include "pism/util/fem/FEM.hh"
22#include "pism/util/node_types.hh"
32 static const double xis[
n_chi] = {-1.0, 1.0};
36 return {0.5 * (1.0 + xis[
k] * pt.
xi),
52 if ((
k == 0 and pt.
xi <= 0.0 and pt.
eta <= 0.0) or
53 (
k == 1 and pt.
xi > 0.0 and pt.
eta <= 0.0) or
54 (
k == 2 and pt.
xi > 0.0 and pt.
eta > 0.0) or
55 (
k == 3 and pt.
xi <= 0.0 and pt.
eta > 0.0)) {
74 static const double xi[
n_chi] = {-1.0, 1.0, 1.0, -1.0};
75 static const double eta[
n_chi] = {-1.0, -1.0, 1.0, 1.0};
79 return {0.25 * (1.0 + xi[
k] * pt.
xi) * (1.0 + eta[
k] * pt.
eta),
80 0.25 * xi[
k] * (1.0 + eta[
k] * pt.
eta),
81 0.25 * eta[
k] * (1.0 + xi[
k] * pt.
xi),
96 return {1.0 - pt.
xi - pt.
eta, -1.0, -1.0, 0.0};
98 return {pt.
xi, 1.0, 0.0, 0.0};
100 return {pt.
eta, 0.0, 1.0, 0.0};
109 const int n_exterior_nodes = (
static_cast<int>(node_type[0] ==
NODE_EXTERIOR) +
115 if (n_exterior_nodes == 0) {
119 if (n_exterior_nodes == 1) {
142 double xis[8] = {-1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0};
143 double etas[8] = {-1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0};
144 double zetas[8] = {-1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0};
146 return {0.125 * (1.0 + xis[
k]*p.
xi) * (1.0 + etas[
k]*p.
eta) * (1.0 + zetas[
k]*p.
zeta),
147 0.125 * xis[
k] * (1.0 + etas[
k] * p.
eta) * (1.0 + zetas[
k] * p.
zeta),
148 0.125 * etas[
k] * (1.0 + xis[
k] * p.
xi) * (1.0 + zetas[
k] * p.
zeta),
149 0.125 * zetas[
k] * (1.0 + xis[
k] * p.
xi) * (1.0 + etas[
k] * p.
eta)};
Germ chi(unsigned int k, const QuadPoint &pt)
Linear basis functions on the interval [-1, -1].
Germ chi(unsigned int k, const QuadPoint &pt)
P1 basis functions on the reference element with nodes (0,0), (1,0), (0,1).
Germ chi(unsigned int k, const QuadPoint &pt)
Germ chi(unsigned int k, const QuadPoint &p)
Evaluate a Q1 shape function and its derivatives with respect to xi and eta.
Germ chi(unsigned int k, const QuadPoint &pt)
Q1 basis functions on the reference element with nodes (-1,-1), (1,-1), (1,1), (-1,...
ElementType element_type(const int node_type[q1::n_chi])
double dy
Function derivative with respect to y.
double val
Function value.
double dz
Function derivative with respect to z.
double dx
Function deriviative with respect to x.
Struct for gathering the value and derivative of a function at a point.