www.mooseframework.org
MooseEigenSystem.h
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 #pragma once
11 
12 #include "NonlinearSystem.h"
13 
14 // libMesh
15 #include "libmesh/eigen_system.h"
16 
17 class FEProblemBase;
18 
20 {
21 public:
22  MooseEigenSystem(FEProblemBase & problem, const std::string & name);
23  virtual ~MooseEigenSystem();
24 
31  virtual void
32  addKernel(const std::string & kernel_name, const std::string & name, InputParameters parameters);
33 
38  virtual void markEigenVariable(const VariableName & var_name);
39 
43  enum SYSTEMTAG
44  {
45  ALL,
47  };
48 
55  void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor);
56 
63  void combineSystemSolution(SYSTEMTAG tag, const std::vector<Real> & coefficients);
64 
71  void initSystemSolution(SYSTEMTAG tag, Real v);
72  void initSystemSolutionOld(SYSTEMTAG tag, Real v);
73 
77  void eigenKernelOnOld();
78  void eigenKernelOnCurrent();
79 
84 
88  bool activeOnOld();
89 
93  const std::set<VariableName> & getEigenVariableNames() const { return _eigen_var_names; }
94 
98  bool containsEigenKernel() const;
99 
100 protected:
101  std::set<VariableName> _eigen_var_names;
103  std::set<dof_id_type> _eigen_var_indices;
104 
106 
108  unsigned int _eigen_kernel_counter;
109 };
110 
const std::set< VariableName > & getEigenVariableNames() const
Get variable names of the eigen system.
void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor)
Scale the solution vector.
unsigned int _eigen_kernel_counter
counter of eigen kernels
virtual ~MooseEigenSystem()
SYSTEMTAG
System or kernel tags.
bool activeOnOld()
Return if eigen kernels should be on old solution.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const std::string & name() const
Definition: SystemBase.C:1088
void buildSystemDoFIndices(SYSTEMTAG tag=ALL)
Build DoF indices for a system.
void initSystemSolution(SYSTEMTAG tag, Real v)
Initialize the solution vector with a constant value.
void eigenKernelOnOld()
Ask eigenkernels to operate on old or current solution vectors.
void combineSystemSolution(SYSTEMTAG tag, const std::vector< Real > &coefficients)
Linear combination of the solution vectors.
virtual void markEigenVariable(const VariableName &var_name)
Mark a variable as a variable of the eigen system.
std::set< dof_id_type > _eigen_var_indices
std::set< VariableName > _eigen_var_names
bool containsEigenKernel() const
Weather or not the system contains eigen kernels.
Nonlinear system to be solved.
MooseEigenSystem(FEProblemBase &problem, const std::string &name)
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
Adds a kernel.
void initSystemSolutionOld(SYSTEMTAG tag, Real v)