OGS
DirichletBoundaryConditionWithinTimeInterval.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
11
12namespace ProcessLib
13{
16 BaseLib::TimeInterval time_interval,
17 ParameterLib::Parameter<double> const& parameter,
18 MeshLib::Mesh const& bc_mesh,
19 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
20 int const variable_id, int const component_id)
21 : _parameter(parameter),
22 _bc_mesh(bc_mesh),
23 _variable_id(variable_id),
24 _component_id(component_id),
25 _time_interval(std::move(time_interval))
26{
27 config(dof_table_bulk);
28}
29
31 NumLib::LocalToGlobalIndexMap const& dof_table_bulk)
32{
35
36 std::vector<MeshLib::Node*> const& bc_nodes = _bc_mesh.getNodes();
37 MeshLib::MeshSubset bc_mesh_subset(_bc_mesh, bc_nodes);
38
39 // Create local DOF table from the BC mesh subset for the given variable
40 // and component id.
42 _variable_id, {_component_id}, std::move(bc_mesh_subset));
43}
44
46 const double t, GlobalVector const& x,
48{
49 if (_time_interval.contains(t))
50 {
52 _variable_id, _component_id, t, x, bc_values);
53 return;
54 }
55
56 bc_values.ids.clear();
57 bc_values.values.clear();
58}
59} // namespace ProcessLib
MathLib::EigenVector GlobalVector
A subset of nodes on a single mesh.
Definition MeshSubset.h:17
std::unique_ptr< LocalToGlobalIndexMap > deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
void getEssentialBCValues(const double t, GlobalVector const &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
Writes the values of essential BCs to bc_values.
DirichletBoundaryConditionWithinTimeInterval(BaseLib::TimeInterval time_interval, ParameterLib::Parameter< double > const &parameter, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
std::unique_ptr< NumLib::LocalToGlobalIndexMap const > _dof_table_boundary
void getEssentialBCValuesLocal(ParameterLib::Parameter< double > const &parameter, MeshLib::Mesh const &bc_mesh, std::vector< std::size_t > const &nodes_in_bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, int const variable_id, int const component_id, const double t, GlobalVector const &, NumLib::IndexValueVector< GlobalIndexType > &bc_values)
void checkParametersOfDirichletBoundaryCondition(MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
std::vector< IndexType > ids
std::vector< double > values