However, the discoverIO command may also be used directly by BTCL experts to implement specialized data exchanges between Discover and other programs running on the network during Discover energy evaluations.
Any number of -read tclFileHandle ?-options args? groups may be used on the same discoverIO command to specify several data exchanges in succession.
For example, suppose the variables outFH and inFH are Tcl file handles to open channels for writing and reading, respectively. Then, the command:
discoverIO -write $outFH -read $inFH -atom "*:*:Atom;*"writes data (Coord) for all atoms and then reads data (e.g., Gradient) for all atoms. That is, the -atom option refers to the previous -read and also to the -write before that.
Coord
Cartesian2Fractional
Fractional2Cartesian
CellParameters
Energy
Gradient
Stress
Hessian
If no -data option is specified and the operation is -write, the default -data corresponds to -data Coord if the system is nonperiodic and to -data {Cartesian2Fractional Fractional2Cartesian Coord} if the system is periodic.
If Coord is requested and no atom specification is given, then the following coordinates are exchanged:
Nonperiodic: all coordinates Periodic: write: all P1 atoms Periodic: read: all assymetric atomsIf Gradient is requested and no atom specification is given, then the following gradients are exchanged:
Nonperiodic: all gradients Periodic: write: all asymmetric atom gradients Periodic: read: all P1 atom gradientsCellParameters sends a,b,c,alpha,beta,gamma
Cartesian2Fractional and Fractional2Cartesian send over transformation matrices as 9 real*8 values ordered as: 1,1 1,2 1,3 2,1 2,2, etc.
If -expect option is used, then discoverIO either sends a string-type IPC frame (if the -expect applies to a -write) containing the list of items the client should expect next; or, if the -expect applies to a -read, discoverIO expects a string IPC frame containing the names of the data items that the Discover program should expect in forthcoming IPC frames.
The optional tag argument specifies a message entry for the IPC frame containing the expected data. This tag is used on -write and expected on -read. If no tag is provided, the tag Expect is sent or expected. If the tag must have a leading hyphen, use two hyphens (--).
Outgoing Expect frames always generate a flush.
The -request option is similar to the -expect option in that it helps the Discover program and clients negotiate what information is to be exchanged. If -request is specified, then before waiting for the data specified in the -read, Discover sends a Request message with strings indicating what information is desired from the client. If no -expect option applies to the -read in question, then Discover waits for the information requested. If an -expect does apply to this read, then before waiting for the data, Discover waits for an Expect message from the client. The contents of the Expect message from the client may modify what data Discover attempts to read next.
The optional tag argument specifies a message entry for the IPC frame containing the request data. If no tag is provided, the tag Request is sent. If the tag must have a leading hyphen, use two hyphens (--).
Request frames always generate a flush.
If -energyName is absent, then a new child of the ``External'' row is created using the name of the tclFileHandle specified on the associated -read action.
For example, if -energyName MOPAC appears, then the Energy database will look like:
External ... MOPAC ...All IPC frames with the message ``Energy'' will be summed into the MOPAC row. Furthermore, if ``Energy'' IPC frames are returned from the remote application with a second word in the message, then these distinguished energies are made children of the energy row specified by -energyName. For example, suppose -energyName MOPAC appears (as before) and that the application sends back two energy IPC frames with messages:
"Energy firstPart" "Energy secondPart"Now, the Energy database is set up as follows:
External ... MOPAC ... firstPart ... secondPart ...When the energies are printed, ``firstPart'' and ``secondPart'' are summed into ``MOPAC'', which will in turn be summed with any other rows at that level of the hierarchy, into ``External''. Note that, because the ``MOPAC'' row now has children, no energy IPC frames should arrive with only an ``Energy'' message; if this happens, the energies stored into ``MOPAC'' are overwritten when the children (``firstPart'' and ``secondPart'') are summed into ``MOPAC''.
-energyName applies to the previous read action.
If the -write option is specified, the Tcl result is a list of the message records sent for each output IPC frame.
The possible operations are as follows:
Copyright Biosym/MSI