source: pcp/src/ions.h@ 64ca279

Last change on this file since 64ca279 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: 4.9 KB
Line 
1#ifndef ions_h
2#define ions_h
3
4/** \file ions.h
5 * Header file for \ref ions.c
6 *
7 * Contains declarations of the functions implemented in \ref ions.c,
8 * enumerations such CoreCorrType - whether the config file has values for the
9 * core electron density - or IonMoveType - is the ion allowed to move or not -
10 * and structures for IonType, containg all Ions of a atomic type, which are all
11 * attached to Ions.
12 *
13 Project: ParallelCarParrinello
14 Jan Hamaekers
15 2000
16
17 File: ions.h
18 $Id: ions.h,v 1.19 2007/02/09 09:13:48 foo Exp $
19*/
20
21
22// use double precision fft when available
23#ifdef HAVE_CONFIG_H
24#include <config.h>
25#endif
26
27#ifdef HAVE_DFFTW_H
28#include "dfftw.h"
29#else
30#include "fftw.h"
31#endif
32
33enum CoreCorrType { NotCoreCorrected, CoreCorrected}; //!< Pseudopotential: Whether there is a correction factor for the potential ansatz or not
34#define MaxIonMoveType 2 //!< Number of different IonMoveType
35enum IonMoveType { MoveIon, FixedIon}; //!< Whether the Ion is movable or not (influences kinetic energy among others)
36
37/** Structure containing data for a single ion type.
38 * Contains Mass, atomic number, number of types, coordinates (current and the
39 * last two old positions), forces (and last one), velocity, some Pseudopotential
40 * values
41 */
42struct IonType { /* A single Ion */
43 int Z; //!< Atomic number of ion
44 double IonMass; //!< Mass of ion
45 int Max_IonsOfType; //!< Maximum number of ions of this type (needed for memory allocation)
46 double *R; //!< coordinate (x,y,z) array for all ions of this type R[i][j] (i=x,y,z;j=1,..)
47 double *R_old; //!< (?) Remembers last position (two-dim array, see IonType::R)
48 double *R_old_old; //!< (?) Remembers position before the last one (two-dim array, see IonType::R)
49 double *FIon; //!< (?) Overall force acting on the ion (two-dim array, see IonType::R)
50 double *FIonL; //!< (?) Linear force acting on the ion (two-dim array, see IonType::R)
51 double *FIonNL; //!< (?) Nonlinear force acting on the ion (two-dim array, see IonType::R)
52 double *U; //!< Velocity of the ion (two-dim array, see IonType::R)
53 double *FIon_old; //!< (?) Remembers prior force acting on the ion (two-dim array, see IonType::R)
54 double *FEwald; //!< (?) Ewald force (two-dim array, see IonType::R)
55 double IonFac; //!< mass-like factor in CG structure optimization to determinte step width
56 double *GammaA; //!<
57 double *SearchDir; //!<
58 double rgauss; //!< Gauss radius
59 double *alpha; //!< parameter for CSDGT gauge, see ShiftGaugeOrigin()
60 int l_max; //!< (?) Pseudopotential specific value
61 int l_loc; //!< (?) Pseudopotential specific value
62 double ZFactor; //!< (?) CalcVIFactor
63 fftw_complex *SFactor; //!< structure factor, \f$S_{I_s} (G) \f$, thereby the centre of a potential is shifted away from the origin
64 enum CoreCorrType corecorr; //!< (?) Core correction due to pseudo potential ansatz
65 enum IonMoveType *IMT; //!< Ion is moving or fixed
66 char *Name; //!< name of ion's element
67 char *Symbol; //!< short form of ion's element
68 double **sigma; //!< shielding tensor
69 double **sigma_rezi; //!< shielding tensor for reciprocal calculation
70 double **sigma_PAS; //!< Principal Axis System shielding tensor
71 double **sigma_rezi_PAS; //!< Principal Axis System shielding tensor for reciprocal calculation
72 double chi[NDIM*NDIM]; //!< magnetic susceptibility
73 double chi_PAS[NDIM]; //!< Principal Axis System magnetic susceptibility
74};
75
76/** Containing structure for all ion data.
77 * Contains max types, counts, cut values, temperature and total mass among others
78 */
79struct Ions { /* All Ions */
80 int Max_Types; //!< Number of types overall (needed for memory allocation)
81 int Max_TotalIons; //!< Maximum of of total ions (needed for memory allocation)
82 int Max_Max_IonsOfType; //!< Maximum of ions per type (needed for memory allocation)
83 int TotalZval;
84 struct IonType *I; //!< Structure containing data for each type
85 /* Ewald */
86 double R_cut; //!< Radial cut value
87 int MaxVec;
88 int MaxLocalVec;
89 double *RLatticeVec;
90 double *FTemp; //!<
91 double EKin; //!< Kinetic energy of electrons
92 double ActualTemp; //!< Actual temperature
93 double TotalMass; //!< Total mass of all ions in the structure
94 int StructOpt; //!< whether structure optimization (1) (with CG) or MD (0) shall be done
95};
96
97
98/* Functions */
99void IonsInitRead(struct Problem *P, FILE *source);
100void CalculateEwald(struct Problem *P, int first);
101void RemoveIonsRead(struct Ions *I);
102/*void CalculateIonLocalForce(struct Problem *P);*/
103void CalculateIonForce(struct Problem *P);
104void OutputIonForce(struct Problem *P);
105void OutputIonCoordinates(struct Problem *P);
106void UpdateIons(struct Problem *P);
107void UpdateIonsR(struct Problem *P);
108void UpdateIonsU(struct Problem *P);
109void CalculateEnergyIonsU(struct Problem *P);
110void ScaleTemp(struct Problem *P);
111void GetOuterStop(struct Problem *P);
112void CorrectForces(struct Problem *P);
113void CorrectVelocity(struct Problem *P);
114#endif
Note: See TracBrowser for help on using the repository browser.