SimulationCore Class Reference

Singleton class SimulationCore. More...

#include <SimulationCore.h>

Collaboration diagram for SimulationCore:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~SimulationCore ()
 Destructor.
void exec ()
void init ()
void terminate ()
void abort (string msg)
GreensFunctiongreensFunction ()
LoadFunctionloadFunction ()
DataOutPlugindataOutPlugin ()
unsigned int getLoadFunctionComponent ()
void setLoadFunctionComponent (unsigned int i)
unsigned int getNumberOfLoadComponents ()
void registerParam (ParamWrapper *param, const char *name, PluginCategory category)
const char * outFile ()
int sizeX ()
int sizeY ()
int sizeT ()
int gridSize ()
int minX ()
int minY ()
unsigned long int modelTime ()
int modelStep ()
int stepSize ()
int xIndex ()
int yIndex ()
int zIndex ()
int getDimensions ()
unsigned long int getTimesteps ()
int displacementDimensions ()
int getQuadrant ()
void setQuadrant (int)
void setModelData (double **)
double ** getModelData ()
void runExperimentManager ()
void runPluginManager ()
PluginManagerpluginManager ()
list< string > getRegisteredParameters (PluginCategory cat)
void deleteRegistrees ()
list< string > getRequestedNames ()
void deleteRequests ()
int getOperatorSpaceX ()
int getOperatorSpaceY ()
void setOperatorSpace (int, int)
bool operatorSpaceIsSet ()
string getPluginFilename (string, string)
void registerOutputField (int *output_index, FieldName field)
string currentJob ()
green_exec_function addGreenPlugin (string plugin) throw (FileNotFound, runtime_error)
load_exec_function addLoadPlugin (string plugin) throw (FileNotFound, runtime_error)
run_function addKernelPlugin (string plugin) throw (FileNotFound, runtime_error)
run_function addPostprocessorPlugin (string plugin) throw (FileNotFound, runtime_error)
loadhistory_exec_function addLoadHistoryPlugin (string plugin) throw (FileNotFound, runtime_error)
crustaldecay_exec_function addCrustalDecayPlugin (string plugin) throw (FileNotFound, runtime_error)

Static Public Member Functions

static SimulationCoreinstance (int argc, char **argv) throw ()
static SimulationCoreinstance () throw ()

Static Public Attributes

static s_parameters s_params
 public struct keeping the command line arguments

Private Member Functions

 SimulationCore (int argc, char **argv) throw (SeriousException)
 hidden constructor, the SimulationCore shall be a singleton
 SimulationCore (const SimulationCore &x)
 hidden copy constructor - we do not want to accidentially copy objects
SimulationCore const & operator= (SimulationCore const &rvalue)
 hidden assignment operator - we do not want to accidentially copy objects

Private Attributes

InputHandlercom_port
ExperimentManagerexp_man
PluginManagerplugin_man
Pluginpl_kernel
DataOutPluginpl_out
GreensFunctiongreens_function
LoadFunctionload_function
unsigned int load_function_component
int x_west
int x_east
int y_south
int y_north
int gridsize
unsigned long int modelstep
unsigned long int modeltime
unsigned long int num_timesteps
unsigned long int num_timeincrement
int stepsize
int quadrant
int dimensions
int x_index
int y_index
int z_index
map< int *, int > add_field_map
double ** model_data
list< Plugin * >::iterator pl_iter
list< Plugin * > requested_plugin_list
list< Plugin * > pl_list_postprocess
string root_dir
int operator_space_x
int operator_space_y
bool operator_space_set
unsigned int num_load_components

Static Private Attributes

static SimulationCorepSimulationCore
 static Singleton initialisieren

Detailed Description

Singleton class SimulationCore.

The SimulationCore is implemented following the Singleton Design Pattern, wich makes sure one and only one instance of the class SimulationCore will exist during an application run. This makes sense for various reasons. The most important is certainly that a SimulationCore is the application.

The main() function will get a pointer to this class by calling the instance(int, char**) function. Its main function is to build, init, run and terminate all parts of the application at the right time. The SimulationCore also keeps the simulation clock.


Constructor & Destructor Documentation

SimulationCore::SimulationCore ( int  argc,
char **  argv 
) throw (SeriousException) [private]

hidden constructor, the SimulationCore shall be a singleton

SimulationCore::SimulationCore ( const SimulationCore x  )  [private]

hidden copy constructor - we do not want to accidentially copy objects

SimulationCore::~SimulationCore (  ) 

Destructor.


Member Function Documentation

SimulationCore const& SimulationCore::operator= ( SimulationCore const &  rvalue  )  [private]

hidden assignment operator - we do not want to accidentially copy objects

void SimulationCore::exec (  ) 

go!go!go!

void SimulationCore::init (  ) 

void SimulationCore::terminate (  ) 

void SimulationCore::abort ( string  msg  ) 

static SimulationCore* SimulationCore::instance ( int  argc,
char **  argv 
) throw () [inline, static]

SimulationCore::instance initializes singleton object in case it does not exist. returns the only existing instance

static SimulationCore* SimulationCore::instance (  )  throw () [inline, static]

SimulationCore::instance returns the only existing instance

GreensFunction* SimulationCore::greensFunction (  )  [inline]

LoadFunction* SimulationCore::loadFunction (  )  [inline]

DataOutPlugin* SimulationCore::dataOutPlugin (  )  [inline]

unsigned int SimulationCore::getLoadFunctionComponent (  ) 

returns the id of the load component we are currently working with

