Added snew_aligned and sfree_aligned for managing n-byte-
[gromacs.git] / include / bondf.h
blob97ec6a00eb3a1cad48aa7a59577b88bb3f98e1a2
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * Gromacs Runs On Most of All Computer Systems
36 #ifndef _bondf_h
37 #define _bondf_h
39 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
43 #include <stdio.h>
44 #include "typedefs.h"
45 #include "nrnb.h"
46 #include "pbc.h"
47 #include "genborn.h"
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
53 extern int glatnr(int *global_atom_index,int i);
54 /* Returns the global topology atom number belonging to local atom index i.
55 * This function is intended for writing ascii output
56 * and returns atom numbers starting at 1.
57 * When global_atom_index=NULL returns i+1.
60 extern void calc_bonds(FILE *fplog,const gmx_multisim_t *ms,
61 const t_idef *idef,
62 rvec x[],history_t *hist,
63 rvec f[],t_forcerec *fr,
64 const t_pbc *pbc,const t_graph *g,
65 gmx_enerdata_t *enerd,t_nrnb *nrnb,real lambda,
66 const t_mdatoms *md,
67 t_fcdata *fcd,int *ddgatindex,
68 t_atomtypes *atype, gmx_genborn_t *born,
69 bool bPrintSepPot,gmx_large_int_t step);
70 /*
71 * The function calc_bonds() calculates all bonded force interactions.
72 * The "bonds" are specified as follows:
73 * int nbonds
74 * the total number of bonded interactions.
75 * t_iatom *forceatoms
76 * specifies which atoms are involved in a bond of a certain
77 * type, see also struct t_idef.
78 * t_functype *functype
79 * defines for every bonded force type what type of function to
80 * use, see also struct t_idef.
81 * t_iparams *forceparams
82 * defines the parameters for every bond type, see also struct
83 * t_idef.
84 * real epot[NR_F]
85 * total potential energy split up over the function types.
86 * int *ddgatindex
87 * global atom number indices, should be NULL when not using DD.
88 * bool bPrintSepPot
89 * if TRUE print local potential and dVdlambda for each bonded type.
90 * int step
91 * used with bPrintSepPot
92 * return value:
93 * the total potential energy (sum over epot).
96 extern void calc_bonds_lambda(FILE *fplog,
97 const t_idef *idef,
98 rvec x[],
99 t_forcerec *fr,
100 const t_pbc *pbc,const t_graph *g,
101 gmx_enerdata_t *enerd,t_nrnb *nrnb,
102 real lambda,
103 const t_mdatoms *md,
104 t_fcdata *fcd,int *global_atom_index);
105 /* As calc_bonds, but only determines the potential energy
106 * for the perturbed interactions.
107 * The shift forces in fr are not affected.
110 extern real posres(int nbonds,
111 const t_iatom forceatoms[],const t_iparams forceparams[],
112 const rvec x[],rvec f[],rvec vir_diag,
113 t_pbc *pbc,
114 real lambda,real *dvdlambda,
115 int refcoord_scaling,int ePBC,rvec comA,rvec comB);
116 /* Position restraints require a different pbc treatment from other bondeds */
118 extern real bond_angle(const rvec xi,const rvec xj,const rvec xk,
119 const t_pbc *pbc,
120 rvec r_ij,rvec r_kj,real *costh,
121 int *t1,int *t2); /* out */
122 /* Calculate bond-angle. No PBC is taken into account (use mol-shift) */
124 extern real dih_angle(const rvec xi,const rvec xj,const rvec xk,const rvec xl,
125 const t_pbc *pbc,
126 rvec r_ij,rvec r_kj,rvec r_kl,rvec m,rvec n, /* out */
127 real *sign,
128 int *t1,int *t2,int *t3);
129 /* Calculate dihedral-angle. No PBC is taken into account (use mol-shift) */
131 extern void do_dih_fup(int i,int j,int k,int l,real ddphi,
132 rvec r_ij,rvec r_kj,rvec r_kl,
133 rvec m,rvec n,rvec f[],rvec fshift[],
134 const t_pbc *pbc,const t_graph *g,
135 const rvec *x,int t1,int t2,int t3);
136 /* Do an update of the forces for dihedral potentials */
138 /*************************************************************************
140 * Bonded force functions
142 *************************************************************************/
143 extern t_ifunc bonds,g96bonds,morse_bonds,cubic_bonds,FENE_bonds,restraint_bonds;
144 extern t_ifunc angles,g96angles,cross_bond_bond,cross_bond_angle,urey_bradley,quartic_angles;
145 extern t_ifunc pdihs,idihs,rbdihs;
146 extern t_ifunc tab_bonds,tab_angles,tab_dihs;
147 extern t_ifunc polarize,water_pol,thole_pol,angres,angresz,unimplemented;
149 #ifdef __cplusplus
151 #endif
153 #endif /* _bondf_h */