Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Transient.C
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 #include "Transient.h"
11 
12 // MOOSE includes
13 #include "FixedPointSolve.h"
14 #include "AuxiliarySystem.h"
15 #include "SolverSystem.h"
16 
17 registerMooseObject("MooseApp", Transient);
18 
21 {
23  params.addClassDescription("Executioner for time varying simulations.");
24 
25  params += FEProblemSolve::validParams();
26 
27  return params;
28 }
29 
31  : TransientBase(parameters), _feproblem_solve(*this)
32 {
33  _fixed_point_solve->setInnerSolve(_feproblem_solve);
34 }
35 
36 Real
38 {
39  if (_check_aux)
41  else
42  {
43  // Default criterion for now until we add a "steady-state-convergence-object" option
44  Real residual = 0;
45  for (const auto sys : _feproblem_solve.systemsToSolve())
46  residual +=
47  std::pow(sys->solution().l2_norm_diff(sys->solutionOld()) / sys->solution().l2_norm(), 2);
48  return std::sqrt(residual);
49  }
50 }
51 
52 std::set<TimeIntegrator *>
54 {
55  // We use a set because time integrators were added to every system, and we want a unique
56  std::set<TimeIntegrator *> tis;
57  // Get all time integrators from the systems in the FEProblemSolve
58  for (const auto sys : _feproblem_solve.systemsToSolve())
59  for (const auto & ti : sys->getTimeIntegrators())
60  tis.insert(ti.get());
61  return tis;
62 }
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:20
virtual std::set< TimeIntegrator * > getTimeIntegrators() const override
Get the time integrators (time integration scheme) used Note that because some systems might be stead...
Definition: Transient.C:53
NumericVector< Number > & solution()
Definition: SystemBase.h:195
static InputParameters validParams()
Definition: TransientBase.C:40
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
AuxiliarySystem & _aux
Reference to auxiliary system base for faster access.
Real l2_norm_diff(const NumericVector< Number > &other_vec) const
Transient(const InputParameters &parameters)
Definition: Transient.C:30
virtual Real l2_norm() const =0
virtual Real relativeSolutionDifferenceNorm() override
The relative L2 norm of the difference between solution and old solution vector.
Definition: Transient.C:37
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Definition: TransientBase.h:26
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
const std::vector< SolverSystem * > & systemsToSolve() const
Returns a reference to the vector of solver systems that this object is supposed to solve...
const bool _check_aux
Whether to use the auxiliary system solution to determine steady-states.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
static InputParameters validParams()
Definition: Transient.C:20
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:196
MooseUnits pow(const MooseUnits &, int)
Definition: Units.C:537
registerMooseObject("MooseApp", Transient)
std::unique_ptr< FixedPointSolve > _fixed_point_solve
Definition: Executioner.h:151
FEProblemSolve _feproblem_solve
inner-most solve object to perform Newton solve with PETSc on every time step
Definition: Transient.h:36