Implements a boundary condition of Dirichlet-type. More...
#include <DirichletBC.hpp>
Public Member Functions | |
template<class B > | |
DirichletBC (B &&basis, RowPath const &row, ColPath const &col, BoundarySubset< Intersection > boundarySubset, ValueGridFct values) | |
Make a DirichletBC from a basis with treepath arguments. | |
template<class B > | |
DirichletBC (B &&basis, BoundarySubset< Intersection > boundarySubset, ValueGridFct values) | |
Make a DirichletBC from a global basis. | |
void | init () |
template<class Mat , class Sol , class Rhs > | |
void | apply (Mat &matrix, Sol &solution, Rhs &rhs, bool symmetric=false) |
Apply dirichlet BC to matrix and vector. More... | |
Implements a boundary condition of Dirichlet-type.
By calling the methods init and finish before and after assembling the system-matrix, respectively, dirichlet boundary conditions can be applied to the matrix and system vector. Therefore, a predicate functions indicates the DOFs where values should be enforced and a second functor provided in the constructor is responsible for determining the values to be set at the DOFs.
In the finish method the matrix is called with apply to erase the corresponding rows and columns for the DOF indices. This application of boundary conditions can be symmetric if the matrix does support this symmetric modification.
Basis | GlobalBasis of the solution FE space |
RowPath | Path to the row-node where the boundary condition should be applied to. |
ColPath | Path to the col-node where the boundary condition should be applied to. |
ValueGridFct | Type of the GridFunction representing the Dirichlet values. |
void apply | ( | Mat & | matrix, |
Sol & | solution, | ||
Rhs & | rhs, | ||
bool | symmetric = false |
||
) |
Apply dirichlet BC to matrix and vector.
Add a unit-row to the matrix and optionally delete the corresponding matrix-column.
symmetric | Apply a symmetric form of the DBC, by eliminating entries in the column of the matrix |
void init |
Fill dirichletNodes_ with 1 or 0 whether DOF corresponds to the boundary or not.