source: pcp/src/run.h@ f70c2a

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

Merge branch 'ConcaveHull' of ../espack2 into ConcaveHull

Conflicts:

molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/builder.cpp
molecuilder/src/linkedcell.cpp
molecuilder/src/linkedcell.hpp
molecuilder/src/vector.cpp
molecuilder/src/vector.hpp
util/src/NanoCreator.c

Basically, this resulted from a lot of conversions two from spaces to one tab, which is my standard indentation. The mess was caused by eclipse auto-indenting. And in espack2:ConcaveHull was the new stuff, so all from ConcaveHull was replaced in case of doubt.
Additionally, vector had ofstream << operator instead ostream << ...

  • Property mode set to 100755
File size: 10.0 KB
Line 
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
19#ifdef HAVE_CONFIG_H
20#include <config.h>
21#endif
22
23
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
62 int UseForcesFile; //!< 1 - do not calculate electronic forces but parse values from file, 0 - calculate force by solving ground state problem
63 int UseOldPsi; //!< 1 - old Psis are used, 0 - not
64 int UseAddGramSch; //!< whether additional Gram-Schmidt-Orthogonalization is used
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 DoWannier; //!< States in the non-perturbation case whether we still have to calculate wannier functions (1) or not (0)
70 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
71 int VectorPlane; //!< output current vector plane perpendicular to this axis (0,1,2, -1=don't)
72 double VectorCut; //!< Do the plane cut at this position along the axis defined by RunStruct#VectorPlane
73 int PsiStep; //!< holds count of number of made minimisation steps per state
74 int MaxPsiStep; //!< maximum number of minimisation steps per state (0 - default)
75 int AlphaStep; //!< holds count of how often alpha was recalculated, due to wrong jump prediction in the CG-minimisation of the wave functions
76 enum PsiTypeTag CurrentMin; //!< within which minimisation loop are we right now (only useful in DoSeparated-case)
77 int Seed; //!< initial value for random seed on randomisation of Psi coefficients
78 int WaveNr; //!< wave function number that OutputVis writes to file
79 double Lambda; //!< test factor with no meaning
80 double Diffcount; //!< sums up difference between TE and ATE for measure
81 double Diffsteps; //!< start value of MinStep, when summation began
82
83 int MinStopStep; //!< counts how often stop condition was checked
84 int MaxMinStopStep; //!< check whether to check if to stop every ..th steps
85 int ActualMaxMinStopStep; //!< actual check whether to check if to stop every ..th steps
86 int InitMaxMinStopStep; //!< initial check whether to check if to stop every ..th steps
87 int MaxMinGapStopStep; //!< check whether to check if to stop gap calcs every ..th steps
88 int ActualMaxMinGapStopStep; //!< actual check whether to check if to stop gap calcs every ..th steps
89 int InitMaxMinGapStopStep; //!< initial check whether to check if to stop gap calcs every ..th steps
90
91 int MaxOuterStep; //!< maximum number of MolecularDynamics steps
92 int MaxStructOptStep; //!< maximum number of structure optimization steps
93 int NewRStep; //!< holds count of how often the ions were moved (position R has changed)
94 int MaxMinStepFactor; //!< Additional factor for setting RunStruct::ActualMaxMinStep, see InitRun()
95 double XCEnergyFactor; //!< part of discrete integration width factor in exchange correlation energy calculation, equal to volume of lattice cell
96 double HGcFactor; //!< ..., equal to one over volume of lattice cell
97
98 double RelEpsTotalEnergy; //!< minimal relative change in total energy
99 double InitRelEpsTotalEnergy; //!< initial relative change in total energy
100 double ActualRelEpsTotalEnergy; //!< actual relative change in total energy
101 double ActualRelTE[Extra][RUNMAXOLD-1]; //!< current [0] and archived relative change in total energy up to RUNMAXOLD-1
102 double *ActualRelTotalEnergy; //!< points to \a ActualRelTE with respect to current RunStruct#CurrentMin
103 double RelEpsKineticEnergy; //!< minimal relative change in kinetic energy
104 double InitRelEpsKineticEnergy; //!< initial minimal relative change in kinetic energy
105 double ActualRelEpsKineticEnergy; //!< actual minimal relative change in kinetic energy
106 double ActualRelKE[Extra][RUNMAXOLD-1]; //!< current [0] and archived relative change in kinetic energy up to RUNMAXOLD-1
107 double *ActualRelKineticEnergy; //!< points to \a ActualRelKE with respect to current RunStruct#CurrentMin
108
109 double TE[Extra][RUNMAXOLD]; //!< current [0] and archived total energy up to RUNMAXOLD
110 double KE[Extra][RUNMAXOLD]; //!< current [0] and archived kinetic energy up to RUNMAXOLD-1
111 double *TotalEnergy; //!< points to \a TE with respect to current RunStruct#CurrentMin
112 double *KineticEnergy; //!< points to \a KE with respect to current RunStruct#CurrentMin
113
114 double MeanForce[MAXOLD]; //!< stores old mean force values (see GetOuterStop), [0] is recent one
115 double delta_t; //!< time per MD step
116 double t; //!< Current time
117 int OutVisStep; //!< Output data for OpenDX every ..th step
118 int OutSrcStep; //!< Output data for measurements every ..th step
119 int OuterStep; //!< Current MD step
120 int StructOptStep; //!< Current step in structure optimization
121 double TargetTemp; //!< Target temperature
122 int ScaleTempStep; //!< MD temperature is scaled every ..step
123 double HooverMass; //!< Hoover Mass for Nose-Hoover Thermostat in atom mass units (not atom_ic_ units), \sa Thermostat()
124 double TempFrequency; //!< collision frequency for Langevin/Stochastic Thermostat/\f$\tau_T\f$ for Berendsen Thermostat, \sa Thermostat()
125 double alpha; //!< interpolation coefficent for Langevin/Stochastic Thermostat, \sa Thermostat()
126 double EpsWannier; //!< tolerance value for spread minimisation of orbitals, \sa ComputeMLWF()
127
128 double BField[NDIM];
129
130 char **MinimisationName;
131 /*[8]={"Occ",
132 "UnOcc",
133 "P0",
134 "P1",
135 "P2",
136 "RxP0",
137 "RxP1",
138 "RxP2"}; //!< suffixes for SrcPsiFiles
139 */
140};
141
142void InitRunLevel(struct Problem *P);
143void InitRun(struct Problem *P);
144void CalculateMD(struct Problem *P);
145void UpdateActualPsiNo(struct Problem *P, enum PsiTypeTag SkipType);
146void SetCurrentMinState(struct Problem *P, enum PsiTypeTag state);
147int CalculateMinimumStop(struct Problem *P, int SuperStop);
148void Thermostats(struct Problem *P, enum thermostats i);
149#endif
Note: See TracBrowser for help on using the repository browser.