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

This time controller calculates the time stepping based on the CFL condition. More...

#include <time_controller.h>

Inheritance diagram for DefaultTimeController:
TimeController

Public Member Functions

 DefaultTimeController (const Initializer &init, LPSolver *solver, const std::vector< ParticleViewer * > &viewers)
 Constructor. More...
 
virtual int solve ()
 Calls main solvers of the simulation and determines the time stepping between iterations. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TimeController
bool adjustDtByWriteTimeInterval ()
 Adjusts the iteration time step when current time approaches the time for results writting. More...
 
- Protected Attributes inherited from TimeController
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

This time controller calculates the time stepping based on the CFL condition.

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

Constructor & Destructor Documentation

DefaultTimeController::DefaultTimeController ( const Initializer init,
LPSolver solver,
const std::vector< ParticleViewer * > &  viewers 
)

Constructor.

The constructor initializes parameters based on and also initializes the main solver and viewer based on solver and used to perform the main iterations and to write results for viewing

Parameters
[in]initConst reference to an object of the Initializer class
[in]solverPointer to an object of the LPSolver family
[in]viewersVector containing pointers to objects of the ParticleViewer family

Member Function Documentation

int DefaultTimeController::solve ( )
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 CFL condition

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

Implements TimeController.


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