www.mooseframework.org
AccumulateAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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.addRequiredCoupledVar(
19  "accumulate_from_variable",
20  "Variable whose values are to be accumulated into the current variable");
21  return params;
22 }
23 
25  : AuxKernel(parameters), _values(coupledValues("accumulate_from_variable")), _u_old(uOld())
26 {
27 }
28 
29 Real
31 {
32  Real ret = _u_old[_qp];
33  for (const auto & value : _values)
34  ret += (*value)[_qp];
35  return ret;
36 }
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:30
const VariableValue & _u_old
The old variable value.
Definition: AccumulateAux.h:33
static InputParameters validParams()
AccumulateAux(const InputParameters &parameters)
Definition: AccumulateAux.C:24