General
General information regarding User-Defined solvers
Input template files
LS-OPT converts the input template to an input deck for the preprocessor or solver by replacing the original parameter values (or labels) with new values determined by the sampling procedure. During run-time, LS-OPT appends a standard input deck name to the end of the execution command. In the case of the standard solvers, the appropriate syntax is used (e.g. i=DynaOpt.inp for LS-DYNA). For a user-defined solver, the name UserOpt.inp is appended. The specification of an input file is not required for a user-defined solver.
Interfacing with a user-defined solver
A user defined solver can be specified using the solver own solvername command, or selecting User-Defined in LS-OPTui. The solver command " " can either execute a command, a script or any program. The substituted input file UserOpt.inp will automatically be appended to the command, script or program. Variable substitution will be performed in the solver input file (which will be renamed UserOpt.inp) and the solver append file.
Example
solver own 'Analyzer'
solver command "../../run_this_script"
solver input file "setup.jou"
The script "run_this_script" could content a solver command such as for example
myprogram I=UserOpt.inp or myprogram I=$1
If the own solver does not generate a ‘Normal’ termination command to standard output,
the solver command must execute a script that has as its last statement the command:
echo ‘N o r m a l’ in case the user-defined program terminates normally.
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
