00001
00007
00008
00009
00010
00011 #ifndef COMMON_H
00012 #define COMMON_H
00013
00014 #if !defined(WIN32) || defined(__CYGWIN__)
00015 #include <unistd.h>
00016 #endif
00017 #include <stdio.h>
00018 #include <limits.h>
00019
00020 #if ( INT_MAX == 2147483647L )
00021 typedef int int32;
00022 #elif ( SHRT_MAX == 2147483647L )
00023 typedef short int32;
00024 #endif
00025
00026 #ifdef _MSC_VER
00027 typedef __int64 int64;
00028 #else
00029 #if ( INT_MAX == 9223372036854775807LL )
00030 typedef int int64;
00031 #elif ( LONG_MAX == 9223372036854775807LL )
00032 typedef long int64;
00033 #else
00034 typedef long long int64;
00035 #endif
00036 #endif
00037
00038 #if defined(PLACEMENT_NEW)
00039 void * ::operator new (size_t, void *p) { return p; }
00040 #elif defined(PLACEMENT_NEW_GLOBAL)
00041 void * operator new (size_t, void *p) { return p; }
00042 #endif
00043
00044 #define COLOUMB 332.0636
00045 #define BOLTZMAN 0.001987191
00046 #define TIMEFACTOR 48.88821
00047 #define PRESSUREFACTOR 6.95E4
00048 #define PDBVELFACTOR 20.45482706
00049 #define PDBVELINVFACTOR (1.0/PDBVELFACTOR)
00050 #define PNPERKCALMOL 69.479
00051
00052 #ifndef PI
00053 #define PI 3.141592653589793
00054 #endif
00055
00056 #ifndef TWOPI
00057 #define TWOPI 2.0 * PI
00058 #endif
00059
00060 #ifndef ONE
00061 #define ONE 1.000000000000000
00062 #endif
00063
00064 #ifndef ZERO
00065 #define ZERO 0.000000000000000
00066 #endif
00067
00068 #ifndef SMALLRAD
00069 #define SMALLRAD 0.0005
00070 #endif
00071
00072 #ifndef SMALLRAD2
00073 #define SMALLRAD2 SMALLRAD*SMALLRAD
00074 #endif
00075
00076
00077
00078
00079 typedef float Real;
00080
00081 #ifdef SHORTREALS
00082 typedef float BigReal;
00083 #else
00084 typedef double BigReal;
00085 #endif
00086
00087 #ifndef FALSE
00088 #define FALSE 0
00089 #define TRUE 1
00090 #endif
00091
00092 #ifndef NO
00093 #define NO 0
00094 #define YES 1
00095 #endif
00096
00097 #ifndef STRINGNULL
00098 #define STRINGNULL '\0'
00099 #endif
00100
00101 #define MAX_NEIGHBORS 27
00102
00103 typedef int Bool;
00104
00105 class Communicate;
00106
00107
00108 void NAMD_quit(const char *);
00109 void NAMD_die(const char *);
00110 void NAMD_err(const char *);
00111 void NAMD_bug(const char *);
00112 void NAMD_backup_file(const char *filename, const char *extension = 0);
00113 void NAMD_write(int fd, const void *buf, size_t count);
00114 char *NAMD_stringdup(const char *);
00115 FILE *Fopen(const char *filename, const char *mode);
00116 int Fclose(FILE *fout);
00117
00118
00119 #define SIMPARAMSTAG 100 // Tag for SimParameters class
00120 #define STATICPARAMSTAG 101 // Tag for Parameters class
00121 #define MOLECULETAG 102 // Tag for Molecule class
00122 #define FULLTAG 104
00123 #define FULLFORCETAG 105
00124 #define DPMTATAG 106
00125
00126 #define CYCLE_BARRIER 0
00127 #define PME_BARRIER 0
00128
00129 #define USE_BARRIER (CYCLE_BARRIER || PME_BARRIER)
00130
00131
00132
00133
00134
00135
00136
00137 #define NAMD_SeparateWaters 0
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 #define NAMD_ComputeNonbonded_SortAtoms 0
00151 #define NAMD_ComputeNonbonded_SortAtoms_LessBranches 1
00152
00153
00154 #define WAT_TIP3 0
00155 #define WAT_TIP4 1
00156
00157
00158 #include "converse.h"
00159 #if CHARM_VERSION <= 50900
00160 #ifndef CmiMemcpy
00161 #define CmiMemcpy(D,S,N) memcpy(D,S,N)
00162 #endif
00163 #endif
00164
00165 #endif
00166