source: pcp/src/run.h@ 79290f

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

config.h is included in each and every file. After trying to compile on JUMP (with xlc).

  • Property mode set to 100644
File size: 9.9 KB
RevLine 
[a0bcf1]1#ifndef run_h
2#define run_h
3
4/** \file run.h
5 * Header file for \ref run.c
6 *
7 * Contains declarations of the functions implemented in \ref run.c and declaration
8 * of RunStruct structure, which contains LatticeLevels, do or don't variables and
9 * all the current stop conditions.
10 *
11 Project: ParallelCarParrinello
12 Jan Hamaekers
13 2000
14
15 File: run.h
16 $Id: run.h,v 1.42 2007/02/09 09:37:29 foo Exp $
17*/
18
[79290f]19#ifdef HAVE_CONFIG_H
20#include <config.h>
21#endif
22
23
[a0bcf1]24#define RUNMAXOLD 2 //!< store this many old values of relative kinetic and total energ in RunStruct
25
26
27/** Structure containing values needed during the simulation.
28 * contains values such as LatticeLevel, densities, MaxMinStep, UseAddGramSch,
29 * deltat, energies, MeanForce
30 */
31struct RunStruct {
32 struct LatticeLevel *LevS; //!< _S_tandard level
33 int LevSNo; //!< number of standard level within Lattice::Lev array
34 struct LatticeLevel *Lev0; //!< topmost (zeroth) level
35 int Lev0No; //!< number of topmost level within Lattice::Lev array
36 struct LatticeLevel *LevR; //!< _R_iemann level (only for RiemannTensor use)
37 int LevRNo; //!< number of Riemann level within Lattice::Lev array
38 struct LatticeLevel *LevRS; //!< _R_iemann _S_tandard level (only for RiemannTensor use)
39 int LevRSNo; //!< number of Riemann standard level within Lattice::Lev array
40 struct LatticeLevel *LevR0; //!< _R_iemann topmost level (only for RiemannTensor use)
41 int LevR0No; //!< number of Riemann topmost level within Lattice::Lev array
42 struct LatticeLevel *InitLevS; //!< initial _S_tandard LatticeLevel
43 int InitLevSNo; //!< number of initial standard level within Lattice::Lev array
44 struct LatticeLevel *InitLev0; //!< initial topmost (zeroth) level
45 int InitLev0No; //!< number of inital topmost level within Lattice::Lev array
46 double FactorDensityR; //!< one over volume of lattice cell
47 double FactorDensityC; //!< volume of lattice cell
48 int ActualLocalPsiNo; //!< number among local Psis of wave function currently minimised
49 int OldActualLocalPsiNo; //!< number among local Psis of wave function minimised last step
50
51 int MinStep; //!< holds count of minimisation steps
52 int MaxMinStep; //!< Maximum number of minimisation steps until stop
53 int MaxInitMinStep; //!< initial Maximum number of minimisation steps until stop
54 int ActualMaxMinStep; //!< actual maximum number of minimisation steps until stop: MaxMinStep times MaxPsiStep times MaxMinStepFactor
55
56 int ScanPotential; //!< prevents CGradient from being calculated more than once (for testing the potential)
57 int ScanAtStep; //!< as RunStruct#ScanPotential is steadily increased, this gives the step where CGradient is no more updated furtheron
58 double ScanDelta; //!< step size for delta within the 0..PI array whilst scanning the potential form
59 int ScanFlag; //!< Indicates whether Scan step is to be made (1) or just for testing (0)
60
61 int DoBrent; //!< whether line search shall be approximative (0) or numerically exact by a brent algorithm (1) per wave function
[995ff3]62 int UseForcesFile; //!< 1 - do not calculate electronic forces but parse values from file, 0 - calculate force by solving ground state problem
[a0bcf1]63 int UseOldPsi; //!< 1 - old Psis are used, 0 - not
[995ff3]64 int UseAddGramSch; //!< whether additional Gram-Schmidt-Orthogonalization is used
[a0bcf1]65 int DoCalcCGGauss; //!< whether to calculate the gaussian part in the second derivative of the hartree exchange potential or not
66 int DoUnOccupied; //!< whether unoccupied states shall be minimised in a separate run per level or not
67 int DoFullCurrent; //!< whether in current density \f$\Delta j_k(r')\f$ is always (1), never (0) or when needed (2) calculated and added
68 int DoPerturbation; //!< States whether an external magnetic field is applied and perturbed wave functions, energies and derivated currents shall be calculated
69 int CommonWannier; //!< Defines whether the same Wannier centre for all orbitals (1), individual (0) or combined ones in regard to spread (2) shall be used
70 int VectorPlane; //!< output current vector plane perpendicular to this axis (0,1,2, -1=don't)
71 double VectorCut; //!< Do the plane cut at this position along the axis defined by RunStruct#VectorPlane
72 int PsiStep; //!< holds count of number of made minimisation steps per state
73 int MaxPsiStep; //!< maximum number of minimisation steps per state (0 - default)
74 int AlphaStep; //!< holds count of how often alpha was recalculated, due to wrong jump prediction in the CG-minimisation of the wave functions
75 enum PsiTypeTag CurrentMin; //!< within which minimisation loop are we right now (only useful in DoSeparated-case)
76 int Seed; //!< initial value for random seed on randomisation of Psi coefficients
77 int WaveNr; //!< wave function number that OutputVis writes to file
78 double Lambda; //!< test factor with no meaning
79 double Diffcount; //!< sums up difference between TE and ATE for measure
80 double Diffsteps; //!< start value of MinStep, when summation began
81
82 int MinStopStep; //!< counts how often stop condition was checked
83 int MaxMinStopStep; //!< check whether to check if to stop every ..th steps
84 int ActualMaxMinStopStep; //!< actual check whether to check if to stop every ..th steps
85 int InitMaxMinStopStep; //!< initial check whether to check if to stop every ..th steps
86 int MaxMinGapStopStep; //!< check whether to check if to stop gap calcs every ..th steps
87 int ActualMaxMinGapStopStep; //!< actual check whether to check if to stop gap calcs every ..th steps
88 int InitMaxMinGapStopStep; //!< initial check whether to check if to stop gap calcs every ..th steps
89
90 int MaxOuterStep; //!< maximum number of MolecularDynamics steps
[995ff3]91 int MaxStructOptStep; //!< maximum number of structure optimization steps
[a0bcf1]92 int NewRStep; //!< holds count of how often the ions were moved (position R has changed)
93 int MaxMinStepFactor; //!< Additional factor for setting RunStruct::ActualMaxMinStep, see InitRun()
94 double XCEnergyFactor; //!< part of discrete integration width factor in exchange correlation energy calculation, equal to volume of lattice cell
95 double HGcFactor; //!< ..., equal to one over volume of lattice cell
96
97 double RelEpsTotalEnergy; //!< minimal relative change in total energy
98 double InitRelEpsTotalEnergy; //!< initial relative change in total energy
99 double ActualRelEpsTotalEnergy; //!< actual relative change in total energy
100 double ActualRelTE[Extra][RUNMAXOLD-1]; //!< current [0] and archived relative change in total energy up to RUNMAXOLD-1
101 double *ActualRelTotalEnergy; //!< points to \a ActualRelTE with respect to current RunStruct#CurrentMin
102 double RelEpsKineticEnergy; //!< minimal relative change in kinetic energy
103 double InitRelEpsKineticEnergy; //!< initial minimal relative change in kinetic energy
104 double ActualRelEpsKineticEnergy; //!< actual minimal relative change in kinetic energy
105 double ActualRelKE[Extra][RUNMAXOLD-1]; //!< current [0] and archived relative change in kinetic energy up to RUNMAXOLD-1
106 double *ActualRelKineticEnergy; //!< points to \a ActualRelKE with respect to current RunStruct#CurrentMin
107
108 double TE[Extra][RUNMAXOLD]; //!< current [0] and archived total energy up to RUNMAXOLD
109 double KE[Extra][RUNMAXOLD]; //!< current [0] and archived kinetic energy up to RUNMAXOLD-1
110 double *TotalEnergy; //!< points to \a TE with respect to current RunStruct#CurrentMin
111 double *KineticEnergy; //!< points to \a KE with respect to current RunStruct#CurrentMin
112
113 double MeanForce[MAXOLD]; //!< stores old mean force values (see GetOuterStop), [0] is recent one
114 double delta_t; //!< time per MD step
115 double t; //!< Current time
116 int OutVisStep; //!< Output data for OpenDX every ..th step
117 int OutSrcStep; //!< Output data for measurements every ..th step
[995ff3]118 int OuterStep; //!< Current MD step
119 int StructOptStep; //!< Current step in structure optimization
[a0bcf1]120 double TargetTemp; //!< Target temperature
121 int ScaleTempStep; //!< MD temperature is scaled every ..step
[995ff3]122 double HooverMass; //!< Hoover Mass for Nose-Hoover Thermostat in atom mass units (not atom_ic_ units), \sa Thermostat()
123 double TempFrequency; //!< collision frequency for Langevin/Stochastic Thermostat/\f$\tau_T\f$ for Berendsen Thermostat, \sa Thermostat()
124 double alpha; //!< interpolation coefficent for Langevin/Stochastic Thermostat, \sa Thermostat()
[a0bcf1]125 double EpsWannier; //!< tolerance value for spread minimisation of orbitals, \sa ComputeMLWF()
126
[995ff3]127 double BField[NDIM];
128
[a0bcf1]129 char **MinimisationName;
130 /*[8]={"Occ",
131 "UnOcc",
132 "P0",
133 "P1",
134 "P2",
135 "RxP0",
136 "RxP1",
137 "RxP2"}; //!< suffixes for SrcPsiFiles
138 */
139};
140
141void InitRunLevel(struct Problem *P);
142void InitRun(struct Problem *P);
143void CalculateMD(struct Problem *P);
144void UpdateActualPsiNo(struct Problem *P, enum PsiTypeTag SkipType);
145void SetCurrentMinState(struct Problem *P, enum PsiTypeTag state);
146int CalculateMinimumStop(struct Problem *P, int SuperStop);
[995ff3]147void Thermostats(struct Problem *P, enum thermostats i);
[a0bcf1]148#endif
Note: See TracBrowser for help on using the repository browser.