CONOPT
Loading...
Searching...
No Matches

Enables the user to provide an options file and set individual options.

Non-default tolerances or non-standard operations can be defined with two different methods. They can be defined in an Option File, also called a "Control program", or they can be defined with a sequence of callback calls, or with a combination of both methods.

You select the method by supplying one or more callback routines. You can define an Option file by registering an OptFile callback routine using COIDEF_Optfile(). The callback routine must define the name of the file with the Option file. An Option callback routine can be registered using COIDEF_Option().


OptFile – Define Options File

If this callback routine has been registered it is called by CONOPT immediately after start. It lets the modeler define a file with an Option file or Control program. If LFILNM is positive, CONOPT will open the file named FILENM, read it, and close it immediately. If FNLEN is zero, CONOPT will not use an Option file.

int COI_CALLCONV OptFile( int* LFILNM, double* USRMEM,
char* FILENM, int LENFN );

where:

The special C-argument, LENFN holds the allocated length of FILENM, i.e. 255.

Note
No Option file will be used if the modeler does not register OptFile, if OptFile returns LFILNM = 0, or if the file define by Optfile cannot be found.

The format of the CONOPT Options file consists in its simplest form of a number of lines like these:

    rtmaxv :=  1.e8;
    lfnsup := 500;

An optional "set" verb can be added in front of the assignment statements, and the separators :, =, and ; are silently ignored, so the first line could also be written as "set rtmaxv 1.e8" or simply "rtmaxv 1.e8". Lower case letters are converted to upper case so the second line could also be written as "LFNSUP := 500;". The assignment or set statement is used to assign a new value to internal CONOPT variables, so-called CR-Cells. The optional set verb, the name of the CR-Cell, and the value must be separated by blanks, tabs, commas, colons, and/or equal signs. The value must be written using legal Fortran format with a maximum of 10 characters, i.e. a real number may contain an optional E and D exponent, but a number may not contain blanks. The value must have the same type as the CR-Cell, i.e. real CR-Cells must be assigned real values, integer CR-Cells must be assigned integer values, and logical CR-Cells must be assigned logical values. Values can also be the name of a CR-Cell of the same type.


Option – Define Options

This callback routine will (if registered using COIDEF_Option()) be called after OptFile has been called and after the Option file has been read so the options defined using the Option callback will overwrite options in the Option file. Option defines one option in each call and it will be called repeatedly until the modeler returns a blank NAME. This way, the modeler can define any number of CR-cells. If NAME is not a legal CR-cell name CONOPT will write a message to the listing file and otherwise ignore the call.

int COI_CALLCONV Option( int* NCALL, double* RVAL, int* IVAL,
int* LVAL, char* NAME, double* USRMEM );

where: