-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for affine constraints on dofs (#401)
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
Showing
7 changed files
with
409 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
... |
Oops, something went wrong.