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 advanceStep () 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 26 of file LevelSetReinitializationMultiApp.h.

Constructor & Destructor Documentation

LevelSetReinitializationMultiApp::LevelSetReinitializationMultiApp ( const InputParameters &  parameters)

Definition at line 38 of file LevelSetReinitializationMultiApp.C.

40  : MultiApp(parameters), _level_set_problem(NULL), _interval(getParam<unsigned int>("interval"))
41 {
42 }
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

virtual void LevelSetReinitializationMultiApp::advanceStep ( )
inlineoverridevirtual

Definition at line 32 of file LevelSetReinitializationMultiApp.h.

32 {}
void LevelSetReinitializationMultiApp::initialSetup ( )
overridevirtual

Definition at line 45 of file LevelSetReinitializationMultiApp.C.

46 {
47  MultiApp::initialSetup();
48 
49  if (_has_an_app)
50  {
51  Executioner * ex = _apps[0]->getExecutioner();
52 
53  if (!ex)
54  mooseError("Executioner does not exist!");
55 
56  ex->init();
57 
58  _executioner = ex;
59 
60  _level_set_problem = dynamic_cast<LevelSetReinitializationProblem *>(&appProblemBase(0));
61  if (!_level_set_problem)
62  mooseError("The Problem type must be LevelSetReinitializationProblem.");
63  }
64 }
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()
bool LevelSetReinitializationMultiApp::solveStep ( Real  dt,
Real  target_time,
bool  auto_advance = true 
)
overridevirtual

Definition at line 67 of file LevelSetReinitializationMultiApp.C.

Referenced by advanceStep().

70 {
71  // Do nothing if not on interval
72  if ((_fe_problem.timeStep() % _interval) != 0)
73  return true;
74 
75  if (!_has_an_app)
76  return true;
77 
78  _console << "Solving Reinitialization problem." << std::endl;
79 
80  int rank;
81  int ierr;
82  ierr = MPI_Comm_rank(_orig_comm, &rank);
83  mooseCheckMPIErr(ierr);
84 
85  bool last_solve_converged = true;
86 
88  _executioner->execute();
89  if (!_executioner->lastSolveConverged())
90  last_solve_converged = false;
91 
92  return last_solve_converged;
93 }
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* LevelSetReinitializationMultiApp::_executioner
protected

Access to the Executioner object to call execute()

Definition at line 40 of file LevelSetReinitializationMultiApp.h.

Referenced by initialSetup(), and solveStep().

const unsigned int& LevelSetReinitializationMultiApp::_interval
protected

The solve interval for reinitialization.

Definition at line 43 of file LevelSetReinitializationMultiApp.h.

Referenced by solveStep().

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 37 of file LevelSetReinitializationMultiApp.h.

Referenced by initialSetup(), and solveStep().


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