www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
LineElementAction Class Reference

#include <LineElementAction.h>

Inheritance diagram for LineElementAction:
[legend]

Public Member Functions

 LineElementAction (const InputParameters &params)
 
virtual void act ()
 

Static Public Member Functions

static InputParameters beamParameters ()
 Add parameters required for a beam element. More...
 

Protected Types

enum  Strain { Strain::SMALL, Strain::FINITE }
 strain formulation More...
 

Protected Member Functions

void actGatherActionParameters ()
 Gather all the block ids from all the actions of this type to create variables spanning all the blocks. More...
 
void actAddVariables ()
 Adds displacement and rotation variables. More...
 
void actAddMaterials ()
 Adds material objects required for beam and truss elements. More...
 
void actAddKernels ()
 Adds StressDivergence kernels for beam and truss elements and inertia kernels for dynamic beam simulations. More...
 
void actAddAuxVariables ()
 Adds translational and rotational velocity and acceleration aux variables for dynamic beam simulations. More...
 
void actAddAuxKernels ()
 Adds auxkernels corresponding to the translational and rotational velocity and acceleration aux variables. More...
 
void actAddNodalKernels ()
 Adds nodal kernels that calculate inertial force/torque due to mass/inertia assigned to nodes of the beam. More...
 

Protected Attributes

std::vector< VariableName > _displacements
 Names of displacement variables. More...
 
unsigned int _ndisp
 Number of displacement variables. More...
 
std::vector< VariableName > _rotations
 Names of rotational variables for beam element. More...
 
std::vector< VariableName > _velocities
 Names of translational velocity variables for dynamic simulation using beam element. More...
 
std::vector< VariableName > _accelerations
 Names of translational acceleration variables for dynamic simulation beam element. More...
 
std::vector< VariableName > _rot_velocities
 Names of rotational velocity variables for dynamic simulation using beam element. More...
 
std::vector< VariableName > _rot_accelerations
 Names of rotational acceleration variables for dynamic simulation beam element. More...
 
std::vector< SubdomainName > _subdomain_names
 If this vector is not empty the variables, auxvariables, kernels, auxkernels, nodalkernels and materials are restricted to these subdomains. More...
 
std::set< SubdomainID > _subdomain_ids
 set generated from the passed in vector of subdomain names More...
 
std::set< SubdomainID > _subdomain_id_union
 set generated from the combined block restrictions of all LineElementAction action blocks More...
 
enum LineElementAction::Strain _strain_type
 
Strain _rotation_type
 
bool _use_displaced_mesh
 use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION) More...
 
bool _add_dynamic_variables
 Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels using the action when the dynamic kernels or nodal kernels are not set by the action. More...
 
bool _dynamic_consistent_inertia
 Set to true to use consistent mass and inertia matrices to calculate inertial forces/torques in dynamic beam simulations. More...
 
bool _dynamic_nodal_translational_inertia
 Set to true to use nodal mass matrix to calculate inertial forces in dynamic beam simulations. More...
 
bool _dynamic_nodal_rotational_inertia
 Set to true to use nodal inertia matrix to calculate inertial torques in dynamic beam simulations. More...
 
bool _truss
 Set to true if line element is a truss. More...
 
std::vector< AuxVariableName > _save_in
 residual debugging More...
 
std::vector< AuxVariableName > _diag_save_in
 

Detailed Description

Definition at line 20 of file LineElementAction.h.

Member Enumeration Documentation

◆ Strain

enum LineElementAction::Strain
strongprotected

strain formulation

Enumerator
SMALL 
FINITE 

Definition at line 121 of file LineElementAction.h.

122  {
123  SMALL,
124  FINITE
125  } _strain_type;
enum LineElementAction::Strain _strain_type

Constructor & Destructor Documentation

◆ LineElementAction()

LineElementAction::LineElementAction ( const InputParameters &  params)

Definition at line 207 of file LineElementAction.C.

208  : Action(params),
209  _rotations(0),
210  _velocities(0),
211  _accelerations(0),
212  _rot_velocities(0),
214  _subdomain_names(getParam<std::vector<SubdomainName>>("block")),
215  _subdomain_ids(),
217 {
218  // check if a container block with common parameters is found
219  auto action = _awh.getActions<CommonLineElementAction>();
220  if (action.size() == 1)
221  _pars.applyParameters(action[0]->parameters());
222 
223  // Set values to variables after common parameters are applied
224  _save_in = getParam<std::vector<AuxVariableName>>("save_in");
225  _diag_save_in = getParam<std::vector<AuxVariableName>>("diag_save_in");
226  _strain_type = getParam<MooseEnum>("strain_type").getEnum<Strain>();
227  _rotation_type = getParam<MooseEnum>("rotation_type").getEnum<Strain>();
228  _dynamic_consistent_inertia = getParam<bool>("dynamic_consistent_inertia");
229  _dynamic_nodal_translational_inertia = getParam<bool>("dynamic_nodal_translational_inertia");
230  _dynamic_nodal_rotational_inertia = getParam<bool>("dynamic_nodal_rotational_inertia");
233  _add_dynamic_variables = true;
234 
235  if (params.isParamSetByUser("add_dynamic_variables"))
236  {
237  bool user_defined_add_dynamic_variables = getParam<bool>("add_dynamic_variables");
238  if (!_add_dynamic_variables && user_defined_add_dynamic_variables)
239  _add_dynamic_variables = true;
240  else if (_add_dynamic_variables && !user_defined_add_dynamic_variables)
241  mooseError("LineElementAction: When using 'dynamic_consistent_inertia', "
242  "'dynamic_nodal_rotational_inertia' or '_dynamic_nodal_translational_inertia', "
243  "the velocity and acceleration AuxVariables and the corresponding AuxKernels are "
244  "automatically set by the action and this cannot be turned off by setting "
245  "'add_dynamic_variables' to false.");
246  }
247  _truss = getParam<bool>("truss");
248 
249  if (!isParamValid("displacements"))
250  paramError("displacements",
251  "LineElementAction: A vector of displacement variable names should be provided as "
252  "input using `displacements`.");
253 
254  _displacements = getParam<std::vector<VariableName>>("displacements");
255  _ndisp = _displacements.size();
256 
257  // determine if displaced mesh is to be used
259  if (params.isParamSetByUser("use_displaced_mesh"))
260  {
261  bool use_displaced_mesh_param = getParam<bool>("use_displaced_mesh");
262  if (use_displaced_mesh_param != _use_displaced_mesh && params.isParamSetByUser("strain_type") &&
263  params.isParamSetByUser("rotation_type"))
264  paramError("use_displaced_mesh",
265  "LineElementAction: Wrong combination of "
266  "`use_displaced_mesh`, `strain_type` and `rotation_type`.");
267  _use_displaced_mesh = use_displaced_mesh_param;
268  }
269 
270  if (_save_in.size() != 0 && _save_in.size() != _ndisp)
271  paramError("save_in",
272  "LineElementAction: Number of save_in variables should equal to the number of "
273  "displacement variables ",
274  _ndisp);
275 
276  if (_diag_save_in.size() != 0 && _diag_save_in.size() != _ndisp)
277  paramError("diag_save_in",
278  "LineElementAction: Number of diag_save_in variables should equal to the number of "
279  "displacement variables ",
280  _ndisp);
281 
282  // Check if all the parameters required for static and dynamic beam simulation are provided as
283  // input
284  if (!_truss)
285  {
286  // Parameters required for static simulation using beams
287  if (!isParamValid("rotations"))
288  paramError("rotations",
289  "LineElementAction: Rotational variable names should be provided for beam "
290  "elements using `rotations` parameter.");
291 
292  _rotations = getParam<std::vector<VariableName>>("rotations");
293 
294  if (_rotations.size() != _ndisp)
295  paramError("rotations",
296  "LineElementAction: Number of rotational and displacement variable names provided "
297  "as input for beam should be same.");
298 
299  if (!isParamValid("y_orientation") || !isParamValid("area") || !isParamValid("Iy") ||
300  !isParamValid("Iz"))
301  mooseError("LineElementAction: `y_orientation`, `area`, `Iy` and `Iz` should be provided for "
302  "beam elements.");
303 
304  // Parameters required for dynamic simulation using beams
306  {
307  if (!isParamValid("velocities") || !isParamValid("accelerations") ||
308  !isParamValid("rotational_velocities") || !isParamValid("rotational_accelerations"))
309  mooseError(
310  "LineElementAction: Variable names for translational and rotational velocities "
311  "and accelerations should be provided as input to perform dynamic simulation "
312  "using beam elements using `velocities`, `accelerations`, `rotational_velocities` and "
313  "`rotational_accelerations`.");
314 
315  _velocities = getParam<std::vector<VariableName>>("velocities");
316  _accelerations = getParam<std::vector<VariableName>>("accelerations");
317  _rot_velocities = getParam<std::vector<VariableName>>("rotational_velocities");
318  _rot_accelerations = getParam<std::vector<VariableName>>("rotational_accelerations");
319 
320  if (_velocities.size() != _ndisp || _accelerations.size() != _ndisp ||
321  _rot_velocities.size() != _ndisp || _rot_accelerations.size() != _ndisp)
322  mooseError("LineElementAction: Number of translational and rotational velocity and "
323  "acceleration variable names provided as input for the beam should be same as "
324  "number of displacement variables.");
325 
326  if (!isParamValid("beta") || !isParamValid("gamma"))
327  mooseError("LineElementAction: Newmark time integration parameters `beta` and `gamma` "
328  "should be provided as input to perform dynamic simulations using beams.");
329  }
330 
331  if (_dynamic_consistent_inertia && !isParamValid("density"))
332  paramError("density",
333  "LineElementAction: Either name of the density material property or a constant "
334  "density value should be provided as input using `density` for creating the "
335  "consistent mass/inertia matrix required for dynamic beam simulation.");
336 
338  (!isParamValid("nodal_mass") && !isParamValid("nodal_mass_file")))
339  paramError("nodal_mass",
340  "LineElementAction: `nodal_mass` or `nodal_mass_file` should be provided as input "
341  "to calculate "
342  "inertial forces on beam due to nodal mass.");
343 
345  ((!isParamValid("nodal_Ixx") || !isParamValid("nodal_Iyy") || !isParamValid("nodal_Izz"))))
346  mooseError("LineElementAction: `nodal_Ixx`, `nodal_Iyy`, `nodal_Izz` should be provided as "
347  "input to calculate inertial torque on beam due to nodal inertia.");
348  }
349  else // if truss
350  {
351  if (!isParamValid("area"))
352  paramError("area",
353  "LineElementAction: `area` should be provided as input for "
354  "truss elements.");
355 
356  if (isParamValid("rotations"))
357  paramError("rotations",
358  "LineElementAction: Rotational variables cannot be set for truss elements.");
359  }
360 }
unsigned int _ndisp
Number of displacement variables.
bool _dynamic_consistent_inertia
Set to true to use consistent mass and inertia matrices to calculate inertial forces/torques in dynam...
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
std::vector< AuxVariableName > _save_in
residual debugging
std::vector< VariableName > _accelerations
Names of translational acceleration variables for dynamic simulation beam element.
std::vector< VariableName > _velocities
Names of translational velocity variables for dynamic simulation using beam element.
std::vector< AuxVariableName > _diag_save_in
bool _truss
Set to true if line element is a truss.
bool _add_dynamic_variables
Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels us...
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
enum LineElementAction::Strain _strain_type
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION)
Store common line element action parameters.
std::vector< VariableName > _displacements
Names of displacement variables.
bool _dynamic_nodal_rotational_inertia
Set to true to use nodal inertia matrix to calculate inertial torques in dynamic beam simulations...
std::vector< SubdomainName > _subdomain_names
If this vector is not empty the variables, auxvariables, kernels, auxkernels, nodalkernels and materi...
std::vector< VariableName > _rot_velocities
Names of rotational velocity variables for dynamic simulation using beam element. ...
bool _dynamic_nodal_translational_inertia
Set to true to use nodal mass matrix to calculate inertial forces in dynamic beam simulations...
std::vector< VariableName > _rot_accelerations
Names of rotational acceleration variables for dynamic simulation beam element.

