#include <APPSPACK_Evaluator_SystemCall.hpp>
Inheritance diagram for APPSPACK::Evaluator::SystemCall:
Default method for handling evaluations. The user provides an executable that takes an input file with the point to be evaluated and creates an output file with the result.
See Using the APPSPACK Executables for more information on using APPSPACK with this object.
Basic system call mode of evaluation
Definition at line 66 of file APPSPACK_Evaluator_SystemCall.hpp.
Public Member Functions | |
SystemCall (const string &executableName_in, const string &inputPrefix_in, const string &outputPrefix_in) | |
Constructor. | |
SystemCall (const Parameter::List ¶ms) | |
Constructor (via parameter list). | |
virtual | ~SystemCall () |
Destructor. | |
virtual void | operator() (int tag_in, const Vector &x_in, bool &isF_out, double &f_out, string &msg_out) |
Do the function evaluation for the point x_in, and fill int he results. | |
virtual void | print () const |
Prints out the name of the executable, and the input and output file prefixes. | |
Private Member Functions | |
void | createStrings (int tag_in) |
Create the strings tag, inputFileName, outputFileName, and execString. | |
void | writeInputFile (const Vector &x) |
Write the parameter file. | |
void | runProgram () |
Run the function evaluation using a system command. | |
void | readOutputFile () |
Read the result file containing the function value. | |
void | deleteFiles () |
Delete the input and output files. | |
Private Attributes | |
const string | executableName |
Executable name. | |
const string | inputPrefix |
Prefix for name of parameters file. | |
const string | outputPrefix |
Prefix for name of output file. | |
string | tag |
Tag for this function evaluation. | |
string | inputFileName |
Name of parameters file for this function evaluation. | |
string | outputFileName |
Name of output file for this function evaluation. | |
bool | isInputFile |
Is there currently an input file (that will need to be deleted)? | |
bool | isOutputFile |
Is there currently an output file (that will need to be deleted)? | |
string | execString |
Executable string for this function evaluation. | |
bool | isF |
Does a function value exist for this function evaluation? | |
double | f |
The function value. | |
string | msg |
Any message about the function value. |
|
Constructor. Definition at line 42 of file APPSPACK_Evaluator_SystemCall.cpp. |
|
Constructor (via parameter list). Reads "Executable Name", "Input Prefix", and "Output Prefix" from the give parameter list. See Using the APPSPACK Executables for more information. Definition at line 53 of file APPSPACK_Evaluator_SystemCall.cpp. |
|
Destructor. Definition at line 86 of file APPSPACK_Evaluator_SystemCall.hpp. |
|
Do the function evaluation for the point x_in, and fill int he results.
Implements APPSPACK::Evaluator::Interface. Definition at line 62 of file APPSPACK_Evaluator_SystemCall.cpp. References createStrings(), deleteFiles(), f, isF, msg, readOutputFile(), runProgram(), APPSPACK::Vector, and writeInputFile(). |
|
Prints out the name of the executable, and the input and output file prefixes.
Reimplemented from APPSPACK::Evaluator::Interface. Definition at line 175 of file APPSPACK_Evaluator_SystemCall.cpp. References executableName, inputPrefix, and outputPrefix. |
|
Create the strings tag, inputFileName, outputFileName, and execString. Definition at line 82 of file APPSPACK_Evaluator_SystemCall.cpp. References execString, executableName, inputFileName, inputPrefix, outputFileName, outputPrefix, and tag. Referenced by operator()(). |
|
Write the parameter file.
Create the file named inputFileName containing the input vector
3 1.23547e-5 2.00000e-3 4.55000e+10 References inputFileName, isInputFile, and APPSPACK::Vector. Referenced by operator()(). |
|
Run the function evaluation using a system command. Definition at line 115 of file APPSPACK_Evaluator_SystemCall.cpp. References execString. Referenced by operator()(). |
|
Read the result file containing the function value. Read the file of the name specified by outputFileName. The file is expected to contain a single double value in scientific format. Return false and set isF to false if we cannot read the result file or encounter any other problems. Otherwise isF will be set to true and f will contain the function value for this task. Definition at line 120 of file APPSPACK_Evaluator_SystemCall.cpp. References f, APPSPACK::getNextDouble(), isF, isOutputFile, msg, outputFileName, and tag. Referenced by operator()(). |
|
Delete the input and output files. Definition at line 162 of file APPSPACK_Evaluator_SystemCall.cpp. References inputFileName, isInputFile, isOutputFile, and outputFileName. Referenced by operator()(). |
|
Executable name. Definition at line 136 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
Prefix for name of parameters file. Definition at line 139 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
Prefix for name of output file. Definition at line 142 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
Tag for this function evaluation. Definition at line 145 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and readOutputFile(). |
|
Name of parameters file for this function evaluation. Definition at line 148 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), deleteFiles(), and writeInputFile(). |
|
Name of output file for this function evaluation. Definition at line 151 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), deleteFiles(), and readOutputFile(). |
|
Is there currently an input file (that will need to be deleted)? Definition at line 154 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by deleteFiles(), and writeInputFile(). |
|
Is there currently an output file (that will need to be deleted)? Definition at line 157 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by deleteFiles(), and readOutputFile(). |
|
Executable string for this function evaluation. Definition at line 160 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and runProgram(). |
|
Does a function value exist for this function evaluation? Definition at line 163 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by operator()(), and readOutputFile(). |
|
The function value. Definition at line 166 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by operator()(), and readOutputFile(). |
|
Any message about the function value. Definition at line 169 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by operator()(), and readOutputFile(). |
© Sandia Corporation | Site Contact | Privacy and Security
Generated on Wed Dec 14 18:41:05 2005 for APPSPACK 4.0.2 by
1.3.8 written by Dimitri van Heesch,
© 1997-2002