www.mooseframework.org
EigenExecutionerBase.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef EIGENEXECUTIONERBASE_H
16 #define EIGENEXECUTIONERBASE_H
17 
18 #include "Executioner.h"
19 
20 // Forward Declarations
22 class MooseEigenSystem;
23 class FEProblemBase;
24 
25 template <>
27 
32 {
33 public:
41 
42  virtual void init() override;
43 
47  const Real & eigenvalueOld();
48 
52  virtual void makeBXConsistent(Real k);
53 
57  virtual void checkIntegrity();
58 
74  virtual void inversePowerIteration(unsigned int min_iter,
75  unsigned int max_iter,
76  Real pfactor,
77  bool cheb_on,
78  Real tol_eig,
79  bool echo,
80  PostprocessorName xdiff,
81  Real tol_x,
82  Real & k,
83  Real & initial_res);
84 
89  virtual void preIteration();
90 
95  virtual void postIteration();
96 
100  virtual void postExecute() override;
101 
108  virtual Real normalizeSolution(bool force = true);
109 
118  virtual void nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real & k);
119 
124  Real & eigenValue() { return _eigenvalue; }
125 
126 protected:
130  virtual void printEigenvalue();
131 
132  // the fe problem
135 
137  Real & _eigenvalue;
138 
139  // postprocessor for eigenvalue
140  const Real & _source_integral;
142 
144  const Real & _normalization;
146 
147  // Chebyshev acceleration
149  {
150  public:
152  void reinit();
153 
154  const unsigned int n_iter; // minimum number of accelerated iteration each cycle
155  const unsigned int fsmooth; // number of unaccelerated iteration each cycle
156  unsigned int finit; // number of unaccelerated iteration before Chebyshev
157 
158  unsigned int lgac; // doing acceleration or not
159  unsigned int icheb; // number of acceleration in current cycle
160  unsigned int iter_begin; // starting number of current acceleration cycle
161  double error_begin; // starting flux error of current acceleration cycle
162  double flux_error_norm_old; // flux error of previous power iteration
163  double ratio; // estimation of dominant ratio
164  double ratio_new; // new estimated dominant ratio
165  unsigned int icho; // improved ratio estimation
166  };
167  void chebyshev(Chebyshev_Parameters & params,
168  unsigned int iter,
169  const PostprocessorValue * solution_diff);
170 };
171 
172 #endif // EIGENEXECUTIONERBASE_H
InputParameters validParams< EigenExecutionerBase >()
EigenExecutionerBase(const InputParameters &parameters)
Constructor.
virtual void makeBXConsistent(Real k)
Normalize solution so that |Bx| = k.
const Real & eigenvalueOld()
The old eigenvalue used by inverse power iterations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void postIteration()
Override this for actions that should take place after linear solve of each inverse power iteration...
virtual void checkIntegrity()
Make sure time kernel is not presented.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void inversePowerIteration(unsigned int min_iter, unsigned int max_iter, Real pfactor, bool cheb_on, Real tol_eig, bool echo, PostprocessorName xdiff, Real tol_x, Real &k, Real &initial_res)
Perform inverse power iterations with the initial guess of the solution.
virtual void nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real &k)
Perform nonlinear solve with the initial guess of the solution.
This class provides reusable routines for eigenvalue executioners.
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:73
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:41
const Real & _normalization
Postprocessor for normalization.
void chebyshev(Chebyshev_Parameters &params, unsigned int iter, const PostprocessorValue *solution_diff)
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
MooseEigenSystem & _eigen_sys
virtual void printEigenvalue()
Print eigenvalue.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
virtual Real normalizeSolution(bool force=true)
Normalize the solution vector based on the postprocessor value for normalization. ...
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
virtual void postExecute() override
Override this for actions that should take place after the main solve.
virtual void init() override
Initialize the executioner.
virtual void preIteration()
Override this for actions that should take place before linear solve of each inverse power iteration...
Real & eigenValue()
A method for returning the eigenvalue computed by the executioner.