25 int const variable_id,
int const component_id,
38 std::vector<MeshLib::Node*>
const& bc_nodes = bc_mesh.
getNodes();
44 variable_id, {component_id}, std::move(bc_mesh_subset));
53 bc_values.
ids.clear();
56 auto const& nodes_in_bc_mesh =
_bc_mesh.getNodes();
58 bc_values.
ids.reserve(bc_values.
ids.size() + nodes_in_bc_mesh.size());
59 bc_values.
values.reserve(bc_values.
values.size() + nodes_in_bc_mesh.size());
60 for (
auto const*
const node : nodes_in_bc_mesh)
62 auto const id = node->getID();
78 if (global_index >= 0)
81 auto const local_x = x.
get(std::vector{global_index});
86 bc_values.
ids.emplace_back(global_index);
92 bc_values.
ids.emplace_back(global_index);
103 DBUG(
"Parsing PrimaryVariableConstraintDirichletBoundaryCondition config.");
109 DBUG(
"parameter {:s}", name);
111 auto const threshold_parameter_name =
114 DBUG(
"parameter {:s} as threshold_parameter", threshold_parameter_name);
116 auto const comparison_operator_string =
120 return {name, threshold_parameter_name, comparison_operator_string};
123std::unique_ptr<PrimaryVariableConstraintDirichletBoundaryCondition>
128 int const component_id,
129 const std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters)
131 DBUG(
"Constructing PrimaryVariableConstraintDirichletBoundaryCondition.");
143 "The comparison operator is '{:s}', but has to be either "
144 "'greater' or 'less'.",
163 return std::make_unique<
165 parameter, bc_mesh, dof_table_bulk, variable_id, component_id,
166 threshold_parameter, less);
MathLib::EigenVector GlobalVector
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
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 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)
PrimaryVariableConstraintDirichletBoundaryConditionConfig parsePrimaryVariableConstraintDirichletBoundaryCondition(BaseLib::ConfigTree const &config)
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(PrimaryVariableConstraintDirichletBoundaryConditionConfig 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
std::string comparison_operator_string
std::string threshold_parameter_name
std::string parameter_name