www.mooseframework.org
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
NonlinearEigen Class Reference

#include <NonlinearEigen.h>

Inheritance diagram for NonlinearEigen:
[legend]

Public Member Functions

 NonlinearEigen (const InputParameters &parameters)
 
virtual void init () override
 Initialize the executioner. More...
 
virtual void execute () override
 Pure virtual execute function MUST be overridden by children classes. More...
 
const Real & eigenvalueOld ()
 The old eigenvalue used by inverse power iterations. More...
 
virtual void makeBXConsistent (Real k)
 Normalize solution so that |Bx| = k. More...
 
virtual void checkIntegrity ()
 Make sure time kernel is not presented. More...
 
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. More...
 
virtual void preIteration ()
 Override this for actions that should take place before linear solve of each inverse power iteration. More...
 
virtual void postIteration ()
 Override this for actions that should take place after linear solve of each inverse power iteration. More...
 
virtual void postExecute () override
 Override this for actions that should take place after the main solve. More...
 
virtual Real normalizeSolution (bool force=true)
 Normalize the solution vector based on the postprocessor value for normalization. More...
 
virtual void nonlinearSolve (Real rel_tol, Real abs_tol, Real pfactor, Real &k)
 Perform nonlinear solve with the initial guess of the solution. More...
 
Real & eigenValue ()
 A method for returning the eigenvalue computed by the executioner. More...
 
virtual void preExecute ()
 Override this for actions that should take place before execution. More...
 
virtual void preSolve ()
 Override this for actions that should take place before execution. More...
 
virtual void postSolve ()
 Override this for actions that should take place after execution. More...
 
virtual Problemproblem ()
 Deprecated: Return a reference to this Executioner's Problem instance. More...
 
FEProblemBasefeProblem ()
 Return a reference to this Executioner's FEProblemBase instance. More...
 
virtual std::string getTimeStepperName ()
 The name of the TimeStepper This is an empty string for non-Transient executioners. More...
 
virtual void parentOutputPositionChanged ()
 Can be used by subsclasses to call parentOutputPositionChanged() on the underlying FEProblemBase. More...
 
virtual bool lastSolveConverged ()
 Whether or not the last solve converged. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
template<class T >
const T & getUserObject (const std::string &name)
 Get an user object with a given parameter name. More...
 
template<class T >
const T & getUserObjectByName (const std::string &name)
 Get an user object with a given name. More...
 
const UserObjectgetUserObjectBase (const std::string &name)
 Get an user object with a given parameter name. More...
 
const UserObjectgetUserObjectBaseByName (const std::string &name)
 Get an user object with a given name. More...
 
bool hasPostprocessor (const std::string &name) const
 Determine if the Postprocessor exists. More...
 
bool hasPostprocessorByName (const PostprocessorName &name)
 Determine if the Postprocessor exists. More...
 
const PostprocessorValuegetPostprocessorValue (const std::string &name)
 Retrieve the value of a Postprocessor or one of it's old or older values. More...
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &name)
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &name)
 
const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name)
 Retrieve the value of the Postprocessor. More...
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name)
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name)
 
const PostprocessorValuegetDefaultPostprocessorValue (const std::string &name)
 Return the default postprocessor value. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

virtual void takeStep ()
 
virtual void printEigenvalue ()
 Print eigenvalue. More...
 
void chebyshev (Chebyshev_Parameters &params, unsigned int iter, const PostprocessorValue *solution_diff)
 
virtual void addAttributeReporter (const std::string &name, Real &attribute, const std::string execute_on="")
 Adds a postprocessor to report a Real class attribute. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 

Protected Attributes

const unsigned int & _free_iter
 
const Real & _abs_tol
 
const Real & _rel_tol
 
const Real & _pfactor
 
bool _output_pi
 
bool _output_after_pi
 
FEProblemBase_problem
 
MooseEigenSystem_eigen_sys
 
Real & _eigenvalue
 Storage for the eigenvalue computed by the executioner. More...
 
const Real & _source_integral
 
Real _source_integral_old
 
const Real & _normalization
 Postprocessor for normalization. More...
 
ExecFlagType _norm_execflag
 
FEProblemBase_fe_problem
 
Real _initial_residual_norm
 Initial Residual Variables. More...
 
Real _old_initial_residual_norm
 
std::string _restart_file_base
 
std::vector< std::string > _splitting
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 

Detailed Description

Definition at line 26 of file NonlinearEigen.h.

Constructor & Destructor Documentation

NonlinearEigen::NonlinearEigen ( const InputParameters parameters)

Definition at line 36 of file NonlinearEigen.C.

37  : EigenExecutionerBase(parameters),
38  _free_iter(getParam<unsigned int>("free_power_iterations")),
39  _abs_tol(getParam<Real>("source_abs_tol")),
40  _rel_tol(getParam<Real>("source_rel_tol")),
41  _pfactor(getParam<Real>("pfactor")),
42  _output_after_pi(getParam<bool>("output_after_power_iterations"))
43 {
44  if (!_app.isRecovering() && !_app.isRestarting())
45  _eigenvalue = getParam<Real>("k0");
46 
47  addAttributeReporter("eigenvalue", _eigenvalue, "initial timestep_end");
48 }
const unsigned int & _free_iter
virtual void addAttributeReporter(const std::string &name, Real &attribute, const std::string execute_on="")
Adds a postprocessor to report a Real class attribute.
Definition: Executioner.C:180
EigenExecutionerBase(const InputParameters &parameters)
Constructor.
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:608
const Real & _abs_tol
const Real & _pfactor
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
const Real & _rel_tol
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:614

Member Function Documentation

