source: pcp/src/ions.h@ 963310a

Last change on this file since 963310a was 094b41, checked in by Frederik Heber <heber@…>, 17 years ago

enum thermostats with all the thermostat names

  • Property mode set to 100644
File size: 5.3 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#define MaxThermostats 6 //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
38enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover }; //!< Thermostat names for output
39
40/** Structure containing data for a single ion type.
41 * Contains Mass, atomic number, number of types, coordinates (current and the
42 * last two old positions), forces (and last one), velocity, some Pseudopotential
43 * values
44 */
45struct IonType { /* A single Ion */
46 int Z; //!< Atomic number of ion
47 double IonMass; //!< Mass of ion
48 int Max_IonsOfType; //!< Maximum number of ions of this type (needed for memory allocation)
49 double *R; //!< coordinate (x,y,z) array for all ions of this type R[i][j] (i=x,y,z;j=1,..)
50 double *R_old; //!< (?) Remembers last position (two-dim array, see IonType::R)
51 double *R_old_old; //!< (?) Remembers position before the last one (two-dim array, see IonType::R)
52 double *FIon; //!< (?) Overall force acting on the ion (two-dim array, see IonType::R)
53 double *FIonL; //!< (?) Linear force acting on the ion (two-dim array, see IonType::R)
54 double *FIonNL; //!< (?) Nonlinear force acting on the ion (two-dim array, see IonType::R)
55 double *U; //!< Velocity of the ion (two-dim array, see IonType::R)
56 double *FIon_old; //!< (?) Remembers prior force acting on the ion (two-dim array, see IonType::R)
57 double *FEwald; //!< (?) Ewald force (two-dim array, see IonType::R)
58 double *FConstraint;//!< Constraint force acting on the ion, needed for Thermostat() (two-dim array, see IonType::R)
59 double IonFac; //!< mass-like factor in CG structure optimization to determinte step width
60 double *GammaA; //!<
61 double *SearchDir; //!<
62 double rgauss; //!< Gauss radius
63 double *alpha; //!< parameter for CSDGT gauge, see ShiftGaugeOrigin()
64 int l_max; //!< (?) Pseudopotential specific value
65 int l_loc; //!< (?) Pseudopotential specific value
66 double ZFactor; //!< (?) CalcVIFactor
67 fftw_complex *SFactor; //!< structure factor, \f$S_{I_s} (G) \f$, thereby the centre of a potential is shifted away from the origin
68 enum CoreCorrType corecorr; //!< (?) Core correction due to pseudo potential ansatz
69 enum IonMoveType *IMT; //!< Ion is moving or fixed
70 char *Name; //!< name of ion's element
71 char *Symbol; //!< short form of ion's element
72 double **sigma; //!< shielding tensor
73 double **sigma_rezi; //!< shielding tensor for reciprocal calculation
74 double **sigma_PAS; //!< Principal Axis System shielding tensor
75 double **sigma_rezi_PAS; //!< Principal Axis System shielding tensor for reciprocal calculation
76 double chi[NDIM*NDIM]; //!< magnetic susceptibility
77 double chi_PAS[NDIM]; //!< Principal Axis System magnetic susceptibility
78};
79
80/** Containing structure for all ion data.
81 * Contains max types, counts, cut values, temperature and total mass among others
82 */
83struct Ions { /* All Ions */
84 int Max_Types; //!< Number of types overall (needed for memory allocation)
85 int Max_TotalIons; //!< Maximum of of total ions (needed for memory allocation)
86 int Max_Max_IonsOfType; //!< Maximum of ions per type (needed for memory allocation)
87 int TotalZval;
88 struct IonType *I; //!< Structure containing data for each type
89 /* Ewald */
90 double R_cut; //!< Radial cut value
91 int MaxVec;
92 int MaxLocalVec;
93 double *RLatticeVec;
94 double *FTemp; //!<
95 double EKin; //!< Kinetic energy of electrons
96 double ActualTemp; //!< Actual temperature
97 double TotalMass; //!< Total mass of all ions in the structure
98 int StructOpt; //!< whether structure optimization (1) (with CG) or MD (0) shall be done
99};
100
101
102/* Functions */
103void IonsInitRead(struct Problem *P, FILE *source);
104void CalculateEwald(struct Problem *P, int first);
105void RemoveIonsRead(struct Ions *I);
106/*void CalculateIonLocalForce(struct Problem *P);*/
107void CalculateIonForce(struct Problem *P);
108void OutputIonForce(struct Problem *P);
109void OutputIonCoordinates(struct Problem *P);
110void UpdateIons(struct Problem *P);
111void UpdateIonsR(struct Problem *P);
112void UpdateIonsU(struct Problem *P);
113void CalculateEnergyIonsU(struct Problem *P);
114void ScaleTemp(struct Problem *P);
115void GetOuterStop(struct Problem *P);
116void CorrectForces(struct Problem *P);
117void CorrectVelocity(struct Problem *P);
118#endif
Note: See TracBrowser for help on using the repository browser.