|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
Numerical integration of finite element functions. More...
#include <FETools.hh>
Public Member Functions | |
| FEQuadrature () | |
| void | init (const IceGrid &g, PetscScalar L=1.) |
Obtain the weights for quadrature. | |
| const FEFunctionGerm(* | testFunctionValues ())[Nq] |
| Return the values at all quadrature points of all shape functions. | |
| const FEFunctionGerm * | testFunctionValues (PetscInt q) |
| Return the values of all shape functions at quadrature point q. | |
| const FEFunctionGerm * | testFunctionValues (PetscInt q, PetscInt k) |
| Return the values at quadrature point q of shape function k. | |
| void | computeTrialFunctionValues (const PetscReal *x, PetscReal *vals) |
| Compute the values at the quadrature ponits of a scalar-valued finite-element function with element-local degrees of freedom x. | |
| void | computeTrialFunctionValues (const PetscReal *x, PetscReal *vals, PetscReal *dx, PetscReal *dy) |
| Compute the values and first derivatives at the quadrature points of a scalar-valued finite-element function with element-local degrees of freedom x. | |
| void | computeTrialFunctionValues (PetscInt i, PetscInt j, const FEDOFMap &dof, PetscReal const *const *xg, PetscReal *vals) |
| Compute the values at the quadrature points on element (i,j) of a scalar-valued finite-element function with global degrees of freedom x. | |
| void | computeTrialFunctionValues (PetscInt i, PetscInt j, const FEDOFMap &dof, PetscReal const *const *xg, PetscReal *vals, PetscReal *dx, PetscReal *dy) |
| Compute the values and first derivatives at the quadrature points on element (i,j) of a scalar-valued finite-element function with global degrees of freedom x. | |
| void | computeTrialFunctionValues (const PISMVector2 *x, PISMVector2 *vals) |
| Compute the values at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x. | |
| void | computeTrialFunctionValues (const PISMVector2 *x, PISMVector2 *vals, PetscReal(*Dv)[3]) |
| Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x. | |
| void | computeTrialFunctionValues (const PISMVector2 *x, PISMVector2 *vals, PISMVector2 *dx, PISMVector2 *dy) |
| Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x. | |
| void | computeTrialFunctionValues (PetscInt i, PetscInt j, const FEDOFMap &dof, PISMVector2 const *const *xg, PISMVector2 *vals) |
| Compute the values at the quadrature points of a vector-valued finite-element function on element (i,j) with global degrees of freedom xg. | |
| void | computeTrialFunctionValues (PetscInt i, PetscInt j, const FEDOFMap &dof, PISMVector2 const *const *xg, PISMVector2 *vals, PetscReal(*Dv)[3]) |
| Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function on element (i,j) with global degrees of freedom xg. | |
| void | getWeightedJacobian (PetscReal *jxw) |
Obtain the weights for quadrature. | |
Static Public Attributes | |
| static const PetscInt | Nq = 4 |
| Number of quadrature points. | |
| static const PetscInt | Nk = 4 |
| Number of test functions on the element. | |
| static const PetscReal | quadPoints [Nq][2] |
| The coordinates of the quadrature points on the reference element. | |
| static const PetscReal | quadWeights [Nq] = {1,1,1,1} |
| The weights for quadrature on the reference element. | |
Protected Attributes | |
| PetscReal | m_jacobianDet |
| The Jacobian determinant of the map from the reference element to the physical element. | |
| FEFunctionGerm | m_germs [Nq][Nk] |
| Shape function values (for each of Nq quadrature points, and each of Nk shape function ) | |
| PetscReal | m_tmpScalar [Nk] |
| PISMVector2 | m_tmpVector [Nk] |
Numerical integration of finite element functions.
The core of the finite element method is the computation of integrals over elements. For nonlinear problems, or problems with non-constant coefficients (i.e. any real problem) the integration has to be done approximately:
for certain quadrature points
and weights
. An FEQuadrature is used to evaluate finite element functions at quadrature points, and to compute weights
for a given element.
In this concrete implementation, the reference element
is the square
. On a given element, nodes (o) and quadrature points (*) are ordered as follows:
3 o------------------o 2
| 3 2 |
| * * |
| |
| |
| * * |
| 0 1 |
0 o------------------o 1
So there are four quad points per element, which occur at
. This corresponds to the tensor product of Gaussian integration on an interval that is exact for cubic functions on the interval.
Integration on a physical element can be thought of as being done by change of variables. The quadrature weights need to be modified, and the FEQuadrature takes care of this for you. Because all elements in an IceGrid are congruent, the quadrature weights are the same for each element, and are computed upon initialization with an IceGrid.
See also: FiniteElement/IceGrid background material.
Definition at line 380 of file FETools.hh.
| FEQuadrature | ( | ) |
Definition at line 202 of file FETools.cc.
Compute the values at the quadrature ponits of a scalar-valued finite-element function with element-local degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vector vals.
Definition at line 258 of file FETools.cc.
References m_germs, Nk, Nq, and FEFunctionGerm::val.
Referenced by SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), computeTrialFunctionValues(), SSAFEM_Forward::domainIP_core(), SSAFEM_Forward::rangeIP_core(), SSAFEM_Forward::set_tauc(), and SSAFEM::setup().
| void computeTrialFunctionValues | ( | PetscInt | i, |
| PetscInt | j, | ||
| const FEDOFMap & | dof, | ||
| PetscReal const *const * | xg, | ||
| PetscReal * | vals, | ||
| PetscReal * | dx, | ||
| PetscReal * | dy | ||
| ) |
Compute the values and first derivatives at the quadrature points on element (i,j) of a scalar-valued finite-element function with global degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vectors vals, dx, and dy.
Definition at line 300 of file FETools.cc.
References computeTrialFunctionValues(), FEDOFMap::extractLocalDOFs(), and m_tmpScalar.
| void computeTrialFunctionValues | ( | PetscInt | i, |
| PetscInt | j, | ||
| const FEDOFMap & | dof, | ||
| PISMVector2 const *const * | xg, | ||
| PISMVector2 * | vals, | ||
| PetscReal(*) | Dv[3] | ||
| ) |
Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function on element (i,j) with global degrees of freedom xg.
There should be room for FEQuadrature::Nq values in the output vectors vals and Dv. Each entry of Dv is an array of three numbers:
.
Definition at line 387 of file FETools.cc.
References computeTrialFunctionValues(), FEDOFMap::extractLocalDOFs(), and m_tmpVector.
| void computeTrialFunctionValues | ( | const PISMVector2 * | x, |
| PISMVector2 * | vals | ||
| ) |
Compute the values at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vector vals.
Definition at line 310 of file FETools.cc.
References m_germs, Nk, Nq, and FEFunctionGerm::val.
| void computeTrialFunctionValues | ( | const PISMVector2 * | x, |
| PISMVector2 * | vals, | ||
| PetscReal(*) | Dv[3] | ||
| ) |
Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vectors vals and Dv. Each entry of Dv is an array of three numbers:
.
Definition at line 329 of file FETools.cc.
References FEFunctionGerm::dx, FEFunctionGerm::dy, m_germs, Nk, Nq, and FEFunctionGerm::val.
| void computeTrialFunctionValues | ( | const PISMVector2 * | x, |
| PISMVector2 * | vals, | ||
| PISMVector2 * | dx, | ||
| PISMVector2 * | dy | ||
| ) |
Compute the values and symmetric gradient at the quadrature points of a vector-valued finite-element function with element-local degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vectors vals, \ dx, and dy. Each element of dx is the derivative of the vector-valued finite-element function in the x direction, and similarly for dy.
Definition at line 352 of file FETools.cc.
References FEFunctionGerm::dx, FEFunctionGerm::dy, m_germs, Nk, Nq, and FEFunctionGerm::val.
| void computeTrialFunctionValues | ( | const PetscReal * | x, |
| PetscReal * | vals, | ||
| PetscReal * | dx, | ||
| PetscReal * | dy | ||
| ) |
Compute the values and first derivatives at the quadrature points of a scalar-valued finite-element function with element-local degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vectors vals, dx, and dy.
Definition at line 274 of file FETools.cc.
References FEFunctionGerm::dx, FEFunctionGerm::dy, m_germs, Nk, Nq, and FEFunctionGerm::val.
| void computeTrialFunctionValues | ( | PetscInt | i, |
| PetscInt | j, | ||
| const FEDOFMap & | dof, | ||
| PISMVector2 const *const * | xg, | ||
| PISMVector2 * | vals | ||
| ) |
Compute the values at the quadrature points of a vector-valued finite-element function on element (i,j) with global degrees of freedom xg.
There should be room for FEQuadrature::Nq values in the output vectors vals.
Definition at line 374 of file FETools.cc.
References computeTrialFunctionValues(), FEDOFMap::extractLocalDOFs(), and m_tmpVector.
| void computeTrialFunctionValues | ( | PetscInt | i, |
| PetscInt | j, | ||
| const FEDOFMap & | dof, | ||
| PetscReal const *const * | xg, | ||
| PetscReal * | vals | ||
| ) |
Compute the values at the quadrature points on element (i,j) of a scalar-valued finite-element function with global degrees of freedom x.
There should be room for FEQuadrature::Nq values in the output vector vals.
Definition at line 290 of file FETools.cc.
References computeTrialFunctionValues(), FEDOFMap::extractLocalDOFs(), and m_tmpScalar.
| void getWeightedJacobian | ( | PetscReal * | jxw | ) |
Obtain the weights
for quadrature.
Definition at line 207 of file FETools.cc.
References m_jacobianDet, Nq, and quadWeights.
Referenced by SSAFEM_Forward::assemble_DomainNorm_matrix(), SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), SSAFEM_Forward::domainIP_core(), and SSAFEM_Forward::rangeIP_core().
| void init | ( | const IceGrid & | g, |
| PetscScalar | L = 1. |
||
| ) |
Obtain the weights
for quadrature.
ref.Length();
ref.Length();
Definition at line 216 of file FETools.cc.
References FEFunctionGerm::dx, FEFunctionGerm::dy, FEShapeQ1::eval(), L, m_germs, m_jacobianDet, Nk, Nq, and quadPoints.
Referenced by SSAFEM::SSAFEM().
| const FEFunctionGerm(* testFunctionValues | ( | ) | )[Nq] |
Return the values at all quadrature points of all shape functions.
Definition at line 236 of file FETools.cc.
Referenced by SSAFEM_Forward::assemble_DomainNorm_matrix(), SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), and SSAFEM::setup().
| const FEFunctionGerm * testFunctionValues | ( | PetscInt | q, |
| PetscInt | k | ||
| ) |
Return the values at quadrature point q of shape function k.
Definition at line 249 of file FETools.cc.
References m_germs.
| const FEFunctionGerm * testFunctionValues | ( | PetscInt | q | ) |
Return the values of all shape functions at quadrature point q.
Definition at line 243 of file FETools.cc.
References m_germs.
FEFunctionGerm m_germs[Nq][Nk] [protected] |
Shape function values (for each of Nq quadrature points, and each of Nk shape function )
Definition at line 422 of file FETools.hh.
Referenced by computeTrialFunctionValues(), init(), and testFunctionValues().
PetscReal m_jacobianDet [protected] |
The Jacobian determinant of the map from the reference element to the physical element.
Definition at line 420 of file FETools.hh.
Referenced by getWeightedJacobian(), and init().
PetscReal m_tmpScalar[Nk] [protected] |
Definition at line 424 of file FETools.hh.
Referenced by computeTrialFunctionValues().
PISMVector2 m_tmpVector[Nk] [protected] |
Definition at line 425 of file FETools.hh.
Referenced by computeTrialFunctionValues().
const PetscInt Nk = 4 [static] |
Number of test functions on the element.
Definition at line 385 of file FETools.hh.
Referenced by SSAFEM_Forward::assemble_DomainNorm_matrix(), SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), computeTrialFunctionValues(), init(), and SSAFEM::setup().
const PetscInt Nq = 4 [static] |
Number of quadrature points.
Definition at line 384 of file FETools.hh.
Referenced by SSAFEM::allocate_fem(), SSAFEM_Forward::assemble_DomainNorm_matrix(), SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), computeTrialFunctionValues(), SSAFEM_Forward::domainIP_core(), getWeightedJacobian(), init(), SSAFEM_Forward::rangeIP_core(), SSAFEM_Forward::set_tauc(), and SSAFEM::setup().
const PetscReal quadPoints [static] |
{{ -0.57735026918962573, -0.57735026918962573 },
{ 0.57735026918962573, -0.57735026918962573 },
{ 0.57735026918962573, 0.57735026918962573 },
{ -0.57735026918962573, 0.57735026918962573 }}
The coordinates of the quadrature points on the reference element.
The quadrature points on the reference square
.
Definition at line 413 of file FETools.hh.
Referenced by init().
const PetscReal quadWeights = {1,1,1,1} [static] |
The weights for quadrature on the reference element.
The weights w_i for gaussian quadrature on the reference element with these quadrature points.
Definition at line 415 of file FETools.hh.
Referenced by getWeightedJacobian().
1.7.3