Member Function Documentation

◆ act()

void LineElementAction::act ( )
virtual

Definition at line 363 of file LineElementAction.C.

364 {
365  // Get the subdomain involved in the action once the mesh setup is complete
366  if (_current_task == "create_problem")
367  {
368  // get subdomain IDs
369  for (auto & name : _subdomain_names)
370  _subdomain_ids.insert(_mesh->getSubdomainID(name));
371  }
372 
373  if (_current_task == "add_variable")
374  {
375  //
376  // Gather info from all other LineElementAction
377  //
379 
380  //
381  // Add variables (optional)
382  //
383  actAddVariables();
384  }
385 
386  //
387  // Add Materials - ComputeIncrementalBeamStrain or ComputeFiniteBeamStrain
388  // for beam elements
389  //
390  if (_current_task == "add_material")
391  actAddMaterials();
392 
393  //
394  // Add Kernels - StressDivergenceBeam and InertialForceBeam (if dynamic_consistent_inertia is
395  // turned on) for beams and StressDivergenceTensorsTruss for truss elements
396  //
397  if (_current_task == "add_kernel")
398  actAddKernels();
399 
400  //
401  // Add aux variables for translational and Rotational velocities and acceleration for dynamic
402  // analysis using beams
403  //
404  if (_current_task == "add_aux_variable")
406 
407  //
408  // Add NewmarkVelAux and NewarkAccelAux auxkernels for dynamic simulation using beams
409  //
410  if (_current_task == "add_aux_kernel")
412 
413  //
414  // Add NodalKernels - NodalTranslationalInertia (if dynamic_nodal_translational_inertia is turned
415  // on) and NodalRotattionalInertia (if dynamic_nodal_rotational_inertia) for dynamic simulations
416  // using beams
417  //
418  if (_current_task == "add_nodal_kernel")
420 }
void actAddAuxKernels()
Adds auxkernels corresponding to the translational and rotational velocity and acceleration aux varia...
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
void actGatherActionParameters()
Gather all the block ids from all the actions of this type to create variables spanning all the block...
void actAddMaterials()
Adds material objects required for beam and truss elements.
void actAddNodalKernels()
Adds nodal kernels that calculate inertial force/torque due to mass/inertia assigned to nodes of the ...
const std::string name
Definition: Setup.h:22
void actAddKernels()
Adds StressDivergence kernels for beam and truss elements and inertia kernels for dynamic beam simula...
void actAddVariables()
Adds displacement and rotation variables.
std::vector< SubdomainName > _subdomain_names
If this vector is not empty the variables, auxvariables, kernels, auxkernels, nodalkernels and materi...
void actAddAuxVariables()
Adds translational and rotational velocity and acceleration aux variables for dynamic beam simulation...

◆ actAddAuxKernels()

void LineElementAction::actAddAuxKernels ( )
protected

Adds auxkernels corresponding to the translational and rotational velocity and acceleration aux variables.

Definition at line 663 of file LineElementAction.C.

Referenced by act().

