A wrapper for boundary conditions. More...
#include <boundary_conditions.h>
Public Member Functions | |
BoundaryConditions (const std::string §ion_name="", const std::string &component_names="u", const std::vector< std::set< types::boundary_id >> &ids={{numbers::internal_face_boundary_id}}, const std::vector< std::string > &selected_components={"u"}, const std::vector< BoundaryConditionType > &bc_type={BoundaryConditionType::dirichlet}, const std::vector< std::string > &expressions={"0"}) | |
Constructor. More... | |
void | update_user_substitution_map (const Differentiation::SD::types::substitution_map &substitution_map) |
Update the substitition map of every Functions::SymbolicFunction defined in this object. More... | |
void | set_additional_function_arguments (const Differentiation::SD::types::substitution_map &arguments) |
Call Functions::SymbolicFunction::set_additional_function_arguments() for every function defined in this object. More... | |
void | set_time (const double &time) |
Update time in each Functions::SymbolicFunction defined in this object. More... | |
template<typename Tria > | |
void | check_consistency (const Tria &tria) const |
Check that the grid is compatible with this boundary condition object, and that the boundary conditions are self consistent. More... | |
void | check_consistency () const |
Make sure the specified boundary conditions make sense. More... | |
template<int dim> | |
void | apply_essential_boundary_conditions (const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< double > &constraints) const |
Add essential boundary conditions computed with this object to the specified constraints. More... | |
template<int dim> | |
void | apply_essential_boundary_conditions (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< double > &constraints) const |
Add the boundary conditions computed with this object to the specified constraints for non standard mapping. More... | |
template<int dim, typename MatrixType , typename VectorType > | |
void | apply_natural_boundary_conditions (const DoFHandler< dim, spacedim > &dof_handler, const AffineConstraints< double > &constraints, MatrixType &matrix, VectorType &rhs) const |
Add natural boundary conditions computed with this object to the specified constraints, matrix, and rhs. More... | |
template<int dim, typename MatrixType , typename VectorType > | |
void | apply_natural_boundary_conditions (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const AffineConstraints< double > &constraints, MatrixType &matrix, VectorType &rhs) const |
Same as above for non standard mapping. More... | |
std::set< types::boundary_id > | get_essential_boundary_ids () const |
Get all ids where we impose essential boundary conditions. More... | |
std::set< types::boundary_id > | get_natural_boundary_ids () const |
Get all ids where we impose natural boundary conditions. More... | |
![]() | |
ParameterAcceptor (const std::string §ion_name="") | |
unsigned int | get_acceptor_id () const |
virtual | ~ParameterAcceptor () override |
virtual void | declare_parameters (ParameterHandler &prm) |
virtual void | parse_parameters (ParameterHandler &prm) |
std::string | get_section_name () const |
std::vector< std::string > | get_section_path () const |
void | add_parameter (const std::string &entry, ParameterType ¶meter, const std::string &documentation="", ParameterHandler &prm_=prm, const Patterns::PatternBase &pattern=*Patterns::Tools::Convert< ParameterType >::to_pattern()) |
void | enter_subsection (const std::string &subsection) |
void | leave_subsection () |
void | enter_my_subsection (ParameterHandler &prm) |
void | leave_my_subsection (ParameterHandler &prm) |
void | serialize (Archive &ar, const unsigned int version) |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
![]() | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) noexcept | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) noexcept |
void | serialize (Archive &ar, const unsigned int version) |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
Private Attributes | |
const std::string | component_names |
Component names of the boundary conditions. More... | |
const unsigned int | n_components |
Number of components of the problem. More... | |
unsigned int | n_boundary_conditions |
Number of boundary conditions. More... | |
std::vector< std::set< types::boundary_id > > | ids |
Ids on which this object applies boundary conditions. More... | |
std::vector< std::string > | selected_components |
Component on which to apply the boundary condition. More... | |
std::vector< BoundaryConditionType > | bc_type |
Type of boundary conditions. More... | |
std::vector< std::string > | expressions |
Expressions for the boundary conditions. More... | |
std::vector< std::unique_ptr< Functions::SymbolicFunction< spacedim > > > | functions |
The actual functions. More... | |
std::vector< ComponentMask > | masks |
Component on which to apply the boundary condition. More... | |
std::vector< Components::Type > | types |
Component types. More... | |
GridInfo | grid_info |
Information about the grid this BC applies to. More... | |
Additional Inherited Members | |
![]() | |
static void | initialize (const std::string &filename="", const std::string &output_filename="", const ParameterHandler::OutputStyle output_style_for_output_filename=ParameterHandler::Short, ParameterHandler &prm=ParameterAcceptor::prm, const ParameterHandler::OutputStyle output_style_for_filename=ParameterHandler::DefaultStyle) |
static void | initialize (std::istream &input_stream, ParameterHandler &prm=ParameterAcceptor::prm) |
static void | clear () |
static void | parse_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
static void | declare_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
![]() | |
boost::signals2::signal< void()> | declare_parameters_call_back |
boost::signals2::signal< void()> | parse_parameters_call_back |
![]() | |
static ParameterHandler | prm |
![]() | |
const std::string | section_name |
std::vector< std::string > | subsections |
A wrapper for boundary conditions.
This class can be used to store different types of boundary conditions, applied to different ids of the domain boundary.
Definition at line 63 of file boundary_conditions.h.
ParsedTools::BoundaryConditions< spacedim >::BoundaryConditions | ( | const std::string & | section_name = "" , |
const std::string & | component_names = "u" , |
||
const std::vector< std::set< types::boundary_id >> & | ids = {{numbers::internal_face_boundary_id}} , |
||
const std::vector< std::string > & | selected_components = {"u"} , |
||
const std::vector< BoundaryConditionType > & | bc_type = {BoundaryConditionType::dirichlet} , |
||
const std::vector< std::string > & | expressions = {"0"} |
||
) |
Constructor.
Definition at line 30 of file boundary_conditions.cc.
References ParameterAcceptor::add_parameter(), ParsedTools::BoundaryConditions< spacedim >::component_names, ParsedTools::BoundaryConditions< spacedim >::ids, Patterns::List::max_int_value, and ParsedTools::BoundaryConditions< spacedim >::n_components.
void ParsedTools::BoundaryConditions< spacedim >::update_user_substitution_map | ( | const Differentiation::SD::types::substitution_map & | substitution_map | ) |
Update the substitition map of every Functions::SymbolicFunction defined in this object.
See the documentation of Functions::SymbolicFunction::update_user_substitution_map().
Definition at line 201 of file boundary_conditions.cc.
void ParsedTools::BoundaryConditions< spacedim >::set_additional_function_arguments | ( | const Differentiation::SD::types::substitution_map & | arguments | ) |
Call Functions::SymbolicFunction::set_additional_function_arguments() for every function defined in this object.
See the documentation of Functions::SymbolicFunction::set_additional_function_arguments().
Definition at line 224 of file boundary_conditions.cc.
void ParsedTools::BoundaryConditions< spacedim >::set_time | ( | const double & | time | ) |
Update time in each Functions::SymbolicFunction defined in this object.
Definition at line 235 of file boundary_conditions.cc.
|
inline |
Check that the grid is compatible with this boundary condition object, and that the boundary conditions are self consistent.
Definition at line 116 of file boundary_conditions.h.
References ParsedTools::GridInfo::build_info(), ParsedTools::BoundaryConditions< spacedim >::check_consistency(), and ParsedTools::BoundaryConditions< spacedim >::grid_info.
void ParsedTools::BoundaryConditions< spacedim >::check_consistency |
Make sure the specified boundary conditions make sense.
Do this, independently of the Triangulation this object is associated with.
Definition at line 113 of file boundary_conditions.cc.
References AssertThrow, and StandardExceptions::ExcMessage().
Referenced by ParsedTools::BoundaryConditions< spacedim >::check_consistency().
void ParsedTools::BoundaryConditions< spacedim >::apply_essential_boundary_conditions | ( | const DoFHandler< dim, spacedim > & | dof_handler, |
AffineConstraints< double > & | constraints | ||
) | const |
Add essential boundary conditions computed with this object to the specified constraints.
void ParsedTools::BoundaryConditions< spacedim >::apply_essential_boundary_conditions | ( | const Mapping< dim, spacedim > & | mapping, |
const DoFHandler< dim, spacedim > & | dof_handler, | ||
AffineConstraints< double > & | constraints | ||
) | const |
Add the boundary conditions computed with this object to the specified constraints for non standard mapping.
void ParsedTools::BoundaryConditions< spacedim >::apply_natural_boundary_conditions | ( | const DoFHandler< dim, spacedim > & | dof_handler, |
const AffineConstraints< double > & | constraints, | ||
MatrixType & | matrix, | ||
VectorType & | rhs | ||
) | const |
Add natural boundary conditions computed with this object to the specified constraints, matrix, and rhs.
Notice that constraintes must be still open before calling this function, and will be used to assemble the matrix and rhs parts of the boundary conditions.
Call this function after you have added all constraints to your constraints object. After this call, the constraints will be closed.
void ParsedTools::BoundaryConditions< spacedim >::apply_natural_boundary_conditions | ( | const Mapping< dim, spacedim > & | mapping, |
const DoFHandler< dim, spacedim > & | dof_handler, | ||
const AffineConstraints< double > & | constraints, | ||
MatrixType & | matrix, | ||
VectorType & | rhs | ||
) | const |
Same as above for non standard mapping.
Notice that constraintes must be still open before calling this function, and will be used to assemble the matrix and rhs parts of the boundary conditions.
Call this function after you have added all constraints to your constraints object. After this call, the constraints will be closed.
std::set< types::boundary_id > ParsedTools::BoundaryConditions< spacedim >::get_essential_boundary_ids |
Get all ids where we impose essential boundary conditions.
Definition at line 245 of file boundary_conditions.cc.
References ParsedTools::dirichlet, and ParsedTools::first_dof.
std::set< types::boundary_id > ParsedTools::BoundaryConditions< spacedim >::get_natural_boundary_ids |
Get all ids where we impose natural boundary conditions.
Definition at line 261 of file boundary_conditions.cc.
References ParsedTools::neumann.
|
private |
Component names of the boundary conditions.
Definition at line 208 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< spacedim >::BoundaryConditions(), and ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().
|
private |
Number of components of the problem.
Definition at line 213 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< spacedim >::BoundaryConditions().
|
mutableprivate |
Number of boundary conditions.
Definition at line 218 of file boundary_conditions.h.
|
private |
Ids on which this object applies boundary conditions.
Definition at line 223 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< spacedim >::BoundaryConditions().
|
private |
Component on which to apply the boundary condition.
Definition at line 228 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().
|
private |
Type of boundary conditions.
Definition at line 233 of file boundary_conditions.h.
|
private |
Expressions for the boundary conditions.
Definition at line 238 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().
|
private |
The actual functions.
Definition at line 244 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().
|
private |
Component on which to apply the boundary condition.
Definition at line 249 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< dim >::update_user_substitution_map().
|
private |
Component types.
Definition at line 254 of file boundary_conditions.h.
|
mutableprivate |
Information about the grid this BC applies to.
Definition at line 260 of file boundary_conditions.h.
Referenced by ParsedTools::BoundaryConditions< spacedim >::check_consistency().