User Data and Actions
There is a variety of different user data, like scalar- and vector-valued constants, time-dependent data, region-dependent data or plain functions that depend on the the space coordinates. Also dependency on the item number of the reference coordinates of the quadrature point in the quadrature item are sometimes desireable. To allow for flexible user-specified data, all functions have to be negotiated by the UserData interface that fixes the order and number of the arguments in the interface via a user-given substring of "XTIL" where each character stands for a dependency. The following table explains the meaning of each character.
Character | Explanation |
---|---|
X | depends on (vector-valued) space coordinates |
T | depends on time coordinate |
I | depends on item information (item nr, parent nr, region) |
L | depends on local coordinates in reference geometry of item |
Also note that all functions are expected to write their result into the first argument.
Data Function
DataFunctions can be used to define boundary data, right-hand side functions and can be interpolated by the finite element standard interpolations. The have to be conform to the interface
function datafunction_kernel!(result,[X,T,I,L])
# X = space coordinates
# T = time
# I = item information (vector with item number (w.r.t. AT), parent number and region number)
# L = local coordinates on item reference domain
end
GradientRobustMultiPhysics.DataFunction
— TypeDataFunction(
kernel::Function,
argsizes;
Tv,
Ti,
dependencies,
bonus_quadorder,
name
) -> DataFunction{Float64, Int32}
generates a DataFunction that can be used in the construction of PDEoperators, interpolations etc. and essentially consists of a kernel function specified by the user plus additional information on argument dimensions and additional dependencies:
- kernel : Function with interface (result, ...)
- argsizes : expected lengths of [result, interface]
Optional arguments:
- dependencies : substring of "XTIL" that specifies if the kernel also depends on space coordinates (X), time (T), item (I), local coordinates (L)
- bonus_quadorder : is added to the quadrature order computed based on the used FESpaces during assembly
- name : name of this Action used in print messages
- Tv : expected NumberType for result/input
- Ti : expected NumberType for grid enumeration infos (e.g. item/region numbers when "I" dependecy is used)
function DataFunction(c::Array{<:Real,1}; name = "constant user data", quadorder::Int = 0)
Directly generates a DataFunction from a given array c, i.e. a DataFunction that is constant and has no dependencies on x or t.
There are also derivatives defined for DataFunctions that generate another DataFunction where the derivative is calculated via ForwardDiff.
Missing docstring for DataFunction
. Check Documenter's build log for details.
GradientRobustMultiPhysics.∇
— Functionfunction ∇(UD::AbstractUserDataType; quadorder = UD.quadorder - 1) -> DataFunction
Provides a DataFunction with the same dependencies that evaluates the gradient of the DataFunction UD. The derivatives are computed by ForwardDiff.
Base.div
— Functionfunction Base.div(UD::AbstractUserDataType; quadorder = UD.quadorder - 1)
Provides a DataFunction with the same dependencies that evaluates the divergence of the DataFunction UD. The derivatives are computed by ForwardDiff.
GradientRobustMultiPhysics.curl
— Functionfunction curl(UD::AbstractUserDataType; quadorder = UD.quadorder - 1)
Provides a DataFunction with the same dependencies that evaluates the curl of the DataFunction UD. The derivatives are computed by ForwardDiff.
GradientRobustMultiPhysics.Δ
— Functionfunction Δ(UD::AbstractUserDataType; quadorder = UD.quadorder - 2)
Provides a DataFunction with the same dependencies that evaluates the Laplacian of the DataFunction UD. The derivatives are computed by ForwardDiff.
Action
Actions are used by abstract user-defined PDEOperators and consist of an action kernel function of the interface
function action_kernel!(result,input,[X,T,I,L])
# result = modified input, possibly depended on
# X = space coordinates
# T = time
# I = item information (vector with item number (w.r.t. AT), parent number and region number)
# L = local coordinates on item reference domain
end
plus some additional infrastructure like expected dimensiona of result and input and further dependencies
GradientRobustMultiPhysics.Action
— FunctionAction(
kernel::Function,
argsizes;
xdim,
Tv,
Ti,
dependencies,
bonus_quadorder,
name
) -> DefaultUserAction{Float64, Int32}
generates an Action that can be used in the construction of PDEoperators and essentially consists of a kernel function specified by the user plus additional information on argument dimensions and additional dependencies:
- kernel : Function with interface (result, input, ...)
- argsizes : expected lengths of [result, interface]
Optional arguments:
- dependencies : substring of "XTIL" that specifies if the kernel also depends on space coordinates (X), time (T), item (I), local coordinates (L)
- bonus_quadorder : is added to the quadrature order computed based on the used FESpaces during assembly
- name : name of this Action used in print messages
- Tv : expected NumberType for result/input
- Ti : expected NumberType for grid enumeration infos (e.g. item/region numbers when "I" dependecy is used)