664 {
666  {
667  auto params = _factory.getValidParams("NewmarkAccelAux");
668  params.applyParameters(parameters(), {"boundary"});
669  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
670 
671  for (unsigned i = 0; i < 2 * _ndisp; ++i)
672  {
673  std::string aux_kernel_name = name() + "_newmark_accel_" + Moose::stringify(i);
674 
675  if (i < _ndisp)
676  {
677  params.set<AuxVariableName>("variable") = _accelerations[i];
678  params.set<std::vector<VariableName>>("velocity") = {_velocities[i]};
679  params.set<std::vector<VariableName>>("displacement") = {_displacements[i]};
680 
681  _problem->addAuxKernel("NewmarkAccelAux", aux_kernel_name, params);
682  }
683  else
684  {
685  params.set<AuxVariableName>("variable") = _rot_accelerations[i - _ndisp];
686  params.set<std::vector<VariableName>>("velocity") = {_rot_velocities[i - _ndisp]};
687  params.set<std::vector<VariableName>>("displacement") = {_rotations[i - _ndisp]};
688 
689  _problem->addAuxKernel("NewmarkAccelAux", aux_kernel_name, params);
690  }
691  }
692 
693  params = _factory.getValidParams("NewmarkVelAux");
694  params.applyParameters(parameters(), {"boundary"});
695  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
696 
697  for (unsigned i = 0; i < 2 * _ndisp; ++i)
698  {
699  std::string aux_kernel_name = name() + "_newmark_vel_" + Moose::stringify(i);
700 
701  if (i < _ndisp)
702  {
703  params.set<AuxVariableName>("variable") = _velocities[i];
704  params.set<std::vector<VariableName>>("acceleration") = {_accelerations[i]};
705  _problem->addAuxKernel("NewmarkVelAux", aux_kernel_name, params);
706  }
707  else
708  {
709  params.set<AuxVariableName>("variable") = _rot_velocities[i - _ndisp];
710  params.set<std::vector<VariableName>>("acceleration") = {_rot_accelerations[i - _ndisp]};
711  _problem->addAuxKernel("NewmarkVelAux", aux_kernel_name, params);
712  }
713  }
714  }
715 }
unsigned int _ndisp
Number of displacement variables.
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
std::vector< VariableName > _accelerations
Names of translational acceleration variables for dynamic simulation beam element.
std::vector< VariableName > _velocities
Names of translational velocity variables for dynamic simulation using beam element.
bool _truss
Set to true if line element is a truss.
bool _add_dynamic_variables
Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels us...
const std::string name
Definition: Setup.h:22
std::vector< VariableName > _displacements
Names of displacement variables.
std::vector< VariableName > _rot_velocities
Names of rotational velocity variables for dynamic simulation using beam element. ...
std::vector< VariableName > _rot_accelerations
Names of rotational acceleration variables for dynamic simulation beam element.

◆ actAddAuxVariables()

void LineElementAction::actAddAuxVariables ( )
protected

Adds translational and rotational velocity and acceleration aux variables for dynamic beam simulations.

Definition at line 624 of file LineElementAction.C.

Referenced by act().

