Skip to content

Commit

Permalink
Add support for affine constraints on dofs (#401)
Browse files Browse the repository at this point in the history
This adds the AffineConstraint constraint type that can be added to the
constraint handler. An affine constraint of the form
    u_i = \sum_j (c_j * u_j) + b,
where u_i are dofs, c_j scaling factors and b a inhomogeneity is
constructed and added to the constraint handler as
    ac = AffineConstraint(i, [u_j => c_j, ...], b)
    add!(ch, ac)

Sparsity patterns must then be constructed with the constraint handler
e.g. create_sparsity_pattern(dh, ch), and apply! must be used after
solving the system (apply!(u, ch), where u is the solution).
  • Loading branch information
lijas committed Feb 7, 2022
1 parent 085a30a commit 27192eb
Show file tree
Hide file tree
Showing 7 changed files with 409 additions and 49 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ makedocs(
"manual/degrees_of_freedom.md",
"manual/assembly.md",
"manual/boundary_conditions.md",
"manual/constraints.md",
"manual/grid.md",
"manual/export.md"
],
Expand Down
37 changes: 37 additions & 0 deletions docs/src/manual/constraints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
```@meta
DocTestSetup = :(using Ferrite)
```

# Constraints

PDEs can in general be subjected to a number of constraints,

```math
g_I(\boldsymbol{a}) = 0, \quad I = 1 \text{ to } n_c
```

where ``g`` are (non-linear) constraint equations, $\boldsymbol{a}$ is a vector of the
degrees of freedom, and ``n_c`` is the number of constraints. There are many ways to
enforce these constraints, e.g. penalty methods and Lagrange multiplier methods. A special
case is when the constraint equations are affine/linear, in which they can be enforced in a
special way. This is explained below.

## Affine constraints

Affine (or linear) constraints can be written as

```math
a_i = \sum_j C_{ij} a_j + g_i
```

or in matrix form

```math
\boldsymbol{a}_c = \boldsymbol{C} \boldsymbol{a}_f + \boldsymbol{g}
```

where ``\boldsymbol{a}_c`` is a vector of the constrained dofs, ``\boldsymbol{a}_f`` is a
vector of free dofs, ``\boldsymbol{g}`` contains possible inhomogeneities, and
``\boldsymbol{C}`` is matrix defining the connectivity between constrained and free dofs.

...
Loading

0 comments on commit 27192eb

Please sign in to comment.