20 #include "pism/util/fem/FEM.hh"
21 #include "pism/util/node_types.hh"
31 static const double xis[
n_chi] = {-1.0, 1.0};
35 return {0.5 * (1.0 + xis[
k] * pt.
xi),
51 if ((
k == 0 and pt.
xi <= 0.0 and pt.
eta <= 0.0) or
52 (
k == 1 and pt.
xi > 0.0 and pt.
eta <= 0.0) or
53 (
k == 2 and pt.
xi > 0.0 and pt.
eta > 0.0) or
54 (
k == 3 and pt.
xi <= 0.0 and pt.
eta > 0.0)) {
72 static const double xi[
n_chi] = {-1.0, 1.0, 1.0, -1.0};
73 static const double eta[
n_chi] = {-1.0, -1.0, 1.0, 1.0};
77 return {0.25 * (1.0 + xi[
k] * pt.
xi) * (1.0 + eta[
k] * pt.
eta),
78 0.25 * xi[
k] * (1.0 + eta[
k] * pt.
eta),
79 0.25 * eta[
k] * (1.0 + xi[
k] * pt.
xi),
94 return {1.0 - pt.
xi - pt.
eta, -1.0, -1.0, 0.0};
96 return {pt.
xi, 1.0, 0.0, 0.0};
98 return {pt.
eta, 0.0, 1.0, 0.0};
107 const int n_exterior_nodes = ((node_type[0] ==
NODE_EXTERIOR) +
113 if (n_exterior_nodes == 0) {
117 if (n_exterior_nodes == 1) {
140 double xis[8] = {-1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0};
141 double etas[8] = {-1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0};
142 double zetas[8] = {-1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0};
144 return {0.125 * (1.0 + xis[
k]*p.
xi) * (1.0 + etas[
k]*p.
eta) * (1.0 + zetas[
k]*p.
zeta),
145 0.125 * xis[
k] * (1.0 + etas[
k] * p.
eta) * (1.0 + zetas[
k] * p.
zeta),
146 0.125 * etas[
k] * (1.0 + xis[
k] * p.
xi) * (1.0 + zetas[
k] * p.
zeta),
147 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(int node_type[q1::n_chi])
double dy
Function derivative with respect to y.
double val
Function value.
double dx
Function deriviative with respect to x.
Struct for gathering the value and derivative of a function at a point.