Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f43e044
delete device_flag
A-006 Sep 27, 2024
b5ab55f
fix nelec
A-006 Sep 27, 2024
0c27cea
fix nelec in test
A-006 Sep 27, 2024
7c2af98
fix updown
A-006 Sep 27, 2024
745ec89
Merge branch 'deepmodeling:develop' into para21
A-006 Sep 29, 2024
487361c
delete use_uspp
A-006 Sep 27, 2024
e0d51b7
modify nlocal in module_cell
A-006 Sep 29, 2024
5c4626f
change parameter in the module_eslover
A-006 Sep 29, 2024
96c84ae
change parameter in the module_lcao
A-006 Sep 29, 2024
55b4d9a
fix bug in initelec
A-006 Sep 29, 2024
904c66a
Modify param nlocal in the hsolver
A-006 Sep 29, 2024
952283b
Modify param nlocal in the io
A-006 Sep 29, 2024
6b8086d
fix param nlocal bug in the io
A-006 Sep 29, 2024
fbec408
fix param nlocal in the ri
A-006 Sep 29, 2024
79888f5
fix param nlocal
A-006 Sep 29, 2024
1b05e40
fix param nlocal in the test file
A-006 Sep 29, 2024
ec33d56
fix param nbands in the elecstate
A-006 Sep 29, 2024
7efa61d
fix param nbands in the module_esolver
A-006 Sep 29, 2024
d34140d
fix param nbands in the module_hamilt
A-006 Sep 29, 2024
0599a43
fix param nbands in the module_hsolver
A-006 Sep 29, 2024
47bf6fb
fix param nbands in the module_io
A-006 Sep 29, 2024
5d9af46
fix param nbands in the module_ri
A-006 Sep 29, 2024
24fef0a
fix param nbands
A-006 Sep 29, 2024
16a545d
fix param nbands in test file
A-006 Sep 29, 2024
21ba013
change the variable file
A-006 Sep 29, 2024
111ba48
fix compile error
A-006 Sep 29, 2024
26dbd9a
fix input_conv.cpp compile bug
A-006 Sep 29, 2024
fbbf0b3
fix bug in test hasSubstr
A-006 Sep 30, 2024
08fc8c6
fix para in cal_atoms
A-006 Sep 30, 2024
8a87ac9
Merge branch 'develop' into para21
A-006 Sep 30, 2024
81faf30
Merge branch 'develop' into para21
mohanchen Oct 2, 2024
08092f0
Merge branch 'develop' into para21
A-006 Oct 5, 2024
7778dbb
change device in cpp file
A-006 Oct 5, 2024
caf0ea8
change device in test file
A-006 Oct 5, 2024
fa8190d
change param.globalv.device_flag
A-006 Oct 5, 2024
93c46db
change param.sys.device_flag
A-006 Oct 5, 2024
0773c4c
Merge branch 'develop' into para21
A-006 Oct 6, 2024
a9a7052
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 6, 2024
a6c720b
fix auto in input_parameter
A-006 Oct 8, 2024
cfdee63
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions source/module_base/global_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@
#include <vector>
namespace GlobalV
{

//----------------------------------------------------------
// EXPLAIN : Basic Global Variables
// In practice calculation, these values are set in
// input.cpp.
//----------------------------------------------------------
int NBANDS = 0;
int NLOCAL = 0; // total number of local basis.

double nupdown = 0.0;

bool use_uspp = false;
std::string KS_SOLVER = "cg"; // xiaohui add 2013-09-01
double SEARCH_RADIUS = -1.0;

int NB2D = 1;


//----------------------------------------------------------
// EXPLAIN : Parallel information
//----------------------------------------------------------
Expand All @@ -52,21 +34,11 @@ int GRANK = MY_RANK;
int GSIZE = DSIZE;

//----------------------------------------------------------
// EXPLAIN : The input file name and directory
// EXPLAIN : ofstream for output
//----------------------------------------------------------
std::ofstream ofs_running;
std::ofstream ofs_warning;
std::ofstream ofs_info; // output math lib info
std::ofstream ofs_device; // output device info


//==========================================================
// device flags added by denghui
//==========================================================
std::string device_flag = "unknown";

double nelec = 0;


// on-site orbitals
} // namespace GlobalV
44 changes: 0 additions & 44 deletions source/module_base/global_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@

