Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions src/lazy_interpolate.jl
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
"""
````
function lazy_interpolate!(
target::FEVectorBlock{T1,Tv,Ti},
source::FEVectorBlock{T2,Tv,Ti};
operator = Identity,
postprocess = nothing,
xtrafo = nothing,
items = [],
not_in_domain_value = 1e30,
eps = 1e-13,
use_cellparents::Bool = false) where {T1,T2,Tv,Ti}
target::FEVectorBlock{T1, Tv, Ti},
source,
operators = [(1, Identity)];
postprocess! = standard_kernel,
xtrafo! = nothing,
items = [],
resultdim = get_ncomponents(eltype(target.FES)),
not_in_domain_value = 1.0e30,
start_cell = 1,
only_localsearch = false,
use_cellparents::Bool = false,
eps = 1.0e-13,
kwargs...) where {T1, Tv, Ti}
````

Interpolates (operator-evaluations of) the given finite element function into the finite element space assigned to the target FEVectorBlock.
(Currently not the most efficient way as it is based on the PointEvaluation pattern and cell search. If CellParents
are available in the grid components of the target grid, these parent cell information can be used to improve the
search. To activate this put 'use_cellparents' = true). By some given kernel function that is conforming to the interface
Interpolates (operator-evaluations of) the given FEVector source (or an array of FEVectorBlocks)
into the (finite element space assigned to) the `target` FEVectorBlock.
By the given `postprocess!` function that is conforming to the interface

kernel!(result, input, qpinfo)
postprocess!(result, input, qpinfo)

the operator evaluation (=input) can be further postprocessed. The qpinfo argument
allows to access information at the current quadrature point.
the operator evaluations (=input) can be further manipulated (default is unmodified input). The qpinfo argument
allows to access information at the current quadrature point. The `xtrafo!` function with the interface

xtrafo!(x_source, x)

maps coordinates x from the target grid to coordinates in the source grid in case the grids
(the default is the identity). If `x_source` cannot be found in the source_grid the value
`not_in_domain_value` is used as a function value. With the `items` arguments the
target cells for the interpolation can be restricted.

Note: discontinuous quantities at vertices of the target grid will be evaluated in the first found cell of the
source grid. No averaging is performed. With eps the tolerances of the cell search via ExtendableGrids.CellFinder can be steered.

Note 2: This is not the most efficient way (therefore lazy) as it is based on the PointEvaluation pattern and cell search (with
tolerance `eps`).
If CellParents are available in the grid components of the target grid, parent cell information can be used to (slightly) improve the
search. To activate this put `use_cellparents` = true.
"""
function lazy_interpolate!(
target::FEVectorBlock{T1, Tv, Ti},
Expand Down
Loading