OGS
BoundaryConditionCollection.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "BoundaryCondition.h"
17
18namespace ProcessLib
19{
21{
22public:
24 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const&
25 parameters)
26 : _parameters(parameters)
27 {
28 }
29
30 void applyNaturalBC(const double t, std::vector<GlobalVector*> const& x,
31 int const process_id, GlobalMatrix* K, GlobalVector& b,
32 GlobalMatrix* Jac) const;
33
34 std::vector<NumLib::IndexValueVector<GlobalIndexType>> const*
35 getKnownSolutions(double const t, GlobalVector const& x) const
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 }
46
48 std::vector<std::reference_wrapper<ProcessVariable>> const&
49 process_variables,
50 NumLib::LocalToGlobalIndexMap const& dof_table,
51 unsigned const integration_order, Process const& process,
52 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
53 media);
54
55 void addBoundaryCondition(std::unique_ptr<BoundaryCondition>&& bc)
56 {
57 _boundary_conditions.push_back(std::move(bc));
58 }
59
60 void preTimestep(const double t, std::vector<GlobalVector*> const& x,
61 int const process_id) const
62 {
63 for (auto const& bc_ptr : _boundary_conditions)
64 {
65 bc_ptr->preTimestep(t, x, process_id);
66 }
67 }
68
69 void postTimestep(const double t, std::vector<GlobalVector*> const& x,
70 int const process_id) const
71 {
72 for (auto const& bc_ptr : _boundary_conditions)
73 {
74 bc_ptr->postTimestep(t, x, process_id);
75 }
76 }
77
78private:
79 mutable std::vector<NumLib::IndexValueVector<GlobalIndexType>>
81 std::vector<std::unique_ptr<BoundaryCondition>> _boundary_conditions;
82 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const&
84};
85
86} // namespace ProcessLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
std::vector< NumLib::IndexValueVector< GlobalIndexType > > _dirichlet_bcs
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions(double const t, GlobalVector const &x) const
BoundaryConditionCollection(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
void postTimestep(const double t, std::vector< GlobalVector * > const &x, int const process_id) const
void addBoundaryCondition(std::unique_ptr< BoundaryCondition > &&bc)
std::vector< std::unique_ptr< BoundaryCondition > > _boundary_conditions
void applyNaturalBC(const double t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac) const
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & _parameters
void preTimestep(const double t, std::vector< GlobalVector * > const &x, int const process_id) 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)