Rodin/Variational/DirichletBC.h file

Dirichlet boundary condition implementation.

This file defines classes for imposing Dirichlet (essential) boundary conditions in finite element problems. Dirichlet conditions prescribe the solution values on specified boundaries.

Mathematical Foundation

A Dirichlet boundary condition specifies:

\[ u = g \quad \text{on} \quad \Gamma_D \]

where $ u $ is the solution, $ g $ is the prescribed boundary value, and $ \Gamma_D $ is a portion of the domain boundary.

Implementation

Dirichlet conditions are typically enforced by:

  1. Identifying boundary degrees of freedom
  2. Setting their values to $ g $
  3. Modifying the system matrix and right-hand side

Usage Example

// Homogeneous Dirichlet BC (u = 0 on boundary)
auto bc = DirichletBC(u, Zero());

// Inhomogeneous Dirichlet BC
auto g = [](const Point& p) { return sin(p.x()); };
auto bc = DirichletBC(u, g).on(1);  // On boundary attribute 1

Namespaces

namespace Rodin
The Rodin library for Shape and Topology Optimization.
namespace Rodin::Variational
Module which provides the necessary tools for constructing variational problems.

Classes

template<class Scalar>
class Rodin::Variational::DirichletBCBase
Abstract base class for a Dirichlet boundary condition.
template<class Solution, class FES, class ValueDerived>
class Rodin::Variational::DirichletBC<TrialFunction<Solution, FES>, FunctionBase<ValueDerived>>
Represents a Dirichlet boundary condition on a ShapeFunction object.