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 addKernel(const std::string & kernel_name,
32  const std::string & name,
33  InputParameters & parameters);
34 
39  virtual void markEigenVariable(const VariableName & var_name);
40 
44  enum SYSTEMTAG
45  {
46  ALL,
48  };
49 
56  void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor);
57 
64  void combineSystemSolution(SYSTEMTAG tag, const std::vector<Real> & coefficients);
65 
72  void initSystemSolution(SYSTEMTAG tag, Real v);
73  void initSystemSolutionOld(SYSTEMTAG tag, Real v);
74 
78  void eigenKernelOnOld();
79  void eigenKernelOnCurrent();
80 
85 
89  bool activeOnOld();
90 
94  const std::set<VariableName> & getEigenVariableNames() const { return _eigen_var_names; }
95 
99  bool containsEigenKernel() const;
100 
101 protected:
102  std::set<VariableName> _eigen_var_names;
104  std::set<dof_id_type> _eigen_var_indices;
105 
107 
109  unsigned int _eigen_kernel_counter;
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:1297
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)
void initSystemSolutionOld(SYSTEMTAG tag, Real v)
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Adds a kernel.