Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* \file
* \copyright
* Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include "BoundaryCondition.h"
namespace BaseLib
{
class ConfigTree;
}
namespace ParameterLib
{
template <typename T>
struct Parameter;
}
namespace ProcessLib
{
// TODO docu
/// The PrimaryVariableConstraintDirichletBoundaryCondition class describes a
/// constant in space and time PrimaryVariableConstraintDirichlet boundary
/// condition. The expected parameter in the passed configuration is "value"
/// which, when not present defaults to zero.
class PrimaryVariableConstraintDirichletBoundaryCondition final
: public BoundaryCondition
{
public:
PrimaryVariableConstraintDirichletBoundaryCondition(
ParameterLib::Parameter<double> const& parameter,
MeshLib::Mesh const& bc_mesh,
NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
int const variable_id, int const component_id,
ParameterLib::Parameter<double> const& constraint_threshold_parameter,
bool const less);
void getEssentialBCValues(
const double t, GlobalVector const& x,
NumLib::IndexValueVector<GlobalIndexType>& bc_values) const override;
private:
ParameterLib::Parameter<double> const& _parameter;
MeshLib::Mesh const& _bc_mesh;
std::unique_ptr<NumLib::LocalToGlobalIndexMap const> _dof_table_boundary;
int const _variable_id;
int const _component_id;
/// The threshold value used to the switch off/on the Dirichlet-type
/// boundary condition.
ParameterLib::Parameter<double> const& _constraint_threshold_parameter;
/// The boolean value lower is used for the calculation of the constraint
/// criterion, i.e., if lower is set to true the criterion 'calculated_value
/// < constraint_threshold' is evaluated to switch on/off the boundary
/// condition, else 'calculated_value > constraint_threshold' is evaluated.
bool const _less;
};
std::unique_ptr<PrimaryVariableConstraintDirichletBoundaryCondition>
createPrimaryVariableConstraintDirichletBoundaryCondition(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& bc_mesh,
NumLib::LocalToGlobalIndexMap const& dof_table_bulk, int const variable_id,
int const component_id,
const std::vector<std::unique_ptr<ParameterLib::ParameterBase>>&
parameters);
} // namespace ProcessLib