Problem Description

Central object is the ProblemDescription which is given as a weak form of your problem and usually does not need any information on the discretisation at this point (but of course can depend on region numbers).

struct ProblemDescription

Structure holding data for a problem description with the following fields:

  • name::String: The name of the problem used for printout messages. Default: "My Problem"
  • unknowns::Vector{Unknown}: A vector of Unknowns that are involved in the problem.
  • operators::Vector{AbstractOperator}: A vector of operators that are involved in the problem.

Constructors and assign functions

assign_operator!(PD::ProblemDescription, o::AbstractOperator)

Assigns the AbstractOperator o to the ProblemDescription PD and returns its position in the operators array of the ProblemDescription.

assign_unknown!(PD::ProblemDescription, u::Unknown)

Assigns the Unknown u to the ProblemDescription PD and returns its position in the unknowns array of the ProblemDescription.

replace_operator!(PD::ProblemDescription, j::Int, o::AbstractOperator)

Replaces the j-th operator of the ProblemDescription PD by the new operator o. Here, j is the position in operator array returned by the assign_operator! function. Nothing is returned (as the new operator gets position j).



An Unknown is an identifies that encodes a physical quantity in the ProblemDescription.

struct Unknown

Structure holding information for an unknwon with the following fields:

  • name::String: The name of the unknown used for printout messages.
  • identifier::Any: The identifier of the unknown used for assignments to operators.
  • parameters::Dict{Symbol, Any}: Further properties of the unknown can be stored in a Dict, see constructor.
function Unknown(
	identifier = Symbol(u),
	name = u,

Generates and returns an Unknown with the specified name, identifier and other traits.

Example: BilinearOperator([grad(1)], [grad(1)]; kwargs...) generates a weak Laplace operator.

Keyword arguments:

  • algebraic_constraint: is this unknown an algebraic constraint?. 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

  • dimension: dimension of the unknown. Default: nothing



Operator is a quite general concept and is everything that makes modifications to the system matrix, hence classical represenations of weak discretisations of differential operators, penalisations for boundary conditions or global constraints, or stabilisation terms.

Types of operators

The three most important operator classes are:

  • NonlinearOperator (e.g. the convection term in a Navier-Stokes problem)
  • BilinearOperator (e.g. the Laplacian in a Poisson problem)
  • LinearOperator (e.g. the right-hand side in a Poisson or Navier-Stokes problem)

To assing boundary conditions or global constraints there are three possibilities:

  • InterpolateBoundaryData
  • HomogeneousData
  • FixDofs
  • CombineDofs

Entities and Regions

Each operator assembles on certain entities of the mesh, the default is a cell-wise assembly. Most operators have the entities kwarg to changes that. Restrictions to subsets of the entities can be made via the regions kwarg.

AT_NODESinterpolate at vertices of the mesh (only for H1-conforming FEM)
ON_CELLSassemble/interpolate on the cells of the mesh
ON_FACESassemble/interpolate on all faces of the mesh
ON_IFACESassemble/interpolate on the interior faces of the mesh
ON_BFACESassemble/interpolate on the boundary faces of the mesh
ON_EDGES (*)assemble/interpolate on all edges of the mesh (in 3D)
ON_BEDGES (*)assemble/interpolate on the boundary edges of the mesh (in 3D)

(*) = only reasonable in 3D and still experimental, might have some issues