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"
7
8#include <map>
9// Class to store TDDFT infos, mainly for periodic system.
10class TD_info
11{
12 public:
13 TD_info(const UnitCell* ucell_in,const Parallel_Orbitals& pv, const LCAO_Orbitals& orb);
15
17 static bool out_mat_R;
18
20 static TD_info* td_vel_op;
21
23 static bool out_vecpot;
24
26 static int out_current;
27
29 static bool out_current_k;
30
32 static bool init_vecpot_file;
33
35 static bool evolve_once;
36
38 static int estep_shift;
39
42
45
47 void out_restart_info(const int nstep,
48 const ModuleBase::Vector3<double>& At_current,
49 const ModuleBase::Vector3<double>& At_laststep);
50
51 // allocate memory for current term.
52 void initialize_current_term(const hamilt::HContainer<std::complex<double>>* HR, const Parallel_Orbitals* paraV);
53
55 {
56 return this->current_term[i];
57 }
58 // set velocity HR.
59 void set_velocity_HR(hamilt::HContainer<std::complex<double>>* HR)
60 {
61 this->velocity_HR = HR;
62 }
67
69 {
70 return istep;
71 }
72
74 {
75 return this->ucell;
76 }
77
78 // For TDDFT velocity gauge, to fix the output of HR
79 std::map<Abfs::Vector3_Order<int>, std::map<size_t, std::map<size_t, std::complex<double>>>> HR_sparse_td_vel[2];
80
81 //r_calculator
83
84 private:
86 const UnitCell* ucell = nullptr;
87
89 void read_cart_At();
90
92 void output_cart_At(const std::string& out_dir);
93
95 static int istep;
96
98 static int max_istep;
99
101 static std::vector<ModuleBase::Vector3<double>> At_from_file;
102
105
107 std::vector<hamilt::HContainer<std::complex<double>>*> current_term = {nullptr, nullptr, nullptr};
108
111};
112
113#endif
const std::complex< double > i
Definition cal_pLpR.cpp:46
Definition ORB_read.h:18
3 elements vector
Definition vector3.h:24
Definition parallel_orbitals.h:9
Definition mock_tdinfo.cpp:4
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:165
void read_cart_At()
read At from output file
Definition td_info.cpp:114
static int out_current
switch to control the output of current
Definition td_info.h:26
void destroy_HS_R_td_sparse()
destory HSR data stored
Definition td_info.cpp:224
static int estep_shift
Restart step.
Definition td_info.h:38
static int max_istep
total steps of read in At
Definition td_info.h:98
hamilt::HContainer< std::complex< double > > * get_velocity_HR_pointer() const
Definition td_info.h:63
void initialize_current_term(const hamilt::HContainer< std::complex< double > > *HR, const Parallel_Orbitals *paraV)
Definition td_info.cpp:188
static TD_info * td_vel_op
pointer to the only TD_info object itself
Definition mock_tdinfo.cpp:13
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:79
static bool init_vecpot_file
switch to control the source of At
Definition td_info.h:32
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:107
static ModuleBase::Vector3< double > cart_At
Store the vector potential for tddft calculation.
Definition mock_tdinfo.cpp:12
static int istep
store isteps now
Definition td_info.h:95
static bool evolve_once
if need to calculate more than once
Definition td_info.h:35
void output_cart_At(const std::string &out_dir)
output cart_At to output file
Definition td_info.cpp:63
static bool out_mat_R
switch to control the output of HR
Definition td_info.h:17
static std::vector< ModuleBase::Vector3< double > > At_from_file
store the read in At_data
Definition td_info.h:101
const UnitCell * ucell
pointer to the unit cell
Definition td_info.h:86
hamilt::HContainer< std::complex< double > > * get_current_term_pointer(const int &i) const
Definition td_info.h:54
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:29
void set_velocity_HR(hamilt::HContainer< std::complex< double > > *HR)
Definition td_info.h:59
cal_r_overlap_R r_calculator
Definition td_info.h:82
hamilt::HContainer< std::complex< double > > * velocity_HR
store kinetic hamilton
Definition td_info.h:110
TD_info()
Definition mock_tdinfo.cpp:6
int get_istep()
Definition td_info.h:68
void cal_cart_At(const ModuleBase::Vector3< double > &At)
calculate the At in cartesian coordinate
Definition td_info.cpp:95
const UnitCell * get_ucell()
Definition td_info.h:73
static bool out_vecpot
switch to control the output of At
Definition td_info.h:23
Definition unitcell.h:15
Definition cal_r_overlap_R.h:24
Definition hcontainer.h:144