https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AccumulateAux.C
Go to the documentation of this file.
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
12registerMooseObject("SolidMechanicsApp", AccumulateAux);
13
16{
18 params.addClassDescription("Accumulates one or more variables and this auxiliary variable into "
19 "this auxiliary variable");
21 "accumulate_from_variable",
22 "Variable whose values are to be accumulated into the current variable");
23 return params;
24}
25
27 : AuxKernel(parameters), _values(coupledValues("accumulate_from_variable")), _u_old(uOld())
28{
29}
30
31Real
33{
34 Real ret = _u_old[_qp];
35 for (const auto & value : _values)
36 ret += (*value)[_qp];
37 return ret;
38}
registerMooseObject("SolidMechanicsApp", AccumulateAux)
Accumulate values from one auxiliary variable into another.
const VariableValue & _u_old
The old variable value.
const std::vector< const VariableValue * > _values
coupled variable values to be aggregated
virtual Real computeValue()
static InputParameters validParams()
AccumulateAux(const InputParameters &parameters)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual const OutputTools< ComputeValueType >::VariableValue & value()