https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EigenExecutionerBase.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
15class FEProblemBase;
16
21{
22public:
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
119protected:
123 virtual void printEigenvalue();
124
125 // the fe problem
128
131
134
135 // postprocessor for eigenvalue
136 const Real & _source_integral;
138
140 const Real & _normalization;
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};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
This class provides reusable routines for eigenvalue executioners.
virtual void postExecute() override
Override this for actions that should take place after the main solve.
FEProblemSolve _feproblem_solve
dummy solve object for properly setting PETSc options
const Real & _normalization
Postprocessor for normalization.
virtual Real normalizeSolution(bool force=true)
Normalize the solution vector based on the postprocessor value for normalization.
virtual void preIteration()
Override this for actions that should take place before linear solve of each inverse power iteration.
virtual void checkIntegrity()
Make sure time kernel is not presented.
MooseEigenSystem & _eigen_sys
static InputParameters validParams()
Constructor.
virtual bool nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real &k)
Perform nonlinear solve with the initial guess of the solution.
Real & eigenValue()
A method for returning the eigenvalue computed by the executioner.
const Real & eigenvalueOld()
The old eigenvalue used by inverse power iterations.
PostprocessorValue & _eigenvalue
Storage for the eigenvalue computed by the executioner.
void chebyshev(Chebyshev_Parameters &params, unsigned int iter, const PostprocessorValue *solution_diff)
virtual void printEigenvalue()
Print eigenvalue.
virtual void makeBXConsistent(Real k)
Normalize solution so that |Bx| = k.
virtual void postIteration()
Override this for actions that should take place after linear solve of each inverse power iteration.
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.
virtual void init() override
Initialize the executioner.
A MultiMooseEnum object to hold "execute_on" flags.
Executioners are objects that do the actual work of solving your problem.
Definition Executioner.h:37
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131