8#include <range/v3/range/conversion.hpp>
9#include <range/v3/view/iota.hpp>
25 DBUG(
"Parse ReleaseNodalForce boundary condition.");
30 "The compensate_non_equilibrium_initial_residuum must be set for "
31 "the ReleaseNodalForce boundary condition.");
34 auto const& config = bc_config.
config;
38 auto const decay_parameter_name =
40 config.getConfigParameter<std::string>(
"time_decay_parameter");
41 DBUG(
"decay parameter {:s}", decay_parameter_name);
43 return decay_parameter_name;
47 unsigned const global_dim,
int const variable_id,
48 std::string
const& decay_parameter_name,
51 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
53 DBUG(
"Create ReleaseNodalForce boundary condition.");
58 "The compensate_non_equilibrium_initial_residuum must be set for "
59 "the ReleaseNodalForce boundary condition.");
63 decay_parameter_name, parameters, 1, &bc_mesh);
82 "The dimension ({:d}) of the given boundary mesh '{:s}' is not "
83 "lower than the bulk dimension ({:d}).",
88 auto const& number_of_components =
90 std::vector<int> component_ids =
91 ranges::views::iota(0, number_of_components) | ranges::to_vector;
94 std::vector<MeshLib::Node*>
const bc_nodes = bc_mesh.
getNodes();
95 DBUG(
"Found {:d} nodes for Natural BCs for the variable {:d}",
96 bc_nodes.size(), variable_id);
103 variable_id, std::move(component_ids), std::move(bc_mesh_subset));
108 if (time_decay_parameter(0, pos).front() - 1.0 >
109 std::numeric_limits<double>::epsilon())
112 "The time_decay_parameter '{:s}' must be equal to 1.0 at t=0.0. "
113 "and decrease over time to 0. ",
114 decay_parameter_name);
117 return std::make_unique<ReleaseNodalForce>(
118 variable_id, bc_mesh, dof_table_boundary, time_decay_parameter);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
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).
const std::string getName() const
Get name of the mesh.
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
int getNumberOfVariableComponents(int variable_id) const
std::unique_ptr< LocalToGlobalIndexMap > deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
void setNodeID(std::size_t node_id)
void setCoordinates(MathLib::Point3d const &coordinates)
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)
std::string parseReleaseNodalForce(BoundaryConditionConfig const &bc_config)
std::unique_ptr< BoundaryCondition > createReleaseNodalForce(unsigned const global_dim, int const variable_id, std::string const &decay_parameter_name, BoundaryConditionConfig const &bc_config, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters)
BaseLib::ConfigTree config
bool compensate_non_equilibrium_initial_residuum