|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
Classes for implementing the Finite Element Method on an IceGrid. More...
#include <petscmat.h>#include "iceModelVec.hh"#include "flowlaws.hh"Go to the source code of this file.
Classes | |
| struct | FEFunctionGerm |
| Struct for gathering the value and derivative of a function at a point. More... | |
| struct | FEVector2Germ |
| Struct for gathering the value and derivative of a vector valued function at a point. More... | |
| class | FEShapeQ1 |
| Computation of Q1 shape function values. More... | |
| class | FEDOFMap |
| The mapping from global to local degrees of freedom. More... | |
| class | FEElementMap |
| Manages iterating over element indices. More... | |
| class | FEQuadrature |
| Numerical integration of finite element functions. More... | |
Functions | |
| int | PismIntMask (PetscScalar maskvalue) |
| Legacy code that needs to vanish. | |
Classes for implementing the Finite Element Method on an IceGrid.
We assume that the reader has a basic understanding of the finite element method at the level of ?????. The following is a reminder of the method that also gives the background for the how to implement it on an IceGrid with the tools in this module.
The IceGrid domain
is decomposed into a grid of rectangular physical elements indexed by indices (i,j):
(0,1) (1,1)
---------
| | |
---------
| | |
---------
(0,0) (1,0)
The index of an element corresponds with the index of its lower-left vertex in the grid.
The reference element is the square
. For each physical element
, there is an map
from the reference element
to
. In this implementation, the rectangles in the domain are all congruent, and the maps F_{ij} are all the same up to a translation.
On the reference element, vertices are ordered as follows:
3 o---------o 2
| |
| |
| |
0 o---------o 1
For each vertex
there is an element basis function
that is bilinear, equals 1 at vertex
, and equals 0 at the remaining vertices.
For each node
in the physical domain there is a basis function that equals 1 at vertex
, equals zero at all other vertices, and that on element
can be written as
for some index
.
A (scalar) finite element function
on the domain is then a linear combination
Let
denote the weak form of the PDE under consideration. For example, for the scalar Poisson equation
,
In the continuous problem we seek to find a trial function
such that
for all suitable test functions
. In the discrete problem, we seek a finite element function
such that
for all suitable indices
. For realistice problems, the integral given by
cannot be evaluated exactly, but is approximated with some
that arises from numerical quadrature quadrature rule: integration on an element
is approximated with
for certain points
and weights
(specific details are found in FEQuadrature).
The unknown
is represented by an IceVec,
where
are the coefficients of the vector. The solution of the finite element problem requires the following computations:

Computations of these 'integrals' are done by adding up the contributions from each element (an FEElementMap helps with iterating over the elements). For a fixed element, there is a locally defined trial function
(with 4 degrees of freedom in the scalar case) and 4 local test functions
, one for each vertex.
The contribution to the integrals proceeds as follows (for concreteness in the case of computing the residual):
defining
the local degrees of freedom
defining
. (FEDOFMap)
(values and derivatives as needed) at the quadrature points
(FEQuadrature)
at each quadrature point (call these
) and form the weighted sums
.
is the contribution of the current element to a residual entry
, where local degree of freedom
corresponds with global degree of freedom
. The local contibutions now need to be added to the global residual vector (FEDOFMap).Computation of the Jacobian is similar, except that there are now multiple integrals per element (one for each local degree of freedom of
).
All of the above is a simplified description of what happens in practice. The complications below treated by the following classes, and discussed in their documentation:
It should be mentioned that the classes in this module are not intended to be a fancy finite element package. Their purpose is to clarify the steps that occur in the computation of residuals and Jacobians in SSAFEM, and to isolate and consolodate the hard steps so that they are not scattered about the code.
Definition in file FETools.hh.
| int PismIntMask | ( | PetscScalar | maskvalue | ) |
Legacy code that needs to vanish.
Definition at line 415 of file FETools.cc.
Referenced by SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), and SSAFEM::FixDirichletValues().
1.7.3