void Executioner::addAttributeReporter ( const std::string &  name,
Real &  attribute,
const std::string  execute_on = "" 
)
protectedvirtualinherited

Adds a postprocessor to report a Real class attribute.

Parameters
nameThe name of the postprocessor to create
attributeThe Real class attribute to report
execute_onWhen to execute the postprocessor that is created

Definition at line 180 of file Executioner.C.

Referenced by InversePowerMethod::InversePowerMethod(), NonlinearEigen(), and Executioner::parentOutputPositionChanged().

183 {
185  "_fe_problem_base",
186  "Failed to retrieve FEProblemBase when adding a attribute reporter in Executioner");
187  InputParameters params = _app.getFactory().getValidParams("ExecutionerAttributeReporter");
188  params.set<Real *>("value") = &attribute;
189  if (!execute_on.empty())
190  params.set<MultiMooseEnum>("execute_on") = execute_on;
191  problem->addPostprocessor("ExecutionerAttributeReporter", name, params);
192 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
Definition: Factory.C:26
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Factory & getFactory()
Retrieve the Factory associated with this App.
Definition: MooseApp.h:253
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
virtual Problem & problem()
Deprecated: Return a reference to this Executioner&#39;s Problem instance.
Definition: Executioner.C:155
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual void addPostprocessor(std::string pp_name, const std::string &name, InputParameters parameters)
void EigenExecutionerBase::chebyshev ( Chebyshev_Parameters params,
unsigned int  iter,
const PostprocessorValue solution_diff 
)
protectedinherited

Definition at line 463 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

