Quadrature

Usually quadrature is a hidden layer as quadrature rules are chosen automatically based on the polynomial degree of the ansatz functions and the specified quadorder of the user data.

Hence, quadrature rules are only needed if the user wants write his own low-level assembly.

Quadrature rules consist of points (coordinates of evaluation points with respect to reference geometry) and weights. There are constructors for several AbstractElementGeometries (from ExtendableGrids) and different order (some have generic formulas for arbitrary order), see below for a detailed list.

ExtendableFEMBase.QuadratureRuleType
abstract type QuadratureRule{T<:Real, ET<:ExtendableGrids.AbstractElementGeometry}

Abstract type for quadrature rules for a certain NumberType and element geometry

source
ExtendableFEMBase.QuadratureRuleMethod
function QuadratureRule{T,ET}(order::Int) where {T<:Real, ET <: AbstractElementGeometry0D}

Constructs 0D quadrature rule of specified order (always point evaluation).

source
ExtendableFEMBase.QuadratureRuleMethod
function QuadratureRule{T,ET}(order::Int) where {T<:Real, ET <: Parallelepiped3D}

Constructs quadrature rule on Parallelepiped3D of specified order.

source
ExtendableFEMBase.QuadratureRuleMethod
function QuadratureRule{T,ET}(order::Int) where {T<:Real, ET <: Parallelogram2D}

Constructs quadrature rule on Parallelogram2D of specified order.

source
ExtendableFEMBase.QuadratureRuleMethod
function QuadratureRule{T,ET}(order::Int) where {T<:Real, ET <: Tetrahedron3D}

Constructs quadrature rule on Tetrahedron3D of specified order.

source
ExtendableFEMBase.SQuadratureRuleType
struct SQuadratureRule{T<:Real, ET<:ExtendableGrids.AbstractElementGeometry, dim, npoints} <: QuadratureRule{T<:Real, ET<:ExtendableGrids.AbstractElementGeometry}

A struct that contains the name of the quadrature rule, the reference points and the weights for the parameter-determined element geometry.

source
Base.eltypeMethod
eltype(
    _::QuadratureRule{T<:Real, ET<:ExtendableGrids.AbstractElementGeometry}
) -> Any

Custom eltype function for QuadratureRule{T,ET}.

source
Base.showMethod
show(io::IO, Q::QuadratureRule)

Custom show function for QuadratureRule{T,ET} that prints some information.

source
ExtendableFEMBase.VertexRuleFunction
VertexRule(
    ET::Type{ExtendableGrids.Edge1D};
    ...
) -> ExtendableFEMBase.SQuadratureRule{Float64, ExtendableGrids.Edge1D, 1}
VertexRule(
    ET::Type{ExtendableGrids.Edge1D},
    order;
    T
) -> ExtendableFEMBase.SQuadratureRule{Float64, ExtendableGrids.Edge1D, 1}

sets up a quadrature rule that evaluates at vertices of element geometry; not optimal from quadrature point of view, but helpful when interpolating. Note, that order of xref matches dof order of H1Pk element

source
ExtendableFEMBase.integrate!Method
integrate!(
    integral4items::AbstractArray{T},
    grid::ExtendableGrids.ExtendableGrid{Tv, Ti},
    AT::Type{<:ExtendableGrids.AssemblyType},
    integrand;
    offset,
    bonus_quadorder,
    quadorder,
    regions,
    time,
    items,
    force_quadrature_rule,
    kwargs...
)

Integration of an integrand of the signature

integrand!(result, qpinfo)

over the entities AT of the grid. The result on every item is written into integral4items (at least of size nitems x length of result). As usual, qpinfo allows to access information at the current quadrature point.

Keyword arguments:

  • quadorder = specifies the quadrature order (default = 0)
  • regions = restricts integration to these regions (default = [] meaning all regions)
  • items = restricts integration to these item numbers (default = [] meaning all items)
  • time = sets the time to be passed to qpinfo (default = 0)
  • params = sets the params array to be passed to qpinfo (default = [])
  • offset = offset for writing into result array integral4items (default = [0]),
source
ExtendableFEMBase.integrateMethod
integrate(
    grid::ExtendableGrids.ExtendableGrid,
    AT::Type{<:ExtendableGrids.AssemblyType},
    integrand!,
    resultdim::Int64;
    T,
    kwargs...
) -> Union{Float64, Vector{Float64}}

Integration that returns total integral of an integrand of the signature

integrand!(result, qpinfo)

over the entities AT of the grid. Here, qpinfo allows to access information at the current quadrature point. The length of the result needs to be specified via resultdim.

Keyword arguments:

  • quadorder = specifies the quadrature order (default = 0)
  • regions = restricts integration to these regions (default = [] meaning all regions)
  • items = restricts integration to these item numbers (default = [] meaning all items)
  • time = sets the time to be passed to qpinfo (default = 0)
  • params = sets the params array to be passed to qpinfo (default = [])
source
ExtendableFEMBase.ref_integrate!Method
ref_integrate!(
    integral::AbstractArray,
    EG::Type{<:ExtendableGrids.AbstractElementGeometry},
    order::Int64,
    integrand::Function
)

Integration for reference basis functions on reference domains (merely for testing stuff).

Note: area of reference geometry is not multiplied

source

Accumulating Vector (not relevant for users, but for completeness)

Internally a global integration uses an accumulating vector and calls the cell-wise integration.

ExtendableFEMBase.AccumulatingVectorType
struct AccumulatingVector{T} <: AbstractArray{T, 2}

vector that is acting as an AbstractArray{T, 2} and automatically accumulates all values from the second dimension

AV[k,j] += s for any j results in AV.entries[k] += s

source