Problem Description

The ProblemDescription is the central object for defining finite element problems in a high-level, flexible, and modular way. It encodes the weak form of your PDE, including unknowns, operators, and boundary or interface conditions, usually without requiring discretization details at this stage, but region numbers (for boundary conditions, etc.) may be referenced.

ExtendableFEM.ProblemDescriptionType
mutable struct ProblemDescription

A structure representing a finite element problem description, including unknowns and operators.

Fields

  • name::String: name of the problem (used in printouts and logs). Default: "My Problem".
  • unknowns::Vector{Unknown}: List of unknowns involved in the problem.
  • operators::Vector{AbstractOperator}: List of operators (e.g., bilinear forms, linear forms, boundary conditions) that define the problem.

Usage

Create a ProblemDescription using the default constructor, then assign unknowns and operators using assign_unknown! and assign_operator!.

source

Constructors and Assignment Functions

Use the following functions to construct and modify a ProblemDescription:

ExtendableFEM.assign_operator!Method
assign_operator!(
    PD::ProblemDescription,
    o::ExtendableFEM.AbstractOperator
) -> Int64

Adds an operator to a ProblemDescription.

Arguments

  • PD::ProblemDescription: The problem description to which the operator should be added.
  • o::AbstractOperator: The operator to add.

Returns

  • The index (position) of the operator in the operators array of PD.
source
ExtendableFEM.assign_unknown!Method
assign_unknown!(PD::ProblemDescription, u::Unknown) -> Any

Add an Unknown to a ProblemDescription, if not already present.

Arguments

  • PD::ProblemDescription: The problem description to which the unknown should be added.
  • u::Unknown: The unknown to add.

Returns

  • The index (position) of the unknown in the unknowns array of PD.

Notes

  • If the unknown is already present, a warning is issued and its existing position is returned.
source
ExtendableFEM.replace_operator!Method
replace_operator!(
    PD::ProblemDescription,
    j,
    o::ExtendableFEM.AbstractOperator
)

Replace an operator in a ProblemDescription at a specified position.

Arguments

  • PD::ProblemDescription: The problem description in which to replace the operator.
  • j::Int: The index (position) of the operator to replace.
  • o::AbstractOperator: The new operator to insert.
source

Unknowns

An Unknown represents a physical quantity (e.g., velocity, pressure, temperature) in the ProblemDescription. Unknowns are used to tag solution components and to specify which variables operators act on.

ExtendableFEM.UnknownType
mutable struct Unknown{IT}

A structure representing a problem "unknown" (e.g., a field variable) with associated metadata.

Fields

  • name::String: name of the unknown (used in printouts and messages).
  • identifier::IT: identifier for operator assignment and indexing.
  • parameters::Dict{Symbol, Any}: Dictionary of additional properties (e.g., dimension, symbols for ansatz/test functions, ...).

Type Parameters

  • IT: Type of the identifier (commonly Symbol).

Usage

Create an Unknown using the provided constructor, optionally specifying the name, identifier, and additional keyword arguments for parameters.

Example

u = Unknown("velocity"; dimension=2, symbol_ansatz="u", symbol_test="v")
source
ExtendableFEM.UnknownMethod
Unknown(
    u::String;
    identifier,
    name,
    kwargs...
) -> Unknown{Symbol}

Construct an Unknown representing a finite element field variable or problem unknown.

Arguments

  • u::String: Name of the unknown.
  • identifier: (optional) Symbolic or integer identifier for operator assignment and indexing (default: Symbol(u)).
  • name: (optional) name in printouts (default: u).
  • kwargs...: Additional keyword arguments to set or override entries in the parameters dictionary (see below).

Keyword Arguments

  • algebraic_constraint: is this unknown an algebraic constraint?. Default: nothing

  • dimension: dimension of the unknown. Default: nothing

  • symbol_ansatz: symbol for ansatz functions of this unknown in printouts. Default: nothing

  • symbol_test: symbol for test functions of this unknown in printouts. Default: nothing

Example

