| 1 |
diff -rupN ../namd2.orig/config ./config |
| 2 |
--- ../namd2.orig/config 2012-02-29 18:12:11.000000000 -0800 |
| 3 |
+++ ./config 2013-03-13 19:40:12.136815664 -0700 |
| 4 |
@@ -29,6 +29,7 @@ syntax: |
| 5 |
echo ' --arch-suffix <suffix for NAMD platform printed at startup>' |
| 6 |
echo ' (the following are experimental features)' |
| 7 |
echo ' --without-memopt (default) --with-memopt' |
| 8 |
+ echo ' --without-apbs (default) --with-apbs' |
| 9 |
echo ' --without-cuda (default) --with-cuda' |
| 10 |
echo ' (do NOT use CUDA-enabled Charm++, NAMD does not need it)' |
| 11 |
echo ' --cuda-prefix <directory containing CUDA bin, lib, and include>' |
| 12 |
@@ -101,6 +102,7 @@ begin: |
| 13 |
set use_fftw3 = 0 |
| 14 |
set use_cuda = 0 |
| 15 |
set use_memopt = 0 |
| 16 |
+ set use_apbs = 0 |
| 17 |
|
| 18 |
if ($#argv < 1) then |
| 19 |
set PRINT_ARCH_LIST |
| 20 |
@@ -125,6 +127,14 @@ begin: |
| 21 |
endif |
| 22 |
|
| 23 |
if ($#argv < 1) goto syntax |
| 24 |
+ if ( $1 == apbs ) then |
| 25 |
+ set use_apbs = 1 |
| 26 |
+ shift |
| 27 |
+ else |
| 28 |
+ set use_apbs = 0 |
| 29 |
+ endif |
| 30 |
+ |
| 31 |
+ if ($#argv < 1) goto syntax |
| 32 |
if ( $1 == plugins ) then |
| 33 |
echo 'The "plugins" flag is not needed; plugins are built automatically.' |
| 34 |
shift |
| 35 |
@@ -241,6 +251,13 @@ begin: |
| 36 |
set use_memopt = 1 |
| 37 |
breaksw |
| 38 |
|
| 39 |
+ case --with-apbs: |
| 40 |
+ set use_apbs = 1 |
| 41 |
+ breaksw |
| 42 |
+ case --without-apbs: |
| 43 |
+ set use_apbs = 0 |
| 44 |
+ breaksw |
| 45 |
+ |
| 46 |
case --charm-base: |
| 47 |
shift |
| 48 |
if ( ! -d $1 ) then |
| 49 |
@@ -406,6 +423,8 @@ begin: |
| 50 |
if ( $CHARM_ARCH =~ *-smp* ) set threaded = 1 |
| 51 |
if ( $CHARM_ARCH =~ *multicore-* ) set threaded = 1 |
| 52 |
|
| 53 |
+ if ( $use_apbs ) echo 'include .rootdir/arch/$(NAMD_ARCH).apbs' >> Make.config |
| 54 |
+ |
| 55 |
if ( $use_tcl ) then |
| 56 |
if ( $?TCL_PREFIX ) then |
| 57 |
echo "TCLDIR = $TCL_PREFIX" >> Make.config |
| 58 |
diff -rupN ../namd2.orig/Make.depends ./Make.depends |
| 59 |
--- ../namd2.orig/Make.depends 2012-04-04 12:38:41.000000000 -0700 |
| 60 |
+++ ./Make.depends 2013-03-13 19:40:12.136815664 -0700 |
| 61 |
@@ -1977,6 +1977,7 @@ obj/ComputeMgr.o: \ |
| 62 |
src/GlobalMasterEasy.h \ |
| 63 |
src/GlobalMasterMisc.h \ |
| 64 |
src/GlobalMasterFreeEnergy.h \ |
| 65 |
+ src/GlobalMasterAPBS.h \ |
| 66 |
src/GlobalMasterColvars.h \ |
| 67 |
src/colvarmodule.h \ |
| 68 |
src/colvartypes.h \ |
| 69 |
@@ -3384,6 +3385,17 @@ obj/GlobalMasterServer.o: \ |
| 70 |
src/InfoStream.h \ |
| 71 |
src/Debug.h |
| 72 |
$(CXX) $(CXXFLAGS) $(COPTO)obj/GlobalMasterServer.o $(COPTC) src/GlobalMasterServer.C |
| 73 |
+obj/GlobalMasterAPBS.o: \ |
| 74 |
+ src/GlobalMasterAPBS.C \ |
| 75 |
+ src/NamdTypes.h \ |
| 76 |
+ src/Vector.h \ |
| 77 |
+ src/common.h \ |
| 78 |
+ src/ResizeArray.h \ |
| 79 |
+ src/ResizeArrayRaw.h \ |
| 80 |
+ src/GlobalMaster.h \ |
| 81 |
+ src/GlobalMasterAPBS.h \ |
| 82 |
+ src/Debug.h |
| 83 |
+ $(CXX) $(CXXFLAGS) $(COPTO)obj/GlobalMasterAPBS.o $(COPTC) src/GlobalMasterAPBS.C |
| 84 |
obj/GlobalMasterTest.o: \ |
| 85 |
src/GlobalMasterTest.C \ |
| 86 |
src/NamdTypes.h \ |
| 87 |
diff -rupN ../namd2.orig/Makefile ./Makefile |
| 88 |
--- ../namd2.orig/Makefile 2012-04-27 08:53:24.000000000 -0700 |
| 89 |
+++ ./Makefile 2013-03-13 19:50:53.969812791 -0700 |
| 90 |
@@ -161,6 +161,7 @@ OBJS = \ |
| 91 |
$(DSTDIR)/FreeEnergyVector.o \ |
| 92 |
$(DSTDIR)/GlobalMaster.o \ |
| 93 |
$(DSTDIR)/GlobalMasterServer.o \ |
| 94 |
+ $(DSTDIR)/GlobalMasterAPBS.o \ |
| 95 |
$(DSTDIR)/GlobalMasterTest.o \ |
| 96 |
$(DSTDIR)/GlobalMasterIMD.o \ |
| 97 |
$(DSTDIR)/GlobalMasterTcl.o \ |
| 98 |
@@ -356,7 +357,7 @@ CHARM_MODULES = -module NeighborLB -modu |
| 99 |
LIBS = $(CUDAOBJS) $(PLUGINLIB) $(DPMTALIBS) $(DPMELIBS) $(TCLDLL) |
| 100 |
|
| 101 |
# CXX is platform dependent |
| 102 |
-CXXBASEFLAGS = $(COPTI)$(CHARMINC) $(COPTI)$(SRCDIR) $(COPTI)$(INCDIR) $(DPMTA) $(DPME) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN $(TCL) $(FFT) $(CUDA) $(MEMOPT) $(CCS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF) $(EXTRAINCS) $(MSA) |
| 103 |
+CXXBASEFLAGS = $(COPTI)$(CHARMINC) $(COPTI)$(SRCDIR) $(COPTI)$(INCDIR) $(DPMTA) $(DPME) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN $(TCL) $(FFT) $(CUDA) $(MEMOPT) $(CCS) $(APBS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF) $(EXTRAINCS) $(MSA) |
| 104 |
CXXFLAGS = $(CXXBASEFLAGS) $(CXXOPTS) |
| 105 |
CXXTHREADFLAGS = $(CXXBASEFLAGS) $(CXXTHREADOPTS) |
| 106 |
CXXSIMPARAMFLAGS = $(CXXBASEFLAGS) $(CXXSIMPARAMOPTS) |
| 107 |
@@ -398,6 +399,7 @@ namd2: $(MKINCDIR) $(MKDSTDIR) $(OBJS) $ |
| 108 |
$(TCLLIB) \ |
| 109 |
$(FFTLIB) \ |
| 110 |
$(PLUGINLIB) \ |
| 111 |
+ $(APBSLIB) \ |
| 112 |
$(CHARMOPTS) \ |
| 113 |
$(EXTRALINKLIBS) \ |
| 114 |
-lm -o namd2 |
| 115 |
diff -rupN ../namd2.orig/src/ComputeMgr.C ./src/ComputeMgr.C |
| 116 |
--- ../namd2.orig/src/ComputeMgr.C 2012-04-04 12:38:08.000000000 -0700 |
| 117 |
+++ ./src/ComputeMgr.C 2013-03-13 19:40:12.148815518 -0700 |
| 118 |
@@ -83,6 +83,9 @@ |
| 119 |
#include "GlobalMasterEasy.h" |
| 120 |
#include "GlobalMasterMisc.h" |
| 121 |
#include "GlobalMasterFreeEnergy.h" |
| 122 |
+#ifdef NAMD_APBS |
| 123 |
+#include "GlobalMasterAPBS.h" |
| 124 |
+#endif NAMD_APBS |
| 125 |
#include "GlobalMasterColvars.h" |
| 126 |
|
| 127 |
ComputeMgr::ComputeMgr() |
| 128 |
@@ -791,6 +794,10 @@ ComputeMgr::createComputes(ComputeMap *m |
| 129 |
masterServerObject->addClient(new GlobalMasterFreeEnergy()); |
| 130 |
if ( simParams->colvarsOn ) |
| 131 |
masterServerObject->addClient(new GlobalMasterColvars()); |
| 132 |
+#ifdef NAMD_APBS |
| 133 |
+ if ( simParams->apbsForcesOn ) |
| 134 |
+ masterServerObject->addClient(new GlobalMasterAPBS); |
| 135 |
+#endif NAMD_APBS |
| 136 |
|
| 137 |
} |
| 138 |
|
| 139 |
diff -rupN ../namd2.orig/src/SimParameters.C ./src/SimParameters.C |
| 140 |
--- ../namd2.orig/src/SimParameters.C 2012-04-18 09:45:17.000000000 -0700 |
| 141 |
+++ ./src/SimParameters.C 2013-03-13 19:53:47.778080995 -0700 |
| 142 |
@@ -1452,6 +1452,13 @@ void SimParameters::config_parser_constr |
| 143 |
"Configuration file for constant forces", PARSE_STRING); |
| 144 |
opts.require("constantforce", "consForceScaling", |
| 145 |
"Scaling factor for constant forces", &consForceScaling, 1.0); |
| 146 |
+ |
| 147 |
+ //// APBS solvation forces |
| 148 |
+ opts.optionalB("main", "apbsForces", "Apply APBS solvation forces?", |
| 149 |
+ &apbsForcesOn, FALSE); |
| 150 |
+ opts.require("apbsForces", "apbsPQRFile", "Path to PQR file", apbsPQRFile); |
| 151 |
+ opts.require("apbsForces", "apbsForcesConfig", |
| 152 |
+ "Configuration file for APBS solvation forces", PARSE_MULTIPLES); |
| 153 |
|
| 154 |
//// Collective variables |
| 155 |
opts.optionalB("main", "colvars", "Is the colvars module enabled?", |
| 156 |
@@ -4301,8 +4308,13 @@ if ( openatomOn ) |
| 157 |
// Global forces configuration |
| 158 |
|
| 159 |
globalForcesOn = ( tclForcesOn || freeEnergyOn || miscForcesOn || |
| 160 |
- (IMDon && ! IMDignore) || SMDOn || TMDOn || colvarsOn || symmetryOn ); |
| 161 |
+ (IMDon && ! IMDignore) || SMDOn || TMDOn || colvarsOn || symmetryOn || apbsForcesOn ); |
| 162 |
|
| 163 |
+ if (apbsForcesOn) { |
| 164 |
+ iout << iINFO << "APBS SOLVATION FORCES ACTIVE\n"; |
| 165 |
+ iout << iINFO << " APBS PQR FILE: " << apbsPQRFile << "\n"; |
| 166 |
+ iout << endi; |
| 167 |
+ } |
| 168 |
|
| 169 |
if (tclForcesOn) |
| 170 |
{ |
| 171 |
diff -rupN ../namd2.orig/src/SimParameters.h ./src/SimParameters.h |
| 172 |
--- ../namd2.orig/src/SimParameters.h 2012-03-11 16:40:50.000000000 -0700 |
| 173 |
+++ ./src/SimParameters.h 2013-03-13 19:40:12.152815548 -0700 |
| 174 |
@@ -432,6 +432,9 @@ public: |
| 175 |
Bool miscForcesOn; // Using misc forces? |
| 176 |
Bool colvarsOn; // Using the colvars module? |
| 177 |
|
| 178 |
+ Bool apbsForcesOn; // Using APBS to compute solvation forces? |
| 179 |
+ char apbsPQRFile[128]; // path to PQR file for charges and radii. |
| 180 |
+ |
| 181 |
Bool fixedAtomsOn; // Are there fixed atoms? |
| 182 |
Bool fixedAtomsForces; // Calculate forces anyway? |
| 183 |
|