Item Integrators

Item integrators are one of the Assembly Patterns that help to compute certain quantities of the Solution, like a posteriori errors estimators, norms, drag/lift coefficients or other statistics.

GradientRobustMultiPhysics.ItemIntegratorFunction
ItemIntegrator(
    operators;
    ...
) -> AssemblyPattern{ItemIntegrator, Float64, ON_CELLS, Float64, Int32, NoAction}
ItemIntegrator(
    operators,
    action;
    T,
    AT,
    regions,
    name
) -> AssemblyPattern{ItemIntegrator, Float64, ON_CELLS, Float64, Int32}

Creates an ItemIntegrator assembly pattern based on:

  • operators : operators that should be evaluated for the coressponding FESpace (last one refers to test function)
  • action : an Action with kernel of interface (result, input, kwargs) that takes input (= all but last operator evaluations) and computes result to be dot-producted with test function evaluation (if no action is specified, the full input vector is dot-producted with the test function operator evaluation)

Optional arguments:

  • T : expected NumberType for evaluation output
  • AT : specifies on which entities of the grid the ItemINtegrator is evaluated
  • regions : specifies in which regions the operator should assemble, default [0] means all regions
  • name : name for this LinearForm that is used in print messages
source
GradientRobustMultiPhysics.L2ErrorIntegratorFunction
L2ErrorIntegrator(
    compare_data::GradientRobustMultiPhysics.AbstractUserDataType;
    ...
) -> AssemblyPattern{ItemIntegrator, T, AT, Float64, Int32, DefaultUserAction{T1, Ti, dx, dt, di, dl, ndim, KernelType}} where {T<:Real, AT<:AssemblyType, T1, Ti, dx, dt, di, dl, ndim, KernelType}
L2ErrorIntegrator(
    compare_data::GradientRobustMultiPhysics.AbstractUserDataType,
    operator;
    T,
    quadorder,
    name,
    AT,
    factor,
    regions,
    time
) -> AssemblyPattern{ItemIntegrator, T, AT, Float64, Int32, DefaultUserAction{T1, Ti, dx, dt, di, dl, ndim, KernelType}} where {T<:Real, AT<:AssemblyType, T1, Ti, dx, dt, di, dl, ndim, KernelType}

Creates an ItemIntegrator that compares discrete FEVectorBlock operator-evaluations against the given comparedata and returns the L2-error || comparedata(x) - factor*discrete(x) ||. If quadorder is left on "auto" two times the quadorder of the data is used in the evaluation.

source
GradientRobustMultiPhysics.L2NormIntegratorFunction
L2NormIntegrator(
    ncomponents::Int64,
    operator;
    T,
    AT,
    name,
    quadorder,
    regions
) -> AssemblyPattern{ItemIntegrator, T, AT, Float64, Int32, DefaultUserAction{T1, Ti, dx, dt, di, dl, ndim, KernelType}} where {T<:Real, AT<:AssemblyType, T1, Ti, dx, dt, di, dl, ndim, KernelType}

Creates an ItemIntegrator that computes the L2 norm of an operator evaluation where ncomponents is the expected length of the operator evaluation.

source
GradientRobustMultiPhysics.L2DifferenceIntegratorFunction
L2DifferenceIntegrator(
    ncomponents::Int64,
    operator;
    AT,
    T,
    name,
    quadorder,
    regions
) -> AssemblyPattern{ItemIntegrator, T, AT, Float64, Int32, DefaultUserAction{T1, Ti, dx, dt, di, dl, ndim, KernelType}} where {T<:Real, AT<:AssemblyType, T1, Ti, dx, dt, di, dl, ndim, KernelType}

Creates an ItemIntegrator that computes the L2 norm difference between two arguments evalauted with the same operator (or with different operators if operator is an array) where ncomponents is the expected length of each operator evaluation. Note that all arguments in an evaluation call need to be defined on the same grid !

source

Evaluation

There are two possibilities to evaluate an ItemIntegrator, on each item (with evaluate!) or globally (with evaluate):

GradientRobustMultiPhysics.evaluate!Function
function evaluate!(
    result,                     # target for result
    PE::PointEvaluator,         
    xref,                       # local coordinates inside item
    item                        # item number
    ) where  {T, Tv, Ti, FEType, FEOP, AT, ACT}

Evaluates the PointEvaluator at the point with the given local coordinates insides the item with the specified item number. (To get the local coordinates, currently a CellFinder has to be maintained manually, this might change in future.)

source
function evaluate!(
    b::AbstractArray{T,2},
    AP::AssemblyPattern{APT,T,AT},
    FEB::Union{<:FEVector{T,Tv,Ti},<:FEVectorBlock{T,Tv,Ti},Array{<:FEVectorBlock{T,Tv,Ti},1}};
    skip_preps::Bool = false) where {APT <: APT_ItemIntegrator, T<: Real, AT <: AssemblyType, Tv, Ti}

Evaluation of an ItemIntegrator assembly pattern with given FEVectorBlock or FEVector FEB into given two-dimensional Array b.

source
GradientRobustMultiPhysics.evaluateFunction
function evaluate(PE::PointEvaluator)

Returns the function (result,xref,cell) –> evaluate!(result,PE,xref,cell)

(e.g. to be used as a callback function in vectorplot!)

source
function evaluate(
    AP::AssemblyPattern{APT,T,AT},
    FEB::Union{<:FEVector{T,Tv,Ti},<:FEVectorBlock{T,Tv,Ti},Array{<:FEVectorBlock{T,Tv,Ti},1}};
    skip_preps::Bool = false) where {APT <: APT_ItemIntegrator, T<: Real, AT <: AssemblyType, Tv, Ti}

Evaluation of an ItemIntegrator assembly pattern with given FEVectorBlock or FEVector FEB, only returns accumulation over all items.

source

Noteworthy Examples

Examples 204 and A06 use ItemIntegrators for a posteriori error estimation and refinement indicators.

Example 224 uses ItemIntegrators to calculate drag and lift coefficients.