466 {
467  if (!solution_diff)
468  mooseError("solution diff is required for Chebyshev acceleration");
469 
470  if (chebyshev_parameters.lgac == 0)
471  {
472  if (chebyshev_parameters.icho == 0)
473  chebyshev_parameters.ratio = *solution_diff / chebyshev_parameters.flux_error_norm_old;
474  else
475  {
476  chebyshev_parameters.ratio = chebyshev_parameters.ratio_new;
477  chebyshev_parameters.icho = 0;
478  }
479 
480  if (iter > chebyshev_parameters.finit && chebyshev_parameters.ratio >= 0.4 &&
481  chebyshev_parameters.ratio <= 1)
482  {
483  chebyshev_parameters.lgac = 1;
484  chebyshev_parameters.icheb = 1;
485  chebyshev_parameters.error_begin = *solution_diff;
486  chebyshev_parameters.iter_begin = iter;
487  double alp = 2 / (2 - chebyshev_parameters.ratio);
488  std::vector<double> coef(2);
489  coef[0] = alp;
490  coef[1] = 1 - alp;
494  }
495  }
496  else
497  {
498  chebyshev_parameters.icheb++;
499  double gamma = acosh(2 / chebyshev_parameters.ratio - 1);
500  double alp = 4 / chebyshev_parameters.ratio *
501  std::cosh((chebyshev_parameters.icheb - 1) * gamma) /
502  std::cosh(chebyshev_parameters.icheb * gamma);
503  double beta = (1 - chebyshev_parameters.ratio / 2) * alp - 1;
504  /* if (iter<int(chebyshev_parameters.iter_begin+chebyshev_parameters.n_iter))
505  {
506  std::vector<double> coef(3);
507  coef[0] = alp;
508  coef[1] = 1-alp+beta;
509  coef[2] = -beta;
510  _eigen_sys.combineSystemSolution(NonlinearSystem::EIGEN, coef);
511  }
512  else
513  {*/
514  double gamma_new =
515  (*solution_diff / chebyshev_parameters.error_begin) *
516  (std::cosh((chebyshev_parameters.icheb - 1) * acosh(2 / chebyshev_parameters.ratio - 1)));
517  if (gamma_new < 1.0)
518  gamma_new = 1.0;
519 
520  chebyshev_parameters.ratio_new =
521  chebyshev_parameters.ratio / 2 *
522  (std::cosh(acosh(gamma_new) / (chebyshev_parameters.icheb - 1)) + 1);
523  if (gamma_new > 1.01)
524  {
525  chebyshev_parameters.lgac = 0;
526  // chebyshev_parameters.icheb = 0;
527  // if (chebyshev_parameters.icheb>30)
528  // {
529  if (chebyshev_parameters.icheb > 0)
530  {
531  chebyshev_parameters.icho = 1;
532  chebyshev_parameters.finit = iter;
533  }
534  else
535  {
536  chebyshev_parameters.icho = 0;
537  chebyshev_parameters.finit = iter + chebyshev_parameters.fsmooth;
538  }
539  }
540  else
541  {
542  std::vector<double> coef(3);
543  coef[0] = alp;
544  coef[1] = 1 - alp + beta;
545  coef[2] = -beta;
549  }
550  // }
551  }
552  chebyshev_parameters.flux_error_norm_old = *solution_diff;
553 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
void combineSystemSolution(SYSTEMTAG tag, const std::vector< Real > &coefficients)
Linear combination of the solution vectors.
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
MooseEigenSystem & _eigen_sys
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
void EigenExecutionerBase::checkIntegrity ( )
virtualinherited

Make sure time kernel is not presented.

Definition at line 153 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::init().

154 {
155  // check to make sure that we don't have any time kernels in this simulation
157  mooseError("You have specified time kernels in your steady state eigenvalue simulation");
159  mooseError("You have not specified any eigen kernels in your eigenvalue simulation");
160 }
bool containsEigenKernel() const
Weather or not the system contains eigen kernels.
MooseEigenSystem & _eigen_sys
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
Real& EigenExecutionerBase::eigenValue ( )
inlineinherited

A method for returning the eigenvalue computed by the executioner.

Returns
A reference to the eigenvalue stored withing the executioner

Definition at line 124 of file EigenExecutionerBase.h.

124 { return _eigenvalue; }
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
const Real & EigenExecutionerBase::eigenvalueOld ( )
inherited

The old eigenvalue used by inverse power iterations.

Definition at line 50 of file EigenExecutionerBase.C.

Referenced by EigenKernel::EigenKernel().

51 {
52  return _source_integral_old;
53 }
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
void NonlinearEigen::execute ( )
overridevirtual

Pure virtual execute function MUST be overridden by children classes.

This is where the Executioner actually does it's work.

Implements Executioner.

Definition at line 105 of file NonlinearEigen.C.

106 {
107  if (_app.isRecovering())
108  return;
109 
110  preExecute();
111 
112  takeStep();
113 
114  postExecute();
115 }
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:608
virtual void takeStep()
virtual void preExecute()
Override this for actions that should take place before execution.
Definition: Executioner.C:135
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
virtual void postExecute() override
Override this for actions that should take place after the main solve.
FEProblemBase & Executioner::feProblem ( )
inherited

Return a reference to this Executioner's FEProblemBase instance.

Definition at line 162 of file Executioner.C.

163 {
164  return _fe_problem;
165 }
FEProblemBase & _fe_problem
Definition: Executioner.h:126
const PostprocessorValue & PostprocessorInterface::getDefaultPostprocessorValue ( const std::string &  name)
inherited

Return the default postprocessor value.

Parameters
nameThe name of the postprocessor parameter
Returns
A const reference to the default value

Definition at line 92 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel().

93 {
95 }
const PostprocessorValue & getDefaultPostprocessorValue(const std::string &name, bool suppress_error=false) const
Get the default value for a postprocessor added with addPostprocessor.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
const PostprocessorValue & PostprocessorInterface::getPostprocessorValue ( const std::string &  name)
inherited

Retrieve the value of a Postprocessor or one of it's old or older values.

Parameters
nameThe name of the Postprocessor parameter (see below)
Returns
A reference to the desired value

The name required by this method is the name that is hard-coded into your source code. For example, if you have a Kernel that requires a Postprocessor you may have an input file with "pp = my_pp", this function requires the "pp" name as input (see .../moose_test/functions/PostprocessorFunction.C)

see getPostprocessorValueByName getPostprocessorValueOldByName getPostprocessorValueOlderByName

Definition at line 29 of file PostprocessorInterface.C.

Referenced by GeneralUserObject::getPostprocessorValue(), and AuxKernel::getPostprocessorValue().

30 {
31  // Return the default if the Postprocessor does not exist and a default does, otherwise
32  // continue as usual
35  else
36  return _pi_feproblem.getPostprocessorValue(_ppi_params.get<PostprocessorName>(name));
37 }
bool hasPostprocessor(const std::string &name) const
Determine if the Postprocessor exists.
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
bool hasDefaultPostprocessorValue(const std::string &name) const
Returns true if a default PostprocessorValue is defined.
const PostprocessorValue & getDefaultPostprocessorValue(const std::string &name, bool suppress_error=false) const
Get the default value for a postprocessor added with addPostprocessor.
PostprocessorValue & getPostprocessorValue(const PostprocessorName &name)
Get a reference to the value associated with the postprocessor.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
const PostprocessorValue & PostprocessorInterface::getPostprocessorValueByName ( const PostprocessorName &  name)
inherited

Retrieve the value of the Postprocessor.

Parameters
namePostprocessor name (see below)
Returns
A reference to the desired value

The name required by this method is the name defined in the input file. For example, if you have a Kernel that requires a Postprocessor you may have an input file with "pp = my_pp", this method requires the "my_pp" name as input (see .../moose_test/functions/PostprocessorFunction.C)

see getPostprocessorValue getPostprocessorValueOld getPostprocessorValueOlder

Definition at line 62 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel(), GeneralUserObject::getPostprocessorValueByName(), AuxKernel::getPostprocessorValueByName(), and EigenExecutionerBase::inversePowerIteration().

63 {
65 }
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
PostprocessorValue & getPostprocessorValue(const PostprocessorName &name)
Get a reference to the value associated with the postprocessor.
const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOld ( const std::string &  name)
inherited

Definition at line 40 of file PostprocessorInterface.C.

41 {
42  // Return the default if the Postprocessor does not exist and a default does, otherwise
43  // continue as usual
46  else
47  return _pi_feproblem.getPostprocessorValueOld(_ppi_params.get<PostprocessorName>(name));
48 }
PostprocessorValue & getPostprocessorValueOld(const std::string &name)
Get the reference to the old value of a post-processor.
bool hasPostprocessor(const std::string &name) const
Determine if the Postprocessor exists.
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
bool hasDefaultPostprocessorValue(const std::string &name) const
Returns true if a default PostprocessorValue is defined.
const PostprocessorValue & getDefaultPostprocessorValue(const std::string &name, bool suppress_error=false) const
Get the default value for a postprocessor added with addPostprocessor.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOldByName ( const PostprocessorName &  name)
inherited

Definition at line 68 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel().

69 {
71 }
PostprocessorValue & getPostprocessorValueOld(const std::string &name)
Get the reference to the old value of a post-processor.
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOlder ( const std::string &  name)
inherited

Definition at line 51 of file PostprocessorInterface.C.

52 {
53  // Return the default if the Postprocessor does not exist and a default does, otherwise
54  // continue as usual
57  else
58  return _pi_feproblem.getPostprocessorValueOlder(_ppi_params.get<PostprocessorName>(name));
59 }
bool hasPostprocessor(const std::string &name) const
Determine if the Postprocessor exists.
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
PostprocessorValue & getPostprocessorValueOlder(const std::string &name)
Get the reference to the older value of a post-processor.
bool hasDefaultPostprocessorValue(const std::string &name) const
Returns true if a default PostprocessorValue is defined.
const PostprocessorValue & getDefaultPostprocessorValue(const std::string &name, bool suppress_error=false) const
Get the default value for a postprocessor added with addPostprocessor.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
const PostprocessorValue & PostprocessorInterface::getPostprocessorValueOlderByName ( const PostprocessorName &  name)
inherited

Definition at line 74 of file PostprocessorInterface.C.

75 {
77 }
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
PostprocessorValue & getPostprocessorValueOlder(const std::string &name)
Get the reference to the older value of a post-processor.
std::string Executioner::getTimeStepperName ( )
virtualinherited

The name of the TimeStepper This is an empty string for non-Transient executioners.

Returns
A string of giving the TimeStepper name

Reimplemented in Transient.

Definition at line 168 of file Executioner.C.

Referenced by ConsoleUtils::outputExecutionInformation().

169 {
170  return std::string();
171 }
template<class T >
const T & UserObjectInterface::getUserObject ( const std::string &  name)
inherited

Get an user object with a given parameter name.

Parameters
nameThe name of the parameter key of the user object to retrieve
Returns
The user object with name associated with the parameter 'name'

Definition at line 85 of file UserObjectInterface.h.

86 {
87  unsigned int tid = isDiscreteUserObject(getUserObjectBase(name)) ? _uoi_tid : 0;
88  return _uoi_feproblem.getUserObject<T>(_uoi_params.get<UserObjectName>(name), tid);
89 }
bool isDiscreteUserObject(const UserObject &uo) const
Check if the user object is a DiscreteElementUserObject.
const InputParameters & _uoi_params
Parameters of the object with this interface.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
THREAD_ID _uoi_tid
Thread ID.
const T & getUserObject(const std::string &name, unsigned int tid=0)
Get the user object by its name.
const UserObject & getUserObjectBase(const std::string &name)
Get an user object with a given parameter name.
const UserObject & UserObjectInterface::getUserObjectBase ( const std::string &  name)
inherited

Get an user object with a given parameter name.

Parameters
nameThe name of the parameter key of the user object to retrieve
Returns
The user object with name associated with the parameter 'name'

Definition at line 28 of file UserObjectInterface.C.

Referenced by UserObjectInterface::getUserObject(), InitialCondition::getUserObjectBase(), and AuxKernel::getUserObjectBase().

29 {
30  return _uoi_feproblem.getUserObjectBase(_uoi_params.get<UserObjectName>(name));
31 }
const InputParameters & _uoi_params
Parameters of the object with this interface.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObject & getUserObjectBase(const std::string &name)
Get the user object by its name.
const UserObject & UserObjectInterface::getUserObjectBaseByName ( const std::string &  name)
inherited

Get an user object with a given name.

Parameters
nameThe name of the user object to retrieve
Returns
The user object with the name

Definition at line 34 of file UserObjectInterface.C.

Referenced by UserObjectInterface::getUserObjectByName().

35 {
36  return _uoi_feproblem.getUserObjectBase(name);
37 }
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObject & getUserObjectBase(const std::string &name)
Get the user object by its name.
template<class T >
const T & UserObjectInterface::getUserObjectByName ( const std::string &  name)
inherited

Get an user object with a given name.

Parameters
nameThe name of the user object to retrieve
Returns
The user object with the name

Definition at line 93 of file UserObjectInterface.h.

94 {
95  unsigned int tid = isDiscreteUserObject(getUserObjectBaseByName(name)) ? _uoi_tid : 0;
96  return _uoi_feproblem.getUserObject<T>(name, tid);
97 }
bool isDiscreteUserObject(const UserObject &uo) const
Check if the user object is a DiscreteElementUserObject.
const UserObject & getUserObjectBaseByName(const std::string &name)
Get an user object with a given name.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
THREAD_ID _uoi_tid
Thread ID.
const T & getUserObject(const std::string &name, unsigned int tid=0)
Get the user object by its name.
bool PostprocessorInterface::hasPostprocessor ( const std::string &  name) const
inherited

Determine if the Postprocessor exists.

Parameters
nameThe name of the Postprocessor parameter
Returns
True if the Postprocessor exists
See also
hasPostprocessorByName getPostprocessorValue

Definition at line 80 of file PostprocessorInterface.C.

Referenced by EigenKernel::EigenKernel(), PostprocessorInterface::getPostprocessorValue(), PostprocessorInterface::getPostprocessorValueOld(), PostprocessorInterface::getPostprocessorValueOlder(), and TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction().

81 {
82  return _pi_feproblem.hasPostprocessor(_ppi_params.get<PostprocessorName>(name));
83 }
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
bool hasPostprocessor(const std::string &name)
Check existence of the postprocessor.
const InputParameters & _ppi_params
PostprocessorInterface Parameters.
bool PostprocessorInterface::hasPostprocessorByName ( const PostprocessorName &  name)
inherited

Determine if the Postprocessor exists.

Parameters
nameThe name of the Postprocessor
Returns
True if the Postprocessor exists
See also
hasPostprocessor getPostprocessorValueByName

Definition at line 86 of file PostprocessorInterface.C.

Referenced by VectorOfPostprocessors::VectorOfPostprocessors().

87 {
88  return _pi_feproblem.hasPostprocessor(name);
89 }
FEProblemBase & _pi_feproblem
Reference the the FEProblemBase class.
bool hasPostprocessor(const std::string &name)
Check existence of the postprocessor.
void NonlinearEigen::init ( )
overridevirtual

Initialize the executioner.

Reimplemented from EigenExecutionerBase.

Definition at line 51 of file NonlinearEigen.C.

52 {
53  if (_app.isRecovering())
54  {
55  _console << "\nCannot recover NonlinearEigen solves!\nExiting...\n" << std::endl;
56  return;
57  }
58 
60 
61  // Write the initial.
62  // Note: We need to tempararily change the system time to make the output system work properly.
63  _problem.timeStep() = 0;
64  Real t = _problem.time();
67  _problem.time() = t;
68 
69  if (_free_iter > 0)
70  {
71  // save the initial guess
73 
74  // free power iterations
75  _console << " Free power iteration starts" << std::endl;
76 
77  Real initial_res;
79  _free_iter,
80  _pfactor,
81  false,
82  std::numeric_limits<Real>::min(),
83  true,
84  "",
85  std::numeric_limits<Real>::max(),
87  initial_res);
88 
91 
92  if (_output_after_pi)
93  {
94  // output initial guess created by free power iterations
95  _problem.timeStep()++;
96  Real t = _problem.time();
99  _problem.time() = t;
100  }
101  }
102 }
const unsigned int & _free_iter
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:608
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
virtual Real & time() const
virtual void onTimestepEnd() override
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
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 int & timeStep() const
const Real & _pfactor
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void init() override
Initialize the executioner.
virtual void outputStep(ExecFlagType type)
Output the current step.
void EigenExecutionerBase::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 
)
virtualinherited

