OGS
ProcessLib::BoundaryConditionCollection Class Referencefinal

Detailed Description

Definition at line 20 of file BoundaryConditionCollection.h.

#include <BoundaryConditionCollection.h>

Public Member Functions

 BoundaryConditionCollection (std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
 
void applyNaturalBC (const double t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac) const
 
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions (double const t, GlobalVector const &x) const
 
void addBCsForProcessVariables (std::vector< std::reference_wrapper< ProcessVariable > > const &process_variables, NumLib::LocalToGlobalIndexMap const &dof_table, unsigned const integration_order, Process const &process, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
void addBoundaryCondition (std::unique_ptr< BoundaryCondition > &&bc)
 
void preTimestep (const double t, std::vector< GlobalVector * > const &x, int const process_id) const
 
void postTimestep (const double t, std::vector< GlobalVector * > const &x, int const process_id) const
 

Private Attributes

std::vector< NumLib::IndexValueVector< GlobalIndexType > > _dirichlet_bcs
 
std::vector< std::unique_ptr< BoundaryCondition > > _boundary_conditions
 
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & _parameters
 

Constructor & Destructor Documentation

◆ BoundaryConditionCollection()

ProcessLib::BoundaryConditionCollection::BoundaryConditionCollection ( std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters)
inlineexplicit

Definition at line 23 of file BoundaryConditionCollection.h.

26 : _parameters(parameters)
27 {
28 }
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & _parameters

Member Function Documentation

◆ addBCsForProcessVariables()

void ProcessLib::BoundaryConditionCollection::addBCsForProcessVariables ( std::vector< std::reference_wrapper< ProcessVariable > > const & process_variables,
NumLib::LocalToGlobalIndexMap const & dof_table,
unsigned const integration_order,
Process const & process,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

Definition at line 25 of file BoundaryConditionCollection.cpp.

31{
32 for (int variable_id = 0;
33 variable_id < static_cast<int>(process_variables.size());
34 ++variable_id)
35 {
36 ProcessVariable& pv = process_variables[variable_id];
37 auto bcs = pv.createBoundaryConditions(
38 dof_table, variable_id, integration_order, _parameters, process,
39 process_variables, media);
40
41 std::move(bcs.begin(), bcs.end(),
42 std::back_inserter(_boundary_conditions));
43 }
44
45 // For each BC there will be storage for Dirichlet BC. This storage will be
46 // uninitialized by default, and has to be filled by the respective BC
47 // object if needed.
49}
std::vector< NumLib::IndexValueVector< GlobalIndexType > > _dirichlet_bcs
std::vector< std::unique_ptr< BoundaryCondition > > _boundary_conditions

References _boundary_conditions, _dirichlet_bcs, _parameters, and ProcessLib::ProcessVariable::createBoundaryConditions().

◆ addBoundaryCondition()

void ProcessLib::BoundaryConditionCollection::addBoundaryCondition ( std::unique_ptr< BoundaryCondition > && bc)
inline

Definition at line 55 of file BoundaryConditionCollection.h.

56 {
57 _boundary_conditions.push_back(std::move(bc));
58 }

References _boundary_conditions.

◆ applyNaturalBC()

void ProcessLib::BoundaryConditionCollection::applyNaturalBC ( const double t,
std::vector< GlobalVector * > const & x,
int const process_id,
GlobalMatrix * K,
GlobalVector & b,
GlobalMatrix * Jac ) const

Definition at line 15 of file BoundaryConditionCollection.cpp.

18{
19 for (auto const& bc : _boundary_conditions)
20 {
21 bc->applyNaturalBC(t, x, process_id, K, b, Jac);
22 }
23}

References _boundary_conditions.

◆ getKnownSolutions()

std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * ProcessLib::BoundaryConditionCollection::getKnownSolutions ( double const t,
GlobalVector const & x ) const
inline

Definition at line 35 of file BoundaryConditionCollection.h.

36 {
37 auto const n_bcs = _boundary_conditions.size();
38 for (std::size_t i = 0; i < n_bcs; ++i)
39 {
40 auto const& bc = *_boundary_conditions[i];
41 auto& dirichlet_storage = _dirichlet_bcs[i];
42 bc.getEssentialBCValues(t, x, dirichlet_storage);
43 }
44 return &_dirichlet_bcs;
45 }

References _boundary_conditions, and _dirichlet_bcs.

◆ postTimestep()

void ProcessLib::BoundaryConditionCollection::postTimestep ( const double t,
std::vector< GlobalVector * > const & x,
int const process_id ) const
inline

Definition at line 69 of file BoundaryConditionCollection.h.

71 {
72 for (auto const& bc_ptr : _boundary_conditions)
73 {
74 bc_ptr->postTimestep(t, x, process_id);
75 }
76 }

References _boundary_conditions.

◆ preTimestep()

void ProcessLib::BoundaryConditionCollection::preTimestep ( const double t,
std::vector< GlobalVector * > const & x,
int const process_id ) const
inline

Definition at line 60 of file BoundaryConditionCollection.h.

62 {
63 for (auto const& bc_ptr : _boundary_conditions)
64 {
65 bc_ptr->preTimestep(t, x, process_id);
66 }
67 }

References _boundary_conditions.

Member Data Documentation

◆ _boundary_conditions

std::vector<std::unique_ptr<BoundaryCondition> > ProcessLib::BoundaryConditionCollection::_boundary_conditions
private

◆ _dirichlet_bcs

std::vector<NumLib::IndexValueVector<GlobalIndexType> > ProcessLib::BoundaryConditionCollection::_dirichlet_bcs
mutableprivate

Definition at line 80 of file BoundaryConditionCollection.h.

Referenced by addBCsForProcessVariables(), and getKnownSolutions().

◆ _parameters

std::vector<std::unique_ptr<ParameterLib::ParameterBase> > const& ProcessLib::BoundaryConditionCollection::_parameters
private

Definition at line 83 of file BoundaryConditionCollection.h.

Referenced by addBCsForProcessVariables().


The documentation for this class was generated from the following files: