CCL Home Page
Up Directory CCL sterdefn
/**************************************************************************/
/******************  STERIC startup declarations  *************************/
/**************************************************************************/

#include "stererr.h"       /* defines for all error calls                 */
#include "vectors.h"       /* structures and functions for vectors        */

/**************************************************************************/
/**************************************************************************/

#define VERSION  111       /* 100* current program version                */
#define V_MONTH  12        /* current version date                        */
#define V_YEAR   95        /* current version date                        */

#ifndef STERICHOME
#define STERICHOME "."     /* default search directory for steric files   */
#endif

#define DUD_ATM  0         /* atom number indicating non-existance        */
#define DEF_RAD  1.0       /* default radius incase of lost parameters    */
#define MOL_LEN  30        /* maximum length of molecule lable            */
#define ATM_LEN  5         /* maximum length of atom lable                */
#define MAX_ALS  4         /* maximum number of type aliases              */
#define GRP_LEN  20        /* maximum length of group lable               */
#define SYM_LEN  250       /* maximum symmetry operator string length     */
#define ERR_NUM  3         /* length of error numbers in error file       */
#define LINELEN  255       /* maximum line length in general functions    */
#define MAXLINE  24        /* maximum text lines in help facility         */
#define MAX_OVER 10        /* current maximum number of overlaps done     */
#define P_DEF    300       /* default array size for radial profiles      */
#define AT_DEF   100       /* default array size for area vs theta        */
#define AP_DEF   100       /* default array size for area vs phi          */
#define S_DEF    300       /* default numerical solid angle array size    */
#define C_DEF    50        /* default array size in 3D profile plot       */
#define V_DEF    50        /* default array size for numerical volume     */
#define VT_DEF   2         /* default time gap between MCV outputs        */
#define SM_DEF   4         /* default profile smoothing window            */
#define VRC_DEF  PI        /* default volrad profile cutoff               */
#define AVM_MCV  5.0e+3    /* start of averaging in MCV                   */
#define MIN_MCV  1.0e+4    /* minimum number of grid points to test in MCV*/
#define MAX_MCV  1.0e+7    /* maximum number of grid points to test in MCV*/
#define MAXVRAD  10000.0   /* maximum radius for group cavity volume      */
#define POSITIVE 2         /* used to distinguish which soln. to use      */
#define NEGATIVE 1
#define E_PS     1.0e-6    /* default fractional accuracy of integration  */
#define VE_PS    1.0e-6    /* default fractional accuracy of MC volume    */

#ifndef PI
#define PI       3.14159265358979323846
#endif
#ifndef PI_2
#define PI_2     1.57079632679489661923
#endif
#define E        2.71828182845904523536
#define GAS      1.987215e-3       /* gas constant in kcal/mol/K */

#define DEF_ROT  3.0*PI/4.0

/* atom settings bits */

#define MAIN_BIT 1         /* status bit for all calculations             */
#define CALC_BIT 2         /* use in current calculation                  */
#define GRP_BIT  4         /* mark whether atom has been included in group*/
 
/* main settings bits */

#define RSET_BIT 1         /* use general settings range for profiles     */
#define RDEF_BIT 2         /* use default range for profiles              */
#define ALL_BIT  4         /* do operations on ALL molecules              */
#define NBO_BIT  8         /* do non-bonded overlap only for VAO and SAO  */
#define NGR_BIT  16        /* do inter-group overlap only for VAO and SAO */
#define CONT_BIT 32        /* do angular-radial contour output from SN    */
#define PERS_BIT 64        /* use perspective mode in contour plot        */
#define VDW_BIT  128       /* use vdWaals radii all round                 */
#define CVL_BIT  256       /* use covalent radii all round                */
#define MTC_BIT  512       /* use monte carlo volume calculation          */
#define SCOR_BIT 1024      /* segment correction in old leach             */
#define MOVG_BIT 2048      /* move G bit in old leach algorithm           */

/* main settings bits continued */

#define UCAV_BIT 1         /* dummy unit cell atoms visible in view       */
#define ABOX_BIT 2         /* automatically box unit cell in cavity volume*/
#define REDU_BIT 4         /* automatically remove redundant atoms in box */
#define SNAM_BIT 8         /* use atom name in duplication test           */
#define TWOD_BIT 16        /* output 2D coords in in view                 */
#define FRAX_BIT 32        /* output fractional coords in view            */
#define POLA_BIT 64        /* output polar coords in view                 */
#define FADE_BIT 128       /* plot orthogonal view with faded atoms       */

#define FULL_BIT 65535     /* all bits in unsigned int turned on          */

/* molecule mode bits */

#define FRAC_BIT 1         /* atomic vectors in fractional coordinates    */
#define CSSG_BIT 2         /* centrosymmetric space group                 */

/* symmetry mode bits */

#define CENT_BIT 1         /* centring operator (eg. DU in schakal)       */

/* group mode bits */

#define FIXA_BIT 1         /* fixed number of atoms in group definition   */
#define CAVV_BIT 2         /* volume is actually cavity volume            */
#define RADV_BIT 4         /* volrad is from radial profile               */

