Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TimeController Class Referenceabstract

An abstract class for different types of simulation time controllers. More...

#include <time_controller.h>

Inheritance diagram for TimeController:
DefaultTimeController

Public Member Functions

virtual int solve ()=0
 Calls main solvers of the simulation and determines the time stepping between iterations. More...
 

Protected Member Functions

bool adjustDtByWriteTimeInterval ()
 Adjusts the iteration time step when current time approaches the time for results writting. More...
 

Protected Attributes

LPSolverm_pSolver
 A pointer to the Lagrangian Particle solver.
 
std::vector< ParticleViewer * > m_vViewers
 A vector containing pointers to different types of particle viewers.
 
double m_fTime
 Current physical time of simulation.
 
double m_fEndTime
 End physical time of simulation.
 
double m_fWriteTimeInterval
 The physical time interval between two writting of results.
 
double m_fNextWriteTime
 The next physical time point to write results.
 
double m_fDt
 The physical time interval between two iterations of the simulation.
 
std::size_t m_iWriteStep
 The number of times results are written to the particle veiwer.
 
bool m_iIfDebug
 if true then print debug info
 
std::ofstream debug
 output information for debugging
 

Detailed Description

An abstract class for different types of simulation time controllers.

Author
Chen, Hsin-Chiang (morri.nosp@m.sche.nosp@m.n2008.nosp@m.@gma.nosp@m.il.co.nosp@m.m)

Co-author: Yu, Kwangmin (yukwa.nosp@m.ngmi.nosp@m.n@gma.nosp@m.il.c.nosp@m.om) on initial interface design

Version
1.0
Date
2014/07/12

Created on: 2014/07/02

Member Function Documentation

bool TimeController::adjustDtByWriteTimeInterval ( )
protected

Adjusts the iteration time step when current time approaches the time for results writting.

m_fDt will be adjusted(shrinked) when m_fTime + m_fDt > m_fNextWriteTime, to match the exact time of results writting

Parameters
None
Returns
true if m_fDt is adjusted; false otherwise
virtual int TimeController::solve ( )
pure virtual

Calls main solvers of the simulation and determines the time stepping between iterations.

The simulation is performed by calling the main LP solver for each iteration and the time length between iterations is determined by the type of time controller adopted

Parameters
None
Returns
0 if the entire simulation runs successfully to the end; 1 if main solver fails during any iteration

Implemented in DefaultTimeController.


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