https://mooseframework.inl.gov
TestNewmarkTI.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "TestNewmarkTI.h"
11 
12 registerMooseObject("SolidMechanicsApp", TestNewmarkTI);
13 
16 {
18  params.addClassDescription("Assigns the velocity/acceleration calculated by time integrator to "
19  "the velocity/acceleration auxvariable.");
20  params.addRequiredCoupledVar(
21  "displacement",
22  "The variable whose first/second derivative needs to be copied to the provided auxvariable.");
23  params.addParam<bool>("first",
24  true,
25  "Set to true to copy the first derivative to the auxvariable. If false, "
26  "the second derivative is copied.");
27  return params;
28 }
29 
31  : AuxKernel(parameters),
32  _first(getParam<bool>("first")),
33  _value(_first ? coupledDot("displacement") : coupledDotDot("displacement"))
34 {
35 }
36 
37 Real
39 {
40  if (!isNodal())
41  mooseError("must run on a nodal variable");
42 
43  // assigns the first/second time derivative of displacement to the provided auxvariable
44  return _value[_qp];
45 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", TestNewmarkTI)
static InputParameters validParams()
Definition: TestNewmarkTI.C:15
TestNewmarkTI(const InputParameters &parameters)
Stores the velocity/acceleration computed using the time integrator into the provided auxvariable...
Definition: TestNewmarkTI.C:30
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue()
Definition: TestNewmarkTI.C:38
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const VariableValue & _value
Value of the first/second time derivative of dispalcement.
Definition: TestNewmarkTI.h:34