Line data Source code
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 : 14 : InputParameters 15 756 : TestNewmarkTI::validParams() 16 : { 17 756 : InputParameters params = AuxKernel::validParams(); 18 756 : params.addClassDescription("Assigns the velocity/acceleration calculated by time integrator to " 19 : "the velocity/acceleration auxvariable."); 20 1512 : params.addRequiredCoupledVar( 21 : "displacement", 22 : "The variable whose first/second derivative needs to be copied to the provided auxvariable."); 23 1512 : params.addParam<bool>("first", 24 1512 : true, 25 : "Set to true to copy the first derivative to the auxvariable. If false, " 26 : "the second derivative is copied."); 27 756 : return params; 28 0 : } 29 : 30 378 : TestNewmarkTI::TestNewmarkTI(const InputParameters & parameters) 31 : : AuxKernel(parameters), 32 378 : _first(getParam<bool>("first")), 33 945 : _value(_first ? coupledDot("displacement") : coupledDotDot("displacement")) 34 : { 35 378 : } 36 : 37 : Real 38 396756 : TestNewmarkTI::computeValue() 39 : { 40 396756 : if (!isNodal()) 41 0 : mooseError("must run on a nodal variable"); 42 : 43 : // assigns the first/second time derivative of displacement to the provided auxvariable 44 396756 : return _value[_qp]; 45 : }