<commit_before>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "ForcingFunctionAux.h"
// #include "Function.h" //don't think this is needed but check

registerMooseObject("MooseApp", ForcingFunctionAux);

defineLegacyParams(ForcingFunctionAux); //?

InputParameters
ForcingFunctionAux::validParams()
{
  InputParameters params = FunctionAux::validParams();
  params.addClassDescription("Auxiliary Kernel that adds a forcing function to the value of an "
                             "AuxVariable from the previous time step.");
  return params;
}

ForcingFunctionAux::ForcingFunctionAux(const InputParameters & parameters)
  : FunctionAux(parameters), _u_old(uOld())
{
}

Real
ForcingFunctionAux::computeValue()
{
  if (isNodal())
    mooseError("Must use an elemental AuxVariable for ForcingFunctionAux.");
  else
    return _u_old[_qp] + _dt * _func.value(_t, _q_point[_qp]);
}<commit_msg>Address PR comments and fix non-unity build failure for ForcingFunctionAux #20065<commit_after>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "ForcingFunctionAux.h"
#include "Function.h"

registerMooseObject("MooseApp", ForcingFunctionAux);

defineLegacyParams(ForcingFunctionAux); //?

InputParameters
ForcingFunctionAux::validParams()
{
  InputParameters params = FunctionAux::validParams();
  params.addClassDescription("Auxiliary Kernel that adds a forcing function to the value of an "
                             "AuxVariable from the previous time step.");
  return params;
}

ForcingFunctionAux::ForcingFunctionAux(const InputParameters & parameters)
  : FunctionAux(parameters), _u_old(uOld())
{
  if (isNodal())
    paramError("variable", "The variable must be elemental");
}

Real
ForcingFunctionAux::computeValue()
{
  return _u_old[_qp] + _dt * _func.value(_t, _q_point[_qp]);
}
{'fraction_non_alphanumeric': 0.12179487179487179, 'fraction_numerical': 0.005555555555555556, 'mean_word_length': 4.534278959810875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6637581', 'n_tokens_mistral': 736, 'n_tokens_neox': 722, 'n_words': 181}