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 ()
int modelTime ()
int modelStep ()
int stepSize ()
int xIndex ()
int yIndex ()
int zIndex ()
int getDimensions ()
int getTimesteps ()
int displacementDimensions ()
int getQuadrant ()
void setQuadrant (int)
void setModelData (double **)
double ** getModelData ()
void runExperimentManager ()
void runPluginManager ()
void installPlugin (string)
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) throw (DatabaseError)
void registerOutputField (int *output_index, FieldName field)
string currentJob ()
void setQuiet (bool)
bool isQuiet ()
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
int modelstep
int modeltime
int num_timesteps
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
bool quiet

Static Private Attributes

static SimulationCorepSimulationCore = 0
 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

References DIR_SEP, EXPERIMENT_DB, EXPERIMENT_DIR, PLUGIN_DB, and PLUGIN_DIR.

Referenced by instance().

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

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

SimulationCore::~SimulationCore (  ) 

Destructor.

References com_port, greens_function, load_function, pl_kernel, and pl_out.


Member Function Documentation

void SimulationCore::abort ( string  msg  ) 
crustaldecay_exec_function SimulationCore::addCrustalDecayPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
green_exec_function SimulationCore::addGreenPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
run_function SimulationCore::addKernelPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
loadhistory_exec_function SimulationCore::addLoadHistoryPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
load_exec_function SimulationCore::addLoadPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
run_function SimulationCore::addPostprocessorPlugin ( string  plugin  )  throw (FileNotFound, runtime_error)
string SimulationCore::currentJob (  ) 
DataOutPlugin* SimulationCore::dataOutPlugin (  )  [inline]

References pl_out.

void SimulationCore::deleteRegistrees (  ) 

deletes all parameters of a specific category

Parameters:
cat plugin category

References s_parameters::crustaldecay, s_parameters::datahandler, s_parameters::green, s_parameters::kernel, s_parameters::load, s_parameters::loadhistory, and s_parameters::postprocessor.

Referenced by PluginManager::addEntry().

void SimulationCore::deleteRequests (  ) 

References pl_iter, and requested_plugin_list.

Referenced by PluginManager::addEntry().

int SimulationCore::displacementDimensions (  ) 

References x_index, y_index, and z_index.

Referenced by crusde_get_displacement_dimensions().

void SimulationCore::exec (  ) 
int SimulationCore::getDimensions (  ) 

References dimensions.

Referenced by crusde_get_dimensions().

unsigned int SimulationCore::getLoadFunctionComponent (  ) 
double ** SimulationCore::getModelData (  ) 

References model_data.

Referenced by crusde_get_result().

unsigned int SimulationCore::getNumberOfLoadComponents (  ) 

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

References num_load_components.

Referenced by crusde_get_number_of_load_components(), and crusde_get_number_of_loads().

int SimulationCore::getOperatorSpaceX (  ) 

References operator_space_x.

Referenced by crusde_get_operator_space().

int SimulationCore::getOperatorSpaceY (  ) 

References operator_space_y.

Referenced by crusde_get_operator_space().

string SimulationCore::getPluginFilename ( string  category,
string  name 
) throw (DatabaseError)

References backpack.

int SimulationCore::getQuadrant (  ) 

References quadrant.

Referenced by crusde_get_quadrant().

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

References pl_iter, and requested_plugin_list.

Referenced by PluginManager::addToDB().

int SimulationCore::getTimesteps (  ) 

References num_timesteps.

Referenced by crusde_get_timesteps().

GreensFunction* SimulationCore::greensFunction (  )  [inline]

References greens_function.

Referenced by crusde_get_green_at().

int SimulationCore::gridSize (  ) 

References gridsize.

Referenced by crusde_get_gridsize().

void SimulationCore::init (  ) 
void SimulationCore::installPlugin ( string  plugin  ) 
static SimulationCore* SimulationCore::instance (  )  throw () [inline, static]

SimulationCore::instance returns the only existing instance

References pSimulationCore.

Referenced by PluginManager::addEntry(), ExperimentManager::addEntry(), PluginManager::addToDB(), crusde_crustal_decay_given(), crusde_exit(), crusde_get_crustal_decay_at(), crusde_get_current_load_component(), crusde_get_dimensions(), crusde_get_displacement_dimensions(), crusde_get_green_at(), crusde_get_gridsize(), crusde_get_load_at(), crusde_get_load_history_at(), crusde_get_min_x(), crusde_get_min_y(), crusde_get_number_of_load_components(), crusde_get_number_of_loads(), crusde_get_operator_space(), crusde_get_out_file(), crusde_get_quadrant(), crusde_get_result(), crusde_get_size_t(), crusde_get_size_x(), crusde_get_size_y(), crusde_get_timesteps(), crusde_get_x_index(), crusde_get_y_index(), crusde_get_z_index(), crusde_info(), crusde_load_history_given(), crusde_model_step(), crusde_model_time(), crusde_register_optional_param_double(), crusde_register_optional_param_string(), crusde_register_output_field(), crusde_register_param_double(), crusde_register_param_string(), crusde_request_crustaldecay_plugin(), crusde_request_green_plugin(), crusde_request_kernel_plugin(), crusde_request_load_plugin(), crusde_request_loadhistory_plugin(), crusde_request_postprocessor_plugin(), crusde_set_current_load_component(), crusde_set_operator_space(), crusde_set_quadrant(), crusde_set_result(), crusde_stepsize(), LoadFunction::crustalDecayGiven(), InputHandler::getCrustalDecayPlugin(), LoadFunction::getCrustalDecayValueAt(), InputHandler::getGreenJobMap(), InputHandler::getGreenPlugin(), LoadFunction::getHistoryValueAt(), InputHandler::getKernelPlugin(), InputHandler::getLoadHistoryPlugin(), InputHandler::getLoadPlugin(), InputHandler::getOutputPlugin(), LoadFunction::getValueAt(), LoadFunction::init(), InputHandler::init(), LoadFunction::load(), GreensFunction::load(), LoadFunction::loadHistoryGiven(), main(), InputHandler::readCommandline(), LoadFunction::registerOutputFields(), registerParam(), LoadFunction::registerParameter(), LoadFunction::release(), LoadFunction::requestPlugins(), and LoadFunction::unload().

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

References crusde_error(), pSimulationCore, and SimulationCore().

bool SimulationCore::isQuiet (  ) 

returns a flag for quiet, i.e. no output to commandline, runs

References quiet.

LoadFunction* SimulationCore::loadFunction (  )  [inline]
int SimulationCore::minX (  ) 

References x_west.

Referenced by crusde_get_min_x().

int SimulationCore::minY (  ) 

References y_south.

Referenced by crusde_get_min_y().

int SimulationCore::modelStep (  ) 

References modelstep.

Referenced by crusde_model_step().

int SimulationCore::modelTime (  ) 

References modeltime.

Referenced by crusde_model_time().

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

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

bool SimulationCore::operatorSpaceIsSet (  ) 

References operator_space_set.

Referenced by init().

const char * SimulationCore::outFile (  ) 
PluginManager * SimulationCore::pluginManager (  ) 
void SimulationCore::registerOutputField ( int *  output_index,
FieldName  field 
)
void SimulationCore::registerParam ( ParamWrapper param,
const char *  name,
PluginCategory  category 
)
void SimulationCore::runExperimentManager (  ) 
void SimulationCore::runPluginManager (  ) 
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)

References load_function_component, and num_load_components.

Referenced by crusde_set_current_load_component(), LoadFunction::init(), LoadFunction::load(), LoadFunction::registerOutputFields(), LoadFunction::registerParameter(), LoadFunction::release(), LoadFunction::requestPlugins(), and LoadFunction::unload().

