ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gatefield.h
Go to the documentation of this file.
1#ifndef GATEFIELD_H
2#define GATEFIELD_H
3
6
7namespace elecstate
8{
10{
11 public:
14
15 static void add_gatefield(double *vltot,
16 const UnitCell &cell,
17 const ModulePW::PW_Basis *rho_basis,
18 const bool &linear,
19 const bool &quadratic);
20
21 static double mopopla(double &zgate, double z, bool flag);
22
23 static void compute_force(const UnitCell &cell, ModuleBase::matrix &fgate);
24
25 static double etotgatefield; // energy for gatefield
26 static double rho_surface; // surface charge density of charged plate
27 static double zgate; // position of charged plate
28 static bool relax; //
29 static bool block; // add a block potential or not
30 static double block_down; // low bound of the block
31 static double block_up; // high bound of the block
32 static double block_height; // height of the block
33};
34
35} // namespace elecstate
36#include "pot_base.h"
37namespace elecstate
38{
39// new interface for elecstate::Potential
40class PotGate : public PotBase
41{
42 public:
43 PotGate(const ModulePW::PW_Basis *rho_basis_in, const UnitCell *ucell_in) : ucell_(ucell_in)
44 {
45 this->rho_basis_ = rho_basis_in;
46 this->fixed_mode = true;
47 this->dynamic_mode = false;
48 };
49
50 void cal_fixed_v(double *vl_pseudo) override
51 {
52 Gatefield::add_gatefield(vl_pseudo, *ucell_, this->rho_basis_, true, true);
53 }
54
55 private:
56 const UnitCell *ucell_ = nullptr;
57};
58
59} // namespace elecstate
60
61#endif
Definition matrix.h:19
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:56
Definition unitcell.h:16
Definition gatefield.h:10
static double rho_surface
Definition gatefield.h:26
static void compute_force(const UnitCell &cell, ModuleBase::matrix &fgate)
Definition gatefield.cpp:171
static bool block
Definition gatefield.h:29
static void add_gatefield(double *vltot, const UnitCell &cell, const ModulePW::PW_Basis *rho_basis, const bool &linear, const bool &quadratic)
Definition gatefield.cpp:19
static double block_height
Definition gatefield.h:32
static double block_up
Definition gatefield.h:31
static double etotgatefield
Definition gatefield.h:25
static double block_down
Definition gatefield.h:30
static double zgate
Definition gatefield.h:27
static double mopopla(double &zgate, double z, bool flag)
Definition gatefield.cpp:143
static bool relax
Definition gatefield.h:28
Definition pot_base.h:22
const ModulePW::PW_Basis * rho_basis_
Definition pot_base.h:35
bool dynamic_mode
Definition pot_base.h:32
bool fixed_mode
Definition pot_base.h:31
Definition gatefield.h:41
PotGate(const ModulePW::PW_Basis *rho_basis_in, const UnitCell *ucell_in)
Definition gatefield.h:43
void cal_fixed_v(double *vl_pseudo) override
Definition gatefield.h:50
const UnitCell * ucell_
Definition gatefield.h:56
Definition cal_dm.h:10