General
Parameterization of Input files
For User-defined solvers, the LS-OPT parameter format <<>> can be used to parameterize the input files. LS-OPT converts the input template to an input deck UserOpt.inp for the preprocessor or solver by replacing the parameters with values determined by the sampling algorithm . Hence UserOpt.inp is a copy of the specified input file with the corresponding variable substitution for each run that is copied to the respective run directory.
The specification of an input file is not required for a user-defined solver.
Interfacing with a user-defined program
A user defined solver can be specified by selecting the Package Name User-Defined in the respective Stage dialog Setup tab.The solver command can either execute a command, a script or any program.
During run-time, LS-OPT appends the standard input deck name UserOpt.inp to the end of the execution command. This could be omitted by selecting Do not add input file argument. Variable substitution will be performed in the solver input file (which will be renamed UserOpt.inp) and in Extra input files.
The script run_this_script could content a solver command such as for example
myprogram UserOpt.inp or myprogram I=$1
If the User-defined solver does not generate a N o r m a l termination command to standard output,
the solver command must execute a script that has as its last statement the command (Linux)
echo ‘N o r m a l’
It is also possible to differentiate between normal and error termination for a user-defined solver:
Example
if [ \`grep 'NORMAL TERMINATION,EXITO MESSAGE' $SOLVER_LOGFILE | wc -l\` -eq 1 ] then echo "User-Defined Solver terminated normally" >> run.log echo 'N o r m a l' else echo "User-Defined Solver not terminated normally" >> run.log echo 'E r r o r' fi