19 _all_eigen_vars(false),
20 _active_on_old(false),
21 _eigen_kernel_counter(0)
29 const std::string & name,
39 parameters.
set<
bool>(
"implicit") =
true;
40 std::shared_ptr<KernelBase> ekernel =
42 if (parameters.get<
bool>(
"eigen"))
46 if (parameters.
get<
bool>(
"eigen"))
49 parameters.
set<
bool>(
"implicit") =
false;
50 std::string old_name(
name +
"_old");
52 std::shared_ptr<KernelBase> ekernel =
62 std::shared_ptr<KernelBase> kernel =
68 if (parameters.
get<std::vector<AuxVariableName>>(
"save_in").size() > 0)
70 if (parameters.
get<std::vector<AuxVariableName>>(
"diag_save_in").size() > 0)
87 else if (tag ==
EIGEN)
106 mooseAssert(coefficients.size() > 0 && coefficients.size() <= 3,
"Size error on coefficients");
110 if (coefficients.size() > 1)
112 if (coefficients.size() > 2)
115 else if (tag ==
EIGEN)
120 if (coefficients.size() > 1)
122 if (coefficients.size() > 2)
127 if (coefficients.size() > 2)
131 Real t =
solution()(dof) * coefficients[0];
137 else if (coefficients.size() > 1)
141 Real t =
solution()(dof) * coefficients[0];
150 Real t =
solution()(dof) * coefficients[0];
167 else if (tag ==
EIGEN)
190 else if (tag ==
EIGEN)
232 else if (tag ==
EIGEN)
244 std::set<dof_id_type> var_indices;
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void updateActiveObjects()
Update the active objects in the warehouses.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
This is the common base class for the three main kernel types implemented in MOOSE,...
void eigenKernelOnOld()
Ask eigenkernels to operate on old or current solution vectors.
virtual ~MooseEigenSystem()
void eigenKernelOnCurrent()
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds a kernel.
virtual void markEigenVariable(const VariableName &var_name)
Mark a variable as a variable of the eigen system.
SYSTEMTAG
System or kernel tags.
void initSystemSolutionOld(SYSTEMTAG tag, Real v)
std::set< dof_id_type > _eigen_var_indices
const std::set< VariableName > & getEigenVariableNames() const
Get variable names of the eigen system.
void buildSystemDoFIndices(SYSTEMTAG tag=ALL)
Build DoF indices for a system.
unsigned int _eigen_kernel_counter
counter of eigen kernels
void initSystemSolution(SYSTEMTAG tag, Real v)
Initialize the solution vector with a constant value.
bool containsEigenKernel() const
Weather or not the system contains eigen kernels.
void combineSystemSolution(SYSTEMTAG tag, const std::vector< Real > &coefficients)
Linear combination of the solution vectors.
void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor)
Scale the solution vector.
bool activeOnOld()
Return if eigen kernels should be on old solution.
MooseEigenSystem(FEProblemBase &problem, const std::string &name)
std::set< VariableName > _eigen_var_names
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
MooseObjectTagWarehouse< KernelBase > _kernels
bool _has_save_in
If there is any Kernel or IntegratedBC having save_in.
bool _has_diag_save_in
If there is any Kernel or IntegratedBC having diag_save_in.
Nonlinear system to be solved.
virtual libMesh::NonlinearImplicitSystem & sys()
FEProblemBase & _fe_problem
the governing finite element/volume problem
const std::vector< VariableName > & getVariableNames() const
NumericVector< Number > & solutionOld()
NumericVector< Number > & solutionOlder()
virtual const std::string & name() const
NumericVector< Number > & solution()
void update()
Update the system (doing libMesh magic)
virtual void set(const numeric_index_type i, const T value)=0
virtual void scale(const T factor)=0
virtual void add(const numeric_index_type i, const T value)=0
void local_dof_indices(const unsigned int var, std::set< dof_id_type > &var_indices) const
unsigned int variable_number(std::string_view var) const