13 #include "libmesh/utility.h" 21 #include "libmesh/utility.h" 22 #include "libmesh/quadrature.h" 23 #include "libmesh/enum_quadrature_type.h" 24 #include "libmesh/fe_type.h" 25 #include "libmesh/string_to_enum.h" 26 #include "libmesh/quadrature_gauss.h" 37 "contribution of mass dependent Rayleigh damping and HHT time " 38 "integration scheme.");
39 params.
set<
bool>(
"use_displaced_mesh") =
true;
42 "The rotational variables appropriate for the simulation geometry and coordinate system");
45 "The displacement variables appropriate for the simulation geometry and coordinate system");
46 params.
addCoupledVar(
"velocities",
"Translational velocity variables");
47 params.
addCoupledVar(
"accelerations",
"Translational acceleration variables");
48 params.
addCoupledVar(
"rotational_velocities",
"Rotational velocity variables");
49 params.
addCoupledVar(
"rotational_accelerations",
"Rotational acceleration variables");
50 params.
addParam<MaterialPropertyName>(
53 "Name of Material Property or a constant real number defining the density of the beam.");
57 "An integer corresponding to the direction " 58 "the variable this kernel acts in. (0 for disp_x, " 59 "1 for disp_y, 2 for disp_z, 3 for alpha, and 4 for beta)");
61 params.
addParam<MaterialPropertyName>(
"eta",
63 "Name of material property or a constant real " 64 "number defining the eta parameter for the " 68 "alpha >= -0.3333 & alpha <= 0.0",
69 "Alpha parameter for mass dependent numerical damping induced " 70 "by HHT time integration scheme");
77 _nrot(coupledComponents(
"rotations")),
78 _ndisp(coupledComponents(
"displacements")),
84 _rot_accel_num(_nrot),
85 _component(getParam<unsigned
int>(
"component")),
90 _eta(getMaterialProperty<
Real>(
"eta")),
91 _transformation_matrix(getADMaterialProperty<
RankTwoTensor>(
"transformation_matrix_element")),
92 _J_map(getADMaterialProperty<
Real>(
"J_mapping_t_points_0")),
93 _thickness(getParam<
Real>(
"thickness")),
94 _density(getMaterialProperty<
Real>(
"density")),
95 _alpha(getParam<
Real>(
"alpha"))
99 mooseError(
"InertialForceShell: The number of variables supplied in 'displacements' " 100 "must be 3 and that in 'rotations' must be 2.");
103 for (
unsigned int i = 0; i <
_ndisp; ++i)
108 for (
unsigned int i = 0; i <
_nrot; ++i)
161 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
162 for (
unsigned int i = 0; i <
_save_in.size(); i++)
178 "This is hard coded to index from 0 to 3, so we must have at least four spots in our " 179 "container. I'd prefer to assert that the size == 4, but I don't know what the " 180 "tensor mechanics folks expect.");
230 normal /= normal.
norm();
238 for (
unsigned int k = 0;
k <
_nodes.size(); ++
k)
254 mooseError(
"InertialForceShell: Time derivative of solution (`u_dot`) is not stored. Please " 255 "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
258 mooseError(
"InertialForceShell: Old time derivative of solution (`u_dot_old`) is not " 259 "stored. Please set uDotOldRequested() to true in FEProblemBase before " 260 "requesting `u_dot_old`.");
263 mooseError(
"InertialForceShell: Second time derivative of solution (`u_dotdot`) is not " 264 "stored. Please set uDotDotRequested() to true in FEProblemBase before " 265 "requesting `u_dotdot`.");
271 for (
unsigned int i = 0; i <
_ndisp; ++i)
279 _vel.
pos[0](i) = vel(dof_index_0);
280 _vel.
pos[1](i) = vel(dof_index_1);
281 _vel.
pos[2](i) = vel(dof_index_2);
282 _vel.
pos[3](i) = vel(dof_index_3);
295 for (
unsigned int i = 0; i <
_nrot; ++i)
303 _vel.
rot[0](i) = vel(dof_index_0);
304 _vel.
rot[1](i) = vel(dof_index_1);
305 _vel.
rot[2](i) = vel(dof_index_2);
306 _vel.
rot[3](i) = vel(dof_index_3);
381 for (
unsigned int i = 0; i < 3; i++)
471 std::vector<ADDenseVector> local_acc;
473 local_acc[0].resize(3);
474 local_acc[1].resize(3);
475 local_acc[2].resize(3);
476 local_acc[3].resize(3);
478 local_acc[0] = local_accel_dv_0;
479 local_acc[1] = local_accel_dv_1;
480 local_acc[2] = local_accel_dv_2;
481 local_acc[3] = local_accel_dv_3;
483 std::vector<ADDenseVector> local_rot_acc;
485 local_rot_acc[0].resize(3);
486 local_rot_acc[1].resize(3);
487 local_rot_acc[2].resize(3);
488 local_rot_acc[3].resize(3);
489 local_rot_acc[0] = local_rot_accel_dv_0;
490 local_rot_acc[1] = local_rot_accel_dv_1;
491 local_rot_acc[2] = local_rot_accel_dv_2;
492 local_rot_acc[3] = local_rot_accel_dv_3;
496 std::vector<ADDenseVector> local_vel;
498 local_vel[0].resize(3);
499 local_vel[1].resize(3);
500 local_vel[2].resize(3);
501 local_vel[3].resize(3);
512 local_vel_dv_0.
add(1.0, local_old_vel_dv_0);
513 local_vel_dv_1.
add(1.0, local_old_vel_dv_1);
514 local_vel_dv_2.
add(1.0, local_old_vel_dv_2);
515 local_vel_dv_3.
add(1.0, local_old_vel_dv_3);
517 local_vel[0] = local_vel_dv_0;
518 local_vel[1] = local_vel_dv_1;
519 local_vel[2] = local_vel_dv_2;
520 local_vel[3] = local_vel_dv_3;
522 std::vector<ADDenseVector> local_rot_vel;
524 local_rot_vel[0].resize(3);
525 local_rot_vel[1].resize(3);
526 local_rot_vel[2].resize(3);
527 local_rot_vel[3].resize(3);
538 local_rot_vel_dv_0.
add(1.0, local_old_rot_vel_dv_0);
539 local_rot_vel_dv_1.
add(1.0, local_old_rot_vel_dv_1);
540 local_rot_vel_dv_2.
add(1.0, local_old_rot_vel_dv_2);
541 local_rot_vel_dv_3.
add(1.0, local_old_rot_vel_dv_3);
543 local_rot_vel[0] = local_rot_vel_dv_0;
544 local_rot_vel[1] = local_rot_vel_dv_1;
545 local_rot_vel[2] = local_rot_vel_dv_2;
546 local_rot_vel[3] = local_rot_vel_dv_3;
549 FEType fe_type(Utility::string_to_enum<Order>(
"First"),
550 Utility::string_to_enum<FEFamily>(
"LAGRANGE"));
554 _phi_map = fe->get_fe_map().get_phi_map();
559 std::vector<const Node *> nodes;
560 for (
unsigned int i = 0; i < 4; ++i)
563 for (
unsigned int i = 0; i <
_ndisp; i++)
564 for (
unsigned int j = 0;
j < 4;
j++)
567 for (
unsigned int i = 0; i <
_nrot; i++)
568 for (
unsigned int j = 0;
j < 4;
j++)
571 for (
unsigned int qp_xy = 0; qp_xy <
_2d_points.size(); ++qp_xy)
576 for (
unsigned int dim = 0;
dim < 3;
dim++)
584 if (
_eta[0] > TOLERANCE * TOLERANCE)
597 if (
_eta[0] > TOLERANCE * TOLERANCE)
609 if (
_eta[0] > TOLERANCE * TOLERANCE)
622 if (
_eta[0] > TOLERANCE * TOLERANCE)
634 momentInertia(0) = (G1(0, 0) * (local_rot_acc[0](0) +
_eta[0] * local_rot_vel[0](0)) +
635 G1(0, 1) * (local_rot_acc[0](1) +
_eta[0] * local_rot_vel[0](1)) +
636 G2(0, 0) * (local_rot_acc[1](0) +
_eta[0] * local_rot_vel[1](0)) +
637 G2(0, 1) * (local_rot_acc[1](1) +
_eta[0] * local_rot_vel[1](1)) +
638 G3(0, 0) * (local_rot_acc[2](0) +
_eta[0] * local_rot_vel[2](0)) +
639 G3(0, 1) * (local_rot_acc[2](1) +
_eta[0] * local_rot_vel[2](1)) +
640 G4(0, 0) * (local_rot_acc[3](0) +
_eta[0] * local_rot_vel[3](0)) +
641 G4(0, 1) * (local_rot_acc[3](1) +
_eta[0] * local_rot_vel[3](1)));
643 momentInertia(1) = (G1(1, 0) * (local_rot_acc[0](0) +
_eta[0] * local_rot_vel[0](0)) +
644 G1(1, 1) * (local_rot_acc[0](1) +
_eta[0] * local_rot_vel[0](1)) +
645 G2(1, 0) * (local_rot_acc[1](0) +
_eta[0] * local_rot_vel[1](0)) +
646 G2(1, 1) * (local_rot_acc[1](1) +
_eta[0] * local_rot_vel[1](1)) +
647 G3(1, 0) * (local_rot_acc[2](0) +
_eta[0] * local_rot_vel[2](0)) +
648 G3(1, 1) * (local_rot_acc[2](1) +
_eta[0] * local_rot_vel[2](1)) +
649 G4(1, 0) * (local_rot_acc[3](0) +
_eta[0] * local_rot_vel[3](0)) +
650 G4(1, 1) * (local_rot_acc[3](1) +
_eta[0] * local_rot_vel[3](1)));
652 momentInertia(2) = (G1(2, 0) * (local_rot_acc[0](0) +
_eta[0] * local_rot_vel[0](0)) +
653 G1(2, 1) * (local_rot_acc[0](1) +
_eta[0] * local_rot_vel[0](1)) +
654 G2(2, 0) * (local_rot_acc[1](0) +
_eta[0] * local_rot_vel[1](0)) +
655 G2(2, 1) * (local_rot_acc[1](1) +
_eta[0] * local_rot_vel[1](1)) +
656 G3(2, 0) * (local_rot_acc[2](0) +
_eta[0] * local_rot_vel[2](0)) +
657 G3(2, 1) * (local_rot_acc[2](1) +
_eta[0] * local_rot_vel[2](1)) +
658 G4(2, 0) * (local_rot_acc[3](0) +
_eta[0] * local_rot_vel[3](0)) +
659 G4(2, 1) * (local_rot_acc[3](1) +
_eta[0] * local_rot_vel[3](1)));
662 (G1T(0, 0) * momentInertia(0) + G1T(0, 1) * momentInertia(1) +
663 G1T(0, 2) * momentInertia(2));
666 (G1T(1, 0) * momentInertia(0) + G1T(1, 1) * momentInertia(1) +
667 G1T(1, 2) * momentInertia(2));
670 (G1T(0, 0) * momentInertia(0) + G1T(0, 1) * momentInertia(1) +
671 G2T(0, 2) * momentInertia(2));
674 (G1T(1, 0) * momentInertia(0) + G1T(1, 1) * momentInertia(1) +
675 G2T(1, 2) * momentInertia(2));
678 (G1T(0, 0) * momentInertia(0) + G1T(0, 1) * momentInertia(1) +
679 G3T(0, 2) * momentInertia(2));
682 (G1T(1, 0) * momentInertia(0) + G1T(1, 1) * momentInertia(1) +
683 G3T(1, 2) * momentInertia(2));
686 (G1T(0, 0) * momentInertia(0) + G1T(0, 1) * momentInertia(1) +
687 G4T(0, 2) * momentInertia(2));
690 (G1T(1, 0) * momentInertia(0) + G1T(1, 1) * momentInertia(1) +
691 G4T(1, 2) * momentInertia(2));
std::array< ADRealVectorValue, 2 > _0g2_vectors
Node 2 g vectors.
std::vector< std::vector< Real > > _dphidxi_map
Derivatives of shape functions w.r.t isoparametric coordinates xi.
const Real _alpha
HHT time integration parameter.
virtual void computeResidual() override
auto norm() const -> decltype(std::norm(T()))
boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type add(const T2 factor, const DenseVector< T3 > &vec)
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void accumulateTaggedLocalResidual()
std::array< ADRealVectorValue, 2 > _0g3_vectors
Node 3 g vectors.
std::vector< MooseVariableFEBase *> _save_in
PosRotVectors _local_vel
Current shell nodal velocities in the local frame of reference.
PosRotVectors _old_vel
Old shell nodal velocities in the global frame of reference.
const MaterialProperty< Real > & _eta
Mass proportional Rayleigh damping parameter.
unsigned int number() const
PosRotVectors _local_accel
Current shell nodal accelerations in the local frame of reference.
const unsigned int _component
Direction along which residual is calculated.
virtual const std::vector< dof_id_type > & dofIndices() const
std::array< ADRealVectorValue, 4 > _local_moment
void resize(const unsigned int n)
std::array< ADRealVectorValue, 4 > _local_force
Forces and moments at the four nodes in the initial local configuration.
std::array< ADRealVectorValue, 4 > rot
virtual void precalculateResidual()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
const std::vector< double > y
PosRotVectors _local_old_vel
Old shell nodal velocities in the local frame of reference.
virtual void computeResidualsForJacobian() override
std::vector< unsigned int > _disp_num
Variable numbers corresponding to displacement variables.
std::vector< ADRealVectorValue > _node_normal
Normal to the element at the 4 nodes.
std::vector< Point > _2d_points
Quadrature points in the in-plane direction in isoparametric coordinate system.
const ADTemplateVariableTestValue< T > & _test
void scale(const T factor)
std::vector< std::vector< Real > > _dphideta_map
Derivatives of shape functions w.r.t isoparametric coordinates eta.
ADRealVectorValue _x3
Helper vector.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
std::array< ADRealVectorValue, 2 > _0g1_vectors
Node 1 g vectors.
const ADMaterialProperty< RankTwoTensor > & _transformation_matrix
Rotation matrix material property.
std::vector< const Node * > _nodes
Vector storing pointers to the nodes of the shell element.
std::vector< ADReal > _residuals
std::vector< std::vector< Real > > _phi_map
Shape function value.
const std::vector< double > x
std::array< ADRealVectorValue, 4 > pos
const ADReal _thickness
Coupled variable for the shell thickness.
virtual NumericVector< Number > * solutionUDot()
void get_transpose(DenseMatrix< T > &dest) const
PosRotVectors _accel
Current shell nodal accelerations in the global frame of reference.
virtual NumericVector< Number > * solutionUDotOld()
const QBase *const & _qrule
FEProblemBase & _fe_problem
std::vector< unsigned int > _rot_num
Variable numbers corresponding to rotational variables.
std::array< ADRealVectorValue, 4 > _global_moment
PosRotVectors _vel
Current shell nodal velocities in the global frame of reference.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
const MooseArray< ADReal > & _ad_JxW
unsigned int number() const
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
std::vector< ADRealVectorValue > _v1
First tangential vectors at nodes.
RankTwoTensorTempl< T > transpose() const
virtual void computeShellInertialForces(const MooseArray< ADReal > &_ad_coord, const MooseArray< ADReal > &_ad_JxW)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::array< ADRealVectorValue, 2 > _0g4_vectors
Node 4 g vectors.
std::vector< ADRealVectorValue > _v2
Second tangential vectors at nodes.
unsigned int _ndisp
Number of coupled displacement variables.
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", ADInertialForceShell)
DenseVector< Number > _local_re
unsigned int _nrot
Number of coupled rotational variables.
void mooseError(Args &&... args) const
MooseVariableFE< T > & _var
ADRankTwoTensor _original_local_config
Rotational transformation from global to initial shell local coordinate system.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Elem *const & _current_elem
std::array< ADRealVectorValue, 4 > _global_force
Forces and moments at the four nodes in the global coordinate system.
virtual NumericVector< Number > * solutionUDotDot()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
ADRealVectorValue _x2
Helper vector.
static const std::string k
static InputParameters validParams()
void ErrorVector unsigned int
const MooseArray< ADReal > & _ad_coord
ADInertialForceShell(const InputParameters ¶meters)
const MaterialProperty< Real > & _density
Shell material density.