Skip to content

Commit

Permalink
Change to seperate features for twist-stack and hydrogen-bond IA.
Browse files Browse the repository at this point in the history
  • Loading branch information
fweik committed May 5, 2015
1 parent bdcc039 commit af74af0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 5 additions & 3 deletions src/core/energy_inline.hpp
Expand Up @@ -264,7 +264,7 @@ inline void add_non_bonded_pair_energy(Particle *p1, Particle *p2, double d[3],
inline void add_bonded_energy(Particle *p1)
{
Particle *p2, *p3 = NULL, *p4 = NULL;
#ifdef CG_DNA
#ifdef TWIST_STACK
Particle *p5 = NULL,*p6 = NULL,*p7 = NULL,*p8 = NULL;
#endif
Bonded_ia_parameters *iaparams;
Expand Down Expand Up @@ -311,7 +311,7 @@ inline void add_bonded_energy(Particle *p1)
return;
}
}
#ifdef CG_DNA
#ifdef TWIST_STACK
if(n_partners >= 7) {
p5 = local_particles[p1->bl.e[i++]];
p6 = local_particles[p1->bl.e[i++]];
Expand Down Expand Up @@ -361,10 +361,12 @@ inline void add_bonded_energy(Particle *p1)
bond_broken = angle_energy(p1, p2, p3, iaparams, &ret);
break;
#endif
#ifdef CG_DNA
#ifdef TWIST_STACK
case BONDED_IA_CG_DNA_STACKING:
bond_broken = calc_twist_stack_energy(p1, p2, p3, p4, p5, p6, p7, p8, iaparams, &ret);
break;
#endif
#ifdef HYDROGEN_BOND
case BONDED_IA_CG_DNA_BASEPAIR:
bond_broken = calc_hydrogen_bond_energy(p1, p2, p3, p4, iaparams, &ret);
break;
Expand Down
8 changes: 5 additions & 3 deletions src/core/forces_inline.hpp
Expand Up @@ -598,7 +598,7 @@ inline void add_bonded_force(Particle *p1)
double force[3] = { 0., 0., 0. };
double force2[3] = { 0., 0., 0. };
double force3[3] = { 0., 0., 0. };
#ifdef CG_DNA
#ifdef TWIST_STACK
double force4[3] = { 0., 0., 0. };
double force5[3] = { 0., 0., 0. };
double force6[3] = { 0., 0., 0. };
Expand Down Expand Up @@ -657,7 +657,7 @@ inline void add_bonded_force(Particle *p1)
return;
}
}
#ifdef CG_DNA
#ifdef TWIST_STACK
if(n_partners >= 7) {
p5 = local_particles[p1->bl.e[i++]];
p6 = local_particles[p1->bl.e[i++]];
Expand Down Expand Up @@ -709,10 +709,12 @@ inline void add_bonded_force(Particle *p1)
case BONDED_IA_AREA_FORCE_LOCAL:
bond_broken = calc_area_force_local(p1, p2, p3, iaparams, force, force2, force3);
break;
#ifdef CG_DNA
#ifdef HYDROGEN_BOND
case BONDED_IA_CG_DNA_BASEPAIR:
bond_broken = calc_hydrogen_bond_force(p1, p2, p3, p4, iaparams, force, force2, force3, force4);
break;
#endif
#ifdef TWIST_STACK
case BONDED_IA_CG_DNA_STACKING:
bond_broken = calc_twist_stack_force(p1, p2, p3, p4, p5, p6, p7, p8, iaparams,
force, force2, force3, force4, force5, force6, force7, force8);
Expand Down
6 changes: 3 additions & 3 deletions src/core/hydrogen_bond.hpp
Expand Up @@ -19,15 +19,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CG_DNA_HPP
#define CG_DNA_HPP
#ifndef __HYDROGEN_BOND_HPP
#define __HYDROGEN_BOND_HPP

#include "utils.hpp"
#include "interaction_data.hpp"
#include "particle_data.hpp"
#include "grid.hpp"

#ifdef HYRDOGEN_BOND
#ifdef HYDROGEN_BOND

int hydrogen_bond_set_params(int bond_type, DoubleList *params);

Expand Down
4 changes: 3 additions & 1 deletion src/tcl/interaction_data_tcl.cpp
Expand Up @@ -1018,8 +1018,10 @@ int tclcommand_inter_parse_bonded(Tcl_Interp *interp,
#ifdef BOND_VIRTUAL
REGISTER_BONDED("virtual_bond", tclcommand_inter_parse_virtual_bonds);
#endif
#ifdef CG_DNA
#ifdef HYDROGEN_BOND
REGISTER_BONDED("hydrogen_bond", tclcommand_inter_parse_hydrogen_bond);
#endif
#ifdef TWIST_STACK
REGISTER_BONDED("twist_stack", tclcommand_inter_parse_twist_stack);
#endif
Tcl_AppendResult(interp, "unknown bonded interaction type \"", argv[0],
Expand Down

0 comments on commit af74af0

Please sign in to comment.