source: pcp/src/grad.h@ 88e890

Last change on this file since 88e890 was a0bcf1, checked in by Frederik Heber <heber@…>, 17 years ago

-initial commit
-Minimum set of files needed from ESPACK SVN repository
-Switch to three tantamount package parts instead of all relating to pcp (as at some time Ralf's might find inclusion as well)

  • Property mode set to 100644
File size: 3.3 KB
Line 
1#ifndef grad_h
2#define grad_h
3/** \file grad.h
4 * Header file for \ref grad.c
5 *
6 * Contains declarations of the functions implemented in \ref grad.c and
7 * enumeration of the various GradientTypes which is used in the Gradient
8 * structure herein discerning the various stages of finding the conjugate
9 * gradient direction.
10 *
11 *
12 Project: ParallelCarParrinello
13 Jan Hamaekers
14 2000
15
16 File: grad.h
17 $Id: grad.h,v 1.21 2007/02/09 09:22:05 foo Exp $
18*/
19
20
21// use double precision fft when we have it
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
26#ifdef HAVE_DFFTW_H
27#include "dfftw.h"
28#else
29#include "fftw.h"
30#endif
31
32
33#define MaxGradientArrayTypes 9 //!< number of different stages in the conjugate direction
34/// Enumerating the different Gradient types during the construction of the conjugate gradient
35enum GradientTypes { GraSchGradient, //!< set onto extra local Psi in order to orthonormalise CG by GramSch() (working array)
36 ActualGradient, //!< contains orthonormalized direction of steepest descent of step m \f$\zeta^{(m)}_i = - (H-\lambda_i)\psi^{(m)}_i\f$
37 OldActualGradient, //!< contains orthonormalized direction of steepest descent of step m-1 \f$\zeta^{(m-1)}_i = - (H-\lambda_i)\psi^{(m-1)}_i\f$
38 HcGradient, //!< contains gradient of wave function \f$\langle \chi_G| -\frac{1}{2}\nabla^2 + \underbrace{V^H + V^{ps,loc} + V^{XC}}_{V^{loc}} + V^{ps,nl} | \psi_i \rangle\f$
39 H1cGradient, //!< contains gradient of wave function \f$\langle {\cal H}^{(1)} | \psi_i^{(0)} \rangle\f$
40 PreConGradient, //!< contains preconditioned, orthonormalized direction of steepest descent \f$M \tilde{\zeta}_i\f$
41 ConDirGradient, //!< conjugate gradient direction of current step m, \f$\tilde{\tilde{\zeta}}_i^{(m)}\f$
42 OldConDirGradient, //!< old conjugate gradient direction of last step m-1, \f$\tilde{\tilde{\zeta}}_i^{(m-1)}\f$
43 TempGradient //!< temporary working gradient array
44 };
45
46/** Structure containing calculated conjugate gradient at its various stages.
47 */
48struct Gradient {
49 fftw_complex *GradientArray[MaxGradientArrayTypes]; //!< Array containing the conjugate direction: initial, steepest descent, preconditioned, conjugate, ...
50};
51
52void InitGradients(struct Problem *P, struct Gradient *Grad);
53void RemoveGradients(struct Problem *P, struct Gradient *Grad);
54void CalculateGradientNoRT(struct Problem *P, fftw_complex *source, const double PsiFactor, double *Lambda, fftw_complex ***fnl, fftw_complex *grad, fftw_complex *oldgrad, fftw_complex *Hc_grad);
55void CalculateNewWave(struct Problem *P, double *x);
56void CalculateConDirHConDir(struct Problem *P, fftw_complex *ConDir, const double PsiFactor, double *ConDirHConDir, double *HartreeddEddt0, double *XCddEddt0);
57double CalculateDeltaI(double E0, double dEdt0, double ddEddt0, double *E, double *dE, double *ddE, double *dcos, double *dsin);
58void CalculateHamiltonian(struct Problem *P);
59void CalculateUnOccupied(struct Problem *P);
60double GradSP(struct Problem *P, struct LatticeLevel *Lev, const fftw_complex *LPsiDatA, const fftw_complex *LPsiDatB);
61double GradImSP(struct Problem *P, struct LatticeLevel *Lev, fftw_complex *LPsiDatA, fftw_complex *LPsiDatB);
62double UpdateWaveAfterIonMove(struct Problem *P);
63#endif
Note: See TracBrowser for help on using the repository browser.