LCOV - code coverage report
Current view: top level - src/auxkernels - NewmarkVelAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 16 18 88.9 %
Date: 2025-09-04 07:57:23 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 "NewmarkVelAux.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", NewmarkVelAux);
      13             : 
      14             : InputParameters
      15        2191 : NewmarkVelAux::validParams()
      16             : {
      17        2191 :   InputParameters params = AuxKernel::validParams();
      18        2191 :   params.addClassDescription("Calculates the current velocity using Newmark method.");
      19        4382 :   params.addRequiredCoupledVar("acceleration", "acceleration variable");
      20        4382 :   params.addRequiredParam<Real>("gamma", "gamma parameter for Newmark method");
      21        2191 :   return params;
      22           0 : }
      23             : 
      24        1153 : NewmarkVelAux::NewmarkVelAux(const InputParameters & parameters)
      25             :   : AuxKernel(parameters),
      26        1153 :     _accel_old(coupledValueOld("acceleration")),
      27        1153 :     _accel(coupledValue("acceleration")),
      28        1153 :     _u_old(uOld()),
      29        3459 :     _gamma(getParam<Real>("gamma"))
      30             : {
      31        1153 : }
      32             : 
      33             : Real
      34      785437 : NewmarkVelAux::computeValue()
      35             : {
      36      785437 :   Real vel_old = _u_old[_qp];
      37      785437 :   if (!isNodal())
      38           0 :     mooseError("must run on a nodal variable");
      39             :   // Calculates Velocity using Newmark time integration scheme
      40      785437 :   return vel_old + (_dt * (1 - _gamma)) * _accel_old[_qp] + _gamma * _dt * _accel[_qp];
      41             : }

Generated by: LCOV version 1.14