SPH
|
Defines the interface for a run. More...
#include <IRun.h>
Public Member Functions | |
IRun () | |
~IRun () | |
Statistics | run (Storage &storage) |
Runs the simulation. More... | |
Statistics | run (Storage &storage, IRunCallbacks &callbacks) |
Runs the simulation. More... | |
![]() | |
virtual | ~Polymorphic () |
Protected Member Functions | |
virtual void | setUp (SharedPtr< Storage > storage)=0 |
Prepares the run, creates logger, output, ... More... | |
virtual void | tearDown (const Storage &storage, const Statistics &stats)=0 |
Called after the run. More... | |
void | setNullToDefaults (SharedPtr< Storage > storage) |
void | tearDownInternal (const Storage &storage, const Statistics &stats) |
Protected Attributes | |
RunSettings | settings |
AutoPtr< IOutput > | output |
Data output. More... | |
SharedPtr< ILogger > | logger |
Logging. More... | |
AutoPtr< ILogWriter > | logWriter |
Writes statistics into logger every timestep. More... | |
SharedPtr< IScheduler > | scheduler |
Scheduler used for parallelization. More... | |
AutoPtr< ITimeStepping > | timeStepping |
Timestepping. More... | |
AutoPtr< ISolver > | solver |
Solver. More... | |
List< AutoPtr< ITrigger > > | triggers |
Triggers. More... | |
Array< AutoPtr< IDiagnostic > > | diagnostics |
Diagnostics. More... | |
Defines the interface for a run.
Each run must implement methods setUp and tearDown, settings up initial conditions for the run and closing down the run, respectively.
Implementation can set up all member variables to any given value. If any variable is left uninitialized, it will be initialized to a default value as specified by run settings. Only particle storage MUST be initialized by the setUp function. User must call setUp before calling run. After run ends, function setUp must be called again before another run can be started.
Run is started up using run member function. The function is blocking and ends when run is finished. The function can be called from any thread, but cannot be executed from multiple threads simultaneously. The flow of the run can be controlled from different thread using provided implementation of Callbacks.
|
default |
Statistics IRun::run | ( | Storage & | storage | ) |
Runs the simulation.
The provided storage can either be filled with initial conditions specified by the IRun implementation, or it can use particles already stored in the storage. The function is blocking and returns after the simulation ends. The storage then contains the particle state at the end of the simulation.
Statistics IRun::run | ( | Storage & | storage, |
IRunCallbacks & | callbacks | ||
) |
Runs the simulation.
The provided storage can either be filled with initial conditions specified by the IRun implementation, or it can use particles already stored in the storage. The function is blocking and returns after the simulation ends. The storage then contains the particle state at the end of the simulation.
callbacks | Interface used to obtain particle data during the simulation, etc. |
Prepares the run, creates logger, output, ...
Implemented in Hde, Reaccumulation, Fragmentation, Collision, VanDerWallsSimulation, DeathStar, HelloAsteroid, NBodyRun, SphStabilizationRun, SphRun, Sod, Sedov, RotatingRod, KelvinHelmholtz, GalaxyRun, ElasticBands, Collision, CliffCollapse, and BoundaryRun.
|
protectedpure virtual |
Called after the run.
Used to save the necessary data, log run statistics, etc. Is called at the end of run function.
stats | Run statistics at the end of the run. |
Implemented in Reaccumulation, Fragmentation, Collision, DeathStar, HelloAsteroid, NBodyRun, SphRun, RotatingRod, GalaxyRun, ElasticBands, Collision, and CliffCollapse.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |