DOLFIN-X
DOLFIN-X C++ interface
|
Interface for setting (strong) Dirichlet boundary conditions. More...
#include <DirichletBC.h>
Public Member Functions | |
DirichletBC (const std::shared_ptr< const function::Function > &g, const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 >> &dofs) | |
Create boundary condition. More... | |
DirichletBC (const std::shared_ptr< const function::Function > &g, const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 2 >> &V_g_dofs, std::shared_ptr< const function::FunctionSpace > V) | |
Create boundary condition. More... | |
DirichletBC (const DirichletBC &bc)=default | |
Copy constructor. More... | |
DirichletBC (DirichletBC &&bc)=default | |
Move constructor. More... | |
~DirichletBC ()=default | |
Destructor. | |
DirichletBC & | operator= (const DirichletBC &bc)=default |
Assignment operator. More... | |
DirichletBC & | operator= (DirichletBC &&bc)=default |
Move assignment operator. | |
std::shared_ptr< const function::FunctionSpace > | function_space () const |
The function space to which boundary conditions are applied. More... | |
std::shared_ptr< const function::Function > | value () const |
Return boundary value function g. More... | |
const Eigen::Array< std::int32_t, Eigen::Dynamic, 2 > & | dofs () const |
Get array of dof indices to which a Dirichlet boundary condition is applied. The array is sorted and may contain ghost entries. | |
const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 2 > > | dofs_owned () const |
Get array of dof indices owned by this process to which a Dirichlet BC is applied. The array is sorted and does not contain ghost entries. | |
void | set (Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> x, double scale=1.0) const |
Set bc entries in x to scale*x_bc. More... | |
void | set (Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> x, const Eigen::Ref< const Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> &x0, double scale=1.0) const |
Set bc entries in x to scale*(x0 - x_bc). More... | |
void | dof_values (Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> values) const |
Set boundary condition value for entres with an applied boundary condition. Other entries are not modified. More... | |
void | mark_dofs (std::vector< bool > &markers) const |
Set markers[i] = true if dof i has a boundary condition applied. Value of markers[i] is not changed otherwise. More... | |
Interface for setting (strong) Dirichlet boundary conditions.
u = g on G,
where u is the solution to be computed, g is a function and G is a sub domain of the mesh.
A DirichletBC is specified by the function g, the function space (trial space) and degrees of freedom to which the boundary condition applies.
DirichletBC::DirichletBC | ( | const std::shared_ptr< const function::Function > & | g, |
const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 >> & | dofs | ||
) |
Create boundary condition.
[in] | g | The boundary condition value. The boundary condition can be applied to a a function on the same space as g. |
[in] | dofs | Degree-of-freedom indices in the space of the boundary value function applied to V_dofs[i] |
DirichletBC::DirichletBC | ( | const std::shared_ptr< const function::Function > & | g, |
const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 2 >> & | V_g_dofs, | ||
std::shared_ptr< const function::FunctionSpace > | V | ||
) |
Create boundary condition.
[in] | g | The boundary condition value |
[in] | V_g_dofs | 2D array of degree-of-freedom indices. First column are indices in the space where boundary condition is applied (V), second column are indices in the space of the boundary condition value function g. |
[in] | V | The function (sub)space on which the boundary condition is applied |
|
default |
Copy constructor.
[in] | bc | The object to be copied |
|
default |
Move constructor.
[in] | bc | The object to be moved |
void DirichletBC::dof_values | ( | Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> | values | ) | const |
Set boundary condition value for entres with an applied boundary condition. Other entries are not modified.
std::shared_ptr< const function::FunctionSpace > DirichletBC::function_space | ( | ) | const |
The function space to which boundary conditions are applied.
void DirichletBC::mark_dofs | ( | std::vector< bool > & | markers | ) | const |
Set markers[i] = true if dof i has a boundary condition applied. Value of markers[i] is not changed otherwise.
|
default |
Assignment operator.
[in] | bc | Another DirichletBC object |
void DirichletBC::set | ( | Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> | x, |
const Eigen::Ref< const Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> & | x0, | ||
double | scale = 1.0 |
||
) | const |
Set bc entries in x to scale*(x0 - x_bc).
void DirichletBC::set | ( | Eigen::Ref< Eigen::Matrix< PetscScalar, Eigen::Dynamic, 1 >> | x, |
double | scale = 1.0 |
||
) | const |
Set bc entries in x to scale*x_bc.
std::shared_ptr< const function::Function > DirichletBC::value | ( | ) | const |
Return boundary value function g.