/* general function modes */

#define VIS_BIT 1          /* output extra data during calculation        */

/**************************************************************************/
/*****  definitions for the different types of calculations performed *****/

#define S_ANGU   'a'
#define S_ANGUS  "SV cone angular profile"        /* angular profile      */
#define S_CONE   'c'
#define S_CONES  "Cone angle"                     /* cone angle           */
#define S_TOLM   't'
#define S_TOLMS  "Tolman cone angle"              /* tolman cone angle    */
#define S_OLDL   'o'
#define S_OLDLS  "old Leach solid angle"          /* old leach solid angle*/
#define S_RYAN   'r'
#define S_RYANS  "Ryan/Peter solid angle"         /* ryan/leach solid angl*/
#define S_CRAI   'g'
#define S_CRAIS  "Craig solid angle"              /* craig solid angle    */
#define S_NUME   'n'
#define S_NUMES  "Numerical solid angle"          /* numerical solid angle*/
#define S_VAOV   'v'
#define S_VAOVS  "Vertex angle of overlap"        /* vertex angle of over */
#define S_SAOV   's'
#define S_SAOVS  "Solid angle of overlap"         /* solid angle of over  */
#define S_VOLM   'l'
#define S_VOLMS  "Molecular volume"               /* molecular volume     */
#define S_PROJ   'p'
#define S_PROJS  "Projected area"                 /* projected area       */

/**************************************************************************/
/**************************************************************************/

struct paramstruct         /* memory for parameter table                  */
{
  char name[ATM_LEN+1];    /* atom type lable                             */
  char alias[MAX_ALS][ATM_LEN+1];  /* atom type aliases                   */
  double Vrad;             /* van der Waals radius                        */
  double Crad;             /* covalent radius                             */
  struct paramstruct *next;/* pointer to next parameter set               */
  struct paramstruct *prev;/* pointer to previous parameter set           */
};
typedef struct paramstruct Parm;

/**************************************************************************/

struct bondstruct
{
  short unsigned type;     /* bond type (0=not bonded, 1=single, 2=double */
  struct atomstruct *atom; /* pointer to atom bonded to                   */
  struct bondstruct *prev; /* pointer to previous bond                    */
  struct bondstruct *next; /* pointer to next bond                        */
};
typedef struct bondstruct Bond;

/**************************************************************************/

struct atomstruct          /* memory for individual atoms                 */
{
  char name[ATM_LEN+1];    /* atom label used for identification          */
  char type[ATM_LEN+1];    /* atom type label used for radius             */
  Vector v;                /* position rel. to apex                       */
  Vector fv;               /* position rel. to apex in fractional coords  */
  Vector tv;               /* position in 2D, on projection plane         */
  double distance;	   /* distance from apex                          */
  double theta,phi;        /* polar position with main atom at 0,0        */
  double radius;           /* atomic radius                               */
  double tradius;          /* atomic radius in 2D projection              */
  double SVangle;          /* effective semi-vertix angle for calc.       */
  unsigned bonds;          /* number of bonds                             */
  unsigned count;          /* number of times counted in craig counting   */
  int group;               /* group atom belongs to                       */
  unsigned stat;	   /* status of atom                              */
  struct bondstruct *bond; /* pointer to one of the atoms bonds           */
  struct atomstruct *prev; /* pointer to previous atom                    */
  struct atomstruct *next; /* pointer to next atom                        */
};
typedef struct atomstruct Atms;

/**************************************************************************/

struct symmstruct          /* structure for normal symmetry operators     */
{
  char S[SYM_LEN];         /* symmetry as in International Tables         */
  Matrix M;                /* matrix rotation part of symmetry            */
  Vector t;                /* vectro translation part of symmetry         */
  unsigned mode;           /* type of symmetry operator (eg. centring)    */
  struct symmstruct *prev;
  struct symmstruct *next;
};
typedef struct symmstruct Symm;

/**************************************************************************/

struct groupstruct
{
  char name[GRP_LEN+1];     /* group lable for identification             */
  char atex[LINELEN];       /* list of extra atom types allowed           */
  Atms *main;               /* atom no of atom bonded to origin           */
  int num_atoms;            /* no of atoms in group                       */
  double SVangle;           /* peak semi vertex angle for group           */
  double volume;            /* group volume                               */
  double cavity;            /* cavity volume                              */
  double radvol;            /* radial profile volume                      */
  double radcav;            /* radvol cavity volume                       */
  double volrad;            /* radius for cavity volume calculation       */
  unsigned mode;            /* mode (fixed numatoms or not)               */
  struct groupstruct *prev; /* previous group structure                   */
  struct groupstruct *next; /* next group structure                       */
};
typedef struct groupstruct Grps;

/**************************************************************************/

struct construct            /* memory for individual conformer            */
{
  double value;             /* total steric value for conformer           */
  double temperature;       /* conformer temperature                      */
  double Ec;                /* conformer energy in kcal/mol               */
  double mol;               /* conformer molar ratio                      */
  struct construct *prev;   /* previous conformer structure               */
  struct construct *next;   /* next conformer structure                   */
};
typedef struct construct Conf;

/**************************************************************************/

struct stericstruct
{
  char name[50];           /* string for steric parameter name            */
  char type;               /* byte indicating which parameter is used     */
  double tot_val;          /* total value from normal calculation         */
  double err_val;          /* error in value from normal calculation      */
  double tot_con;          /* total value from conformer calculation      */
  double err_con;          /* error in value from conformer calculation   */
  double max_val;          /* maximum value in profile                    */
  double pr_area;          /* area under radial profile                   */
  double peak_R;           /* radius at profile peak                      */
  double min, max;         /* min and max profile range                   */
  int size;                /* array size                                  */
  double *val;             /* pointer to array of values                  */
  Conf *conf;              /* pointer to conformer memory                 */
  struct stericstruct *prev;  /* pointer to previous steric structure     */
  struct stericstruct *next;  /* pointer to next steric structure         */
};
typedef struct stericstruct Ster;

/**************************************************************************/

struct molstruct           /* memory for molecule info                    */
{
  char name[MOL_LEN];      /* molecule name                               */
  char Fname[100];         /* molecule filename without extension         */
  double a,b,c;            /* unit cell parameters a, b, c                */
  double al,be,ga;         /* unit cell parameters alpha, beta, gamma     */
  double cellvol;          /* unit cell volume                            */
  double freevol;          /* free volume in unit cell                    */
  unsigned geneq;          /* number of general equivalent positions      */
  char centring;           /* type of centring condition                  */
  int num_atoms;           /* number of atoms                             */
  int multi;               /* number of overlaps to consider              */
  double tolman;           /* value of tolman cone angle                  */
  double minR, maxR;       /* min,max molecule distance from apex         */
  Vector plane;            /* vector defining arbitrary plane             */
  Vector plane_x;          /* vector in arbitrary plane                   */
  double plane_minT, plane_maxT;   /* plane rotation theta range          */
  double plane_minP, plane_maxP;   /* plane rotation theta range          */
  double plane_T, plane_P; /* current plane theta and phi                 */
  Vector basis_x;          /* basis vector for polar position 1,90,0      */
  Vector basis_y;          /* basis vector for polar position 1,90,90     */
  Vector basis_z;          /* basis vector for polar position 1,0,0       */
  Atms *main_atom;         /* atom bonded to DUO (if any)                 */
  Atms *origin;            /* pointer to origin atom in atom list         */
  Atms *atoms;             /* pointer to individual atoms memory          */
  Grps *groups;            /* pointer to definable atomic groups          */
  Symm *symmetry;          /* pointer to symmetry operator memory         */
  Ster *ster;              /* steric measurments memory                   */
  unsigned mode;           /* molecule mode                               */
  struct molstruct *prev;  /* pointer to previous molecule                */
  struct molstruct *next;  /* pointer to next molecule                    */
};
typedef struct molstruct Mol;

/**************************************************************************/

struct settingstruct       /* set of general parameters                   */
{
  Parm *parm;              /* pointer to table of parameters              */
  FILE *input;             /* pointer to text input stream                */
  FILE *contour;           /* pointer to contour output file              */
  double rotation;         /* contour plot rotation angle about z axis    */
  int multi;               /* multiple overlap order                      */
  int size;                /* size of general profile array               */
  int t_size;              /* size of area vs. theta profile array        */
  int p_size;              /* size of area vs. phi profile array          */
  int n_size;              /* size of array used for numerical solid angle*/
  int c_size;              /* size of array used for graphical 3D profile */
  int vx, vy, vz;          /* size of x,y,z arrays for numerical volume   */
  int avmmcv;              /* point at which to start averaging in MCV    */
  int minmcv;              /* minimum count for Monte Carlo Volume        */
  int maxmcv;              /* max grid points to test in MCV              */
  int smooth;              /* profile smoothing window                    */
  double vrcut;            /* volrad cutoff in profile                    */
  double min,max;          /* minimum and maximum radial profile range    */
  double a_min,a_max;      /* minimum and maximum angular profile range   */
  double eps;              /* maximum error for simpsons rule             */
  double veps;             /* maximum error for Monte Carlo volume        */
  double tgap;             /* time gap between MCV outputs                */
  double bond_minf;        /* fractional min. bond length in find bond    */
  double bond_maxf;        /* fractional max. bond length in find bond    */
  unsigned mode;           /* general calculation mode                    */
  unsigned modev;          /* general viewing mode                        */
  FILE *plot;              /* pointer to plot pipe to plotting program    */
  int x_ran, y_ran;        /* integer x and y ranges for molecule view    */
};
typedef struct settingstruct Set;

extern FILE *output;       /* pointer to text output stream               */

/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
Modified: Fri Dec 8 17:00:00 1995 GMT
Page accessed 5161 times since Sat Apr 17 21:59:52 1999 GMT