21 #include "libmesh/quadrature.h" 29 params.
addClassDescription(
"Quasi-static and dynamic stress divergence kernel for Beam element");
32 "An integer corresponding to the direction " 33 "the variable this kernel acts in. (0 for disp_x, " 34 "1 for disp_y, 2 for disp_z, 3 for rot_x, 4 for rot_y and 5 for rot_z)");
37 "The displacements appropriate for the simulation geometry and coordinate system");
39 "rotations",
"The rotations appropriate for the simulation geometry and coordinate system");
40 params.
addParam<MaterialPropertyName>(
43 "Name of material property or a constant real number defining the zeta parameter for the " 46 "alpha", 0.0,
"alpha >= -0.3333 & alpha <= 0.0",
"alpha parameter for HHT time integration");
48 params.
set<
bool>(
"use_displaced_mesh") =
true;
54 _component(getParam<unsigned
int>(
"component")),
55 _ndisp(coupledComponents(
"displacements")),
57 _nrot(coupledComponents(
"rotations")),
61 _K11(getMaterialPropertyByName<
RankTwoTensor>(
"Jacobian_11")),
62 _K22(getMaterialPropertyByName<
RankTwoTensor>(
"Jacobian_22")),
63 _K22_cross(getMaterialPropertyByName<
RankTwoTensor>(
"Jacobian_22_cross")),
64 _K21_cross(getMaterialPropertyByName<
RankTwoTensor>(
"Jacobian_12")),
65 _K21(getMaterialPropertyByName<
RankTwoTensor>(
"Jacobian_21")),
66 _original_length(getMaterialPropertyByName<
Real>(
"original_length")),
67 _total_rotation(getMaterialPropertyByName<
RankTwoTensor>(
"total_rotation")),
68 _zeta(getMaterialProperty<
Real>(
"zeta")),
69 _alpha(getParam<
Real>(
"alpha")),
70 _isDamped(getParam<MaterialPropertyName>(
"zeta") !=
"0.0" ||
std::
abs(_alpha) > 0.0),
71 _force_old(_isDamped ? &getMaterialPropertyOld<
RealVectorValue>(
"forces") : nullptr),
72 _moment_old(_isDamped ? &getMaterialPropertyOld<
RealVectorValue>(
"moments") : nullptr),
73 _total_rotation_old(_isDamped ? &getMaterialPropertyOld<
RankTwoTensor>(
"total_rotation")
79 _total_rotation_older(
std::
abs(_alpha) > 0.0
83 _global_moment_res(0),
91 "StressDivergenceBeam: The number of displacement and rotation variables should be same.");
93 for (
unsigned int i = 0; i <
_ndisp; ++i)
96 for (
unsigned int i = 0; i <
_nrot; ++i)
106 "StressDivergenceBeam: Beam element must have two nodes only.");
130 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
141 for (
unsigned int i = 0; i <
_test.size(); ++i)
143 for (
unsigned int j = 0;
j <
_phi.size(); ++
j)
167 for (
unsigned int i = 0; i < rows; ++i)
170 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
183 unsigned int coupled_component = 0;
184 bool disp_coupled =
false;
185 bool rot_coupled =
false;
187 for (
unsigned int i = 0; i <
_ndisp; ++i)
191 coupled_component = i;
197 for (
unsigned int i = 0; i <
_nrot; ++i)
201 coupled_component = i + 3;
209 if (disp_coupled || rot_coupled)
211 for (
unsigned int i = 0; i <
_test.size(); ++i)
213 for (
unsigned int j = 0;
j <
_phi.size(); ++
j)
217 else if (_component < 3 && coupled_component > 2)
224 else if (
_component > 2 && coupled_component < 3)
252 std::vector<RealVectorValue> & global_moment_res)
254 mooseAssert(
_zeta[0] >= 0.0,
"StressDivergenceBeam: Zeta parameter should be non-negative.");
255 std::vector<RealVectorValue> global_force_res_old(
_test.size());
256 std::vector<RealVectorValue> global_moment_res_old(
_test.size());
261 std::vector<RealVectorValue> global_force_res_older(
_test.size());
262 std::vector<RealVectorValue> global_moment_res_older(
_test.size());
268 global_force_res_older,
269 global_moment_res_older);
275 global_force_res[
_i] =
279 global_moment_res[
_i] =
290 std::vector<RealVectorValue> & global_force_res,
291 std::vector<RealVectorValue> & global_moment_res)
static InputParameters validParams()
const MaterialProperty< RealVectorValue > * _moment_older
Older moment vector in global coordinate system.
std::vector< RealVectorValue > _global_force_res
Residual corresponding to displacement DOFs at the nodes in global coordinate system.
unsigned int _ndisp
Number of coupled displacement variables.
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
const MaterialProperty< RealVectorValue > & _force
Current force vector in global coordinate system.
StressDivergenceBeam(const InputParameters ¶meters)
static InputParameters validParams()
void accumulateTaggedLocalResidual()
std::vector< MooseVariableFEBase *> _save_in
const MaterialProperty< RankTwoTensor > & _K11
Stiffness matrix relating displacement DOFs of same node or across nodes.
unsigned int number() const
const MaterialProperty< RankTwoTensor > & _K21
Stiffness matrix relating displacement and rotations of same node.
static const std::string component
const MaterialProperty< RankTwoTensor > & _K22_cross
Stiffness matrix relating rotational DOFs across nodes.
void computeDynamicTerms(std::vector< RealVectorValue > &global_force_res, std::vector< RealVectorValue > &global_moment_res)
Computes the force and moment due to stiffness proportional damping and HHT time integration.
std::vector< unsigned int > _disp_var
Variable numbers corresponding to displacement variables.
const MaterialProperty< RankTwoTensor > & _K22
Stiffness matrix relating rotational DOFs of same node.
const MaterialProperty< RealVectorValue > * _force_older
Older force vector in global coordinate system.
DenseMatrix< Number > _local_ke
const MaterialProperty< RankTwoTensor > & _K21_cross
Stiffness matrix relating displacement of one node to rotations of another node.
const MaterialProperty< RankTwoTensor > * _total_rotation_old
Rotational transformation from global to old beam local coordinate system.
std::vector< RealVectorValue > _global_moment_res
Residual corresponding to rotational DOFs at the nodes in global coordinate system.
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
std::vector< RealVectorValue > _local_force_res
Residual corresponding to displacement DOFs at the nodes in beam local coordinate system...
const VariableTestValue & _test
const MaterialProperty< RankTwoTensor > & _total_rotation
Rotational transformation from global to current beam local coordinate system.
std::vector< MooseVariableFEBase *> _diag_save_in
const unsigned int _component
Direction along which force/moment is calculated.
const QBase *const & _qrule
const MaterialProperty< RankTwoTensor > * _total_rotation_older
Rotational transformation from global to older beam local coordinate system.
virtual void computeJacobian() override
virtual void computeResidual() override
void accumulateTaggedLocalMatrix()
const Real & _alpha
HHT time integration parameter.
registerMooseObject("SolidMechanicsApp", StressDivergenceBeam)
std::vector< RealVectorValue > _local_moment_res
Residual corresponding to rotational DOFs at the nodes in beam local coordinate system.
const MaterialProperty< RealVectorValue > * _moment_old
Old moment vector in global coordinate system.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void computeGlobalResidual(const MaterialProperty< RealVectorValue > *force, const MaterialProperty< RealVectorValue > *moment, const MaterialProperty< RankTwoTensor > *total_rotation, std::vector< RealVectorValue > &global_force_res, std::vector< RealVectorValue > &global_moment_res)
Computes the residual corresponding to displacement and rotational variables given the forces and mom...
std::vector< RealVectorValue > _force_local_t
Forces at each Qp in the beam local configuration.
const MaterialProperty< Real > & _original_length
Initial length of beam.
DenseVector< Number > _local_re
const MaterialProperty< Real > & _zeta
Stiffness proportional Rayleigh damping parameter.
void mooseError(Args &&... args) const
virtual unsigned int size() const override final
virtual void computeOffDiagJacobian(unsigned int jvar) override
std::vector< unsigned int > _rot_var
Variable numbers corresponding to rotational variables.
std::vector< RealVectorValue > _moment_local_t
Moments at each Qp in the beam local configuration.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const bool _isDamped
Boolean flag to turn on Rayleigh damping or numerical damping due to HHT time integration.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
const MaterialProperty< RealVectorValue > & _moment
Current moment vector in global coordinate system.
const VariablePhiValue & _phi
void ErrorVector unsigned int
unsigned int _nrot
Number of coupled rotational variables.
const MaterialProperty< RealVectorValue > * _force_old
Old force vector in global coordinate system.