ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
td_info.h
Go to the documentation of this file.
1#ifndef TD_INFO_H
2#define TD_INFO_H
4#include "source_base/timer.h"
6
7#include <map>
8// Class to store TDDFT infos, mainly for periodic system.
9class TD_info
10{
11 public:
12 TD_info(const UnitCell* ucell_in);
13 ~TD_info();
14
15 void init();
16
18 static bool out_mat_R;
19
22
24 static bool out_vecpot;
25
27 static bool out_current;
28
30 static bool out_current_k;
31
33 static bool init_vecpot_file;
34
36 static bool evolve_once;
37
39 static int estep_shift;
40
43
46
48 void out_restart_info(const int nstep,
49 const ModuleBase::Vector3<double>& At_current,
50 const ModuleBase::Vector3<double>& At_laststep);
51
52 // allocate memory for current term.
53 void initialize_current_term(const hamilt::HContainer<std::complex<double>>* HR, const Parallel_Orbitals* paraV);
54
56 {
57 return this->current_term[i];
58 }
59
61 {
62 return istep;
63 }
64
66 {
67 return this->ucell;
68 }
69
70 // For TDDFT velocity gauge, to fix the output of HR
71 std::map<Abfs::Vector3_Order<int>, std::map<size_t, std::map<size_t, std::complex<double>>>> HR_sparse_td_vel[2];
72
73 private:
75 const UnitCell* ucell = nullptr;
76
78 void read_cart_At();
79
81 void output_cart_At(const std::string& out_dir);
82
84 static int istep;
85
87 static int max_istep;
88
90 static std::vector<ModuleBase::Vector3<double>> At_from_file;
91
94
96 std::vector<hamilt::HContainer<std::complex<double>>*> current_term = {nullptr, nullptr, nullptr};
97};
98
99#endif
3 elements vector
Definition vector3.h:22
Definition parallel_orbitals.h:9
Definition td_info.h:10
void out_restart_info(const int nstep, const ModuleBase::Vector3< double > &At_current, const ModuleBase::Vector3< double > &At_laststep)
output RT-TDDFT info for restart
Definition td_info.cpp:161
void read_cart_At()
read At from output file
Definition td_info.cpp:110
void destroy_HS_R_td_sparse()
destory HSR data stored
Definition td_info.cpp:220
void init()
static int estep_shift
Restart step.
Definition td_info.h:39
static int max_istep
total steps of read in At
Definition td_info.h:87
void initialize_current_term(const hamilt::HContainer< std::complex< double > > *HR, const Parallel_Orbitals *paraV)
Definition td_info.cpp:184
static bool out_current
switch to control the output of current
Definition td_info.h:27
std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, std::complex< double > > > > HR_sparse_td_vel[2]
Definition td_info.h:71
static bool init_vecpot_file
switch to control the source of At
Definition td_info.h:33
std::vector< hamilt::HContainer< std::complex< double > > * > current_term
part of Momentum operator, -i∇ - i[r,Vnl]. Used to calculate current.
Definition td_info.h:96
static int istep
store isteps now
Definition td_info.h:84
static bool evolve_once
if need to calculate more than once
Definition td_info.h:36
static ModuleBase::Vector3< double > cart_At
Store the vector potential for tddft calculation.
Definition td_info.h:42
void output_cart_At(const std::string &out_dir)
output cart_At to output file
Definition td_info.cpp:59
static bool out_mat_R
switch to control the output of HR
Definition td_info.h:18
static std::vector< ModuleBase::Vector3< double > > At_from_file
store the read in At_data
Definition td_info.h:90
~TD_info()
Definition td_info.cpp:44
const UnitCell * ucell
pointer to the unit cell
Definition td_info.h:75
hamilt::HContainer< std::complex< double > > * get_current_term_pointer(const int &i) const
Definition td_info.h:55
static bool out_current_k
switch to control the format of the output current, in total or in each k-point
Definition td_info.h:30
static TD_info * td_vel_op
pointer to the only TD_info object itself
Definition td_info.h:21
int get_istep()
Definition td_info.h:60
void cal_cart_At(const ModuleBase::Vector3< double > &At)
calculate the At in cartesian coordinate
Definition td_info.cpp:91
const UnitCell * get_ucell()
Definition td_info.h:65
static bool out_vecpot
switch to control the output of At
Definition td_info.h:24
Definition unitcell.h:16
Definition hcontainer.h:144