Merge branch 'release-4-5-patches' of git@git.gromacs.org:gromacs into release-4...
[gromacs/rigid-bodies.git] / include / pppm.h
blob887a263114c3860f32c364e89f22ec2f5a306690
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 _pppm_h
37 #define _pppm_h
39 #include <stdio.h>
40 #include "typedefs.h"
41 #include "gmxcomplex.h"
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 int gmx_pppm_init(FILE *log, t_commrec *cr,
48 const output_env_t oenv, gmx_bool bVerbose,
49 gmx_bool bOld, matrix box,
50 char *ghatfn, t_inputrec *ir,
51 gmx_bool bReproducible);
52 /* Setup stuff for PPPM.
53 * Either reads a ghat function from file (when the file exists)
54 * or generate a ghat function from scratch.
57 int gmx_pppm_do(FILE *log, gmx_pme_t pme,
58 gmx_bool bVerbose,
59 rvec x[], rvec f[],
60 real charge[], rvec box,
61 real phi[], t_commrec *cr,
62 int start, int nt,
63 t_nrnb *nrnb,
64 int pme_order, real *energy);
65 /* Do a PPPM calculation for the long range electrostatics. */
67 /******************************************************************
69 * ROUTINES FOR GHAT MANIPULATION
71 ******************************************************************/
73 real gk(real k,real rc,real r1);
74 /* Compute the Ghat function for a single k-value */
76 real gknew(real k,real rc,real r1);
77 /* Compute the (new!) Ghat function for a single k-value */
79 void pr_scalar_gk(const char *fn,const output_env_t oenv,
80 int nx,int ny,int nz, rvec box,real ***ghat);
82 void mk_ghat(FILE *fp,int nx,int ny,int nz,
83 real ***ghat, rvec box,real r1,real rc,gmx_bool bSym,gmx_bool bOld);
84 /* Generate a Ghat function from scratch. The ghat grid should
85 * be allocated using the mk_rgrid function. When bSym, only
86 * the first octant of the function is generated by direct calculation
87 * and the above mentioned function is called for computing the rest.
88 * When !bOld a new experimental function form will be used.
91 real ***rd_ghat(FILE *log,const output_env_t oenv,char *fn,ivec igrid,
92 rvec gridspacing, rvec beta,int *porder,
93 real *rshort,real *rlong);
94 /* Read a Ghat function from a file as generated by the program
95 * mk_ghat. The grid size (number of grid points) is returned in
96 * igrid, the space between grid points in gridspacing,
97 * beta is a constant that determines the contribution of first
98 * and second neighbours in the grid to the force
99 * (See Luty et al. JCP 103 (1995) 3014)
100 * porder determines whether 8 (when porder = 1) or 27 (when
101 * porder = 2) neighbouring grid points are used for spreading
102 * the charge.
103 * rshort and rlong are the lengths used for generating the Ghat
104 * function.
107 void wr_ghat(const char *fn,const output_env_t oenv,
108 int n1max,int n2max, int n3max,real h1,
109 real h2,real h3,real ***ghat,int nalias,
110 int porder,int niter,gmx_bool bSym,rvec beta,
111 real r1,real rc,real pval,real zval,real eref,real qopt);
112 /* Write a ghat file. (see above) */
114 #ifdef __cplusplus
116 #endif
118 #endif