Implements a symmetric Dirichlet boundary condition. More...
#include <SymmetricDirichletBC.hpp>
Inherits DirichletBC< Basis, Path, Path, ValueGridFct >.
Public Member Functions | |
| template<class B > | |
| SymmetricDirichletBC (B &&basis, Path const &path, BoundarySubset< Intersection > boundarySubset, ValueGridFct values) | |
| template<class Mat , class Sol , class Rhs > | |
| void | apply (Mat &matrix, Sol &solution, Rhs &rhs) |
Public Member Functions inherited from DirichletBC< Basis, Path, Path, ValueGridFct > | |
| DirichletBC (B &&basis, Path const &row, Path const &col, BoundarySubset< Intersection > boundarySubset, ValueGridFct values) | |
| Make a DirichletBC from a basis with treepath arguments. | |
| DirichletBC (B &&basis, BoundarySubset< Intersection > boundarySubset, ValueGridFct values) | |
| Make a DirichletBC from a global basis. | |
| void | init () |
| void | apply (Mat &matrix, Sol &solution, Rhs &rhs, bool symmetric=false) |
| Apply dirichlet BC to matrix and vector. | |
Implements a symmetric Dirichlet boundary condition.
This class enforces Dirichlet boundary values by eliminating both rows and columns of the constrained degrees of freedom using MatZeroRowsColumns. This preserves symmetry and positive definiteness of the system matrix when row and column DOF sets coincide.
Motivation: The standard DirichletBC implementation eliminates only matrix rows. While this correctly enforces Dirichlet values, it breaks matrix symmetry, which can significantly degrade convergence of symmetric Krylov solvers such as Conjugate Gradient.
SymmetricDirichletBC restores symmetry by eliminating both rows and columns of constrained DOFs. This typically results in faster and more robust CG convergence for symmetric operators (e.g. Laplace or elasticity).
Usage constraints:
| Basis | GlobalBasis of the solution space |
| Path | TreePath identifying the constrained subspace |
| ValueGridFct | GridFunction providing Dirichlet values |