625 {
627  {
628  for (auto vel : _velocities)
629  {
630  _problem->addAuxVariable(vel,
631  FEType(Utility::string_to_enum<Order>("FIRST"),
632  Utility::string_to_enum<FEFamily>("LAGRANGE")),
633  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
634  }
635 
636  for (auto accel : _accelerations)
637  {
638  _problem->addAuxVariable(accel,
639  FEType(Utility::string_to_enum<Order>("FIRST"),
640  Utility::string_to_enum<FEFamily>("LAGRANGE")),
641  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
642  }
643 
644  for (auto rot_vel : _rot_velocities)
645  {
646  _problem->addAuxVariable(rot_vel,
647  FEType(Utility::string_to_enum<Order>("FIRST"),
648  Utility::string_to_enum<FEFamily>("LAGRANGE")),
649  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
650  }
651 
652  for (auto rot_accel : _rot_accelerations)
653  {
654  _problem->addAuxVariable(rot_accel,
655  FEType(Utility::string_to_enum<Order>("FIRST"),
656  Utility::string_to_enum<FEFamily>("LAGRANGE")),
657  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
658  }
659  }
660 }
std::vector< VariableName > _accelerations
Names of translational acceleration variables for dynamic simulation beam element.
std::vector< VariableName > _velocities
Names of translational velocity variables for dynamic simulation using beam element.
bool _truss
Set to true if line element is a truss.
bool _add_dynamic_variables
Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels us...
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all LineElementAction action blocks ...
std::vector< VariableName > _rot_velocities
Names of rotational velocity variables for dynamic simulation using beam element. ...
std::vector< VariableName > _rot_accelerations
Names of rotational acceleration variables for dynamic simulation beam element.

◆ actAddKernels()

void LineElementAction::actAddKernels ( )
protected

Adds StressDivergence kernels for beam and truss elements and inertia kernels for dynamic beam simulations.

Definition at line 522 of file LineElementAction.C.

Referenced by act().

523 {
524  if (!_truss)
525  {
526  // add StressDivergenceBeam kernels
527  auto params = _factory.getValidParams("StressDivergenceBeam");
528  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
529  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
530 
531  for (unsigned int i = 0; i < 2 * _ndisp; ++i)
532  {
533  std::string kernel_name = name() + "_stress_divergence_beam_" + Moose::stringify(i);
534 
535  if (i < _ndisp)
536  {
537  params.set<unsigned int>("component") = i;
538  params.set<NonlinearVariableName>("variable") = _displacements[i];
539 
540  if (_save_in.size() == 2 * _ndisp)
541  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
542  if (_diag_save_in.size() == 2 * _ndisp)
543  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
544 
545  _problem->addKernel("StressDivergenceBeam", kernel_name, params);
546  }
547  else
548  {
549  params.set<unsigned int>("component") = i;
550  params.set<NonlinearVariableName>("variable") = _rotations[i - 3];
551 
552  if (_save_in.size() == 2 * _ndisp)
553  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
554  if (_diag_save_in.size() == 2 * _ndisp)
555  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
556 
557  _problem->addKernel("StressDivergenceBeam", kernel_name, params);
558  }
559  }
560  // Add InertialForceBeam if dynamic simulation using consistent mass/inertia matrix has to be
561  // performed
563  {
564  // add InertialForceBeam
565  params = _factory.getValidParams("InertialForceBeam");
566  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
567  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
568 
569  for (unsigned int i = 0; i < 2 * _ndisp; ++i)
570  {
571  std::string kernel_name = name() + "_inertial_force_beam_" + Moose::stringify(i);
572 
573  if (i < _ndisp)
574  {
575  params.set<unsigned int>("component") = i;
576  params.set<NonlinearVariableName>("variable") = _displacements[i];
577 
578  if (_save_in.size() == 2 * _ndisp)
579  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
580  if (_diag_save_in.size() == 2 * _ndisp)
581  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
582 
583  _problem->addKernel("InertialForceBeam", kernel_name, params);
584  }
585  else
586  {
587  params.set<unsigned int>("component") = i;
588  params.set<NonlinearVariableName>("variable") = _rotations[i - 3];
589 
590  if (_save_in.size() == 2 * _ndisp)
591  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
592  if (_diag_save_in.size() == 2 * _ndisp)
593  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
594 
595  _problem->addKernel("InertialForceBeam", kernel_name, params);
596  }
597  }
598  }
599  }
600  else
601  {
602  // Add StressDivergenceTensorsTruss kernels
603  auto params = _factory.getValidParams("StressDivergenceTensorsTruss");
604  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
605  params.set<bool>("use_displaced_mesh") = true;
606 
607  for (unsigned int i = 0; i < _ndisp; ++i)
608  {
609  std::string kernel_name = name() + "_stress_divergence_truss_" + Moose::stringify(i);
610  params.set<unsigned int>("component") = i;
611  params.set<NonlinearVariableName>("variable") = _displacements[i];
612 
613  if (_save_in.size() == _ndisp)
614  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
615  if (_diag_save_in.size() == _ndisp)
616  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
617 
618  _problem->addKernel("StressDivergenceTensorsTruss", kernel_name, params);
619  }
620  }
621 }
unsigned int _ndisp
Number of displacement variables.
bool _dynamic_consistent_inertia
Set to true to use consistent mass and inertia matrices to calculate inertial forces/torques in dynam...
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
std::vector< AuxVariableName > _save_in
residual debugging
std::vector< AuxVariableName > _diag_save_in
bool _truss
Set to true if line element is a truss.
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION)
const std::string name
Definition: Setup.h:22
std::vector< VariableName > _displacements
Names of displacement variables.

◆ actAddMaterials()

void LineElementAction::actAddMaterials ( )
protected

Adds material objects required for beam and truss elements.

Definition at line 491 of file LineElementAction.C.

Referenced by act().

492 {
493  if (!_truss)
494  {
495  // Add Strain
497  {
498  auto params = _factory.getValidParams("ComputeIncrementalBeamStrain");
499  params.applyParameters(parameters(), {"boundary", "use_displaced_mesh"});
500  params.set<bool>("use_displaced_mesh") = false;
501 
503  params.set<bool>("large_strain") = true;
504 
505  _problem->addMaterial("ComputeIncrementalBeamStrain", name() + "_strain", params);
506  }
507  else if (_rotation_type == Strain::FINITE)
508  {
509  auto params = _factory.getValidParams("ComputeFiniteBeamStrain");
510  params.applyParameters(parameters(), {"boundary", "use_displaced_mesh"});
511  params.set<bool>("use_displaced_mesh") = false;
512 
514  params.set<bool>("large_strain") = true;
515 
516  _problem->addMaterial("ComputeFiniteBeamStrain", name() + "_strain", params);
517  }
518  }
519 }
bool _truss
Set to true if line element is a truss.
enum LineElementAction::Strain _strain_type
const std::string name
Definition: Setup.h:22

◆ actAddNodalKernels()

void LineElementAction::actAddNodalKernels ( )
protected

Adds nodal kernels that calculate inertial force/torque due to mass/inertia assigned to nodes of the beam.

Definition at line 718 of file LineElementAction.C.

Referenced by act().

719 {
720  if (!_truss)
721  {
722  // NodalTranslationalInertia and NodalRotattionalInertia currently accept only constant real
723  // numbers for eta
724  Real eta = 0.0;
726  {
727  std::string ss(getParam<MaterialPropertyName>("eta"));
728  Real real_value = MooseUtils::convert<Real>(ss);
729 
730  eta = real_value;
731  }
732 
734  {
735  auto params = _factory.getValidParams("NodalTranslationalInertia");
736  params.applyParameters(parameters(),
737  {"save_in", "diag_save_in", "use_displaced_mesh", "eta"});
738  params.set<Real>("mass") = getParam<Real>("nodal_mass");
739  params.set<Real>("eta") = eta;
740  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
741 
742  for (unsigned i = 0; i < _ndisp; ++i)
743  {
744  std::string nodal_kernel_name =
745  name() + "_nodal_translational_inertia_" + Moose::stringify(i);
746 
747  params.set<NonlinearVariableName>("variable") = _displacements[i];
748  params.set<std::vector<VariableName>>("velocity") = {_velocities[i]};
749  params.set<std::vector<VariableName>>("acceleration") = {_accelerations[i]};
750 
751  if (_save_in.size() == 2 * _ndisp)
752  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
753 
754  if (_diag_save_in.size() == 2 * _ndisp)
755  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
756 
757  _problem->addNodalKernel("NodalTranslationalInertia", nodal_kernel_name, params);
758  }
759  }
760 
762  {
763  auto params = _factory.getValidParams("NodalRotationalInertia");
764  params.applyParameters(parameters(),
765  {"save_in",
766  "diag_save_in",
767  "use_displaced_mesh",
768  "eta",
769  "x_orientation",
770  "y_orientation"});
771  params.set<Real>("Ixx") = getParam<Real>("nodal_Ixx");
772  params.set<Real>("Iyy") = getParam<Real>("nodal_Iyy");
773  params.set<Real>("Izz") = getParam<Real>("nodal_Izz");
774  params.set<Real>("eta") = eta;
775  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
776 
777  if (isParamValid("nodal_Ixy"))
778  params.set<Real>("Ixy") = getParam<Real>("nodal_Ixy");
779 
780  if (isParamValid("nodal_Ixz"))
781  params.set<Real>("Ixz") = getParam<Real>("nodal_Ixz");
782 
783  if (isParamValid("nodal_Iyz"))
784  params.set<Real>("Iyz") = getParam<Real>("nodal_Iyz");
785 
786  if (isParamValid("nodal_x_orientation"))
787  params.set<Real>("x_orientation") = getParam<Real>("nodal_x_orientation");
788 
789  if (isParamValid("nodal_y_orientation"))
790  params.set<Real>("y_orientation") = getParam<Real>("nodal_y_orientation");
791 
792  for (unsigned i = 0; i < _ndisp; ++i)
793  {
794  std::string nodal_kernel_name = name() + "_nodal_rotational_inertia_" + Moose::stringify(i);
795 
796  params.set<unsigned int>("component") = i;
797  params.set<NonlinearVariableName>("variable") = _rotations[i];
798 
799  if (_save_in.size() == 2 * _ndisp)
800  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i + _ndisp]};
801 
802  if (_diag_save_in.size() == 2 * _ndisp)
803  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i + _ndisp]};
804 
805  _problem->addNodalKernel("NodalRotationalInertia", nodal_kernel_name, params);
806  }
807  }
808  }
809 }
unsigned int _ndisp
Number of displacement variables.
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
std::vector< AuxVariableName > _save_in
residual debugging
std::vector< VariableName > _accelerations
Names of translational acceleration variables for dynamic simulation beam element.
std::vector< VariableName > _velocities
Names of translational velocity variables for dynamic simulation using beam element.
std::vector< AuxVariableName > _diag_save_in
bool _truss
Set to true if line element is a truss.
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION)
const std::string name
Definition: Setup.h:22
std::vector< VariableName > _displacements
Names of displacement variables.
bool _dynamic_nodal_rotational_inertia
Set to true to use nodal inertia matrix to calculate inertial torques in dynamic beam simulations...
bool _dynamic_nodal_translational_inertia
Set to true to use nodal mass matrix to calculate inertial forces in dynamic beam simulations...

