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 209 of file LineElementAction.C.

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

366 {
367  // Get the subdomain involved in the action once the mesh setup is complete
368  if (_current_task == "setup_mesh_complete")
369  {
370  // get subdomain IDs
371  for (auto & name : _subdomain_names)
372  _subdomain_ids.insert(_mesh->getSubdomainID(name));
373  }
374 
375  if (_current_task == "add_variable")
376  {
377  //
378  // Gather info from all other LineElementAction
379  //
381 
382  //
383  // Add variables (optional)
384  //
385  actAddVariables();
386  }
387 
388  //
389  // Add Materials - ComputeIncrementalBeamStrain or ComputeFiniteBeamStrain
390  // for beam elements
391  //
392  if (_current_task == "add_material")
393  actAddMaterials();
394 
395  //
396  // Add Kernels - StressDivergenceBeam and InertialForceBeam (if dynamic_consistent_inertia is
397  // turned on) for beams and StressDivergenceTensorsTruss for truss elements
398  //
399  if (_current_task == "add_kernel")
400  actAddKernels();
401 
402  //
403  // Add aux variables for translational and Rotational velocities and acceleration for dynamic
404  // analysis using beams
405  //
406  if (_current_task == "add_aux_variable")
408 
409  //
410  // Add NewmarkVelAux and NewarkAccelAux auxkernels for dynamic simulation using beams
411  //
412  if (_current_task == "add_aux_kernel")
414 
415  //
416  // Add NodalKernels - NodalTranslationalInertia (if dynamic_nodal_translational_inertia is turned
417  // on) and NodalRotattionalInertia (if dynamic_nodal_rotational_inertia) for dynamic simulations
418  // using beams
419  //
420  if (_current_task == "add_nodal_kernel")
422 }
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 665 of file LineElementAction.C.

Referenced by act().

666 {
668  {
669  auto params = _factory.getValidParams("NewmarkAccelAux");
670  params.applyParameters(parameters(), {"boundary"});
671  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
672 
673  for (unsigned i = 0; i < 2 * _ndisp; ++i)
674  {
675  std::string aux_kernel_name = name() + "_newmark_accel_" + Moose::stringify(i);
676 
677  if (i < _ndisp)
678  {
679  params.set<AuxVariableName>("variable") = _accelerations[i];
680  params.set<std::vector<VariableName>>("velocity") = {_velocities[i]};
681  params.set<std::vector<VariableName>>("displacement") = {_displacements[i]};
682 
683  _problem->addAuxKernel("NewmarkAccelAux", aux_kernel_name, params);
684  }
685  else
686  {
687  params.set<AuxVariableName>("variable") = _rot_accelerations[i - _ndisp];
688  params.set<std::vector<VariableName>>("velocity") = {_rot_velocities[i - _ndisp]};
689  params.set<std::vector<VariableName>>("displacement") = {_rotations[i - _ndisp]};
690 
691  _problem->addAuxKernel("NewmarkAccelAux", aux_kernel_name, params);
692  }
693  }
694 
695  params = _factory.getValidParams("NewmarkVelAux");
696  params.applyParameters(parameters(), {"boundary"});
697  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
698 
699  for (unsigned i = 0; i < 2 * _ndisp; ++i)
700  {
701  std::string aux_kernel_name = name() + "_newmark_vel_" + Moose::stringify(i);
702 
703  if (i < _ndisp)
704  {
705  params.set<AuxVariableName>("variable") = _velocities[i];
706  params.set<std::vector<VariableName>>("acceleration") = {_accelerations[i]};
707  _problem->addAuxKernel("NewmarkVelAux", aux_kernel_name, params);
708  }
709  else
710  {
711  params.set<AuxVariableName>("variable") = _rot_velocities[i - _ndisp];
712  params.set<std::vector<VariableName>>("acceleration") = {_rot_accelerations[i - _ndisp]};
713  _problem->addAuxKernel("NewmarkVelAux", aux_kernel_name, params);
714  }
715  }
716  }
717 }
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 626 of file LineElementAction.C.

Referenced by act().

