Commit dfa9a2c2 authored by lvs's avatar lvs
Browse files

set 20,48f cutoff for elec and desol in host and device in fastergrad

parent 151f046e
...@@ -206,11 +206,11 @@ PDB := 3ce3 ...@@ -206,11 +206,11 @@ PDB := 3ce3
NRUN := 100 NRUN := 100
POPSIZE := 150 POPSIZE := 150
TESTNAME := test TESTNAME := test
TESTLS := sd TESTLS := sw
test: odock test: odock
$(BIN_DIR)/$(TARGET) -ffile ./input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ./input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun $(NRUN) -psize $(POPSIZE) -resnam $(TESTNAME) -gfpop 0 -lsmet $(TESTLS) -lsit 30 $(BIN_DIR)/$(TARGET) -ffile ./input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ./input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun $(NRUN) -psize $(POPSIZE) -resnam $(TESTNAME) -gfpop 0 -lsmet $(TESTLS)
ASTEX_PDB := 2bsm ASTEX_PDB := 2bsm
ASTEX_NRUN:= 10 ASTEX_NRUN:= 10
......
...@@ -489,59 +489,67 @@ if (get_local_id (0) == 0) { ...@@ -489,59 +489,67 @@ if (get_local_id (0) == 0) {
} }
// Calculating energy contributions // Calculating energy contributions
// Cuttoff: internuclear-distance at 8A. // Cuttoff1: internuclear-distance at 8A only for vdw and hbond.
// Cutoff only for vdw and hbond.
// el and sol contributions are calculated at all distances.
if (atomic_distance < 8.0f) if (atomic_distance < 8.0f)
{ {
// Calculating van der Waals / hydrogen bond term // Calculating van der Waals / hydrogen bond term
partial_energies[get_local_id(0)] += native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,12)); partial_energies[get_local_id(0)] += native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,12));
#if 0
smoothed_intraE = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,12)); #if 0
raw_intraE_vdw_hb = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,12)); smoothed_intraE = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,12));
#endif raw_intraE_vdw_hb = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,12));
#endif
#if defined (DEBUG_ENERGY_KERNEL) #if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,12)); partial_intraE[get_local_id(0)] += native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,12));
#endif #endif
if (intraE_contributors_const[3*contributor_counter+2] == 1) { //H-bond if (intraE_contributors_const[3*contributor_counter+2] == 1) { //H-bond
partial_energies[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,10)); partial_energies[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,10));
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,10)); #if 0
raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,10)); smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,10));
#endif raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,10));
#endif
#if defined (DEBUG_ENERGY_KERNEL) #if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,10)); partial_intraE[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,10));
#endif #endif
} }
else { //van der Waals else { //van der Waals
partial_energies[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,6)); partial_energies[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,6));
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,6)); #if 0
raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,6)); smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,6));
#endif raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,6));
#endif
#if defined (DEBUG_ENERGY_KERNEL) #if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,6)); partial_intraE[get_local_id(0)] -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance/*atomic_distance*/,6));
#endif #endif
} }
} // if cuttoff - internuclear-distance at 8A } // if cuttoff1 - internuclear-distance at 8A
// Calculating energy contributions
// Cuttoff2: internuclear-distance at 20.48A only for el and sol.
if (atomic_distance < 20.48f)
{
// Calculating electrostatic term // Calculating electrostatic term
partial_energies[get_local_id(0)] += native_divide ( partial_energies[get_local_id(0)] += native_divide (
dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id], dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id],
atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance)))) atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance))))
); );
#if 0 #if 0
smoothed_intraE += native_divide ( smoothed_intraE += native_divide (
dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id], dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id],
atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance)))) atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance))))
); );
raw_intraE_el = native_divide ( raw_intraE_el = native_divide (
dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id], dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id],
atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance)))) atomic_distance * (DIEL_A + native_divide(DIEL_B,(1.0f + DIEL_K*native_exp(-DIEL_B_TIMES_H*atomic_distance))))
); );
#endif #endif
#if defined (DEBUG_ENERGY_KERNEL) #if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += native_divide ( partial_intraE[get_local_id(0)] += native_divide (
...@@ -558,19 +566,20 @@ raw_intraE_el = native_divide ( ...@@ -558,19 +566,20 @@ raw_intraE_el = native_divide (
dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) * dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) *
dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2)); dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
#if 0 #if 0
smoothed_intraE += ((dspars_S_const[atom1_typeid] + smoothed_intraE += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] + dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_typeid] + (dspars_S_const[atom2_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) * dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) *
dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2)); dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
raw_intraE_sol = ((dspars_S_const[atom1_typeid] + raw_intraE_sol = ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] + dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_typeid] + (dspars_S_const[atom2_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) * dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) *
dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2)); dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
#endif #endif
#if defined (DEBUG_ENERGY_KERNEL) #if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += ((dspars_S_const[atom1_typeid] + partial_intraE[get_local_id(0)] += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] + dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
...@@ -578,10 +587,7 @@ raw_intraE_sol = ((dspars_S_const[atom1_typeid] + ...@@ -578,10 +587,7 @@ raw_intraE_sol = ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) * dockpars_qasp*fabs(atom_charges_const[atom2_id]))*dspars_V_const[atom1_typeid]) *
dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2)); dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
#endif #endif
} // if cuttoff2 - internuclear-distance at 20.48A
......
...@@ -671,9 +671,7 @@ void gpu_calc_gradient( ...@@ -671,9 +671,7 @@ void gpu_calc_gradient(
} }
// Calculating gradient contributions // Calculating gradient contributions
// Cuttoff: internuclear-distance at 8A. // Cuttoff1: internuclear-distance at 8A only for vdw and hbond.
// Cutoff only for vdw and hbond.
// el and sol contributions are calculated at all distances.
if (atomic_distance < 8.0f) if (atomic_distance < 8.0f)
{ {
// Calculating van der Waals / hydrogen bond term // Calculating van der Waals / hydrogen bond term
...@@ -691,8 +689,12 @@ void gpu_calc_gradient( ...@@ -691,8 +689,12 @@ void gpu_calc_gradient(
native_powr(smoothed_distance/*atomic_distance*/, 7) native_powr(smoothed_distance/*atomic_distance*/, 7)
); );
} }
} // if cuttoff - internuclear-distance at 8A } // if cuttoff1 - internuclear-distance at 8A
// Calculating energy contributions
// Cuttoff2: internuclear-distance at 20.48A only for el and sol.
if (atomic_distance < 20.48f)
{
// Calculating electrostatic term // Calculating electrostatic term
// http://www.wolframalpha.com/input/?i=1%2F(x*(A%2B(B%2F(1%2BK*exp(-h*B*x))))) // http://www.wolframalpha.com/input/?i=1%2F(x*(A%2B(B%2F(1%2BK*exp(-h*B*x)))))
float upper = DIEL_A*native_powr(native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K, 2) + (DIEL_B)*native_exp(DIEL_B_TIMES_H*atomic_distance)*(DIEL_B_TIMES_H_TIMES_K*atomic_distance + native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K); float upper = DIEL_A*native_powr(native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K, 2) + (DIEL_B)*native_exp(DIEL_B_TIMES_H*atomic_distance)*(DIEL_B_TIMES_H_TIMES_K*atomic_distance + native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K);
...@@ -707,6 +709,7 @@ void gpu_calc_gradient( ...@@ -707,6 +709,7 @@ void gpu_calc_gradient(
(dspars_S_const[atom2_typeid] + dockpars_qasp*fabs(atom_charges_const[atom2_id])) * dspars_V_const[atom1_typeid] (dspars_S_const[atom2_typeid] + dockpars_qasp*fabs(atom_charges_const[atom2_id])) * dspars_V_const[atom1_typeid]
) * ) *
dockpars_coeff_desolv * -0.07716049382716049 * atomic_distance * native_exp(-0.038580246913580245*native_powr(atomic_distance, 2)); dockpars_coeff_desolv * -0.07716049382716049 * atomic_distance * native_exp(-0.038580246913580245*native_powr(atomic_distance, 2));
} // if cuttoff2 - internuclear-distance at 20.48A
// Decomposing "priv_gradient_per_intracontributor" // Decomposing "priv_gradient_per_intracontributor"
// into the contribution of each atom of the pair // into the contribution of each atom of the pair
......
...@@ -2094,8 +2094,12 @@ float calc_intraE_f(const Liganddata* myligand, ...@@ -2094,8 +2094,12 @@ float calc_intraE_f(const Liganddata* myligand,
if (debug == 1) if (debug == 1)
printf("van der Waals interaction = "); printf("van der Waals interaction = ");
} }
vW += vdW1 - vdW2;
} }
if (dist < 20.48)
{
s1 = (myligand->solpar [type_id1] + qasp_mul_absq [atom_id1]); s1 = (myligand->solpar [type_id1] + qasp_mul_absq [atom_id1]);
s2 = (myligand->solpar [type_id2] + qasp_mul_absq [atom_id2]); s2 = (myligand->solpar [type_id2] + qasp_mul_absq [atom_id2]);
v1 = myligand->volume [type_id1]; v1 = myligand->volume [type_id1];
...@@ -2105,12 +2109,10 @@ float calc_intraE_f(const Liganddata* myligand, ...@@ -2105,12 +2109,10 @@ float calc_intraE_f(const Liganddata* myligand,
printf(" %lf, electrostatic = %lf, desolv = %lf\n", (vdW1 - vdW2), q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id], printf(" %lf, electrostatic = %lf, desolv = %lf\n", (vdW1 - vdW2), q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id],
(s1*v2 + s2*v1) * desolv_table [distance_id]); (s1*v2 + s2*v1) * desolv_table [distance_id]);
vW += vdW1 - vdW2;
el += q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id]; el += q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id];
desolv += (s1*v2 + s2*v1) * desolv_table [distance_id]; desolv += (s1*v2 + s2*v1) * desolv_table [distance_id];
#if 0
} }
#endif
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment