www.mooseframework.org
LevelSetOlssonTerminator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "NonlinearSystem.h"
12 
14 
17 {
19  params.addClassDescription("Tool for terminating the reinitialization of the level set equation "
20  "based on the criteria defined by Olsson et. al. (2007).");
21  params.addRequiredParam<Real>(
22  "tol", "The limit at which the reinitialization problem is considered converged.");
23  params.addParam<int>("min_steps", 3, "The minimum number of time steps to consider.");
24  return params;
25 }
26 
28  : GeneralUserObject(params),
29  _solution_diff(_fe_problem.getNonlinearSystem(0).addVector("solution_diff", false, PARALLEL)),
30  _tol(getParam<Real>("tol")),
31  _min_t_steps(getParam<int>("min_steps"))
32 {
33 }
34 
35 void
37 {
41  _console << "Computed convergence criteria: " << delta << std::endl;
42 
44  return;
45  else if (delta < _tol)
47 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
PARALLEL
int delta(unsigned int i, unsigned int j)
Delta function, which returns zero if $i j$ and unity if $i=j$.
static InputParameters validParams()
const Real & _tol
The steady-state convergence tolerance.
void addRequiredParam(const std::string &name, const std::string &doc_string)
Terminates the solve based on the criteria defined in Olsson et.
NumericVector< Number > & _solution_diff
The difference of current and old solutions.
virtual Real l2_norm() const =0
virtual void terminateSolve()
virtual void execute() override
const int & _min_t_steps
The required minimum number of timesteps.
virtual int & timeStep() const
LevelSetOlssonTerminator(const InputParameters &parameters)
const NumericVector< Number > *const & currentSolution() const override
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
registerMooseObject("LevelSetApp", LevelSetOlssonTerminator)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
void addClassDescription(const std::string &doc_string)
const ConsoleStream _console
NumericVector< Number > & solutionOld()
void ErrorVector unsigned int