https://mooseframework.inl.gov
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 
12 registerMooseObject("SolidMechanicsApp", AccumulateAux);
13 
16 {
18  params.addClassDescription("Accumulates one or more variables and this auxiliary variable into "
19  "this auxiliary variable");
20  params.addRequiredCoupledVar(
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 
31 Real
33 {
34  Real ret = _u_old[_qp];
35  for (const auto & value : _values)
36  ret += (*value)[_qp];
37  return ret;
38 }
registerMooseObject("SolidMechanicsApp", AccumulateAux)
const std::vector< const VariableValue * > _values
coupled variable values to be aggregated
Definition: AccumulateAux.h:30
static InputParameters validParams()
Definition: AccumulateAux.C:15
Accumulate values from one auxiliary variable into another.
Definition: AccumulateAux.h:19
virtual const OutputTools< Real >::VariableValue & value()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue()
Definition: AccumulateAux.C:32
const VariableValue & _u_old
The old variable value.
Definition: AccumulateAux.h:33
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
AccumulateAux(const InputParameters &parameters)
Definition: AccumulateAux.C:26