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;
17
22{
23public:
31
33
34 virtual void init() override;
35
39 const Real & eigenvalueOld();
40
44 virtual void makeBXConsistent(Real k);
45
49 virtual void checkIntegrity();
50
67 virtual bool inversePowerIteration(unsigned int min_iter,
68 unsigned int max_iter,
69 Real pfactor,
70 bool cheb_on,
71 Real tol_eig,
72 bool echo,
73 PostprocessorName xdiff,
74 Real tol_x,
75 Real & k,
76 Real & initial_res);
77
82 virtual void preIteration();
83
88 virtual void postIteration();
89
93 virtual void postExecute() override;
94
101 virtual Real normalizeSolution(bool force = true);
102
112 virtual bool nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real & k);
113
118 Real & eigenValue() { return _eigenvalue; }
119
120protected:
124 virtual void printEigenvalue();
125
128
129 // the fe problem
132
135
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
171private:
174};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
Default nonlinear convergence criteria for FEProblem.
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.
DefaultNonlinearConvergence * getEigenSystemConvergence()
Gets the Convergence object for _eigen_sys and checks it's the right type.
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.
DefaultNonlinearConvergence * _eigen_sys_conv
Convergence object corresponding to _eigen_sys.
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