1 #ifndef __OPALSIMULATION_H__
2 #define __OPALSIMULATION_H__
14 #include "boost/smart_ptr.hpp"
49 std::map<std::string, std::string> uvars);
57 std::map<std::string, std::vector<double> >
getData(
const std::vector<std::string> &statVariables);
67 void cleanUp(
const std::vector<std::string>& keep);
105 boost::scoped_ptr<GenerateOpalSimulation>
gs_;
130 const std::string& filename,
std::map< std::string, double > variableDictionary_t
boost::shared_ptr< CmdArguments > CmdArguments_t
std::map< std::string, reqVarInfo_t > reqVarContainer_t
namedVariableCollection_t Param_t
std::map< std::string, Expressions::Expr_t * > Named_t
type of an expressions with a name
Concrete implementation of an Opal simulation wrapper.
std::string pwd_
holds current directory (for restoring)
void invalidBunch()
mark a solution as invalid
virtual ~OpalSimulation()
std::map< std::string, std::vector< double > > getData(const std::vector< std::string > &statVariables)
void getVariableDictionary(variableDictionary_t &dictionary, const std::string &filename, const Expressions::Expr_t *const expression)
get variables for expression evaluation from SDDS file. Can throw SDDSParserException
reqVarContainer_t requestedVars_
holds solutions returned to the optimizer
void setupSimulation()
create directories, input files, fieldmaps...
void setFilename(int id)
set job id (SAMPLE command)
void copyH5_m()
copy H5 file
void redirectOutToFile()
redirect stdout and stderr to file
Expressions::Named_t objectives_
std::streambuf * strm_err_
stream buffer to redirect stderr
std::string simulationDirName_
full path of simulation directory (where simulation will be run)
std::set< std::string > dvarNames_
Expressions::Named_t constraints_
std::map< std::string, std::string > userVariables_
variable dictionary holding requested optimizer values
boost::scoped_ptr< GenerateOpalSimulation > gs_
object to generate simulation input files
std::string simTmpDir_
temporary directory for simulation data (environment var SIMTMPDIR)
reqVarContainer_t getResults()
returns container containing all requested variables with results
std::streambuf * strm_buffer_
stream buffer to redirect output
void createSymlink_m(const std::string &path)
create symbolic links
std::string simulationName_
identification of the simulation (corresponding to output filename)
bool hasResultsAvailable()
check if we already have simulated the current set of design vars
void setupFSStructure()
create directories, input files, symlinks...
void collectResults()
Parse SDDS stat file and build up requested variable dictionary.
void restoreOut()
restore stdout and stderr to default
int id_m
job id (SAMPLE command)
OpalSimulation(Expressions::Named_t objectives, Expressions::Named_t constraints, Param_t params, std::string name, MPI_Comm comm, CmdArguments_t args, std::map< std::string, std::string > uvars)