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 class MooseEigenSystem;
15 class FEProblemBase;
16 
21 {
22 public:
30 
32 
33  virtual void init() override;
34 
38  const Real & eigenvalueOld();
39 
43  virtual void makeBXConsistent(Real k);
44 
48  virtual void checkIntegrity();
49 
66  virtual bool inversePowerIteration(unsigned int min_iter,
67  unsigned int max_iter,
68  Real pfactor,
69  bool cheb_on,
70  Real tol_eig,
71  bool echo,
72  PostprocessorName xdiff,
73  Real tol_x,
74  Real & k,
75  Real & initial_res);
76 
81  virtual void preIteration();
82 
87  virtual void postIteration();
88 
92  virtual void postExecute() override;
93 
100  virtual Real normalizeSolution(bool force = true);
101 
111  virtual bool nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real & k);
112 
117  Real & eigenValue() { return _eigenvalue; }
118 
119 protected:
123  virtual void printEigenvalue();
124 
125  // the fe problem
128 
131 
134 
135  // postprocessor for eigenvalue
138 
142 
143  // Chebyshev acceleration
145  {
146  public:
148  void reinit();
149 
150  const unsigned int n_iter; // minimum number of accelerated iteration each cycle
151  const unsigned int fsmooth; // number of unaccelerated iteration each cycle
152  unsigned int finit; // number of unaccelerated iteration before Chebyshev
153 
154  unsigned int lgac; // doing acceleration or not
155  unsigned int icheb; // number of acceleration in current cycle
156  unsigned int iter_begin; // starting number of current acceleration cycle
157  double error_begin; // starting flux error of current acceleration cycle
158  double flux_error_norm_old; // flux error of previous power iteration
159  double ratio; // estimation of dominant ratio
160  double ratio_new; // new estimated dominant ratio
161  unsigned int icho; // improved ratio estimation
162  };
163  void chebyshev(Chebyshev_Parameters & params,
164  unsigned int iter,
165  const PostprocessorValue * solution_diff);
166 };
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
EigenExecutionerBase(const InputParameters &parameters)
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...
PostprocessorValue & _eigenvalue
Storage for the eigenvalue computed by the executioner.
FEProblemSolve _feproblem_solve
dummy solve object for properly setting PETSc options
virtual void checkIntegrity()
Make sure time kernel is not presented.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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
various MOOSE typedefs
Definition: MooseTypes.h:191
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
const Real & _normalization
Postprocessor for normalization.
void chebyshev(Chebyshev_Parameters &params, unsigned int iter, const PostprocessorValue *solution_diff)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseEigenSystem & _eigen_sys
virtual void printEigenvalue()
Print eigenvalue.
static InputParameters validParams()
Constructor.
const InputParameters & parameters() const
Get the parameters of the object.
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.