CONSTRAINT


Function

CONSTRAINT handles `soft' constraints in the DYNAMO library.

This module is a new one but it has the same functionality (and more) of the module ENERGY_EXTRA described in chapter 10 of the book A Practical Introduction to the Simulation of Molecular Systems.

Note that the energy subroutines in this module do not handle second derivatives.

Dependencies

Module Variables
CONSTANTS TO_DEGREES
DEFINITIONS DP
FILES NEXT_UNIT
IO_UNITS OUTPUT
LINEAR_ALGEBRA CROSS_PRODUCT
STATUS ERROR
ATOMS ATMCRD, NATOMS, NFREE


Public Variables

None that the user is likely to need.

Public Procedures

There are eight public subroutines in this module that users are likely to want to use.

SubroutinePurpose
CONSTRAINT_DEFINE Define a harmonic constraint.
CONSTRAINT_INITIALIZE Remove all previously defined harmonic constraints.
CONSTRAINT_POINT_DEFINE Define a point for use in a constraint definition.
CONSTRAINT_PRINT Print a list of the currently defined constraints.
CONSTRAINT_WRITING_START Start writing of constraint data to external files.
CONSTRAINT_WRITING_STOP Halt writing of constraint data.
TETHER_DEFINE Define a set of tether constraints for some atoms.
TETHER_INITIALIZE Remove a previously defined set of tether constraints.


CONSTRAINT_DEFINE

Argument Type Intent Optional Purpose
TYPE Character ( Len = * ) In No The type of constraint.
FC Real In No The harmonic constraint force constant.
EQ Real In No The harmonic constraint equilibrium value.
FILE Character ( Len = * ) In Yes A file on which to write constraint data.
PRINT Logical In Yes A print flag.
WEIGHTS Real(:) In Yes A set of weights.


Error Meaning
Unknown constraint type. The string TYPE is not one of "ANGLE", "DIHEDRAL", "DISTANCE", "MULTIPLE_DISTANCE" or "TRANSFER".
The constraint has an invalid number of points. The number of points defined for the constraint is invalid.
I/O Error on constraint data file. There is a problem with the constraint file.
The WEIGHTS array has the wrong size. The size of the WEIGHTS array is not equal to half the number of points defined for a MULTIPLE_DISTANCE constraint.
A WEIGHTS array was present with a non-MULTIPLE_DISTANCE constraint. A WEIGHTS array is only needed for a MULTIPLE_DISTANCE constraint.




CONSTRAINT_INITIALIZE

There are no arguments for this subroutine.



CONSTRAINT_POINT_DEFINE

Argument Type Intent Optional Purpose
SELECTION Logical(1:NATOMS) In No An atom selection array.
PRINT Logical In Yes A print flag.
WEIGHTS Real(1:NATOMS) In Yes A set of weights.


Error Meaning
Invalid selection array size. The array SELECTION does not have a length of NATOMS.
Invalid weight array size. The array WEIGHTS does not have a length of NATOMS.
No atoms have been selected. All the elements of the array SELECTION are .FALSE..




CONSTRAINT_PRINT

There are no arguments for this subroutine.



CONSTRAINT_WRITING_START

There are no arguments for this subroutine.



CONSTRAINT_WRITING_STOP

Argument Type Intent Optional Purpose
CLOSE Logical In Yes The flag for whether to close the external files.




TETHER_DEFINE

Argument Type Intent Optional Purpose
FORCE_CONSTANT Real In No The force constant for the tether constraints.
REFERENCE_STRUCTURE Real(1:3,1:NATOMS) In Yes The reference structure.
SELECTION Logical(1:NATOMS) In Yes An atom selection array.


Error Meaning
The tether constraint reference structure is missing. No reference structure has been given.




TETHER_INITIALIZE

There are no arguments for this subroutine.



Stability

The constraint definitions may be changed to take account of the minimum image convention and second derivatives need to be implemented. Otherwise, stable.



Back to the DYNAMO Home-Page.