void SimulationCore::setModelData ( double **  result  ) 
void SimulationCore::setOperatorSpace ( int  nx,
int  ny 
)
void SimulationCore::setQuadrant ( int  q  ) 

References quadrant.

Referenced by crusde_set_quadrant().

void SimulationCore::setQuiet ( bool  flag  ) 

sets a flag for quiet, i.e. no output to commandline, runs

References quiet.

Referenced by InputHandler::init(), and InputHandler::readCommandline().

int SimulationCore::sizeT (  ) 

References num_timesteps.

Referenced by crusde_get_size_t().

int SimulationCore::sizeX (  ) 

References gridsize, x_east, and x_west.

Referenced by crusde_get_size_x().

int SimulationCore::sizeY (  ) 

References gridsize, y_north, and y_south.

Referenced by crusde_get_size_y().

int SimulationCore::stepSize (  ) 

References stepsize.

Referenced by crusde_stepsize().

void SimulationCore::terminate (  ) 
int SimulationCore::xIndex (  ) 

References x_index.

Referenced by crusde_get_x_index().

int SimulationCore::yIndex (  ) 

References y_index.

Referenced by crusde_get_y_index().

int SimulationCore::zIndex (  ) 

References z_index.

Referenced by crusde_get_z_index().


Member Data Documentation

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

Referenced by registerOutputField().

hard-wired input handler, no plugin

Referenced by exec(), init(), outFile(), and ~SimulationCore().

hard-wired experiment Manager, no plugin

Referenced by exec(), init(), and runExperimentManager().

Green's Function plug in, one factor for convolution

Referenced by currentJob(), exec(), greensFunction(), init(), terminate(), and ~SimulationCore().

int SimulationCore::gridsize [private]

Referenced by gridSize(), init(), sizeX(), and sizeY().

Load function, holds all loads and histories

Referenced by init(), loadFunction(), terminate(), and ~SimulationCore().

double** SimulationCore::model_data [private]

Referenced by getModelData(), and setModelData().

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

Referenced by exec(), and modelStep().

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

Referenced by exec(), and modelTime().

unsigned int SimulationCore::num_load_components [private]

... using this stepsize

Referenced by exec(), and init().

maximum number of timesteps we want to simulate

Referenced by exec(), getTimesteps(), init(), and sizeT().

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

Plug-in instance taking care on the simulation kernel

Referenced by exec(), init(), terminate(), and ~SimulationCore().

buffer for all the postprocessor plugins that might be loaded

Referenced by exec(), init(), and terminate().

Plug-in instance handling data output

Referenced by dataOutPlugin(), exec(), init(), setModelData(), terminate(), and ~SimulationCore().

hard-wired plugin Manager, no plugin ;)

Referenced by init(), installPlugin(), pluginManager(), and runPluginManager().

static Singleton initialisieren

pointer to the only instance of SimulationCore

Referenced by installPlugin(), instance(), runExperimentManager(), runPluginManager(), and terminate().

int SimulationCore::quadrant [private]

Referenced by getQuadrant(), and setQuadrant().

bool SimulationCore::quiet [private]

Referenced by isQuiet(), and setQuiet().

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

Referenced by deleteRequests(), getRequestedNames(), init(), and terminate().

string SimulationCore::root_dir [private]

public struct keeping the command line arguments

Referenced by InputHandler::initParamsFromDOM(), and registerParam().

int SimulationCore::stepsize [private]

time increment with each model step

Referenced by stepSize().

int SimulationCore::x_east [private]

Referenced by init(), and sizeX().

int SimulationCore::x_index [private]
int SimulationCore::x_west [private]

Referenced by init(), minX(), and sizeX().

int SimulationCore::y_index [private]
int SimulationCore::y_north [private]

Referenced by init(), and sizeY().

int SimulationCore::y_south [private]

Referenced by init(), minY(), and sizeY().

int SimulationCore::z_index [private]

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

Generated on Tue Feb 16 15:18:38 2010 for CrusDe by  doxygen 1.6.1-20091004