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

MultiApp that performs a time reset prior to solving, this enables the level set reinitialization to solve repeatedly. More...

#include <LevelSetReinitializationMultiApp.h>

Inheritance diagram for LevelSetReinitializationMultiApp:
[legend]

Public Member Functions

 LevelSetReinitializationMultiApp (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void incrementTStep () override
 
virtual void finishStep () override
 
virtual bool solveStep (Real dt, Real target_time, bool auto_advance=true) override
 

Protected Attributes

LevelSetReinitializationProblem_level_set_problem
 Access to the level set specific problem to allow for the resetTime() method to be called. More...
 
Executioner * _executioner
 Access to the Executioner object to call execute() More...
 
const unsigned int & _interval
 The solve interval for reinitialization. More...
 

Detailed Description

MultiApp that performs a time reset prior to solving, this enables the level set reinitialization to solve repeatedly.

Definition at line 28 of file LevelSetReinitializationMultiApp.h.

Constructor & Destructor Documentation

◆ LevelSetReinitializationMultiApp()

LevelSetReinitializationMultiApp::LevelSetReinitializationMultiApp ( const InputParameters &  parameters)

Definition at line 42 of file LevelSetReinitializationMultiApp.C.

44  : MultiApp(parameters), _level_set_problem(NULL), _interval(getParam<unsigned int>("interval"))
45 {
46 }
const unsigned int & _interval
The solve interval for reinitialization.
LevelSetReinitializationProblem * _level_set_problem
Access to the level set specific problem to allow for the resetTime() method to be called...

Member Function Documentation

◆ finishStep()

virtual void LevelSetReinitializationMultiApp::finishStep ( )
inlineoverridevirtual

Definition at line 35 of file LevelSetReinitializationMultiApp.h.

35 {}

◆ incrementTStep()

virtual void LevelSetReinitializationMultiApp::incrementTStep ( )
inlineoverridevirtual

Definition at line 34 of file LevelSetReinitializationMultiApp.h.

34 {}

◆ initialSetup()

void LevelSetReinitializationMultiApp::initialSetup ( )
overridevirtual

Definition at line 49 of file LevelSetReinitializationMultiApp.C.

50 {
51  MultiApp::initialSetup();
52 
53  if (_has_an_app)
54  {
55  Executioner * ex = _apps[0]->getExecutioner();
56 
57  if (!ex)
58  mooseError("Executioner does not exist!");
59 
60  ex->init();
61 
62  _executioner = ex;
63 
64  _level_set_problem = dynamic_cast<LevelSetReinitializationProblem *>(&appProblemBase(0));
65  if (!_level_set_problem)
66  mooseError("The Problem type must be LevelSetReinitializationProblem.");
67  }
68 }
A Problem object to perform level set equation reinitialization implementation, mainly implementing a...
LevelSetReinitializationProblem * _level_set_problem
Access to the level set specific problem to allow for the resetTime() method to be called...
Executioner * _executioner
Access to the Executioner object to call execute()

◆ solveStep()

bool LevelSetReinitializationMultiApp::solveStep ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
overridevirtual

Definition at line 71 of file LevelSetReinitializationMultiApp.C.

74 {
75  // Do nothing if not on interval
76  if ((_fe_problem.timeStep() % _interval) != 0)
77  return true;
78 
79  if (!_has_an_app)
80  return true;
81 
82  _console << "Solving Reinitialization problem." << std::endl;
83 
84  int rank;
85  int ierr;
86  ierr = MPI_Comm_rank(_orig_comm, &rank);
87  mooseCheckMPIErr(ierr);
88 
89  bool last_solve_converged = true;
90 
92  _executioner->execute();
93  if (!_executioner->lastSolveConverged())
94  last_solve_converged = false;
95 
96  return last_solve_converged;
97 }
const unsigned int & _interval
The solve interval for reinitialization.
void resetTime()
Resets the state of the simulation to allow for it to be re-executed.
LevelSetReinitializationProblem * _level_set_problem
Access to the level set specific problem to allow for the resetTime() method to be called...
Executioner * _executioner
Access to the Executioner object to call execute()

Member Data Documentation

◆ _executioner

Executioner* LevelSetReinitializationMultiApp::_executioner
protected

Access to the Executioner object to call execute()

Definition at line 43 of file LevelSetReinitializationMultiApp.h.

Referenced by initialSetup(), and solveStep().

◆ _interval

const unsigned int& LevelSetReinitializationMultiApp::_interval
protected

The solve interval for reinitialization.

Definition at line 46 of file LevelSetReinitializationMultiApp.h.

Referenced by solveStep().

◆ _level_set_problem

LevelSetReinitializationProblem* LevelSetReinitializationMultiApp::_level_set_problem
protected

Access to the level set specific problem to allow for the resetTime() method to be called.

Definition at line 40 of file LevelSetReinitializationMultiApp.h.

Referenced by initialSetup(), and solveStep().


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