|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <GenerateOpalSimulation.h>
Public Member Functions | |
| GenerateOpalSimulation (std::string tmplFile, std::string varDictionary, std::map< std::string, std::string > userValues) | |
| ~GenerateOpalSimulation () | |
| void | writeInputFile (std::string outputFile) |
Private Member Functions | |
| void | fillDictionary () |
| void | scale (std::string name, std::string *value) |
| Helper method to scale variable if necessary. | |
Private Attributes | |
| std::string | tmplFile_ |
| template filename | |
| std::string | varDictionary_ |
| data filename | |
| std::map< std::string, std::string > | dictionary_ |
| holds parsed template data | |
| std::map< std::string, double > | scaleVars_ |
| holds all variables that need scaling | |
Definition at line 49 of file GenerateOpalSimulation.h.
|
inline |
Sets up the scaled variables and fills the dictionary with content of data file.
| [in] | tmplFile | filename of template file |
| [in] | varDictionary | filename of data file |
| [in] | userValues | template variables specified by the optimizer |
Definition at line 61 of file GenerateOpalSimulation.h.
References dictionary_, fillDictionary(), scaleVars_, tmplFile_, and varDictionary_.
|
inline |
Definition at line 75 of file GenerateOpalSimulation.h.
References dictionary_, and scaleVars_.
|
inlineprivate |
Parses the data file and insert all values into the dictionary.
The data file needs to conform to the specification:
comments start with a hash symbol (end of line comments possible),
a data row starts with the name of the template variable and the value is separated by at least one whitespace.
In some cases the simple parser may fail, the characters scanned when splitting data rows are
' ', \t
Definition at line 145 of file GenerateOpalSimulation.h.
References dictionary_, scale(), and varDictionary_.
Referenced by GenerateOpalSimulation().
|
inlineprivate |
Helper method to scale variable if necessary.
Definition at line 198 of file GenerateOpalSimulation.h.
References name, and scaleVars_.
Referenced by fillDictionary().
|
inline |
Replace all template variables in template file with corresponding values from the dictionary and write file to disk
| [in] | outputFile | write resulting input file to this file |
Definition at line 86 of file GenerateOpalSimulation.h.
References dictionary_, and tmplFile_.
|
private |
holds parsed template data
Definition at line 128 of file GenerateOpalSimulation.h.
Referenced by fillDictionary(), GenerateOpalSimulation(), writeInputFile(), and ~GenerateOpalSimulation().
|
private |
holds all variables that need scaling
Definition at line 130 of file GenerateOpalSimulation.h.
Referenced by GenerateOpalSimulation(), scale(), and ~GenerateOpalSimulation().
|
private |
template filename
Definition at line 124 of file GenerateOpalSimulation.h.
Referenced by GenerateOpalSimulation(), and writeInputFile().
|
private |
data filename
Definition at line 126 of file GenerateOpalSimulation.h.
Referenced by fillDictionary(), and GenerateOpalSimulation().