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.

CharacterExplanation
Xdepends on (vector-valued) space coordinates
Tdepends on time coordinate
Idepends on item information (item nr, parent nr, region)
Ldepends 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.DataFunctionType
DataFunction(
    kernel::Function,
    argsizes;
    Tv,
    Ti,
    dependencies,
    bonus_quadorder,
    name
) -> DataFunction{Float64, Int32, _A, _B, _C, _D, _E, <:Function} where {_A, _B, _C, _D, _E}

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)
source
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.

source

There are also derivatives defined for DataFunctions that generate another DataFunction where the derivative is calculated via ForwardDiff.

Missing docstring.

Missing docstring for DataFunction. Check Documenter's build log for details.

GradientRobustMultiPhysics.∇Function
function ∇(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.

source
Base.divFunction
function 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.

source
GradientRobustMultiPhysics.curlFunction
function 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.

source
GradientRobustMultiPhysics.ΔFunction
function Δ(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.

source

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.ActionFunction
Action(
    kernel::Function,
    argsizes;
    xdim,
    Tv,
    Ti,
    dependencies,
    bonus_quadorder,
    name
) -> DefaultUserAction{Float64, Int32, _A, _B, _C, _D, _E, <:Function} where {_A, _B, _C, _D, _E}

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)
source