SegmentIntegrator
Segment integrators provide tools to integrate finite element functions (FEVector
) along arbitrary line segments that pass through mesh cells.
ExtendableFEMBase.SegmentIntegrator
— Methodfunction SegmentIntegrator(
EG::ElementGeometry,
[kernel!::Function],
oa_args::Array{<:Tuple{<:Any, DataType},1};
kwargs...)
Construct a SegmentIntegrator
for integrating over segments of the given element geometry EG
.
At each quadrature point, the specified operator evaluations are performed, optionally postprocessed by the provided kernel!
function, and accumulated using the quadrature weights. If no kernel is given, the operator arguments are integrated directly.
Arguments
EG::ElementGeometry
: The segment geometry over which to integrate.kernel!::Function
(optional): A function of the formkernel!(result, eval_args, qpinfo)
that postprocesses operator evaluations at each quadrature point. If omitted, a default kernel is used.oa_args::Array{<:Tuple{Any, DataType},1}
: Array of tuples(tag, FunctionOperator)
, wheretag
identifies the unknown or vector position, andFunctionOperator
specifies the operator to evaluate.
Keyword arguments:
factor: factor that should be multiplied during assembly. Default: 1
resultdim: dimension of result field (default = length of arguments). Default: 0
matrix_mode: integrator integrates basis functions of FEspace separately to assembly a matrix that maps solution to segment integrations (requires that kernel is linear). Default: false
name: name for operator used in printouts. Default: ''SegmentIntegrator''
params: array of parameters that should be made available in qpinfo argument of kernel function. Default: nothing
quadorder: quadrature order. Default: ''auto''
bonus_quadorder: additional quadrature order added to quadorder. Default: 0
entrytolerance: threshold to add entry to sparse matrix (only in matrixmode). Default: 0
verbosity: verbosity level. Default: 0
Kernel Function Interface
kernel!(result, eval_args, qpinfo)
result
: Preallocated array to store the kernel output.eval_args
: Array of operator evaluations at the current quadrature point.qpinfo
:QPInfos
struct with information about the current quadrature point.
Usage
After construction, call initialize!
to prepare the integrator for a given solution, then use integrate_segment!
to perform integration over a segment.
ExtendableFEMBase.initialize!
— Methodfunction initialize!(
O::SegmentIntegrator{T, UT},
sol;
time = 0,
kwargs...)
Initializes the SegmentIntegrator for the specified solution.
ExtendableFEMBase.integrate_segment!
— Methodfunction integrate_segment!(
result::Array{T,1},
SI::SegmentIntegrator,
w::Array{Array{T,1},1},
b::Array{Array{T,1},1},
item
) where {T}
Integrate a segment with world coordinates w and barycentric coordinates b in the cell with the given item number.