LCOV - code coverage report
Current view: top level - src/auxkernels - TestNewmarkTI.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 14 16 87.5 %
Date: 2025-07-25 05:00:39 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14