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