namespace GlobalV
{
//==========================================================
// EXPLAIN : Basic Global Variables
//==========================================================

extern int NBANDS;
extern int NLOCAL; // 1.1 // mohan add 2009-05-29

extern double nupdown;
extern bool use_uspp;

extern std::string KS_SOLVER; // xiaohui add 2013-09-01
extern double SEARCH_RADIUS; // 11.1 // mohan add 2011-03-10


extern int NB2D; // 16.5 dividsion of 2D_matrix.

// pw, 2: real drho for lcao


//========================================================================
// EXPLAIN : Parallel information
// GLOBAL VARIABLES :
Expand Down Expand Up @@ -84,30 +65,5 @@ extern std::ofstream ofs_running;
extern std::ofstream ofs_warning;
extern std::ofstream ofs_info;
extern std::ofstream ofs_device;


// mixing parameters

//==========================================================
// device flags added by denghui
//==========================================================
extern std::string device_flag;
//==========================================================
// precision flags added by denghui
//==========================================================

// "out_chg" elec step.
/// @brief method to initialize wavefunction
/// @author kirk0830, 20230920
/// @brief whether use the new psi initializer to initialize psi
/// @author ykhuang, 20230920

extern double nelec;

// Deltaspin related

// Quasiatomic orbital related

// radius of on-site orbitals
} // namespace GlobalV
#endif
21 changes: 10 additions & 11 deletions source/module_cell/cal_atoms_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class CalAtomsInfo
{
for (int ia = 0; ia < atoms[it].na; ++ia)
{
GlobalV::nupdown += atoms[it].mag[ia];
para.input.nupdown += atoms[it].mag[ia];
}
}
GlobalV::ofs_running << " The readin total magnetization is " << GlobalV::nupdown << std::endl;
GlobalV::ofs_running << " The readin total magnetization is " << para.inp.nupdown << std::endl;
}

if (!para.inp.use_paw)
Expand All @@ -37,38 +37,37 @@ class CalAtomsInfo
{
if (atoms[it].ncpp.tvanp)
{
GlobalV::use_uspp = true;
para.sys.use_uspp = true;
}
}

// calculate the total number of local basis
GlobalV::NLOCAL = 0;
para.sys.nlocal = 0;
for (int it = 0; it < ntype; ++it)
{
const int nlocal_it = atoms[it].nw * atoms[it].na;
if (para.inp.nspin != 4)
{
GlobalV::NLOCAL += nlocal_it;
para.sys.nlocal += nlocal_it;
}
else
{
GlobalV::NLOCAL += nlocal_it * 2; // zhengdy-soc
para.sys.nlocal += nlocal_it * 2; // zhengdy-soc
}
}
}

// calculate the total number of electrons
cal_nelec(atoms, ntype, GlobalV::nelec);
cal_nelec(atoms, ntype, para.input.nelec);

// autoset and check GlobalV::NBANDS
std::vector<double> nelec_spin(2, 0.0);
if (para.inp.nspin == 2)
{
nelec_spin[0] = (GlobalV::nelec + GlobalV::nupdown) / 2.0;
nelec_spin[1] = (GlobalV::nelec - GlobalV::nupdown) / 2.0;
nelec_spin[0] = (para.inp.nelec + para.inp.nupdown ) / 2.0;
nelec_spin[1] = (para.inp.nelec - para.inp.nupdown ) / 2.0;
}
cal_nbands(GlobalV::nelec, GlobalV::NLOCAL, nelec_spin, GlobalV::NBANDS);

cal_nbands(para.inp.nelec, para.sys.nlocal, nelec_spin, para.input.nbands);
return;
}
};
Expand Down
Loading
Loading