◆ actAddVariables()

void LineElementAction::actAddVariables ( )
protected

Adds displacement and rotation variables.

Definition at line 453 of file LineElementAction.C.

Referenced by act().

454 {
455  if (getParam<bool>("add_variables"))
456  {
457  // determine order of elements in mesh
458  const bool second = _problem->mesh().hasSecondOrderElements();
459  if (second)
460  mooseError("LineElementAction: Only linear truss and beam elements are currently supported. "
461  "Please change the order of elements in the mesh to use first order elements.");
462 
463  // Loop through the displacement variables
464  for (const auto & disp : _displacements)
465  {
466  // Create displacement variables
467  _problem->addVariable(disp,
468  FEType(Utility::string_to_enum<Order>("FIRST"),
469  Utility::string_to_enum<FEFamily>("LAGRANGE")),
470  1.0,
471  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
472  }
473 
474  // Add rotation variables if line element is a beam.
475  if (!_truss)
476  {
477  for (const auto & rot : _rotations)
478  {
479  // Create rotation variables
480  _problem->addVariable(rot,
481  FEType(Utility::string_to_enum<Order>("FIRST"),
482  Utility::string_to_enum<FEFamily>("LAGRANGE")),
483  1.0,
484  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
485  }
486  }
487  }
488 }
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
bool _truss
Set to true if line element is a truss.
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all LineElementAction action blocks ...
std::vector< VariableName > _displacements
Names of displacement variables.

◆ actGatherActionParameters()

void LineElementAction::actGatherActionParameters ( )
protected

Gather all the block ids from all the actions of this type to create variables spanning all the blocks.

Definition at line 423 of file LineElementAction.C.

Referenced by act().

424 {
425  //
426  // Gather info about all other master actions when we add variables
427  //
428  if (getParam<bool>("add_variables"))
429  {
430  auto actions = _awh.getActions<LineElementAction>();
431  for (const auto & action : actions)
432  {
433  const auto size_before = _subdomain_id_union.size();
434  const auto added_size = action->_subdomain_ids.size();
435  _subdomain_id_union.insert(action->_subdomain_ids.begin(), action->_subdomain_ids.end());
436  const auto size_after = _subdomain_id_union.size();
437 
438  if (size_after != size_before + added_size)
439  paramError("block",
440  "LineElementAction: The block restrictions in the LineElement actions must be "
441  "non-overlapping.");
442 
443  if (added_size == 0 && actions.size() > 1)
444  paramError(
445  "block",
446  "LineElementAction: No LineElement action can be block unrestricted if more than one "
447  "LineElement action is specified.");
448  }
449  }
450 }
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all LineElementAction action blocks ...

◆ beamParameters()

InputParameters LineElementAction::beamParameters ( )
static

Add parameters required for a beam element.

Definition at line 84 of file LineElementAction.C.

Referenced by validParams< LineElementAction >().

85 {
86  InputParameters params = emptyInputParameters();
87 
88  params.addParam<std::vector<VariableName>>(
89  "rotations", "The rotations appropriate for the simulation geometry and coordinate system");
90 
91  MooseEnum strainType("SMALL FINITE", "SMALL");
92  params.addParam<MooseEnum>("strain_type", strainType, "Strain formulation");
93  params.addParam<MooseEnum>("rotation_type", strainType, "Rotation formulation");
94  params.addParam<std::vector<MaterialPropertyName>>(
95  "eigenstrain_names", "List of beam eigenstrains to be applied in this strain calculation.");
96 
97  // Beam geometry
98  params.addParam<RealGradient>("y_orientation",
99  "Orientation of the y direction along "
100  "which Iyy is provided. This should be "
101  "perpendicular to the axis of the beam.");
102  params.addCoupledVar(
103  "area",
104  "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
105  params.addCoupledVar("Ay",
106  0.0,
107  "First moment of area of the beam about y axis. Can be supplied "
108  "as either a number or a variable name.");
109  params.addCoupledVar("Az",
110  0.0,
111  "First moment of area of the beam about z asix. Can be supplied "
112  "as either a number or a variable name.");
113  params.addCoupledVar("Ix",
114  "Second moment of area of the beam about x axis. Can be supplied as "
115  "either a number or a variable name.");
116  params.addCoupledVar("Iy",
117  "Second moment of area of the beam about y axis. Can be supplied as "
118  "either a number or a variable name.");
119  params.addCoupledVar("Iz",
120  "Second moment of area of the beam about z axis. Can be supplied as "
121  "either a number or a variable name.");
122 
123  // Common parameters for both dynamic consistent and nodal mass/inertia
124  params.addParam<bool>("add_dynamic_variables",
125  "Adds translational and rotational velocity and acceleration aux variables "
126  "and sets up the corresponding AuxKernels for calculating these variables "
127  "using Newmark time integration. When dynamic_consistent_inertia, "
128  "dynamic_nodal_rotational_inertia or dynamic_nodal_translational_inertia "
129  "are set to true, these variables are automatically set up.");
130 
131  params.addParam<std::vector<VariableName>>("velocities", "Translational velocity variables");
132  params.addParam<std::vector<VariableName>>("accelerations",
133  "Translational acceleration variables");
134  params.addParam<std::vector<VariableName>>("rotational_velocities",
135  "Rotational velocity variables");
136  params.addParam<std::vector<VariableName>>("rotational_accelerations",
137  "Rotational acceleration variables");
138  params.addRangeCheckedParam<Real>(
139  "beta", "beta>0.0", "beta parameter for Newmark Time integration");
140  params.addRangeCheckedParam<Real>(
141  "gamma", "gamma>0.0", "gamma parameter for Newmark Time integration");
142  params.addParam<MaterialPropertyName>("eta",
143  0.0,
144  "Name of material property or a constant real "
145  "number defining the eta parameter for mass proportional "
146  "Rayleigh damping.");
147  params.addParam<MaterialPropertyName>(
148  "zeta",
149  0.0,
150  "Name of material property or a constant real "
151  "number defining the zeta parameter for stiffness proportional "
152  "Rayleigh damping.");
153  params.addRangeCheckedParam<Real>("alpha",
154  0,
155  "alpha>=-0.3333 & alpha<=0.0",
156  "alpha parameter for mass dependent numerical damping induced "
157  "by HHT time integration scheme");
158 
159  // dynamic consistent mass/inertia
160  params.addParam<bool>("dynamic_consistent_inertia",
161  false,
162  "If set to true, consistent mass and "
163  "inertia matrices are used for the "
164  "inertial force/torque calculations.");
165  params.addParam<MaterialPropertyName>(
166  "density",
167  "Name of Material Property or a constant real number defining the density of the beam.");
168 
169  // dynamic nodal translational inertia
170  params.addParam<bool>(
171  "dynamic_nodal_translational_inertia",
172  false,
173  "If set to true, nodal mass matrix is used for the inertial force calculation.");
174  params.addRangeCheckedParam<Real>(
175  "nodal_mass", "nodal_mass>0.0", "Mass associated with the node");
176  params.addParam<FileName>(
177  "nodal_mass_file",
178  "The file containing the nodal positions and the corresponding nodal masses.");
179 
180  // dynamic nodal rotational inertia
181  params.addParam<bool>(
182  "dynamic_nodal_rotational_inertia",
183  false,
184  "If set to true, nodal inertia matrix is used for the inertial torque calculation.");
185  params.addRangeCheckedParam<Real>(
186  "nodal_Ixx", "nodal_Ixx>=0.0", "Nodal moment of inertia in the x direction.");
187  params.addRangeCheckedParam<Real>(
188  "nodal_Iyy", "nodal_Iyy>=0.0", "Nodal moment of inertia in the y direction.");
189  params.addRangeCheckedParam<Real>(
190  "nodal_Izz", "nodal_Izz>=0.0", "Nodal moment of inertia in the z direction.");
191  params.addParam<Real>("nodal_Ixy", 0.0, "Nodal moment of inertia in the xy direction.");
192  params.addParam<Real>("nodal_Ixz", 0.0, "Nodal moment of inertia in the xz direction.");
193  params.addParam<Real>("nodal_Iyz", 0.0, "Nodal moment of inertia in the yz direction.");
194  params.addParam<RealGradient>(
195  "nodal_x_orientation",
196  "Unit vector along the x direction if different from global x direction.");
197  params.addParam<RealGradient>(
198  "nodal_y_orientation",
199  "Unit vector along the y direction if different from global y direction.");
200  params.addParam<std::vector<BoundaryName>>(
201  "boundary",
202  "The list of boundary IDs from the mesh where the nodal "
203  "mass/inertia will be applied.");
204  return params;
205 }
VectorValue< Real > RealGradient

Member Data Documentation

◆ _accelerations

std::vector<VariableName> LineElementAction::_accelerations
protected

Names of translational acceleration variables for dynamic simulation beam element.

Definition at line 86 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), actAddNodalKernels(), and LineElementAction().

◆ _add_dynamic_variables

bool LineElementAction::_add_dynamic_variables
protected

Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels using the action when the dynamic kernels or nodal kernels are not set by the action.

Definition at line 137 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), and LineElementAction().

◆ _diag_save_in

std::vector<AuxVariableName> LineElementAction::_diag_save_in
protected

Definition at line 102 of file LineElementAction.h.

Referenced by actAddKernels(), actAddNodalKernels(), and LineElementAction().

◆ _displacements

std::vector<VariableName> LineElementAction::_displacements
protected

Names of displacement variables.

Definition at line 68 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddKernels(), actAddNodalKernels(), actAddVariables(), and LineElementAction().

◆ _dynamic_consistent_inertia

bool LineElementAction::_dynamic_consistent_inertia
protected

Set to true to use consistent mass and inertia matrices to calculate inertial forces/torques in dynamic beam simulations.

Definition at line 143 of file LineElementAction.h.

Referenced by actAddKernels(), and LineElementAction().

◆ _dynamic_nodal_rotational_inertia

bool LineElementAction::_dynamic_nodal_rotational_inertia
protected

Set to true to use nodal inertia matrix to calculate inertial torques in dynamic beam simulations.

Definition at line 155 of file LineElementAction.h.

Referenced by actAddNodalKernels(), and LineElementAction().

◆ _dynamic_nodal_translational_inertia

bool LineElementAction::_dynamic_nodal_translational_inertia
protected

Set to true to use nodal mass matrix to calculate inertial forces in dynamic beam simulations.

Definition at line 149 of file LineElementAction.h.

Referenced by actAddNodalKernels(), and LineElementAction().

◆ _ndisp

unsigned int LineElementAction::_ndisp
protected

Number of displacement variables.

Definition at line 71 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddKernels(), actAddNodalKernels(), and LineElementAction().

◆ _rot_accelerations

std::vector<VariableName> LineElementAction::_rot_accelerations
protected

Names of rotational acceleration variables for dynamic simulation beam element.

Definition at line 98 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), and LineElementAction().

◆ _rot_velocities

std::vector<VariableName> LineElementAction::_rot_velocities
protected

Names of rotational velocity variables for dynamic simulation using beam element.

Definition at line 92 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), and LineElementAction().

◆ _rotation_type

Strain LineElementAction::_rotation_type
protected

Definition at line 127 of file LineElementAction.h.

Referenced by actAddMaterials(), and LineElementAction().

◆ _rotations

std::vector<VariableName> LineElementAction::_rotations
protected

Names of rotational variables for beam element.

Definition at line 74 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddKernels(), actAddNodalKernels(), actAddVariables(), and LineElementAction().

◆ _save_in

std::vector<AuxVariableName> LineElementAction::_save_in
protected

residual debugging

Definition at line 101 of file LineElementAction.h.

Referenced by actAddKernels(), actAddNodalKernels(), and LineElementAction().

◆ _strain_type

enum LineElementAction::Strain LineElementAction::_strain_type
protected

◆ _subdomain_id_union

std::set<SubdomainID> LineElementAction::_subdomain_id_union
protected

set generated from the combined block restrictions of all LineElementAction action blocks

Definition at line 118 of file LineElementAction.h.

Referenced by actAddAuxVariables(), actAddVariables(), and actGatherActionParameters().

◆ _subdomain_ids

