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];
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!");
FVInitialConditionTempl(const InputParameters ¶meters)
Constructor.
virtual void computeElement(const ElemInfo &elem_info) override
Workhorse method for computing the initial conditions for block-restricted initial conditions...
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
virtual bool isFV() const
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual MooseVariableFEBase & variable() override
retrieves the MOOSE variable that this initial condition acts upon
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const Point & centroid() const
const std::string & name() const
Get the name of the class.
MooseVariableField< T > & _base_var
The variable that this initial condition is acting upon.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual ~FVInitialConditionTempl()
const std::vector< std::vector< dof_id_type > > & dofIndices() const
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...
Class used for caching additional information for elements such as the volume and centroid...
This is a template class that implements the workhorse compute and computeNodal methods.