LCOV - code coverage report
Current view: top level - src/auxkernels - AccumulateAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 13 14 92.9 %
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 "AccumulateAux.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", AccumulateAux);
      13             : 
      14             : InputParameters
      15          16 : AccumulateAux::validParams()
      16             : {
      17          16 :   InputParameters params = AuxKernel::validParams();
      18          16 :   params.addClassDescription("Accumulates one or more variables and this auxiliary variable into "
      19             :                              "this auxiliary variable");
      20          32 :   params.addRequiredCoupledVar(
      21             :       "accumulate_from_variable",
      22             :       "Variable whose values are to be accumulated into the current variable");
      23          16 :   return params;
      24           0 : }
      25             : 
      26           8 : AccumulateAux::AccumulateAux(const InputParameters & parameters)
      27          16 :   : AuxKernel(parameters), _values(coupledValues("accumulate_from_variable")), _u_old(uOld())
      28             : {
      29           8 : }
      30             : 
      31             : Real
      32         640 : AccumulateAux::computeValue()
      33             : {
      34         640 :   Real ret = _u_old[_qp];
      35        1280 :   for (const auto & value : _values)
      36         640 :     ret += (*value)[_qp];
      37         640 :   return ret;
      38             : }

Generated by: LCOV version 1.14