www.mooseframework.org
TestNewmarkTI.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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("TensorMechanicsApp", TestNewmarkTI);
13 
15 
16 InputParameters
18 {
19  InputParameters params = AuxKernel::validParams();
20  params.addClassDescription("Assigns the velocity/acceleration calculated by time integrator to "
21  "the velocity/acceleration auxvariable.");
22  params.addRequiredCoupledVar(
23  "displacement",
24  "The variable whose first/second derivative needs to be copied to the provided auxvariable.");
25  params.addParam<bool>("first",
26  true,
27  "Set to true to copy the first derivative to the auxvariable. If false, "
28  "the second derivative is copied.");
29  return params;
30 }
31 
32 TestNewmarkTI::TestNewmarkTI(const InputParameters & parameters)
33  : AuxKernel(parameters),
34  _first(getParam<bool>("first")),
35  _value(_first ? coupledDot("displacement") : coupledDotDot("displacement"))
36 {
37 }
38 
39 Real
41 {
42  if (!isNodal())
43  mooseError("must run on a nodal variable");
44 
45  // assigns the first/second time derivative of displacement to the provided auxvariable
46  return _value[_qp];
47 }
TestNewmarkTI::computeValue
virtual Real computeValue()
Definition: TestNewmarkTI.C:40
TestNewmarkTI::validParams
static InputParameters validParams()
Definition: TestNewmarkTI.C:17
TestNewmarkTI::_value
const VariableValue & _value
Value of the first/second time derivative of dispalcement.
Definition: TestNewmarkTI.h:39
TestNewmarkTI
Definition: TestNewmarkTI.h:19
validParams
InputParameters validParams()
TestNewmarkTI.h
defineLegacyParams
defineLegacyParams(TestNewmarkTI)
registerMooseObject
registerMooseObject("TensorMechanicsApp", TestNewmarkTI)
TestNewmarkTI::TestNewmarkTI
TestNewmarkTI(const InputParameters &parameters)
Stores the velocity/acceleration computed using the time integrator into the provided auxvariable.
Definition: TestNewmarkTI.C:32