Perform inverse power iterations with the initial guess of the solution.

Parameters
min_iterThe minimum number of power iterations.
max_iterThe maximum number of power iterations.
pfactorThe factor on reducing the residual norm of each power iteration.
cheb_onTo turn the Chebyshev acceleration on.
tol_eigTolerance on the difference of the eigenvalue of two successive iterations.
echoTrue to make screen printouts.
xdiffName of the postprocessor evaluating the difference of the solution norm of two successive iterations.
tol_xTolerance on the difference of the solution norm of two successive iterations.
kEigenvalue, input as the initial guess.
initial_resThe initial residual.

Definition at line 163 of file EigenExecutionerBase.C.

Referenced by init(), and InversePowerMethod::takeStep().

173 {
174  mooseAssert(max_iter >= min_iter,
175  "Maximum number of power iterations must be greater than or equal to its minimum");
176  mooseAssert(pfactor > 0.0, "Invaid linear convergence tolerance");
177  mooseAssert(tol_eig > 0.0, "Invalid eigenvalue tolerance");
178  mooseAssert(tol_x > 0.0, "Invalid solution norm tolerance");
179 
180  // obtain the solution diff
181  const PostprocessorValue * solution_diff = NULL;
182  if (xdiff != "")
183  {
184  solution_diff = &getPostprocessorValueByName(xdiff);
185  ExecFlagType xdiff_execflag = _problem.getUserObject<UserObject>(xdiff).execBitFlags();
186  if ((xdiff_execflag & EXEC_LINEAR) == EXEC_NONE)
187  mooseError("Postprocessor " + xdiff + " requires execute_on = 'linear'");
188  }
189 
190  // not perform any iteration when max_iter==0
191  if (max_iter == 0)
192  return;
193 
194  // turn off nonlinear flag so that RHS kernels opterate on previous solutions
196 
197  // FIXME: currently power iteration use old and older solutions,
198  // so save old and older solutions before they are changed by the power iteration
200  if (_problem.getDisplacedProblem() != NULL)
201  _problem.getDisplacedProblem()->saveOldSolutions();
202 
203  // save solver control parameters to be modified by the power iteration
204  Real tol1 = _problem.es().parameters.get<Real>("linear solver tolerance");
205  unsigned int num1 =
206  _problem.es().parameters.get<unsigned int>("nonlinear solver maximum iterations");
207  Real tol2 = _problem.es().parameters.get<Real>("nonlinear solver relative residual tolerance");
208 
209  // every power iteration is a linear solve, so set nonlinear iteration number to one
210  _problem.es().parameters.set<Real>("linear solver tolerance") = pfactor;
211  // disable nonlinear convergence check
212  _problem.es().parameters.set<unsigned int>("nonlinear solver maximum iterations") = 1;
213  _problem.es().parameters.set<Real>("nonlinear solver relative residual tolerance") = 1 - 1e-8;
214 
215  if (echo)
216  {
217  _console << '\n';
218  _console << " Power iterations starts\n";
219  _console << " ________________________________________________________________________________ "
220  << std::endl;
221  }
222 
223  // some iteration variables
224  Chebyshev_Parameters chebyshev_parameters;
225 
226  std::vector<Real> keff_history;
227  std::vector<Real> diff_history;
228 
229  unsigned int iter = 0;
230 
231  // power iteration loop...
232  // Note: |Bx|/k will stay constant one!
233  makeBXConsistent(k);
234  while (true)
235  {
236  if (echo)
237  _console << " Power iteration= " << iter << std::endl;
238 
239  // Important: we do not call _problem.advanceState() because we do not
240  // want to overwrite the old postprocessor values and old material
241  // properties in stateful materials.
244  if (_problem.getDisplacedProblem() != NULL)
245  {
246  _problem.getDisplacedProblem()->nlSys().copyOldSolutions();
247  _problem.getDisplacedProblem()->auxSys().copyOldSolutions();
248  }
249 
250  Real k_old = k;
252 
253  preIteration();
254  _problem.solve();
255  postIteration();
256 
257  // save the initial residual
258  if (iter == 0)
260 
261  // update eigenvalue
263  _eigenvalue = k;
264 
265  if (echo)
266  {
267  // output on screen the convergence history only when we want to and MOOSE output system is
268  // not used
269  keff_history.push_back(k);
270  if (solution_diff)
271  diff_history.push_back(*solution_diff);
272 
273  std::stringstream ss;
274  if (solution_diff)
275  {
276  ss << '\n';
277  ss << " +================+=====================+=====================+\n";
278  ss << " | iteration | eigenvalue | solution_difference |\n";
279  ss << " +================+=====================+=====================+\n";
280  unsigned int j = 0;
281  if (keff_history.size() > 10)
282  {
283  ss << " : : : :\n";
284  j = keff_history.size() - 10;
285  }
286  for (; j < keff_history.size(); j++)
287  ss << " | " << std::setw(14) << j << " | " << std::setw(19) << std::scientific
288  << std::setprecision(8) << keff_history[j] << " | " << std::setw(19) << std::scientific
289  << std::setprecision(8) << diff_history[j] << " |\n";
290  ss << " +================+=====================+=====================+\n" << std::flush;
291  }
292  else
293  {
294  ss << '\n';
295  ss << " +================+=====================+\n";
296  ss << " | iteration | eigenvalue |\n";
297  ss << " +================+=====================+\n";
298  unsigned int j = 0;
299  if (keff_history.size() > 10)
300  {
301  ss << " : : :\n";
302  j = keff_history.size() - 10;
303  }
304  for (; j < keff_history.size(); j++)
305  ss << " | " << std::setw(14) << j << " | " << std::setw(19) << std::scientific
306  << std::setprecision(8) << keff_history[j] << " |\n";
307  ss << " +================+=====================+\n" << std::flush;
308  ss << std::endl;
309  }
310  _console << ss.str();
311  }
312 
313  // increment iteration number here
314  iter++;
315 
316  if (cheb_on)
317  {
318  chebyshev(chebyshev_parameters, iter, solution_diff);
319  if (echo)
320  _console << " Chebyshev step: " << chebyshev_parameters.icheb << std::endl;
321  }
322 
323  if (echo)
324  _console
325  << " ________________________________________________________________________________ "
326  << std::endl;
327 
328  // not perform any convergence check when number of iterations is less than min_iter
329  if (iter >= min_iter)
330  {
331  // no need to check convergence of the last iteration
332  if (iter != max_iter)
333  {
334  bool converged = true;
335  Real keff_error = fabs(k_old - k) / k;
336  if (keff_error > tol_eig)
337  converged = false;
338  if (solution_diff)
339  if (*solution_diff > tol_x)
340  converged = false;
341  if (converged)
342  break;
343  }
344  else
345  break;
346  }
347  }
348 
349  // restore parameters changed by the executioner
350  _problem.es().parameters.set<Real>("linear solver tolerance") = tol1;
351  _problem.es().parameters.set<unsigned int>("nonlinear solver maximum iterations") = num1;
352  _problem.es().parameters.set<Real>("nonlinear solver relative residual tolerance") = tol2;
353 
354  // FIXME: currently power iteration use old and older solutions, so restore them
356  if (_problem.getDisplacedProblem() != NULL)
357  _problem.getDisplacedProblem()->restoreOldSolutions();
358 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
virtual void copyOldSolutions()
Shifts the solutions backwards in time.
Definition: SystemBase.C:693
NonlinearSystemBase & getNonlinearSystemBase()
virtual void makeBXConsistent(Real k)
Normalize solution so that |Bx| = k.
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name)
Retrieve the value of the Postprocessor.
virtual void postIteration()
Override this for actions that should take place after linear solve of each inverse power iteration...
virtual EquationSystems & es() override
void eigenKernelOnOld()
Ask eigenkernels to operate on old or current solution vectors.
virtual std::shared_ptr< DisplacedProblem > getDisplacedProblem()
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:73
AuxiliarySystem & getAuxiliarySystem()
void chebyshev(Chebyshev_Parameters &params, unsigned int iter, const PostprocessorValue *solution_diff)
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
MooseEigenSystem & _eigen_sys
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
const T & getUserObject(const std::string &name, unsigned int tid=0)
Get the user object by its name.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void solve() override
Base class for user-specific data.
Definition: UserObject.h:42
virtual void preIteration()
Override this for actions that should take place before linear solve of each inverse power iteration...
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), MultiAppNearestNodeTransfer::getLocalNodes(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
bool Executioner::lastSolveConverged ( )
virtualinherited

Whether or not the last solve converged.

Reimplemented in Transient.

Definition at line 174 of file Executioner.C.

Referenced by Steady::execute(), Executioner::parentOutputPositionChanged(), FullSolveMultiApp::solveStep(), takeStep(), and InversePowerMethod::takeStep().

175 {
176  return _fe_problem.converged();
177 }
virtual bool converged() override
FEProblemBase & _fe_problem
Definition: Executioner.h:126
void EigenExecutionerBase::makeBXConsistent ( Real  k)
virtualinherited

Normalize solution so that |Bx| = k.

Definition at line 131 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::init(), EigenExecutionerBase::inversePowerIteration(), and EigenExecutionerBase::nonlinearSolve().

132 {
133  Real consistency_tolerance = 1e-10;
134 
135  // Scale the solution so that the postprocessor is equal to k.
136  // Note: all dependent objects of k must be evaluated on linear!
137  // We have a fix point loop here, in case the postprocessor is a nonlinear function of the scaling
138  // factor.
139  // FIXME: We have assumed this loop always converges.
140  while (std::fabs(k - _source_integral) > consistency_tolerance * std::fabs(k))
141  {
142  // On the first time entering, the _source_integral has been updated properly in
143  // FEProblemBase::initialSetup()
146  std::stringstream ss;
147  ss << std::fixed << std::setprecision(10) << _source_integral;
148  _console << "\n|Bx| = " << ss.str() << std::endl;
149  }
150 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor)
Scale the solution vector.
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
MooseEigenSystem & _eigen_sys
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), VTKOutput::output(), XDA::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
void EigenExecutionerBase::nonlinearSolve ( Real  rel_tol,
Real  abs_tol,
Real  pfactor,
Real &  k 
)
virtualinherited

Perform nonlinear solve with the initial guess of the solution.

Parameters
rel_tolRelative tolerance on system residual.
abs_tolAbsolute tolerance on system residual.
pfactorThe factor on reducing the residual norm of each linear iteration.
kEigenvalue, input as the initial guess.

Definition at line 556 of file EigenExecutionerBase.C.

Referenced by takeStep().

557 {
558  makeBXConsistent(k);
559 
560  // turn on nonlinear flag so that eigen kernels opterate on the current solutions
562 
563  // set nonlinear solver controls
564  Real tol1 = _problem.es().parameters.get<Real>("nonlinear solver absolute residual tolerance");
565  Real tol2 = _problem.es().parameters.get<Real>("linear solver tolerance");
566  Real tol3 = _problem.es().parameters.get<Real>("nonlinear solver relative residual tolerance");
567 
568  _problem.es().parameters.set<Real>("nonlinear solver absolute residual tolerance") = abs_tol;
569  _problem.es().parameters.set<Real>("nonlinear solver relative residual tolerance") = rel_tol;
570  _problem.es().parameters.set<Real>("linear solver tolerance") = pfactor;
571 
572  // call nonlinear solve
573  _problem.solve();
574 
575  k = _source_integral;
576  _eigenvalue = k;
577 
578  _problem.es().parameters.set<Real>("nonlinear solver absolute residual tolerance") = tol1;
579  _problem.es().parameters.set<Real>("linear solver tolerance") = tol2;
580  _problem.es().parameters.set<Real>("nonlinear solver relative residual tolerance") = tol3;
581 }
virtual void makeBXConsistent(Real k)
Normalize solution so that |Bx| = k.
virtual EquationSystems & es() override
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
MooseEigenSystem & _eigen_sys
virtual void solve() override
Real EigenExecutionerBase::normalizeSolution ( bool  force = true)
virtualinherited

