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
— TypePointEvaluator(
kernel,
u_args,
ops_args;
...
) -> PointEvaluator{Float64}
PointEvaluator(
kernel,
u_args,
ops_args,
sol;
Tv,
kwargs...
) -> PointEvaluator{Float64}
Construct 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 its finite element basis.
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. Should have the formkernel!(result, eval_args, qpinfo)
.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
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 evaluation point.qpinfo
:QPInfos
struct with information about the current evaluation point.
Usage
After construction, call initialize!
to prepare the evaluator for a given solution, then use evaluate!
or evaluate_bary!
to perform point evaluations.
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
.
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
.