24 "alpha >= -0.3333 & alpha <= 0.0",
25 "Alpha parameter for mass dependent numerical damping induced " 26 "by HHT time integration scheme");
27 params.
addParam<
Real>(
"mass",
"Mass associated with the node");
30 "The file containing the nodal positions and the corresponding nodal masses.");
31 params.
addParam<
Real>(
"gravity_value", 0.0,
"Acceleration due to gravity.");
34 "function",
"1",
"A function that describes the gravitational force");
40 _has_mass(isParamValid(
"mass")),
41 _has_nodal_mass_file(isParamValid(
"nodal_mass_file")),
42 _mass(_has_mass ? getParam<
Real>(
"mass") : 0.0),
43 _alpha(getParam<
Real>(
"alpha")),
44 _gravity_value(getParam<
Real>(
"gravity_value")),
45 _function(getFunction(
"function"))
48 mooseError(
"NodalGravity: Please provide either mass or nodal_mass_file as input.");
50 mooseError(
"NodalGravity: Please provide either mass or nodal_mass_file as input, not both.");
56 nodal_mass_file.
read();
57 std::vector<std::vector<Real>> data = nodal_mass_file.
getData();
59 mooseError(
"NodalGravity: The number of columns in ",
60 getParam<FileName>(
"nodal_mass_file"),
63 unsigned int node_found = 0;
65 for (
auto & bnd_id : bnd_ids)
68 for (
auto & bnd_node : bnd_node_set)
73 for (
unsigned int i = 0; i < data[0].size(); ++i)
86 if (node_found != data[0].size())
89 " nodal positions in ",
90 getParam<FileName>(
"nodal_mass_file"),
93 " nodes were found in the boundary.");
108 mooseError(
"NodalGravity: Unable to find an entry for the current node in the " 109 "_node_id_to_mass map.");
112 return mass * -factor;
void setHeaderFlag(HeaderFlag value)
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const Real _gravity_value
Acceleration due to gravity.
const std::vector< std::vector< double > > & getData() const
virtual Real computeQpResidual() override
virtual const Node & nodeRef(const dof_id_type i) const
const bool _has_mass
Booleans for validity of params.
static InputParameters validParams()
const Real _alpha
HHT time integration parameter.
const std::vector< dof_id_type > & getNodeList(boundary_id_type nodeset_id) const
const Function & _function
Time and space dependent factor multiplying acceleration due to gravity.
NodalGravity(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _mass
Mass associated with the node.
const bool _has_nodal_mass_file
void mooseError(Args &&... args) const
std::map< dof_id_type, Real > _node_id_to_mass
Map between boundary nodes and nodal mass.
const Node *const & _current_node
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", NodalGravity)
Calculates the gravitational force proportional to nodal mass.
virtual const std::set< BoundaryID > & boundaryIDs() const