https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LevelSetOlssonTerminator.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
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(
30 _fe_problem.getNonlinearSystem(0).addVector("solution_diff", false, libMesh::PARALLEL)),
31 _tol(getParam<Real>("tol")),
32 _min_t_steps(getParam<int>("min_steps"))
33{
34}
35
36void
38{
41 Real delta = _solution_diff.l2_norm() / _dt;
42 _console << "Computed convergence criteria: " << delta << std::endl;
43
45 return;
46 else if (delta < _tol)
48}
registerMooseObject("LevelSetApp", LevelSetOlssonTerminator)
void ErrorVector unsigned int
const ConsoleStream _console
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
virtual int & timeStep() const
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Terminates the solve based on the criteria defined in Olsson et.
const int & _min_t_steps
The required minimum number of timesteps.
NumericVector< Number > & _solution_diff
The difference of current and old solutions.
static InputParameters validParams()
const Real & _tol
The steady-state convergence tolerance.
virtual void execute() override
LevelSetOlssonTerminator(const InputParameters &parameters)
virtual void terminateSolve()
virtual const NumericVector< Number > *const & currentSolution() const override final
NumericVector< Number > & solutionOld()
FEProblemBase & _fe_problem
virtual Real l2_norm() const=0
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...