std::set<SubdomainID> LineElementAction::_subdomain_ids
protected

set generated from the passed in vector of subdomain names

Definition at line 112 of file LineElementAction.h.

Referenced by act().

◆ _subdomain_names

std::vector<SubdomainName> LineElementAction::_subdomain_names
protected

If this vector is not empty the variables, auxvariables, kernels, auxkernels, nodalkernels and materials are restricted to these subdomains.

Definition at line 109 of file LineElementAction.h.

Referenced by act().

◆ _truss

bool LineElementAction::_truss
protected

Set to true if line element is a truss.

Definition at line 158 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), actAddKernels(), actAddMaterials(), actAddNodalKernels(), actAddVariables(), and LineElementAction().

◆ _use_displaced_mesh

bool LineElementAction::_use_displaced_mesh
protected

use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION)

Definition at line 130 of file LineElementAction.h.

Referenced by actAddKernels(), actAddNodalKernels(), and LineElementAction().

◆ _velocities

std::vector<VariableName> LineElementAction::_velocities
protected

Names of translational velocity variables for dynamic simulation using beam element.

Definition at line 80 of file LineElementAction.h.

Referenced by actAddAuxKernels(), actAddAuxVariables(), actAddNodalKernels(), and LineElementAction().


The documentation for this class was generated from the following files: