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
NRUN := 100
POPSIZE := 150
TESTNAME := test
TESTLS := sd
TESTLS := sw
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_NRUN:= 10
......
......@@ -489,99 +489,105 @@ if (get_local_id (0) == 0) {
}
// Calculating energy contributions
// Cuttoff: internuclear-distance at 8A.
// Cutoff only for vdw and hbond.
// el and sol contributions are calculated at all distances.
// Cuttoff1: internuclear-distance at 8A only for vdw and hbond.
if (atomic_distance < 8.0f)
{
// 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));
#if 0
smoothed_intraE = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,12));
raw_intraE_vdw_hb = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,12));
#endif
#if 0
smoothed_intraE = native_divide(VWpars_AC_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,12));
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)
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
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));
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,10));
raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,10));
#endif
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,10));
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)
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
}
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));
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,6));
raw_intraE_vdw_hb -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(atomic_distance ,6));
#endif
#if 0
smoothed_intraE -= native_divide(VWpars_BD_const[atom1_typeid * dockpars_num_of_atypes+atom2_typeid],native_powr(smoothed_distance,6));
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)
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
}
} // if cuttoff - internuclear-distance at 8A
} // if cuttoff1 - internuclear-distance at 8A
// Calculating electrostatic term
partial_energies[get_local_id(0)] += native_divide (
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))))
);
#if 0
smoothed_intraE += native_divide (
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))))
);
raw_intraE_el = native_divide (
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))))
);
#endif
// Calculating energy contributions
// Cuttoff2: internuclear-distance at 20.48A only for el and sol.
if (atomic_distance < 20.48f)
{
// Calculating electrostatic term
partial_energies[get_local_id(0)] += native_divide (
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))))
);
#if 0
smoothed_intraE += native_divide (
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))))
);
raw_intraE_el = native_divide (
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))))
);
#endif
#if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += native_divide (
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))))
);
#endif
#if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += native_divide (
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))))
);
#endif
// Calculating desolvation term
// 1/25.92 = 0.038580246913580245
partial_energies[get_local_id(0)] += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
#if 0
smoothed_intraE += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
raw_intraE_sol = ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
#endif
// Calculating desolvation term
// 1/25.92 = 0.038580246913580245
partial_energies[get_local_id(0)] += ((dspars_S_const[atom1_typeid] +
#if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += ((dspars_S_const[atom1_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_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
#if 0
smoothed_intraE += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
raw_intraE_sol = ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
#endif
#if defined (DEBUG_ENERGY_KERNEL)
partial_intraE[get_local_id(0)] += ((dspars_S_const[atom1_typeid] +
dockpars_qasp*fabs(atom_charges_const[atom1_id]))*dspars_V_const[atom2_typeid] +
(dspars_S_const[atom2_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));
#endif
dockpars_coeff_desolv*native_exp(-0.03858025f*native_powr(atomic_distance, 2));
#endif
} // if cuttoff2 - internuclear-distance at 20.48A
......
......@@ -671,9 +671,7 @@ void gpu_calc_gradient(
}
// Calculating gradient contributions
// Cuttoff: internuclear-distance at 8A.
// Cutoff only for vdw and hbond.
// el and sol contributions are calculated at all distances.
// Cuttoff1: internuclear-distance at 8A only for vdw and hbond.
if (atomic_distance < 8.0f)
{
// Calculating van der Waals / hydrogen bond term
......@@ -691,22 +689,27 @@ void gpu_calc_gradient(
native_powr(smoothed_distance/*atomic_distance*/, 7)
);
}
} // if cuttoff - internuclear-distance at 8A
} // if cuttoff1 - internuclear-distance at 8A
// Calculating electrostatic term
// 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);
// Calculating energy contributions
// Cuttoff2: internuclear-distance at 20.48A only for el and sol.
if (atomic_distance < 20.48f)
{
// Calculating electrostatic term
// 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 lower = native_powr(atomic_distance, 2) * native_powr(DIEL_A * (native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K) + DIEL_B * native_exp(DIEL_B_TIMES_H*atomic_distance), 2);
float lower = native_powr(atomic_distance, 2) * native_powr(DIEL_A * (native_exp(DIEL_B_TIMES_H*atomic_distance) + DIEL_K) + DIEL_B * native_exp(DIEL_B_TIMES_H*atomic_distance), 2);
priv_gradient_per_intracontributor += -dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id] * native_divide (upper, lower);
priv_gradient_per_intracontributor += -dockpars_coeff_elec * atom_charges_const[atom1_id] * atom_charges_const[atom2_id] * native_divide (upper, lower);
// Calculating desolvation term
priv_gradient_per_intracontributor += (
(dspars_S_const[atom1_typeid] + dockpars_qasp*fabs(atom_charges_const[atom1_id])) * dspars_V_const[atom2_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));
// Calculating desolvation term
priv_gradient_per_intracontributor += (
(dspars_S_const[atom1_typeid] + dockpars_qasp*fabs(atom_charges_const[atom1_id])) * dspars_V_const[atom2_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));
} // if cuttoff2 - internuclear-distance at 20.48A
// Decomposing "priv_gradient_per_intracontributor"
// into the contribution of each atom of the pair
......
......@@ -2094,23 +2094,25 @@ float calc_intraE_f(const Liganddata* myligand,
if (debug == 1)
printf("van der Waals interaction = ");
}
vW += vdW1 - vdW2;
}
s1 = (myligand->solpar [type_id1] + qasp_mul_absq [atom_id1]);
s2 = (myligand->solpar [type_id2] + qasp_mul_absq [atom_id2]);
v1 = myligand->volume [type_id1];
v2 = myligand->volume [type_id2];
if (dist < 20.48)
{
s1 = (myligand->solpar [type_id1] + qasp_mul_absq [atom_id1]);
s2 = (myligand->solpar [type_id2] + qasp_mul_absq [atom_id2]);
v1 = myligand->volume [type_id1];
v2 = myligand->volume [type_id2];
if (debug == 1)
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]);
if (debug == 1)
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]);
vW += vdW1 - vdW2;
el += q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id];
desolv += (s1*v2 + s2*v1) * desolv_table [distance_id];
#if 0
el += q1q2[atom_id1][atom_id2] * r_epsr_table [distance_id];
desolv += (s1*v2 + s2*v1) * desolv_table [distance_id];
}
#endif
}
}
......
Markdown is supported
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