OGS
BoundaryConditionCollection.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <typeinfo>
7
9#include "ReleaseNodalForce.h"
10
11namespace ProcessLib
12{
13
15 GlobalVector const* r_neq) const
16{
18
19 for (auto const& bc : _boundary_conditions)
20 {
21 auto* release_nodal_forces = dynamic_cast<ReleaseNodalForce*>(bc.get());
22 if (!release_nodal_forces)
23 {
24 continue;
25 }
26 // For ReleasedNodalForce, we need to set the non-equilibrium
27 // initial residuum vector.
28 release_nodal_forces->set(r_neq);
29 }
30}
31
33 const double t, std::vector<GlobalVector*> const& x, int const process_id,
34 GlobalMatrix* K, GlobalVector& b, GlobalMatrix* Jac) const
35{
36 for (auto const& bc : _boundary_conditions)
37 {
38 bc->applyNaturalBC(t, x, process_id, K, b, Jac);
39 }
40}
41
43 std::vector<std::reference_wrapper<ProcessVariable>> const&
44 process_variables,
45 NumLib::LocalToGlobalIndexMap const& dof_table,
46 unsigned const integration_order, Process const& process,
47 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
48{
49 for (int variable_id = 0;
50 variable_id < static_cast<int>(process_variables.size());
51 ++variable_id)
52 {
53 ProcessVariable& pv = process_variables[variable_id];
54 auto bcs = pv.createBoundaryConditions(
55 dof_table, variable_id, integration_order, _parameters, process,
56 process_variables, media);
57
58 std::move(bcs.begin(), bcs.end(),
59 std::back_inserter(_boundary_conditions));
60 }
61
62 // For each BC there will be storage for Dirichlet BC. This storage will be
63 // uninitialized by default, and has to be filled by the respective BC
64 // object if needed.
66}
67} // namespace ProcessLib
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
std::vector< NumLib::IndexValueVector< GlobalIndexType > > _dirichlet_bcs
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 setReleaseNodalForces(GlobalVector const *r_neq) 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)
std::vector< std::unique_ptr< BoundaryCondition > > createBoundaryConditions(const NumLib::LocalToGlobalIndexMap &dof_table, const int variable_id, unsigned const integration_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, Process const &process, std::vector< std::reference_wrapper< ProcessVariable > > const &all_process_variables_for_this_process, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
Boundary condition for simulating excavation using the release nodal force approach.
void set(GlobalVector const *r_neq)
void setLocalAccessibleVector(PETScVector const &x)
Definition LinAlg.cpp:20