www.mooseframework.org
EigenExecutionerBase.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 "Executioner.h"
13 
14 // Forward Declarations
16 class MooseEigenSystem;
17 class FEProblemBase;
18 
19 template <>
21 
26 {
27 public:
35 
36  virtual void init() override;
37 
41  const Real & eigenvalueOld();
42 
46  virtual void makeBXConsistent(Real k);
47 
51  virtual void checkIntegrity();
52 
69  virtual bool inversePowerIteration(unsigned int min_iter,
70  unsigned int max_iter,
71  Real pfactor,
72  bool cheb_on,
73  Real tol_eig,
74  bool echo,
75  PostprocessorName xdiff,
76  Real tol_x,
77  Real & k,
78  Real & initial_res);
79 
84  virtual void preIteration();
85 
90  virtual void postIteration();
91 
95  virtual void postExecute() override;
96 
103  virtual Real normalizeSolution(bool force = true);
104 
114  virtual bool nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real & k);
115 
120  Real & eigenValue() { return _eigenvalue; }
121 
122 protected:
126  virtual void printEigenvalue();
127 
128  // the fe problem
131 
133  Real & _eigenvalue;
134 
135  // postprocessor for eigenvalue
136  const Real & _source_integral;
138 
140  const Real & _normalization;
142 
144 
145  // Chebyshev acceleration
147  {
148  public:
150  void reinit();
151 
152  const unsigned int n_iter; // minimum number of accelerated iteration each cycle
153  const unsigned int fsmooth; // number of unaccelerated iteration each cycle
154  unsigned int finit; // number of unaccelerated iteration before Chebyshev
155 
156  unsigned int lgac; // doing acceleration or not
157  unsigned int icheb; // number of acceleration in current cycle
158  unsigned int iter_begin; // starting number of current acceleration cycle
159  double error_begin; // starting flux error of current acceleration cycle
160  double flux_error_norm_old; // flux error of previous power iteration
161  double ratio; // estimation of dominant ratio
162  double ratio_new; // new estimated dominant ratio
163  unsigned int icho; // improved ratio estimation
164  };
165  void chebyshev(Chebyshev_Parameters & params,
166  unsigned int iter,
167  const PostprocessorValue * solution_diff);
168 };
169 
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:24
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.
unsigned int PerfID
Definition: MooseTypes.h:163
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
This class provides reusable routines for eigenvalue executioners.
virtual bool nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real &k)
Perform nonlinear solve with the initial guess of the solution.
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:154
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:32
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.
virtual Real normalizeSolution(bool force=true)
Normalize the solution vector based on the postprocessor value for normalization. ...
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.
virtual bool 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.