void SimulationCore::setLoadFunctionComponent ( unsigned int  id  ) 

sets value of the load component that is currently to be worked with to given id keeps also track of the total number of load components (max id == number of load components)

unsigned int SimulationCore::getNumberOfLoadComponents (  ) 

returns total number of load components, id's start at zero!

void SimulationCore::registerParam ( ParamWrapper param,
const char *  name,
PluginCategory  category 
)

stick parameter that's being registered by a plug-in into the parameter registry

const char * SimulationCore::outFile (  ) 

int SimulationCore::sizeX (  ) 

int SimulationCore::sizeY (  ) 

int SimulationCore::sizeT (  ) 

int SimulationCore::gridSize (  ) 

int SimulationCore::minX (  ) 

int SimulationCore::minY (  ) 

unsigned long int SimulationCore::modelTime (  ) 

int SimulationCore::modelStep (  ) 

int SimulationCore::stepSize (  ) 

int SimulationCore::xIndex (  ) 

int SimulationCore::yIndex (  ) 

int SimulationCore::zIndex (  ) 

int SimulationCore::getDimensions (  ) 

unsigned long int SimulationCore::getTimesteps (  ) 

int SimulationCore::displacementDimensions (  ) 

int SimulationCore::getQuadrant (  ) 

void SimulationCore::setQuadrant ( int   ) 

void SimulationCore::setModelData ( double **   ) 

double ** SimulationCore::getModelData (  ) 

void SimulationCore::runExperimentManager (  ) 

void SimulationCore::runPluginManager (  ) 

PluginManager * SimulationCore::pluginManager (  ) 

list< string > SimulationCore::getRegisteredParameters ( PluginCategory  category  ) 

Parameters:
cat Plugin category
Returns:
list of string IDs of registered Parameters

void SimulationCore::deleteRegistrees (  ) 

deletes all parameters of a specific category

Parameters:
cat plugin category

list< string > SimulationCore::getRequestedNames (  ) 

void SimulationCore::deleteRequests (  ) 

int SimulationCore::getOperatorSpaceX (  ) 

int SimulationCore::getOperatorSpaceY (  ) 

void SimulationCore::setOperatorSpace ( int  ,
int   
)

bool SimulationCore::operatorSpaceIsSet (  ) 

string SimulationCore::getPluginFilename ( string  ,
string   
)

void SimulationCore::registerOutputField ( int *  output_index,
FieldName  field 
)

string SimulationCore::currentJob (  ) 

green_exec_function SimulationCore::addGreenPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)

load_exec_function SimulationCore::addLoadPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)

run_function SimulationCore::addKernelPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)

run_function SimulationCore::addPostprocessorPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)

loadhistory_exec_function SimulationCore::addLoadHistoryPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)

crustaldecay_exec_function SimulationCore::addCrustalDecayPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)


Member Data Documentation

InputHandler* SimulationCore::com_port [private]

hard-wired input handler, no plugin

ExperimentManager* SimulationCore::exp_man [private]

hard-wired experiment SimulationCore, no plugin

PluginManager* SimulationCore::plugin_man [private]

hard-wired plugin SimulationCore, no plugin ;)

Plugin* SimulationCore::pl_kernel [private]

Plug-in instance taking care on the simulation kernel

DataOutPlugin* SimulationCore::pl_out [private]

Plug-in instance handling data output

GreensFunction* SimulationCore::greens_function [private]

Green's Function plug in, one factor for convolution

LoadFunction* SimulationCore::load_function [private]

Load function, holds all loads and histories

unsigned int SimulationCore::load_function_component [private]

int SimulationCore::x_west [private]

int SimulationCore::x_east [private]

int SimulationCore::y_south [private]

int SimulationCore::y_north [private]

int SimulationCore::gridsize [private]

unsigned long int SimulationCore::modelstep [private]

the model step. an integer that is increased with each timestep

unsigned long int SimulationCore::modeltime [private]

the model time. an integer that is increased with each timestep

unsigned long int SimulationCore::num_timesteps [private]

maximum number of timesteps we want to simulate

unsigned long int SimulationCore::num_timeincrement [private]

... using this stepsize

int SimulationCore::stepsize [private]

time increment with each model step

int SimulationCore::quadrant [private]

int SimulationCore::dimensions [private]

int SimulationCore::x_index [private]

int SimulationCore::y_index [private]

int SimulationCore::z_index [private]

map<int*, int> SimulationCore::add_field_map [private]

double** SimulationCore::model_data [private]

list<Plugin*>::iterator SimulationCore::pl_iter [private]

list<Plugin*> SimulationCore::requested_plugin_list [private]

buffer for all the plugins that will be loaded by other plugins. they only have to be kept in memory so the function pointer stay valid. but noone else will ever need to access them individually, only as a group to perform Plugin functions

list<Plugin*> SimulationCore::pl_list_postprocess [private]

buffer for all the postprocessor plugins that might be loaded

string SimulationCore::root_dir [private]

int SimulationCore::operator_space_x [private]

int SimulationCore::operator_space_y [private]

bool SimulationCore::operator_space_set [private]

unsigned int SimulationCore::num_load_components [private]

SimulationCore * SimulationCore::pSimulationCore [static, private]

static Singleton initialisieren

pointer to the only instance of SimulationCore

s_parameters SimulationCore::s_params [static]

public struct keeping the command line arguments


The documentation for this class was generated from the following files:
Generated on Sun Aug 31 13:20:48 2008 for CrusDe by  doxygen 1.5.0