627 {
629  {
630  for (auto vel : _velocities)
631  {
632  _problem->addAuxVariable(vel,
633  FEType(Utility::string_to_enum<Order>("FIRST"),
634  Utility::string_to_enum<FEFamily>("LAGRANGE")),
635  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
636  }
637 
638  for (auto accel : _accelerations)
639  {
640  _problem->addAuxVariable(accel,
641  FEType(Utility::string_to_enum<Order>("FIRST"),
642  Utility::string_to_enum<FEFamily>("LAGRANGE")),
643  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
644  }
645 
646  for (auto rot_vel : _rot_velocities)
647  {
648  _problem->addAuxVariable(rot_vel,
649  FEType(Utility::string_to_enum<Order>("FIRST"),
650  Utility::string_to_enum<FEFamily>("LAGRANGE")),
651  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
652  }
653 
654  for (auto rot_accel : _rot_accelerations)
655  {
656  _problem->addAuxVariable(rot_accel,
657  FEType(Utility::string_to_enum<Order>("FIRST"),
658  Utility::string_to_enum<FEFamily>("LAGRANGE")),
659  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
660  }
661  }
662 }
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 524 of file LineElementAction.C.

Referenced by act().

525 {
526  if (!_truss)
527  {
528  // add StressDivergenceBeam kernels
529  auto params = _factory.getValidParams("StressDivergenceBeam");
530  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
531  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
532 
533  for (unsigned int i = 0; i < 2 * _ndisp; ++i)
534  {
535  std::string kernel_name = name() + "_stress_divergence_beam_" + Moose::stringify(i);
536 
537  if (i < _ndisp)
538  {
539  params.set<unsigned int>("component") = i;
540  params.set<NonlinearVariableName>("variable") = _displacements[i];
541 
542  if (_save_in.size() == 2 * _ndisp)
543  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
544  if (_diag_save_in.size() == 2 * _ndisp)
545  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
546 
547  _problem->addKernel("StressDivergenceBeam", kernel_name, params);
548  }
549  else
550  {
551  params.set<unsigned int>("component") = i;
552  params.set<NonlinearVariableName>("variable") = _rotations[i - 3];
553 
554  if (_save_in.size() == 2 * _ndisp)
555  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
556  if (_diag_save_in.size() == 2 * _ndisp)
557  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
558 
559  _problem->addKernel("StressDivergenceBeam", kernel_name, params);
560  }
561  }
562  // Add InertialForceBeam if dynamic simulation using consistent mass/inertia matrix has to be
563  // performed
565  {
566  // add InertialForceBeam
567  params = _factory.getValidParams("InertialForceBeam");
568  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
569  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
570 
571  for (unsigned int i = 0; i < 2 * _ndisp; ++i)
572  {
573  std::string kernel_name = name() + "_inertial_force_beam_" + Moose::stringify(i);
574 
575  if (i < _ndisp)
576  {
577  params.set<unsigned int>("component") = i;
578  params.set<NonlinearVariableName>("variable") = _displacements[i];
579 
580  if (_save_in.size() == 2 * _ndisp)
581  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
582  if (_diag_save_in.size() == 2 * _ndisp)
583  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
584 
585  _problem->addKernel("InertialForceBeam", kernel_name, params);
586  }
587  else
588  {
589  params.set<unsigned int>("component") = i;
590  params.set<NonlinearVariableName>("variable") = _rotations[i - 3];
591 
592  if (_save_in.size() == 2 * _ndisp)
593  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
594  if (_diag_save_in.size() == 2 * _ndisp)
595  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
596 
597  _problem->addKernel("InertialForceBeam", kernel_name, params);
598  }
599  }
600  }
601  }
602  else
603  {
604  // Add StressDivergenceTensorsTruss kernels
605  auto params = _factory.getValidParams("StressDivergenceTensorsTruss");
606  params.applyParameters(parameters(), {"use_displaced_mesh", "save_in", "diag_save_in"});
607  params.set<bool>("use_displaced_mesh") = true;
608 
609  for (unsigned int i = 0; i < _ndisp; ++i)
610  {
611  std::string kernel_name = name() + "_stress_divergence_truss_" + Moose::stringify(i);
612  params.set<unsigned int>("component") = i;
613  params.set<NonlinearVariableName>("variable") = _displacements[i];
614 
615  if (_save_in.size() == _ndisp)
616  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
617  if (_diag_save_in.size() == _ndisp)
618  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
619 
620  _problem->addKernel("StressDivergenceTensorsTruss", kernel_name, params);
621  }
622  }
623 }
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 493 of file LineElementAction.C.

Referenced by act().

494 {
495  if (!_truss)
496  {
497  // Add Strain
499  {
500  auto params = _factory.getValidParams("ComputeIncrementalBeamStrain");
501  params.applyParameters(parameters(), {"boundary", "use_displaced_mesh"});
502  params.set<bool>("use_displaced_mesh") = false;
503 
505  params.set<bool>("large_strain") = true;
506 
507  _problem->addMaterial("ComputeIncrementalBeamStrain", name() + "_strain", params);
508  }
509  else if (_rotation_type == Strain::FINITE)
510  {
511  auto params = _factory.getValidParams("ComputeFiniteBeamStrain");
512  params.applyParameters(parameters(), {"boundary", "use_displaced_mesh"});
513  params.set<bool>("use_displaced_mesh") = false;
514 
516  params.set<bool>("large_strain") = true;
517 
518  _problem->addMaterial("ComputeFiniteBeamStrain", name() + "_strain", params);
519  }
520  }
521 }
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 720 of file LineElementAction.C.

Referenced by act().

721 {
722  if (!_truss)
723  {
724  // NodalTranslationalInertia and NodalRotattionalInertia currently accept only constant real
725  // numbers for eta
726  Real eta = 0.0;
728  {
729  std::string ss(getParam<MaterialPropertyName>("eta"));
730  Real real_value = MooseUtils::convert<Real>(ss);
731 
732  eta = real_value;
733  }
734 
736  {
737  auto params = _factory.getValidParams("NodalTranslationalInertia");
738  params.applyParameters(parameters(),
739  {"save_in", "diag_save_in", "use_displaced_mesh", "eta"});
740  params.set<Real>("mass") = getParam<Real>("nodal_mass");
741  params.set<Real>("eta") = eta;
742  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
743 
744  for (unsigned i = 0; i < _ndisp; ++i)
745  {
746  std::string nodal_kernel_name =
747  name() + "_nodal_translational_inertia_" + Moose::stringify(i);
748 
749  params.set<NonlinearVariableName>("variable") = _displacements[i];
750  params.set<std::vector<VariableName>>("velocity") = {_velocities[i]};
751  params.set<std::vector<VariableName>>("acceleration") = {_accelerations[i]};
752 
753  if (_save_in.size() == 2 * _ndisp)
754  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i]};
755 
756  if (_diag_save_in.size() == 2 * _ndisp)
757  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i]};
758 
759  _problem->addNodalKernel("NodalTranslationalInertia", nodal_kernel_name, params);
760  }
761  }
762 
764  {
765  auto params = _factory.getValidParams("NodalRotationalInertia");
766  params.applyParameters(parameters(),
767  {"save_in",
768  "diag_save_in",
769  "use_displaced_mesh",
770  "eta",
771  "x_orientation",
772  "y_orientation"});
773  params.set<Real>("Ixx") = getParam<Real>("nodal_Ixx");
774  params.set<Real>("Iyy") = getParam<Real>("nodal_Iyy");
775  params.set<Real>("Izz") = getParam<Real>("nodal_Izz");
776  params.set<Real>("eta") = eta;
777  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
778 
779  if (isParamValid("nodal_Ixy"))
780  params.set<Real>("Ixy") = getParam<Real>("nodal_Ixy");
781 
782  if (isParamValid("nodal_Ixz"))
783  params.set<Real>("Ixz") = getParam<Real>("nodal_Ixz");
784 
785  if (isParamValid("nodal_Iyz"))
786  params.set<Real>("Iyz") = getParam<Real>("nodal_Iyz");
787 
788  if (isParamValid("nodal_x_orientation"))
789  params.set<Real>("x_orientation") = getParam<Real>("nodal_x_orientation");
790 
791  if (isParamValid("nodal_y_orientation"))
792  params.set<Real>("y_orientation") = getParam<Real>("nodal_y_orientation");
793 
794  for (unsigned i = 0; i < _ndisp; ++i)
795  {
796  std::string nodal_kernel_name = name() + "_nodal_rotational_inertia_" + Moose::stringify(i);
797 
798  params.set<unsigned int>("component") = i;
799  params.set<NonlinearVariableName>("variable") = _rotations[i];
800 
801  if (_save_in.size() == 2 * _ndisp)
802  params.set<std::vector<AuxVariableName>>("save_in") = {_save_in[i + _ndisp]};
803 
804  if (_diag_save_in.size() == 2 * _ndisp)
805  params.set<std::vector<AuxVariableName>>("diag_save_in") = {_diag_save_in[i + _ndisp]};
806 
807  _problem->addNodalKernel("NodalRotationalInertia", nodal_kernel_name, params);
808  }
809  }
810  }
811 }
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 455 of file LineElementAction.C.

Referenced by act().

456 {
457  if (getParam<bool>("add_variables"))
458  {
459  // determine order of elements in mesh
460  const bool second = _problem->mesh().hasSecondOrderElements();
461  if (second)
462  mooseError("LineElementAction: Only linear truss and beam elements are currently supported. "
463  "Please change the order of elements in the mesh to use first order elements.");
464 
465  // Loop through the displacement variables
466  for (const auto & disp : _displacements)
467  {
468  // Create displacement variables
469  _problem->addVariable(disp,
470  FEType(Utility::string_to_enum<Order>("FIRST"),
471  Utility::string_to_enum<FEFamily>("LAGRANGE")),
472  1.0,
473  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
474  }
475 
476  // Add rotation variables if line element is a beam.
477  if (!_truss)
478  {
479  for (const auto & rot : _rotations)
480  {
481  // Create rotation variables
482  _problem->addVariable(rot,
483  FEType(Utility::string_to_enum<Order>("FIRST"),
484  Utility::string_to_enum<FEFamily>("LAGRANGE")),
485  1.0,
486  _subdomain_id_union.empty() ? nullptr : &_subdomain_id_union);
487  }
488  }
489  }
490 }
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 425 of file LineElementAction.C.

Referenced by act().

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

Referenced by validParams< LineElementAction >().

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

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: