30 #ifndef INCLUDED_core_scoring_etable_Etable_hh
31 #define INCLUDED_core_scoring_etable_Etable_hh
48 #include <utility/pointer/access_ptr.hh>
51 #include <ObjexxFCL/FArray1D.hh>
52 #include <ObjexxFCL/FArray1A.hh>
53 #include <ObjexxFCL/FArray2D.hh>
54 #include <ObjexxFCL/FArray3D.hh>
56 #include <utility/assert.hh>
57 #include <utility/pointer/ReferenceCount.hh>
59 #include <ObjexxFCL/FArray1.fwd.hh>
60 #include <ObjexxFCL/FArray2.fwd.hh>
183 ObjexxFCL::FArray3D< Real >
const &
189 ObjexxFCL::FArray3D< Real >
const &
195 ObjexxFCL::FArray3D< Real >
const &
201 ObjexxFCL::FArray3D< Real >
const &
208 ObjexxFCL::FArray3D< Real >
const &
214 ObjexxFCL::FArray3D< Real >
const &
221 ObjexxFCL::FArray3D< Real >
const &
228 ObjexxFCL::FArray3D< Real >
const &
493 ObjexxFCL::FArray3D<Real> & etable,
500 ObjexxFCL::FArray3D<Real> & etable,
659 int const normal_disbins,
660 ObjexxFCL::FArray1A< Real >
ljatr,
661 ObjexxFCL::FArray1A< Real >
dljatr,
662 ObjexxFCL::FArray1A< Real >
ljrep,
663 ObjexxFCL::FArray1A< Real >
dljrep,
664 ObjexxFCL::FArray1A< Real > fasol1,
665 ObjexxFCL::FArray1A< Real > fasol2,
666 ObjexxFCL::FArray1A< Real > dfasol,
667 ObjexxFCL::FArray1A< Real > dfasol1
674 ObjexxFCL::FArray1A< Real >
ljatr,
675 ObjexxFCL::FArray1A< Real >
dljatr,
676 ObjexxFCL::FArray1A< Real >
ljrep,
677 ObjexxFCL::FArray1A< Real >
dljrep,
678 ObjexxFCL::FArray1A< Real > fasol1,
679 ObjexxFCL::FArray1A< Real > fasol2,
680 ObjexxFCL::FArray1A< Real > dfasol,
681 ObjexxFCL::FArray1A< Real > dfasol1
688 ObjexxFCL::FArray1A< Real >
ljatr,
689 ObjexxFCL::FArray1A< Real >
dljatr,
690 ObjexxFCL::FArray1A< Real >
ljrep,
691 ObjexxFCL::FArray1A< Real >
dljrep,
692 ObjexxFCL::FArray1A< Real > fasol1,
693 ObjexxFCL::FArray1A< Real > fasol2,
694 ObjexxFCL::FArray1A< Real > dfasol,
695 ObjexxFCL::FArray1A< Real > dfasol1
702 ObjexxFCL::FArray1A< Real >
ljatr,
703 ObjexxFCL::FArray1A< Real >
dljatr,
704 ObjexxFCL::FArray1A< Real >
ljrep,
705 ObjexxFCL::FArray1A< Real >
dljrep,
706 ObjexxFCL::FArray1A< Real > fasol1,
707 ObjexxFCL::FArray1A< Real > fasol2,
708 ObjexxFCL::FArray1A< Real > dfasol,
709 ObjexxFCL::FArray1A< Real > dfasol1
716 ObjexxFCL::FArray1A< Real >
ljrep,
717 ObjexxFCL::FArray1A< Real >
ljatr,
718 ObjexxFCL::FArray1A< Real >
dljatr,
719 ObjexxFCL::FArray1A< Real > fasol1,
720 ObjexxFCL::FArray1A< Real > fasol2,
721 ObjexxFCL::FArray1A< Real > dfasol,
722 ObjexxFCL::FArray1A< Real > dfasol1
728 ObjexxFCL::FArray2< Real > & lj_sigma,
729 ObjexxFCL::FArray2< Real > & lj_r6_coeff,
730 ObjexxFCL::FArray2< Real > & lj_r12_coeff,
731 ObjexxFCL::FArray2< Real > & lj_switch_intercept,
732 ObjexxFCL::FArray2< Real > & lj_switch_slope,
733 ObjexxFCL::FArray1< Real > & lk_inv_lambda2,
734 ObjexxFCL::FArray2< Real > & lk_coeff,
735 ObjexxFCL::FArray2< Real > & lk_min_dis2sigma_value
751 ObjexxFCL::FArray2< Real > & lj_sigma,
752 ObjexxFCL::FArray2< Real > & lj_r6_coeff,
753 ObjexxFCL::FArray2< Real > & lj_r12_coeff,
754 ObjexxFCL::FArray2< Real > & lj_switch_intercept,
755 ObjexxFCL::FArray2< Real > & lj_switch_slope,
756 ObjexxFCL::FArray1< Real > & lk_inv_lambda2,
757 ObjexxFCL::FArray2< Real > & lk_coeff,
758 ObjexxFCL::FArray2< Real > & lk_min_dis2sigma_value
778 using namespace core;
779 using namespace core::scoring::etable;
780 dis2 = at1.
xyz().distance_squared( at2.
xyz() );
784 lj_atrE = 0; lj_repE = 0; fa_solE = 0;
798 if ( dis2 > p.maxd2 )
return;
806 Real const dis = std::sqrt(dis2);
807 Real const inv_dis = 1.0/dis;
808 Real const inv_dis2 = inv_dis * inv_dis;
810 if ( dis2 < p.ljrep_linear_ramp_d2_cutoff ) {
813 }
else if ( dis < p.ljatr_spline_xlo ) {
816 }
else if ( dis < p.ljatr_spline_xhi ) {
826 if ( p.ljrep_from_negcrossing ) {
829 if (ljE < 0 ) atrE = ljE;
831 }
else if ( dis < p.lj_minimum ) {
832 atrE = p.lj_val_at_minimum;
833 repE = ljE - p.lj_val_at_minimum;
842 if ( dis < exrep.xhi ) {
843 if ( dis < exrep.xlo ) {
846 repE += ( exrep.xhi - dis ) * ( exrep.xhi - dis ) * exrep.slope;
851 lj_atrE = atrE * p.ljatr_final_weight;
859 if ( dis < p.fasol_spline_close_start ) {
860 fa_solE = p.fasol_spline_close.ylo * p.fasol_final_weight;
861 }
else if ( dis < p.fasol_spline_close_end ) {
862 fa_solE =
eval_spline( dis, p.fasol_spline_close_start, p.fasol_spline_close_end, p.fasol_spline_close );
863 fa_solE *= p.fasol_final_weight;
878 fa_solE = inv_dis2 * ( std::exp(-x1) * p.lk_coeff1 + std::exp(-x2) * p.lk_coeff2 );
879 fa_solE *= p.fasol_final_weight;
885 p.fasol_spline_far );
891 fa_solE *= p.fasol_final_weight;
908 using namespace core;
909 using namespace core::scoring::etable;
910 Real dis2 = at1.
xyz().distance_squared( at2.
xyz() );
914 dljatrE_ddis = dljrepE_ddis = dfasolE_ddis = 0.0; inv_d = 1;
917 Real dljE(1), inv_dis6(1);
925 if ( dis2 > p.maxd2 )
return;
933 Real const dis = std::sqrt(dis2);
934 Real const inv_dis = 1.0/dis; inv_d = inv_dis;
935 Real const inv_dis2 = inv_dis * inv_dis;
937 if ( dis2 < p.ljrep_linear_ramp_d2_cutoff ) {
939 dljE = p.lj_switch_slope;
940 }
else if ( dis < p.ljatr_spline_xlo ) {
942 inv_dis6 = inv_dis2 * inv_dis2 * inv_dis2;
943 Real const inv_dis7 = inv_dis * inv_dis6;
945 dljE = inv_dis7 * ( -12.*p.lj_r12_coeff * inv_dis6 - 6.* p.lj_r6_coeff );
946 }
else if ( dis < p.ljatr_spline_xhi ) {
956 if ( p.ljrep_from_negcrossing ) {
960 if ( dis2 < p.ljrep_linear_ramp_d2_cutoff || inv_dis6*( p.lj_r12_coeff*inv_dis6 + p.lj_r6_coeff ) > 0.0 ) {
963 }
else if ( dis < p.lj_minimum ) {
974 if ( dis < exrep.xhi ) {
975 if ( dis < exrep.xlo ) {
978 dljrepE_ddis += -2 * ( exrep.xhi - dis ) * exrep.slope;
982 dljatrE_ddis *= p.ljatr_final_weight;
989 if ( dis < p.fasol_spline_close_start ) {
991 }
else if ( dis < p.fasol_spline_close_end ) {
992 dfasolE_ddis =
spline_deriv( dis, p.fasol_spline_close_start, p.fasol_spline_close_end, p.fasol_spline_close );
993 dfasolE_ddis *= p.fasol_final_weight;
1008 Real const solvE1 = std::exp(-x1) * p.lk_coeff1 * inv_dis2;
1009 Real const solvE2 = std::exp(-x2) * p.lk_coeff2 * inv_dis2;
1011 dfasolE_ddis *= p.fasol_final_weight;
1017 p.fasol_spline_far ) *
1018 p.fasol_final_weight;
1065 Real const ASSERT_ONLY( dis2 ),
1066 Real const inv_dis2,
1072 Real const inv_dis6 = inv_dis2 * inv_dis2 * inv_dis2;
1087 assert( x >= xlo && x <= xhi );
1088 Real width = xhi - xlo;
1089 return eval_spline( x, xlo, xhi, width, 1/width, sp );
1101 assert( x >= xlo && x <= xhi );
1102 Real width = xhi - xlo;
1103 return spline_deriv( x, xlo, xhi, width, 1/width, sp );
1113 Real const invwidth,
1117 Real a = ( xhi - x ) * invwidth;
1118 Real b = ( x - xlo ) * invwidth;
1119 return a*sp.
ylo + b*sp.
yhi + ((a*a*a-a)*sp.
y2lo + (b*b*b-b)*sp.
y2hi)*width*width / 6;
1129 Real const invwidth,
1133 Real a = ( xhi - x ) * invwidth;
1134 Real b = ( x - xlo ) * invwidth;
1135 return -1*invwidth*sp.
ylo + invwidth*sp.
yhi + ((1 - 3*a*a )*sp.
y2lo + (3*b*b - 1 )*sp.
y2hi)*width / 6;
1177 Size i1 = atype1 < atype2 ? atype1 : atype2;
1178 Size i2 = atype1 < atype2 ? atype2 : atype1;
1190 Size i1 = atype1 < atype2 ? atype1 : atype2;
1191 Size i2 = atype1 < atype2 ? atype2 : atype1;