PointEvaluator
Point evaluators provide a convenient interface to evaluate finite element functions (FEVector
) at arbitrary spatial points, not restricted to mesh nodes or quadrature points. This is useful for post-processing, visualization, or extracting solution values at specific locations.
ExtendableFEMBase.PointEvaluator
— Typefunction Pointevaluator(
[kernel!::Function],
oa_args::Array{<:Tuple{<:Any, DataType},1}
sol = nothing;
kwargs...)
Constructs a PointEvaluator
object for evaluating operator expressions at arbitrary points in a finite element space.
A PointEvaluator
can be used to evaluate one or more operator evaluations (e.g., function values, gradients) at arbitrary points, optionally postprocessed by a user-supplied kernel function. The evaluation is performed with respect to a given solution and finite element basis.
If a kernel function is provided, it must have the interface: kernel!(result, evalargs, qpinfo) where result
is the output buffer, `evalargscontains the operator evaluations, and
qpinfo` provides information about the current evaluation point.
Operator evaluations are specified as tuples pairing a tag (to identify the unknown or vector position) with a FunctionOperator
.
After construction, the PointEvaluator
must be initialized with a solution using initialize!
. Evaluation at a point is then performed using evaluate!
or evaluate_bary!
.
Arguments
kernel!
(optional): Postprocessing function for operator evaluations.- `oa_args: Array of operator argument tuples (source block tag, operator type).
sol
(optional): Solution object for immediate initialization.
Keyword arguments:
resultdim: dimension of result field (default = length of operators). Default: 0
params: array of parameters that should be made available in qpinfo argument of kernel function. Default: nothing
name: name for operator used in printouts. Default: ''PointEvaluator''
verbosity: verbosity level. Default: 0
ExtendableFEMBase.eval_func
— Methodfunction eval_func(PE::PointEvaluator)
Yields the function (result, x) -> evaluate!(result,PE,x).
ExtendableFEMBase.eval_func_bary
— Methodfunction eval_func_bary(PE::PointEvaluator)
Yields the function (result, xref, item) -> evaluate_bary!(result,PE,xref,item).
ExtendableFEMBase.evaluate!
— Methodfunction evaluate!(
result,
PE::PointEvaluator,
x
)
Evaluates the PointEvaluator at the specified coordinates x. (To do so it internally calls CellFinder to find the cell and the barycentric coordinates of x and calls evaluate_bary!.)
ExtendableFEMBase.evaluate_bary!
— Methodfunction evaluate_bary!(
result,
PE::PointEvaluator,
xref,
item
)
Evaluates the PointEvaluator at the specified reference coordinates in the cell with the specified item number.
ExtendableFEMBase.initialize!
— Methodfunction initialize!(
O::PointEvaluator,
sol;
time = 0,
kwargs...)
Initializes the given PointEvaluator
for a specified solution (FEVector or vector of FEVectorBlocks).
This function prepares the PointEvaluator
for evaluation by associating it with the provided solution vector. It sets up the necessary finite element basis evaluators, local-to-global transformations, and cell finder structures for the underlying grid.
Arguments
O::PointEvaluator
: ThePointEvaluator
instance to initialize.sol
: The solution object (e.g., array of FEVectorBlocks) to be used for evaluations.
Keyword Arguments
time
: (default:0
) Time value to be passed to the quadrature point info structure.resultdim: dimension of result field (default = length of operators). Default: 0
params: array of parameters that should be made available in qpinfo argument of kernel function. Default: nothing
name: name for operator used in printouts. Default: ''PointEvaluator''
verbosity: verbosity level. Default: 0
Notes
- This function must be called before using
evaluate!
orevaluate_bary!
with thePointEvaluator
.