16#include <range/v3/range/conversion.hpp>
17#include <range/v3/view/iota.hpp>
32 unsigned const global_dim,
int const variable_id,
35 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
37 DBUG(
"Create ReleaseNodalForce boundary condition.");
42 "The compensate_non_equilibrium_initial_residuum must be set for "
43 "the ReleaseNodalForce boundary condition.");
46 auto const& config = bc_config.
config;
50 auto const parameter_name =
52 config.getConfigParameter<std::string>(
"time_decay_parameter");
53 DBUG(
"Using parameter {:s}", parameter_name);
56 parameter_name, parameters, 1, &bc_mesh);
75 "The dimension ({:d}) of the given boundary mesh '{:s}' is not "
76 "lower than the bulk dimension ({:d}).",
81 auto const& number_of_components =
83 std::vector<int> component_ids =
84 ranges::views::iota(0, number_of_components) | ranges::to_vector;
87 std::vector<MeshLib::Node*>
const bc_nodes = bc_mesh.
getNodes();
88 DBUG(
"Found {:d} nodes for Natural BCs for the variable {:d}",
89 bc_nodes.size(), variable_id);
96 variable_id, std::move(component_ids), std::move(bc_mesh_subset));
101 if (time_decay_parameter(0, pos).front() - 1.0 >
102 std::numeric_limits<double>::epsilon())
105 "The time_decay_parameter '{:s}' must be equal to 1.0 at t=0.0. "
106 "and decrease over time to 0. ",
110 return std::make_unique<ReleaseNodalForce>(
111 variable_id, bc_mesh, dof_table_boundary, time_decay_parameter);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
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::unique_ptr< BoundaryCondition > createReleaseNodalForce(unsigned const global_dim, int const variable_id, 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