16#include "libmesh/fe_interface.h"
17#include "libmesh/quadrature.h"
22 _fe_problem(*getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
24 _t(_fe_problem.time()),
25 _base_var(_sys.getActualFieldVariable<T>(parameters.get<
THREAD_ID>(
"_tid"),
26 parameters.get<VariableName>(
"variable")))
29 mooseError(
"A finite volume initial condition has been defined for variable '",
31 "' whereas the variable itself is not a finite volume variable!");
43 _base_var.prepareIC();
47 const auto system_number = _base_var.sys().number();
48 const auto var_number = _base_var.number();
49 const auto dof_id = elem_info.
dofIndices()[system_number][var_number];
50 const auto dof_value = this->value(elem_info.
centroid());
52 _base_var.sys().solution().set(dof_id, dof_value);
60 static_assert(Moose::always_false<T>,
61 "Initial condition is not implemented for the used type!");
Class used for caching additional information for elements such as the volume and centroid.
const std::vector< std::vector< dof_id_type > > & dofIndices() const
const Point & centroid() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
This is a template class that implements the workhorse compute and computeNodal methods.
MooseVariableField< T > & _base_var
The variable that this initial condition is acting upon.
virtual MooseVariableFEBase & variable() override
retrieves the MOOSE variable that this initial condition acts upon
virtual void computeElement(const ElemInfo &elem_info) override
Workhorse method for computing the initial conditions for block-restricted initial conditions.
virtual ~FVInitialConditionTempl()
FVInitialConditionTempl(const InputParameters ¶meters)
Constructor.
const std::string & name() const
Get the name of the class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual bool isFV() const