```julia u = Unknown("velocity"; dimension=2, symbolansatz="u", symboltest="v")

source
ExtendableFEM.jumpMethod
jump(o:Tuple{Union{Unknown, Int}, StandardFunctionOperator})

alias for (o[1], Jump{o[2]})

source
ExtendableFEM.otherMethod
other(o:Tuple{Union{Unknown, Int}, StandardFunctionOperator})

alias for (o[1], Right{o[2]})

source
ExtendableFEM.symgrad_voigtMethod
symgrad_voigt(u, factor)

alias for (u, SymmetricGradient{factor}) in Voigt notation.

The factor is a real number applied to the (summed) off-diagonal entries. In the current implementation in ExtendableFEMBase, factor = 0.5 represents the Voigt strain mapping [σ₁₁ σ₂₂ σ₃₃ σ₁₃ σ₂₃ σ₁₂], while factor = 1.0 represents the Voigt strain mapping [ε₁₁ ε₂₂ ε₃₃ 2ε₁₃ 2ε₂₃ 2ε₁₂].

source
ExtendableFEM.thisMethod
this(o:Tuple{Union{Unknown, Int}, StandardFunctionOperator})

alias for (o[1], Left{o[2]})

source

Operators

Operators define how terms contribute to the system matrix or right-hand side. They can represent weak forms of differential operators, stabilization terms, constraints, or boundary conditions.

Types of Operators

The main operator classes are:

For boundary conditions or global constraints, use:

Entities and Regions

Each operator assembles on certain mesh entities. The default is cell-wise assembly, but this can be changed via the entities keyword. Restrict assembly to subsets of entities using the regions keyword.

EntitiesDescription
AT_NODESInterpolate at mesh vertices (only for H1-conforming FEM)
ON_CELLSAssemble/interpolate on mesh cells
ON_FACESAssemble/interpolate on all mesh faces
ON_IFACESAssemble/interpolate on interior mesh faces
ON_BFACESAssemble/interpolate on boundary mesh faces
ON_EDGES (*)Assemble/interpolate on all mesh edges
ON_BEDGES (*)Assemble/interpolate on boundary mesh edges
Note

(*) = Only reasonable in 3D and still experimental; may have some issues.

Function Operators

Function operators specify the mathematical operation to be applied to an unknown within an operator term. Each operator is defined as a pair of an Unknown (or integer index) and a FunctionOperator (such as Identity, Gradient, etc.), e.g., (u, Identity) or (u, Gradient).

See the full list of function operators.

For convenience and readability, common operator pairs have short aliases:

  • id(u) for (u, Identity)
  • grad(u) for (u, Gradient)
  • div(u) for (u, Divergence)
  • curl1(u) for (u, CurlScalar)
  • curl2(u) for (u, Curl2D)
  • curl3(u) for (u, Curl3D)
  • laplace(u) or Δ(u) for (u, Laplacian)
  • hessian(u) for (u, Hessian)
  • normalflux(u) for (u, NormalFlux)
  • tangentialflux(u) for (u, TangentFlux)
  • tangentialgrad(u) for (u, TangentialGradient)
  • symgrad_voigt(u, factor) for (u, SymmetricGradient{factor}) in Voigt notation
  • εV(u, factor) as a unicode alias for symgrad_voigt(u, factor)
  • grid(u) for (u, "grid") (triggers gridplot in plot)
  • dofgrid(u) for (u, "dofgrid") (triggers gridplot for the dofgrid in plot)
  • apply(u, FO) for (u, FO) for any function operator type

Additional function operators for evaluating discontinuous quantities on faces (such as jump, average, this, other) are available.

For convenience, these discontinuous operator pairs also have short aliases:

  • jump((u, FO)) for (u, Jump{FO}) (jump across a face)
  • average((u, FO)) for (u, Average{FO}) (average across a face)
  • this((u, FO)) for (u, Left{FO}) (value on the left side of a face)
  • other((u, FO)) for (u, Right{FO}) (value on the right side of a face)

Here, FO can be any standard function operator (e.g., Identity, Gradient, etc.). Of course, also something like jump(id(u)) or jump(grad(u)) works.