#ifndef pseudo_h #define pseudo_h /** \file pseudo.h * Header file for \ref pseudo.c * * Contains declarations of the functions implemented in \ref pseudo.c and * the PseudoPot'ential structure. * Project: ParallelCarParrinello Jan Hamaekers 2000 File: pseudo.h $Id: pseudo.h,v 1.19 2007/02/05 16:04:23 foo Exp $ */ // use double precision fft when we have it #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_DFFTW_H #include "dfftw.h" #else #include "fftw.h" #endif struct Problem; /** Pseudopotential structure. * Contains paramaters, form factors, positions of the for the plane waves * needed Pseudopotentials which merge fixed core electron with the core itself. */ struct PseudoPot { double *zval; int *nang; /* Potential Parameters */ double **r; //!< radial mesh for ion type double ***v; //!< Potential double ***R; //!< Radial density \f$R_{I_s,l} (r)\f$ double ***v_loc; //!< Pseudo potentials \f$\nu^{ps}_{I_s} \f$, read from file in InitPseudoRead() double *clog; //!< Integration width in Simpson formula, see Simps() int *mmax; //!< array of number of mesh points (array size of \a **r and others) over ion type /* Gaussian */ double **core; double **rc; double ***rcl; double ***al; double ***bl; double **FacGauss; //!< Gaussian form factor \f$\phi_{I_s}^{Gauss} (G)\f$ /* formfacLocPot */ int Mmax; //!< maximum number of mesh points of all ion types double **integrand2; //!< temporary array containing integrand in evaluating form factor **vpsloc double *integrand; //!< temporary array containing integrand in evaluating form factor **vpsloc double *integrand1; //!< temporary array containing partial integrand in evaluating form factor **vpsloc double ***phi_ps_nl; //!< non-local pseudopotential form factor for certain ion type, l and m (2l+1 ones per l!) value \f$\phi^{ps,nl}_{I_s,l,m}\f$, \sa FormFacNonLocPot() //double ***phi_ps_nl_a; //!< sort of backup array for PseudoPot::pkg double **phi_ps_loc; //!< local pseudo potential form factor for certain ion type on reciprocal mesh \f$\phi^{ps,loc}_{I_s}\f$, \sa FormFacLocPot() double **wNonLoc; //!< non-local pseudopotential weight \f$w^{nl}_{I_s,l}\f$, \sa FormFacNonLocPot() fftw_complex ****fnl; //!< factors of non-local pseudopotential energy, array containing \f$f^{nl}_{i,I_s,I_a,l,m}\f$ for a certain wave function i, ion of type, ion of type \f$I_s \f$and lm value, \sa CalculateNonLocalEnergyNoRT() fftw_complex ***CDfnl; //!< factors of non-local pseudopotential energy for conjugate direction (CD), array for a certain ion type, ion of type and lm value fftw_complex *dfnl; //!< temporary array containing part (of one process) of non-local factors \f$f^{nl}_{i,I_s,I_a,l,m}\f$ for a certain ion of type, , \sa CalculateNonLocalEnergyNoRT() fftw_complex *VCoulombc; //!< Coulomb or Hartree potential and local pseudopotenial \f$\frac{4\pi}{V|G|^2} |\hat{\widetilde{n}}(G)|^2 + \sum_{I_s} S_{I_s} (G) \phi^{ps,loc}_{I_s} (G) \hat{n}^\ast (G)\f$ fftw_complex ***ei; //!< topmost (zeroth) level: \f$\exp(i R_{I_s,I_a}\cdot G)\f$, three-dimensional array over ion type, ion of type and grid vector in LatticeLevel::GArray fftw_complex ***expiGR; //!< standard level: \f$\exp(i(G \cdot R))\f$ for each ion type, ion of type and grid vector, \sa CalcExpiGR() int *lm_end; //!< array of over ion type \f$I_S\f$ containing its topmost m eigenvalue int lm_endmax; //!< maximum m eigenvalue of all ion types double *rr; fftw_complex *t; struct Plans *P; double fac1sqrt2PI; //!< factor: \f$\frac{1}{\sqrt{2\pi}}\f$ double fac1sqrtPI; //!< factor: \f$\frac{1}{\sqrt{\pi}}\f$ double **corewave; double **formfCore; //!< partial core form factor, \f$\phi^{pc}_{I_s}(G)\f$ enum CoreCorrType corecorr; }; void InitPseudoRead(struct Problem *P, char *mainname); void ChangePseudoToLevUp(struct Problem *P); void UpdatePseudoToNewWaves(struct Problem *P); void RemovePseudoRead(struct Problem *P); void CalculateNonLocalEnergyNoRT(struct Problem *P, const int i); void CalculateNonLocalEnergyUseRT(struct Problem *P, const int i); void CalculateGaussSelfEnergyNoRT(struct Problem *P, struct PseudoPot *PP, struct Ions *I); void CalculateSomeEnergyAndHGNoRT(struct Problem *P); void CalculateAddNLPot(struct Problem *P, fftw_complex *HNL, fftw_complex ***fnl, double PsiFactor); void CalculateCDfnl(struct Problem *P, fftw_complex *ConDir, fftw_complex ***CDfnl); void CalculateIonLocalForce(struct Problem *P); void CalculateIonNonLocalForce(struct Problem *P); #endif