3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
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
33 * Gromacs Runs On Most of All Computer Systems
45 #include "gmxcomplex.h"
48 extern int gmx_pppm_init(FILE *log
, t_commrec
*cr
,
49 const output_env_t oenv
, bool bVerbose
,
50 bool bOld
, matrix box
,
51 char *ghatfn
, t_inputrec
*ir
,
53 /* Setup stuff for PPPM.
54 * Either reads a ghat function from file (when the file exists)
55 * or generate a ghat function from scratch.
58 extern int gmx_pppm_do(FILE *log
, gmx_pme_t pme
,
61 real charge
[], rvec box
,
62 real phi
[], t_commrec
*cr
,
65 int pme_order
, real
*energy
);
66 /* Do a PPPM calculation for the long range electrostatics. */
68 /******************************************************************
70 * ROUTINES FOR GHAT MANIPULATION
72 ******************************************************************/
74 extern real
gk(real k
,real rc
,real r1
);
75 /* Compute the Ghat function for a single k-value */
77 extern real
gknew(real k
,real rc
,real r1
);
78 /* Compute the (new!) Ghat function for a single k-value */
80 extern void pr_scalar_gk(const char *fn
,const output_env_t oenv
,
81 int nx
,int ny
,int nz
, rvec box
,real
***ghat
);
83 extern void mk_ghat(FILE *fp
,int nx
,int ny
,int nz
,
84 real
***ghat
, rvec box
,real r1
,real rc
,bool bSym
,bool bOld
);
85 /* Generate a Ghat function from scratch. The ghat grid should
86 * be allocated using the mk_rgrid function. When bSym, only
87 * the first octant of the function is generated by direct calculation
88 * and the above mentioned function is called for computing the rest.
89 * When !bOld a new experimental function form will be used.
92 extern real
***rd_ghat(FILE *log
,const output_env_t oenv
,char *fn
,ivec igrid
,
93 rvec gridspacing
, rvec beta
,int *porder
,
94 real
*rshort
,real
*rlong
);
95 /* Read a Ghat function from a file as generated by the program
96 * mk_ghat. The grid size (number of grid points) is returned in
97 * igrid, the space between grid points in gridspacing,
98 * beta is a constant that determines the contribution of first
99 * and second neighbours in the grid to the force
100 * (See Luty et al. JCP 103 (1995) 3014)
101 * porder determines whether 8 (when porder = 1) or 27 (when
102 * porder = 2) neighbouring grid points are used for spreading
104 * rshort and rlong are the lengths used for generating the Ghat
108 extern void wr_ghat(const char *fn
,const output_env_t oenv
,
109 int n1max
,int n2max
, int n3max
,real h1
,
110 real h2
,real h3
,real
***ghat
,int nalias
,
111 int porder
,int niter
,bool bSym
,rvec beta
,
112 real r1
,real rc
,real pval
,real zval
,real eref
,real qopt
);
113 /* Write a ghat file. (see above) */