20 params.
addParam<
Real>(
"coefficient", 1.0,
"A simple coefficient multiplying the integral");
22 "order", 2,
"The order of global truncation error: midpoint=1, trapezoidal=2, Simpson=3");
28 _coef(getParam<
Real>(
"coefficient")),
29 _order(getParam<unsigned
int>(
"order")),
30 _u_old(_order != 3 ? uOld() : genericZeroValue<false>()),
31 _u_older(_order == 3 ? uOlder() : genericZeroValue<false>())
54 mooseError(
"VariableTimeIntegrationAux: unknown time integration order specified");
72 Real integral_value = 0.0;
74 for (
unsigned int i = 0; i <
_order; ++i)
92 Real term1 = (x2 - x0) * (y0 + (x2 - x0) * (y1 - y0) / (2.0 * (x1 - x0)));
93 Real term2 = (2.0 * x2 * x2 - x0 * x2 - x0 * x0 + 3.0 * x0 * x1 - 3.0 * x1 * x2) / 6.0;
94 Real term3 = (y2 - y1) / (x2 - x1) - (y1 - y0) / (x1 - x0);
95 integral_value = term1 + term2 * term3;
98 return integral_value;
static InputParameters validParams()
virtual Real computeValue() override
Compute and return the value of the aux variable.
Real & _dt_old
Size of the old time step.
virtual const VariableValue & coupledValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled variable.
Real & _dt
Time step size.
std::vector< Real > _integration_coef
VariableTimeIntegrationAux(const InputParameters ¶meters)
virtual const VariableValue & coupledValueOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old value from two time steps previous of a coupled variable.
const VariableValue & _u_old
The old variable value (zero if order == 3)
const VariableValue & _u_older
The older variable value (zero if order != 3)
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
registerMooseObject("MooseApp", VariableTimeIntegrationAux)
std::vector< const VariableValue * > _coupled_vars
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
unsigned int _qp
Quadrature point index.
static InputParameters validParams()
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
void ErrorVector unsigned int
An AuxKernel that can be used to integrate a field variable in time using a variety of different inte...