Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
InertialForceBeam.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "InertialForceBeam.h"
11 #include "SubProblem.h"
12 #include "libmesh/utility.h"
13 #include "MooseVariable.h"
14 #include "Assembly.h"
15 #include "NonlinearSystem.h"
16 #include "AuxiliarySystem.h"
17 #include "MooseMesh.h"
18 
19 registerMooseObject("SolidMechanicsApp", InertialForceBeam);
20 
23 {
25  params.addClassDescription("Calculates the residual for the inertial force/moment and the "
26  "contribution of mass dependent Rayleigh damping and HHT time "
27  "integration scheme.");
28  params.set<bool>("use_displaced_mesh") = true;
29  params.addRequiredCoupledVar(
30  "rotations",
31  "The rotational variables appropriate for the simulation geometry and coordinate system");
32  params.addRequiredCoupledVar(
33  "displacements",
34  "The displacement variables appropriate for the simulation geometry and coordinate system");
35  params.addCoupledVar("velocities", "Translational velocity variables");
36  params.addCoupledVar("accelerations", "Translational acceleration variables");
37  params.addCoupledVar("rotational_velocities", "Rotational velocity variables");
38  params.addCoupledVar("rotational_accelerations", "Rotational acceleration variables");
39  params.addRangeCheckedParam<Real>(
40  "beta", "beta>0.0", "beta parameter for Newmark Time integration");
41  params.addRangeCheckedParam<Real>(
42  "gamma", "gamma>0.0", "gamma parameter for Newmark Time integration");
43  params.addParam<MaterialPropertyName>("eta",
44  0.0,
45  "Name of material property or a constant real "
46  "number defining the eta parameter for the "
47  "Rayleigh damping.");
48  params.addRangeCheckedParam<Real>("alpha",
49  0.0,
50  "alpha >= -0.3333 & alpha <= 0.0",
51  "Alpha parameter for mass dependent numerical damping induced "
52  "by HHT time integration scheme");
53  params.addParam<MaterialPropertyName>(
54  "density",
55  "density",
56  "Name of Material Property or a constant real number defining the density of the beam.");
57  params.addRequiredCoupledVar("area", "Variable containing cross-section area");
58  params.addCoupledVar("Ay", 0.0, "Variable containing first moment of area about y axis");
59  params.addCoupledVar("Az", 0.0, "Variable containing first moment of area about z axis");
60  params.addCoupledVar("Ix",
61  "Variable containing second moment of area about x axis. Defaults to Iy+Iz");
62  params.addRequiredCoupledVar("Iy", "Variable containing second moment of area about y axis");
63  params.addRequiredCoupledVar("Iz", "Variable containing second moment of area about z axis");
64  params.addRequiredRangeCheckedParam<unsigned int>(
65  "component",
66  "component<6",
67  "An integer corresponding to the direction "
68  "the variable this kernel acts in. (0 for disp_x, "
69  "1 for disp_y, 2 for disp_z, 3 for rot_x, 4 for rot_y and 5 for rot_z)");
70  return params;
71 }
72 
74  : TimeKernel(parameters),
75  _has_beta(isParamValid("beta")),
76  _has_gamma(isParamValid("gamma")),
77  _has_velocities(isParamValid("velocities")),
78  _has_rot_velocities(isParamValid("rotational_velocities")),
79  _has_accelerations(isParamValid("accelerations")),
80  _has_rot_accelerations(isParamValid("rotational_accelerations")),
81  _has_Ix(isParamValid("Ix")),
82  _density(getMaterialProperty<Real>("density")),
83  _nrot(coupledComponents("rotations")),
84  _ndisp(coupledComponents("displacements")),
85  _rot_num(_nrot),
86  _disp_num(_ndisp),
87  _vel_num(_ndisp),
88  _accel_num(_ndisp),
89  _rot_vel_num(_nrot),
90  _rot_accel_num(_nrot),
91  _area(coupledValue("area")),
92  _Ay(coupledValue("Ay")),
93  _Az(coupledValue("Az")),
94  _Ix(_has_Ix ? coupledValue("Ix") : _zero),
95  _Iy(coupledValue("Iy")),
96  _Iz(coupledValue("Iz")),
97  _beta(_has_beta ? getParam<Real>("beta") : 0.1),
98  _gamma(_has_gamma ? getParam<Real>("gamma") : 0.1),
99  _eta(getMaterialProperty<Real>("eta")),
100  _alpha(getParam<Real>("alpha")),
101  _original_local_config(getMaterialPropertyByName<RankTwoTensor>("initial_rotation")),
102  _original_length(getMaterialPropertyByName<Real>("original_length")),
103  _component(getParam<unsigned int>("component")),
104  _local_force(2),
105  _local_moment(2)
106 {
107  // Checking for consistency between the length of the provided rotations and displacements vector
108  if (_ndisp != _nrot)
109  mooseError("InertialForceBeam: The number of variables supplied in 'displacements' and "
110  "'rotations' must match.");
111 
114  {
115  if ((coupledComponents("velocities") != _ndisp) ||
116  (coupledComponents("accelerations") != _ndisp) ||
117  (coupledComponents("rotational_velocities") != _ndisp) ||
118  (coupledComponents("rotational_accelerations") != _ndisp))
119  mooseError(
120  "InertialForceBeam: The number of variables supplied in 'velocities', "
121  "'accelerations', 'rotational_velocities' and 'rotational_accelerations' must match "
122  "the number of displacement variables.");
123 
124  // fetch coupled velocities and accelerations
125  for (unsigned int i = 0; i < _ndisp; ++i)
126  {
127  MooseVariable * vel_variable = getVar("velocities", i);
128  _vel_num[i] = vel_variable->number();
129 
130  MooseVariable * accel_variable = getVar("accelerations", i);
131  _accel_num[i] = accel_variable->number();
132 
133  MooseVariable * rot_vel_variable = getVar("rotational_velocities", i);
134  _rot_vel_num[i] = rot_vel_variable->number();
135 
136  MooseVariable * rot_accel_variable = getVar("rotational_accelerations", i);
137  _rot_accel_num[i] = rot_accel_variable->number();
138  }
139  }
140  else if (!_has_beta && !_has_gamma && !_has_velocities && !_has_accelerations &&
142  {
143  _du_dot_du = &coupledDotDu("displacements", 0);
144  _du_dotdot_du = &coupledDotDotDu("displacements", 0);
145  }
146  else
147  mooseError("InertialForceBeam: Either all or none of `beta`, `gamma`, `velocities`, "
148  "`accelerations`, `rotational_velocities` and `rotational_accelerations` should be "
149  "provided as input.");
150 
151  // fetch coupled displacements and rotations
152  for (unsigned int i = 0; i < _ndisp; ++i)
153  {
154  MooseVariable * disp_variable = getVar("displacements", i);
155  _disp_num[i] = disp_variable->number();
156 
157  MooseVariable * rot_variable = getVar("rotations", i);
158  _rot_num[i] = rot_variable->number();
159  }
160 }
161 
162 void
164 {
166 
167  if (_dt != 0.0)
168  {
169  // fetch the two end nodes for _current_elem
170  std::vector<const Node *> node;
171  for (unsigned int i = 0; i < 2; ++i)
172  node.push_back(_current_elem->node_ptr(i));
173 
174  // Fetch the solution for the two end nodes at time t
176 
177  if (_has_beta)
178  {
179  const NumericVector<Number> & sol = *nonlinear_sys.currentSolution();
180  const NumericVector<Number> & sol_old = nonlinear_sys.solutionOld();
181 
183  const NumericVector<Number> & aux_sol_old = aux.solutionOld();
184 
185  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
186  mooseAssert(_eta[0] >= 0.0, "InertialForceBeam: Eta parameter should be non-negative.");
187 
188  for (unsigned int i = 0; i < _ndisp; ++i)
189  {
190  // obtain delta displacement
191  unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
192  unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
193  const Real disp_0 = sol(dof_index_0) - sol_old(dof_index_0);
194  const Real disp_1 = sol(dof_index_1) - sol_old(dof_index_1);
195 
196  dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
197  dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
198  const Real rot_0 = sol(dof_index_0) - sol_old(dof_index_0);
199  const Real rot_1 = sol(dof_index_1) - sol_old(dof_index_1);
200 
201  // obtain new translational and rotational velocities and accelerations using newmark-beta
202  // time integration
203  _vel_old_0(i) = aux_sol_old(node[0]->dof_number(aux.number(), _vel_num[i], 0));
204  _vel_old_1(i) = aux_sol_old(node[1]->dof_number(aux.number(), _vel_num[i], 0));
205  const Real accel_old_0 = aux_sol_old(node[0]->dof_number(aux.number(), _accel_num[i], 0));
206  const Real accel_old_1 = aux_sol_old(node[1]->dof_number(aux.number(), _accel_num[i], 0));
207 
208  _rot_vel_old_0(i) = aux_sol_old(node[0]->dof_number(aux.number(), _rot_vel_num[i], 0));
209  _rot_vel_old_1(i) = aux_sol_old(node[1]->dof_number(aux.number(), _rot_vel_num[i], 0));
210  const Real rot_accel_old_0 =
211  aux_sol_old(node[0]->dof_number(aux.number(), _rot_accel_num[i], 0));
212  const Real rot_accel_old_1 =
213  aux_sol_old(node[1]->dof_number(aux.number(), _rot_accel_num[i], 0));
214 
215  _accel_0(i) =
216  1. / _beta * (disp_0 / (_dt * _dt) - _vel_old_0(i) / _dt - accel_old_0 * (0.5 - _beta));
217  _accel_1(i) =
218  1. / _beta * (disp_1 / (_dt * _dt) - _vel_old_1(i) / _dt - accel_old_1 * (0.5 - _beta));
219  _rot_accel_0(i) =
220  1. / _beta *
221  (rot_0 / (_dt * _dt) - _rot_vel_old_0(i) / _dt - rot_accel_old_0 * (0.5 - _beta));
222  _rot_accel_1(i) =
223  1. / _beta *
224  (rot_1 / (_dt * _dt) - _rot_vel_old_1(i) / _dt - rot_accel_old_1 * (0.5 - _beta));
225 
226  _vel_0(i) = _vel_old_0(i) + (_dt * (1 - _gamma)) * accel_old_0 + _gamma * _dt * _accel_0(i);
227  _vel_1(i) = _vel_old_1(i) + (_dt * (1 - _gamma)) * accel_old_1 + _gamma * _dt * _accel_1(i);
228  _rot_vel_0(i) = _rot_vel_old_0(i) + (_dt * (1 - _gamma)) * rot_accel_old_0 +
229  _gamma * _dt * _rot_accel_0(i);
230  _rot_vel_1(i) = _rot_vel_old_1(i) + (_dt * (1 - _gamma)) * rot_accel_old_1 +
231  _gamma * _dt * _rot_accel_1(i);
232  }
233  }
234  else
235  {
236  if (!nonlinear_sys.solutionUDot())
237  mooseError("InertialForceBeam: Time derivative of solution (`u_dot`) is not stored. Please "
238  "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
239 
240  if (!nonlinear_sys.solutionUDotOld())
241  mooseError("InertialForceBeam: Old time derivative of solution (`u_dot_old`) is not "
242  "stored. Please set uDotOldRequested() to true in FEProblemBase before "
243  "requesting `u_dot_old`.");
244 
245  if (!nonlinear_sys.solutionUDotDot())
246  mooseError("InertialForceBeam: Second time derivative of solution (`u_dotdot`) is not "
247  "stored. Please set uDotDotRequested() to true in FEProblemBase before "
248  "requesting `u_dotdot`.");
249 
250  const NumericVector<Number> & vel = *nonlinear_sys.solutionUDot();
251  const NumericVector<Number> & vel_old = *nonlinear_sys.solutionUDotOld();
252  const NumericVector<Number> & accel = *nonlinear_sys.solutionUDotDot();
253 
254  for (unsigned int i = 0; i < _ndisp; ++i)
255  {
256  // translational velocities and accelerations
257  unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
258  unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _disp_num[i], 0);
259  _vel_0(i) = vel(dof_index_0);
260  _vel_1(i) = vel(dof_index_1);
261  _vel_old_0(i) = vel_old(dof_index_0);
262  _vel_old_1(i) = vel_old(dof_index_1);
263  _accel_0(i) = accel(dof_index_0);
264  _accel_1(i) = accel(dof_index_1);
265 
266  // rotational velocities and accelerations
267  dof_index_0 = node[0]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
268  dof_index_1 = node[1]->dof_number(nonlinear_sys.number(), _rot_num[i], 0);
269  _rot_vel_0(i) = vel(dof_index_0);
270  _rot_vel_1(i) = vel(dof_index_1);
271  _rot_vel_old_0(i) = vel_old(dof_index_0);
272  _rot_vel_old_1(i) = vel_old(dof_index_1);
273  _rot_accel_0(i) = accel(dof_index_0);
274  _rot_accel_1(i) = accel(dof_index_1);
275  }
276  }
277 
278  // transform translational and rotational velocities and accelerations to the initial local
279  // configuration of the beam
286 
293 
294  // local residual
295  for (unsigned int i = 0; i < _ndisp; ++i)
296  {
297  if (_component < 3)
298  {
299  _local_force[0](i) = _density[0] * _area[0] * _original_length[0] / 3.0 *
300  (_local_accel_0(i) + _local_accel_1(i) / 2.0 +
301  _eta[0] * (1.0 + _alpha) * (_local_vel_0(i) + _local_vel_1(i) / 2.0) -
302  _alpha * _eta[0] * (_local_vel_old_0(i) + _local_vel_old_1(i) / 2.0));
303  _local_force[1](i) = _density[0] * _area[0] * _original_length[0] / 3.0 *
304  (_local_accel_1(i) + _local_accel_0(i) / 2.0 +
305  _eta[0] * (1.0 + _alpha) * (_local_vel_1(i) + _local_vel_0(i) / 2.0) -
306  _alpha * _eta[0] * (_local_vel_old_1(i) + _local_vel_old_0(i) / 2.0));
307  }
308 
309  if (_component > 2)
310  {
311  Real I = _Iy[0] + _Iz[0];
312  if (_has_Ix && (i == 0))
313  I = _Ix[0];
314  if (i == 1)
315  I = _Iz[0];
316  else if (i == 2)
317  I = _Iy[0];
318 
319  _local_moment[0](i) =
320  _density[0] * I * _original_length[0] / 3.0 *
321  (_local_rot_accel_0(i) + _local_rot_accel_1(i) / 2.0 +
322  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(i) + _local_rot_vel_1(i) / 2.0) -
323  _alpha * _eta[0] * (_local_rot_vel_old_0(i) + _local_rot_vel_old_1(i) / 2.0));
324  _local_moment[1](i) =
325  _density[0] * I * _original_length[0] / 3.0 *
326  (_local_rot_accel_1(i) + _local_rot_accel_0(i) / 2.0 +
327  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(i) + _local_rot_vel_0(i) / 2.0) -
328  _alpha * _eta[0] * (_local_rot_vel_old_1(i) + _local_rot_vel_old_0(i) / 2.0));
329  }
330  }
331 
332  // If Ay or Az are non-zero, contribution of rotational accelerations to translational forces
333  // and vice versa have to be added
334  if (_component < 3)
335  {
336  _local_force[0](0) +=
337  _density[0] * _original_length[0] / 3.0 *
338  (_Az[0] * (_local_rot_accel_0(1) + _local_rot_accel_1(1) / 2.0 +
339  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(1) + _local_rot_vel_1(1) / 2.0) -
340  _alpha * _eta[0] * (_local_rot_vel_old_0(1) + _local_rot_vel_old_1(1) / 2.0)) -
341  _Ay[0] * (_local_rot_accel_0(2) + _local_rot_accel_1(2) / 2.0 +
342  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(2) + _local_rot_vel_1(2) / 2.0) -
343  _alpha * _eta[0] * (_local_rot_vel_old_0(2) + _local_rot_vel_old_1(2) / 2.0)));
344  _local_force[1](0) +=
345  _density[0] * _original_length[0] / 3.0 *
346  (_Az[0] * (_local_rot_accel_1(1) + _local_rot_accel_0(1) / 2.0 +
347  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(1) + _local_rot_vel_0(1) / 2.0) -
348  _alpha * _eta[0] * (_local_rot_vel_old_1(1) + _local_rot_vel_old_0(1) / 2.0)) -
349  _Ay[0] * (_local_rot_accel_1(2) + _local_rot_accel_0(2) / 2.0 +
350  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(2) + _local_rot_vel_0(2) / 2.0) -
351  _alpha * _eta[0] * (_local_rot_vel_old_1(2) + _local_rot_vel_old_0(2) / 2.0)));
352 
353  _local_force[0](1) +=
354  -_density[0] * _original_length[0] / 3.0 * _Az[0] *
355  (_local_rot_accel_0(0) + _local_rot_accel_1(0) / 2.0 +
356  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(0) + _local_rot_vel_1(0) / 2.0) -
357  _alpha * _eta[0] * (_local_rot_vel_old_0(0) + _local_rot_vel_old_1(0) / 2.0));
358  _local_force[1](1) +=
359  -_density[0] * _original_length[0] / 3.0 * _Az[0] *
360  (_local_rot_accel_1(0) + _local_rot_accel_0(0) / 2.0 +
361  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(0) + _local_rot_vel_0(0) / 2.0) -
362  _alpha * _eta[0] * (_local_rot_vel_old_1(0) + _local_rot_vel_old_0(0) / 2.0));
363 
364  _local_force[0](2) +=
365  _density[0] * _original_length[0] / 3.0 * _Ay[0] *
366  (_local_rot_accel_0(0) + _local_rot_accel_1(0) / 2.0 +
367  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_0(0) + _local_rot_vel_1(0) / 2.0) -
368  _alpha * _eta[0] * (_local_rot_vel_old_0(0) + _local_rot_vel_old_1(0) / 2.0));
369  _local_force[1](2) +=
370  _density[0] * _original_length[0] / 3.0 * _Ay[0] *
371  (_local_rot_accel_1(0) + _local_rot_accel_0(0) / 2.0 +
372  _eta[0] * (1.0 + _alpha) * (_local_rot_vel_1(0) + _local_rot_vel_0(0) / 2.0) -
373  _alpha * _eta[0] * (_local_rot_vel_old_1(0) + _local_rot_vel_old_0(0) / 2.0));
374  }
375  else
376  {
377  _local_moment[0](0) += _density[0] * _original_length[0] / 3.0 *
378  (-_Az[0] * (_local_accel_0(1) + _local_accel_1(1) / 2.0) +
379  _Ay[0] * (_local_accel_0(1) + _local_accel_1(1) / 2.0));
380  _local_moment[1](0) += _density[0] * _original_length[0] / 3.0 *
381  (-_Az[0] * (_local_accel_1(1) + _local_accel_0(1) / 2.0) +
382  _Ay[0] * (_local_accel_1(1) + _local_accel_0(1) / 2.0));
383 
384  _local_moment[0](1) += _density[0] * _original_length[0] / 3.0 * _Az[0] *
385  (_local_accel_0(0) + _local_accel_1(0) / 2.0);
386  _local_moment[1](1) += _density[0] * _original_length[0] / 3.0 * _Az[0] *
387  (_local_accel_1(0) + _local_accel_0(0) / 2.0);
388 
389  _local_moment[0](2) += -_density[0] * _original_length[0] / 3.0 * _Ay[0] *
390  (_local_accel_0(0) + _local_accel_1(0) / 2.0);
391  _local_moment[1](2) += -_density[0] * _original_length[0] / 3.0 * _Ay[0] *
392  (_local_accel_1(0) + _local_accel_0(0) / 2.0);
393  }
394 
395  // Global force and moments
396  if (_component < 3)
397  {
402  }
403  else
404  {
409  }
410  }
411 
413 
414  if (_has_save_in)
415  {
416  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
417  for (unsigned int i = 0; i < _save_in.size(); ++i)
418  _save_in[i]->sys().solution().add_vector(_local_re, _save_in[i]->dofIndices());
419  }
420 }
421 
422 void
424 {
426 
427  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
428 
429  Real factor = 0.0;
430  if (_has_beta)
431  factor = 1.0 / (_beta * _dt * _dt) + _eta[0] * (1.0 + _alpha) * _gamma / _beta / _dt;
432  else
433  factor = (*_du_dotdot_du)[0] + _eta[0] * (1.0 + _alpha) * (*_du_dot_du)[0];
434 
435  for (unsigned int i = 0; i < _test.size(); ++i)
436  {
437  for (unsigned int j = 0; j < _phi.size(); ++j)
438  {
439  if (_component < 3)
440  _local_ke(i, j) = (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] * _area[0] *
441  _original_length[0] * factor;
442  else if (_component > 2)
443  {
444  RankTwoTensor I;
445  if (_has_Ix)
446  I(0, 0) = _Ix[0];
447  else
448  I(0, 0) = _Iy[0] + _Iz[0];
449  I(1, 1) = _Iz[0];
450  I(2, 2) = _Iy[0];
451 
452  // conversion from local config to global coordinate system
453  RankTwoTensor Ig = _original_local_config[0].transpose() * I * _original_local_config[0];
454 
455  _local_ke(i, j) = (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
456  Ig(_component - 3, _component - 3) * _original_length[0] * factor;
457  }
458  }
459  }
460 
462 
463  if (_has_diag_save_in)
464  {
465  unsigned int rows = _local_ke.m();
466  DenseVector<Number> diag(rows);
467  for (unsigned int i = 0; i < rows; ++i)
468  diag(i) = _local_ke(i, i);
469 
470  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
471  for (unsigned int i = 0; i < _diag_save_in.size(); ++i)
472  _diag_save_in[i]->sys().solution().add_vector(diag, _diag_save_in[i]->dofIndices());
473  }
474 }
475 
476 void
477 InertialForceBeam::computeOffDiagJacobian(const unsigned int jvar_num)
478 {
479  mooseAssert(_beta > 0.0, "InertialForceBeam: Beta parameter should be positive.");
480 
481  Real factor = 0.0;
482  if (_has_beta)
483  factor = 1.0 / (_beta * _dt * _dt) + _eta[0] * (1.0 + _alpha) * _gamma / _beta / _dt;
484  else
485  factor = (*_du_dotdot_du)[0] + _eta[0] * (1.0 + _alpha) * (*_du_dot_du)[0];
486 
487  if (jvar_num == _var.number())
488  computeJacobian();
489  else
490  {
491  unsigned int coupled_component = 0;
492  bool disp_coupled = false;
493  bool rot_coupled = false;
494 
495  for (unsigned int i = 0; i < _ndisp; ++i)
496  {
497  if (jvar_num == _disp_num[i] && _component > 2)
498  {
499  coupled_component = i;
500  disp_coupled = true;
501  break;
502  }
503  }
504 
505  for (unsigned int i = 0; i < _nrot; ++i)
506  {
507  if (jvar_num == _rot_num[i])
508  {
509  coupled_component = i + 3;
510  rot_coupled = true;
511  break;
512  }
513  }
514 
515  prepareMatrixTag(_assembly, _var.number(), jvar_num);
516 
517  if (disp_coupled || rot_coupled)
518  {
519  for (unsigned int i = 0; i < _test.size(); ++i)
520  {
521  for (unsigned int j = 0; j < _phi.size(); ++j)
522  {
523  if (_component < 3 && coupled_component > 2)
524  {
526  A(0, 1) = _Az[0];
527  A(0, 2) = -_Ay[0];
528  A(1, 0) = -_Az[0];
529  A(2, 0) = _Ay[0];
530 
531  // conversion from local config to global coordinate system
532  const RankTwoTensor Ag =
533  _original_local_config[0].transpose() * A * _original_local_config[0];
534 
535  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
536  Ag(_component, coupled_component - 3) * _original_length[0] * factor;
537  }
538  else if (_component > 2 && coupled_component < 3)
539  {
541  A(0, 1) = -_Az[0];
542  A(0, 2) = _Ay[0];
543  A(1, 0) = _Az[0];
544  A(2, 0) = -_Ay[0];
545 
546  // conversion from local config to global coordinate system
547  const RankTwoTensor Ag =
548  _original_local_config[0].transpose() * A * _original_local_config[0];
549 
550  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
551  Ag(_component - 3, coupled_component) * _original_length[0] * factor;
552  }
553  else if (_component > 2 && coupled_component > 2)
554  {
555  RankTwoTensor I;
556  if (_has_Ix)
557  I(0, 0) = _Ix[0];
558  else
559  I(0, 0) = _Iy[0] + _Iz[0];
560  I(1, 1) = _Iz[0];
561  I(2, 2) = _Iy[0];
562 
563  // conversion from local config to global coordinate system
564  const RankTwoTensor Ig =
565  _original_local_config[0].transpose() * I * _original_local_config[0];
566 
567  _local_ke(i, j) += (i == j ? 1.0 / 3.0 : 1.0 / 6.0) * _density[0] *
568  Ig(_component - 3, coupled_component - 3) * _original_length[0] *
569  factor;
570  }
571  }
572  }
573  }
574 
576  }
577 }
RealVectorValue _local_vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the initial beam local co...
RealVectorValue _accel_1
RealVectorValue _rot_vel_0
RealVectorValue _local_rot_vel_old_1
const bool _has_velocities
virtual void computeJacobian() override
const VariableValue * _du_dot_du
Coupled variable for du_dot_du calculated by time integrator.
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
RealVectorValue _local_rot_vel_1
std::vector< RealVectorValue > _local_moment
RealVectorValue _local_vel_0
Current translational and rotational velocities at the two nodes of the beam in the initial beam loca...
unsigned int _nrot
Number of coupled rotational variables.
void accumulateTaggedLocalResidual()
MooseVariable & _var
std::vector< MooseVariableFEBase *> _save_in
RealVectorValue _rot_accel_1
const Real _gamma
Newmark time integraion parameter.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
std::vector< unsigned int > _accel_num
Variable numbers corresponding to acceleraion aux variables.
RealVectorValue _vel_0
Current translational and rotational velocities at the two nodes of the beam in the global coordinate...
virtual const VariableValue & coupledDotDotDu(const std::string &var_name, unsigned int comp=0) const
const Real _beta
Newmark time integration parameter.
unsigned int number() const
const MaterialProperty< RankTwoTensor > & _original_local_config
Rotational transformation from global to initial beam local coordinate system.
RealVectorValue _local_rot_vel_0
RealVectorValue _local_accel_1
InertialForceBeam(const InputParameters &parameters)
virtual void computeOffDiagJacobian(unsigned int jvar) override
unsigned int _ndisp
Number of coupled displacement variables.
const Real _alpha
HHT time integration parameter.
T & set(const std::string &name, bool quiet_mode=false)
const VariableValue & _Iz
Coupled variable for second momemnt of area of beam in z direction, i.e., integral of z^2*dA over the...
RealVectorValue _local_rot_accel_0
RealVectorValue _local_rot_vel_old_0
unsigned int m() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Real & _dt
const unsigned int _component
Direction along which residual is calculated.
std::vector< RealVectorValue > _local_force
Forces and moments at the two end nodes of the beam in the initial beam local configuration.
std::vector< unsigned int > _vel_num
Variable numbers corresponding to velocity aux variables.
const bool _has_accelerations
bool _has_diag_save_in
DenseMatrix< Number > _local_ke
std::vector< unsigned int > _rot_accel_num
Variable numbers corresponding to rotational acceleration aux variables.
SystemBase & _sys
std::vector< unsigned int > _rot_vel_num
Variable numbers corresponding to rotational velocity aux variables.
RealVectorValue _rot_vel_1
const VariableTestValue & _test
const VariableValue & _Ix
Coupled variable for second moment of area of beam in x direction, i.e., integral of (y^2+z^2)*dA ove...
virtual const NumericVector< Number > *const & currentSolution() const override final
std::vector< MooseVariableFEBase *> _diag_save_in
virtual NumericVector< Number > * solutionUDot()
virtual NumericVector< Number > * solutionUDotOld()
const VariableValue & _Ay
Coupled variable for first moment of area of beam in y direction, i.e., integral of y*dA over the cro...
bool _has_save_in
FEProblemBase & _fe_problem
const VariableValue & _area
Coupled variable for beam cross-sectional area.
RealVectorValue _vel_old_1
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
unsigned int number() const
const MaterialProperty< Real > & _original_length
Initial length of beam.
void accumulateTaggedLocalMatrix()
const bool _has_rot_accelerations
AuxiliarySystem & getAuxiliarySystem()
RealVectorValue _rot_vel_old_0
RealVectorValue _global_moment_1
Assembly & _assembly
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const VariableValue & _Iy
Coupled variable for second moment of area of beam in y direction, i.e., integral of y^2*dA over the ...
RealVectorValue _local_vel_1
virtual const VariableValue & coupledDotDu(const std::string &var_name, unsigned int comp=0) const
RealVectorValue _rot_vel_old_1
unsigned int coupledComponents(const std::string &var_name) const
RealVectorValue _vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the global coordinate sys...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RealVectorValue _global_force_0
Forces and moments at the two end nodes of the beam in the global coordinate system.
const bool _has_rot_velocities
registerMooseObject("SolidMechanicsApp", InertialForceBeam)
DenseVector< Number > _local_re
const MaterialProperty< Real > & _density
Density of the beam.
void mooseError(Args &&... args) const
RealVectorValue _accel_0
Current translational and rotational accelerations at the two nodes of the beam in the global coordin...
const bool _has_beta
Booleans for validity of params.
void addClassDescription(const std::string &doc_string)
RealVectorValue _global_moment_0
const MaterialProperty< Real > & _eta
Mass proportional Rayleigh damping parameter.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Elem *const & _current_elem
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
RealVectorValue _local_rot_accel_1
std::vector< unsigned int > _disp_num
Variable numbers corresponding to displacement variables.
const VariableValue & _Az
Coupled variable for first moment of area of beam in z direction, i.e., integral of z*dA over the cro...
virtual NumericVector< Number > * solutionUDotDot()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
RealVectorValue _local_vel_old_1
virtual void computeResidual() override
NumericVector< Number > & solutionOld()
std::vector< unsigned int > _rot_num
Variable numbers corresponding to rotational variables.
const VariableValue * _du_dotdot_du
Coupled variable for du_dotdot_du calculated by time integrator.
const VariablePhiValue & _phi
static InputParameters validParams()
RealVectorValue _vel_1
RealVectorValue _local_accel_0
Current translational and rotational accelerations at the two nodes of the beam in the initial beam l...
void ErrorVector unsigned int
RealVectorValue _global_force_1
RealVectorValue _rot_accel_0