Normalize the solution vector based on the postprocessor value for normalization.

Parameters
forceForce the re-evaluation of the postprocessor for normalization. Returns the scaling factor just applied.

Definition at line 406 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::postExecute().

407 {
408  if (force)
410 
411  Real factor;
412  if (isParamValid("normal_factor"))
413  factor = getParam<Real>("normal_factor");
414  else
415  factor = _eigenvalue;
416  Real scaling = factor / _normalization;
417 
418  if (!MooseUtils::absoluteFuzzyEqual(scaling, 1.0))
419  {
420  // FIXME: we assume linear scaling here!
422  // update all aux variables and user objects
423  for (unsigned int i = 0; i < Moose::exec_types.size(); i++)
424  {
425  // EXEC_CUSTOM is special, should be treated only by specifically designed executioners.
426  if (Moose::exec_types[i] == EXEC_CUSTOM)
427  continue;
428 
430  }
431  }
432  return scaling;
433 }
void scaleSystemSolution(SYSTEMTAG tag, Real scaling_factor)
Scale the solution vector.
For use with custom executioners that want to fire objects at a specific time.
Definition: MooseTypes.h:110
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
const Real & _normalization
Postprocessor for normalization.
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
MooseEigenSystem & _eigen_sys
bool absoluteFuzzyEqual(const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
const std::vector< ExecFlagType > exec_types
A static list of all the exec types.
Definition: MooseTypes.C:40
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
virtual void Executioner::parentOutputPositionChanged ( )
inlinevirtualinherited

Can be used by subsclasses to call parentOutputPositionChanged() on the underlying FEProblemBase.

Reimplemented in Transient.

Definition at line 108 of file Executioner.h.

108 {}
void EigenExecutionerBase::postExecute ( )
overridevirtualinherited

Override this for actions that should take place after the main solve.

Reimplemented from Executioner.

Definition at line 371 of file EigenExecutionerBase.C.

Referenced by InversePowerMethod::execute(), and execute().

372 {
373  if (getParam<bool>("output_before_normalization"))
374  {
375  _problem.timeStep()++;
376  Real t = _problem.time();
379  _problem.time() = t;
380  }
381 
382  Real s = 1.0;
384  {
385  _console << " Cannot let the normalization postprocessor on custom.\n";
386  _console << " Normalization is abandoned!" << std::endl;
387  }
388  else
389  {
391  if (!MooseUtils::absoluteFuzzyEqual(s, 1.0))
392  _console << " Solution is rescaled with factor " << s << " for normalization!" << std::endl;
393  }
394 
395  if ((!getParam<bool>("output_before_normalization")) || !MooseUtils::absoluteFuzzyEqual(s, 1.0))
396  {
397  _problem.timeStep()++;
398  Real t = _problem.time();
401  _problem.time() = t;
402  }
403 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
For use with custom executioners that want to fire objects at a specific time.
Definition: MooseTypes.h:110
virtual Real & time() const
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
virtual int & timeStep() const
bool absoluteFuzzyEqual(const libMesh::Real &var1, const libMesh::Real &var2, const libMesh::Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
virtual Real normalizeSolution(bool force=true)
Normalize the solution vector based on the postprocessor value for normalization. ...
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void outputStep(ExecFlagType type)
Output the current step.
void EigenExecutionerBase::postIteration ( )
virtualinherited

Override this for actions that should take place after linear solve of each inverse power iteration.

Definition at line 366 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

367 {
368 }
void Executioner::postSolve ( )
virtualinherited

Override this for actions that should take place after execution.

Definition at line 150 of file Executioner.C.

Referenced by Steady::execute(), Transient::solveStep(), InversePowerMethod::takeStep(), and takeStep().

151 {
152 }
void Executioner::preExecute ( )
virtualinherited

Override this for actions that should take place before execution.

Reimplemented in Transient.

Definition at line 135 of file Executioner.C.

Referenced by InversePowerMethod::execute(), execute(), and Steady::execute().

136 {
137 }
void EigenExecutionerBase::preIteration ( )
virtualinherited

Override this for actions that should take place before linear solve of each inverse power iteration.

Definition at line 361 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

362 {
363 }
void Executioner::preSolve ( )
virtualinherited

Override this for actions that should take place before execution.

Definition at line 145 of file Executioner.C.

Referenced by Steady::execute(), Transient::solveStep(), InversePowerMethod::takeStep(), and takeStep().

146 {
147 }
void EigenExecutionerBase::printEigenvalue ( )
protectedvirtualinherited

Print eigenvalue.

Definition at line 436 of file EigenExecutionerBase.C.

Referenced by EigenExecutionerBase::eigenValue(), takeStep(), and InversePowerMethod::takeStep().

437 {
438  std::ostringstream ss;
439  ss << '\n';
440  ss << "*******************************************************\n";
441  ss << " Eigenvalue = " << std::fixed << std::setprecision(10) << _eigenvalue << '\n';
442  ss << "*******************************************************";
443 
444  _console << ss.str() << std::endl;
445 }
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Problem & Executioner::problem ( )
virtualinherited

Deprecated: Return a reference to this Executioner's Problem instance.

Definition at line 155 of file Executioner.C.

Referenced by Executioner::addAttributeReporter().

156 {
157  mooseDoOnce(mooseWarning("This method is deprecated, use feProblem() instead"));
158  return _fe_problem;
159 }
void mooseWarning(Args &&...args) const
Definition: MooseObject.h:89
FEProblemBase & _fe_problem
Definition: Executioner.h:126
void NonlinearEigen::takeStep ( )
protectedvirtual

Definition at line 118 of file NonlinearEigen.C.

Referenced by execute().

119 {
120  _console << " Nonlinear iteration starts" << std::endl;
121 
122  preSolve();
126 
128  postSolve();
129 
130  if (lastSolveConverged())
131  {
132  printEigenvalue();
133 
136  }
137 }
const Real & _abs_tol
virtual void onTimestepEnd() override
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
virtual void timestepSetup()
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
virtual void nonlinearSolve(Real rel_tol, Real abs_tol, Real pfactor, Real &k)
Perform nonlinear solve with the initial guess of the solution.
virtual bool lastSolveConverged()
Whether or not the last solve converged.
Definition: Executioner.C:174
virtual void preSolve()
Override this for actions that should take place before execution.
Definition: Executioner.C:145
const Real & _pfactor
Real & _eigenvalue
Storage for the eigenvalue computed by the executioner.
const Real & _rel_tol
virtual void printEigenvalue()
Print eigenvalue.
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void postSolve()
Override this for actions that should take place after execution.
Definition: Executioner.C:150

Member Data Documentation

const Real& NonlinearEigen::_abs_tol
protected

Definition at line 39 of file NonlinearEigen.h.

Referenced by takeStep().

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

MooseEigenSystem& EigenExecutionerBase::_eigen_sys
protectedinherited
Real& EigenExecutionerBase::_eigenvalue
protectedinherited
const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

FEProblemBase& Executioner::_fe_problem
protectedinherited
const unsigned int& NonlinearEigen::_free_iter
protected

Definition at line 38 of file NonlinearEigen.h.

Referenced by init().

Real Executioner::_initial_residual_norm
protectedinherited

Initial Residual Variables.

Definition at line 129 of file Executioner.h.

const std::string& MooseObject::_name
protectedinherited
ExecFlagType EigenExecutionerBase::_norm_execflag
protectedinherited
const Real& EigenExecutionerBase::_normalization
protectedinherited

Postprocessor for normalization.

Definition at line 144 of file EigenExecutionerBase.h.

Referenced by EigenExecutionerBase::normalizeSolution().

Real Executioner::_old_initial_residual_norm
protectedinherited

Definition at line 130 of file Executioner.h.

bool NonlinearEigen::_output_after_pi
protected

Definition at line 43 of file NonlinearEigen.h.

Referenced by init().

bool NonlinearEigen::_output_pi
protected

Definition at line 42 of file NonlinearEigen.h.

const InputParameters& MooseObject::_pars
protectedinherited
const Real& NonlinearEigen::_pfactor
protected

Definition at line 41 of file NonlinearEigen.h.

Referenced by init(), and takeStep().

FEProblemBase& EigenExecutionerBase::_problem
protectedinherited
const Real& NonlinearEigen::_rel_tol
protected

Definition at line 40 of file NonlinearEigen.h.

Referenced by takeStep().

std::string Executioner::_restart_file_base
protectedinherited

Definition at line 133 of file Executioner.h.

Referenced by Steady::Steady(), and Transient::Transient().

const Real& EigenExecutionerBase::_source_integral
protectedinherited
Real EigenExecutionerBase::_source_integral_old
protectedinherited
std::vector<std::string> Executioner::_splitting
protectedinherited

Definition at line 136 of file Executioner.h.

Referenced by Steady::Steady(), and Transient::Transient().


The documentation for this class was generated from the following files: