Next: Package FL.CDR-FE, Previous: Package FL.CDRSYS, Up: Reference manual
The FL.DISCRETIZATION package defines
<discretization> as an abstract class and
<fe-discretization> as a concrete derived class.
The key for local assembly is given by the generic function
get-fe, which yields a suitable finite element for a given cell.
The value of get-fe is a class <fe> for scalar problems
or <vector-fe> for vector-valued problems which contains
information on base functions and node functionals. Another generic
function quadrature-rule computes memoized quadrature rules for
those finite elements.
Obviously, also non-standard finite element discretizations like hp-methods
would fit into this scheme. The key for local assembly is given by the
generic function get-fe, which yields a suitable finite element
for a given cell. The value of get-fe is a class <fe>
for scalar problems or <vector-fe> for vector-valued problems which
contains information on base functions and node functionals. Another
generic function quadrature-rule computes memoized quadrature
rules for those finite elements.
The file lagrange.lisp provides Lagrange finite elements of arbitrary order. The evaluation points for the node functionals may be chosen either uniformly distributed or at the Gauss-Lobatto points. The latter choice of points yields better stability properties but is restricted to cube meshes. Also functions for constructing cell mappings by pointwise evaluation of the domain boundary are provided here, which may be used to construct isoparametric domain approximations.
In the file fedisc.lisp, the function fe-discretize is
defined. This function performs the standard steps for finite element
discretization: interior assembly, assembly and elimination of hanging-node
and essential-boundary constraints. It works on a blackboard as explained
in Section Blackboards and can reuse already available matrix-vector
structure. There is a somewhat less flexible interface provided by the
funtion discretize-globally which calls
fe-discretize.
In the files cdr-fe.lisp, elasticity-fe.lisp and
navier-stokes.lisp one can find methods for local assembly for the
different problems. They are defined in own packages which use both the
package FL.DISCRETIZATION and the package for the particular
problem.
The suggested order of discretization. In non-nil, this value should be taken into account by methods to select-discretization.
A sparse-matrix which is interpreted as an automorphism for an ansatz-space. Should probably be made a specialization of ansatz-space-morphism.
Superclasses: <ANSATZ-SPACE-OBJECT> <SPARSE-MATRIX>
A sparse-matrix which is interpreted as an morphism between two ansatz-spaces.
Superclasses: <SPARSE-MATRIX>
Direct slots:
- DOMAIN-ANSATZ-SPACE: NIL
- IMAGE-ANSATZ-SPACE: NIL
A sparse vector which is interpreted as the ansatz-space for a specific fe-class on a given mesh.
Superclasses: <ANSATZ-SPACE-OBJECT> <SPARSE-VECTOR>
A finite element ansatz space is determined by finite element discretization, mesh and problem. The constraints are stored in the slot properties.
Superclasses: PROPERTY-MIXIN
Direct slots:
- FE-CLASS: The finite element class for this ansatz space.
- PROBLEM: The proplem for this ansatz space which determines essential constraints.
- MESH: The mesh for this ansatz space which determines hanging-node constraints.
- MULTIPLICITY: Should be a copy of problem multiplicity.
Finite element discretization where the finite elements can differ from cell to cell. Especially, hp-FEM are included.
Superclasses: <FE-DISCRETIZATION>
Direct slots:
- CELL->FE: A function mapping a cell to a finite element.
Class for scalar fe discretizations.
Superclasses: <STANDARD-FE-DISCRETIZATION>
Direct slots:
- ORDER: NIL
A finite element <fe> is given for each reference cell, e.g. <2-simplex>. dofs are the degrees of freedom associated with the cell, basis is the dual basis to dofs in some polynomial space. subcell-ndofs is the number of ndofs on each subcell. subcell-indices is a list of indices for all subcells with dofs. Usually, the <scalar-fe> will occur as values of a procedure or as values in a hash-table with the reference cells as keys.
Superclasses: <FE>
Direct slots:
- DOFS: NIL
- BASIS: NIL
- ORDER: NIL
Finite element discretization where the finite element depends only on the type of the reference cell.
Superclasses: <CELL-FE-DISCRETIZATION>
Vector FE discretization class.
Superclasses: <STANDARD-FE-DISCRETIZATION>
Direct slots:
- COMPONENTS: NIL
Finite element for vector functions. Components is a vector of scalar finite elements. Local-offset is an array of the same length which contains the offsets for each component in the local discretization vector. Subcell-offsets is an array consisting of arrays which yield such an offset for every subcell.
Superclasses: <FE>
Direct slots:
- COMPONENTS: NIL
- DOFS: NIL
Assemble the interior, i.e. ignore constraints arising from boundaries and hanging nodes. Discretization is done using the ansatz space ansatz-space on level level. The level argument will usually be
NILwhen performing a global assembly, and be equal to some number when assembling coarse level matrices for multigrid. The argument where is a flag indicating where assembly is to be done. It should be one of the keywords:surface,:refined,:all. The arguments matrix, rhs should contain vectors/matrices where the local assembly is accumulated. The numbers mass-factor and stiffness-factor determine weights for mass and stiffness matrix which is used when solving time-dependent and eigenvalue problems. Boundary conditions and constraints are not taken into account within this routine.In general, this function does most of the assembly work. Other steps like handling constraints are intricate, but usually of lower complexity.
Gets all value-blocks associated with the local stiffness matrix. If necessary, those value-blocks are generated.
The multigrid algorithm needs an interpolation which satisfies the constraints like essential or periodic boundary conditions.
Constructs a coefficient input list from FE data cell is the cell, global is the global coordinate of the integration point, values and gradients the values and gradients of the shape functions at the ip, and fe-parameters are the corresponding data of fe-functions to be evalutated.
Calculates matrix and right-hand side for the discretization and the problem. Further parameters are provided inside the blackboard.
Discretize problem on the hierarchical mesh h-mesh using finite elments given by fe-class.
Computes a local stiffness matrix and right-hand side. The algorithm will usually work as follows:
- Get coefficient functions for the patch of the cell.
- Compute geometry information for all ips (values and gradients of the shape functions).
- Loop over integration points ip:
- If necessary, compute input for coefficient functions. This input may contain values of finite element function in the property list fe-parameters.
- Evaluate coefficient functions at ips.
- Add the contributions for matrix and right-hand side to local-mat and local-rhs.
mass-factor and stiffness-factor are weights for mass and stiffness matrix which are used for solving eigenvalue and time-dependent problems. If local-u and local-v are set, then local-v*local-mat*local-u and local-v*local-rhs is computed. This feature may be used later on for implementing matrixless computations.
Degree of freedom in a finite element. It is defined as a functional defined by integration over a sub-cell or by evaluation at a local coordinate of a sub-cell of a reference cell.
Direct slots:
- INDEX: index of the dof in the cell-dof array
- SUBCELL-INDEX: index of the reference subcell on which the dof is defined
- IN-VBLOCK-INDEX: index of the dof in the subcell vblock
- SUBCELL: reference subcell on which the dof is defined
- COORD: local coordinate of the dof in the reference subcell
- GCOORD: global coordinate of the dof on the reference cell
- FUNCTIONAL: a functional for functions defined on the reference cell
Constraints are given by an equation: P x = Q x + r
Here x in V, P is an orthogonal projection on a subspace V_P of V, Q maps some other space which may have nonempty intersection with V_P to V_P. With S we denote the mapping Id-P. This function returns the matrix for a Galerkin method on the constrained space. It is used for treating hanging nodes and essential boundary conditions. When assemble-locally is t the sparse structure of mat is used instead of the sparse structure of the hanging node interface. When include-constraints is non-nil, the constraints are included in matrix and rhs.
Computation of essential constraints. Should probably be incorporated into the ansatz-space definition.
Collects cell geometry information at sample-points inside a property list.
Finite element discretization for an ansatz space provided on the blackboard.
Returns the finite element for the given discretization and reference cell.
Maps the region in the global stiffness matrix determined by cell and fe to a local matrix array.
Maps the region in global-vec determined by cell and fe to a local vector.
Increments the region in global-mat determined by cell and fe to the values of local-mat.
Increments the region in global-vec determined by cell and fe to the values of the local vector array.
On each cell of the skeleton region or on all cells of level level of the mesh of ansatz-space, a local interpolation matrix is collected into an interpolation matrix. type is the interpolation type having a default value *interpolation-type*.
Returns a vector of local gradient matrices for obj which may be a vector of integration points or a quadrature rule. Note that this function is memoized using an :around method.
Returns a vector of ip values for obj which may be a vector of integration points or a quadrature rule. Note that this function is memoized using an :around method.
Returns a function which maps a cell by a polynomial which is obtained by interpolating the boundary map via Lagrange interpolation.
Computes a local transfer matrix between different FE spaces.
<ansatz-space> constructor. Somewhat shorter than with MAKE-INSTANCE.
The algorithm works as follows: On each cell of the provided cell list or the whole refinement a local projection matrix computed on the reference finite element is copied into the global projection matrix.
Returns a ansatz space vector for ansatz-space filled with random entries. Essential constraints are satisfied.
Select a discretization for the given problem depending on the parameters on the blackboard.
Sets the region in global-mat determined by cell and fe to the values of the local matrix array.
Sets the region in global-vec determined by cell and fe to the values of the local vector array.