32 int const variable_id,
int const component_id,
35 : _parameter(parameter),
37 _variable_id(variable_id),
38 _component_id(component_id),
39 _threshold_parameter(threshold_parameter),
45 std::vector<MeshLib::Node*>
const& bc_nodes = bc_mesh.
getNodes();
51 variable_id, {component_id}, std::move(bc_mesh_subset));
60 bc_values.
ids.clear();
65 bc_values.
ids.reserve(bc_values.
ids.size() + nodes_in_bc_mesh.size());
66 bc_values.
values.reserve(bc_values.
values.size() + nodes_in_bc_mesh.size());
67 for (
auto const*
const node : nodes_in_bc_mesh)
69 auto const id = node->getID();
85 if (global_index >= 0)
88 auto const local_x = x.
get(std::vector{global_index});
93 bc_values.
ids.emplace_back(global_index);
99 bc_values.
ids.emplace_back(global_index);
106std::unique_ptr<PrimaryVariableConstraintDirichletBoundaryCondition>
110 int const component_id,
111 const std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters)
114 "Constructing PrimaryVariableConstraintDirichletBoundaryCondition from "
121 DBUG(
"Using parameter {:s}", param_name);
124 param_name, parameters, 1, &bc_mesh);
126 auto const threshold_parameter_name =
129 DBUG(
"Using parameter {:s} as threshold_parameter",
130 threshold_parameter_name);
133 threshold_parameter_name, parameters, 1, &bc_mesh);
135 auto const comparison_operator_string =
138 if (comparison_operator_string !=
"greater" &&
139 comparison_operator_string !=
"less")
142 "The comparison operator is '{:s}', but has to be either "
143 "'greater' or 'less'.",
144 comparison_operator_string);
146 bool const less = comparison_operator_string ==
"less";
162 return std::make_unique<
164 parameter, bc_mesh, dof_table_bulk, variable_id, component_id,
165 threshold_parameter, less);
Defines functions that are shared by DirichletBoundaryCondition and DirichletBoundaryConditionWithinT...
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
T getConfigParameter(std::string const ¶m) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
Global vector based on Eigen vector.
double get(IndexType rowId) const
get entry
A subset of nodes on a single mesh.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
std::size_t getID() const
Get id of the mesh.
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
std::unique_ptr< LocalToGlobalIndexMap > deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
static constexpr NUMLIB_EXPORT GlobalIndexType const nop
void setNodeID(std::size_t node_id)
void setCoordinates(MathLib::Point3d const &coordinates)
void getEssentialBCValues(const double t, GlobalVector const &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override
Writes the values of essential BCs to bc_values.
PrimaryVariableConstraintDirichletBoundaryCondition(ParameterLib::Parameter< double > const ¶meter, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id, ParameterLib::Parameter< double > const &threshold_parameter, bool const less)
std::unique_ptr< NumLib::LocalToGlobalIndexMap const > _dof_table_boundary
ParameterLib::Parameter< double > const & _threshold_parameter
ParameterLib::Parameter< double > const & _parameter
< parameter that defines the Dirirchlet-type condition values
MeshLib::Mesh const & _bc_mesh
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
void checkParametersOfDirichletBoundaryCondition(MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id)
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 > > ¶meters)
std::vector< IndexType > ids
std::vector< double > values