Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ These variables are used to control general system parameters.
- **Description**: This variable is used for both plane wave set and localized orbitals set. It indicates the type of starting density.

- atomic: the density is starting from the summation of the atomic density of single atoms.
- file: the density will be read in from a binary file `charge-density.dat` first. If it does not exist, the charge density will be read in from cube files. Besides, when you do `nspin=1` calculation, you only need the density file chgs1.cube. However, if you do `nspin=2` calculation, you also need the density file chgs2.cube. The density file should be output with these names if you set out_chg = 1 in INPUT file.
- file: the density will be read in from a binary file `charge-density.dat` first. If it does not exist, the charge density will be read in from cube files. When you do `nspin=1` calculation, you only need the density file `chg.cube`. For `nspin=2 or 4` calculation, you need the density file `chgs1.cube` and `chgs2.cube` (and `chgs3.cube`, `chgs4.cube` if needed). The density file should be output with these names if you set out_chg = 1 in INPUT file.
- wfc: the density will be calculated by wavefunctions and occupations. Wavefunctions are read in from binary files `wf*.dat` (see [out_wfc_pw](#out_wfc_pw)) while occupations are read in from file `eig.txt`.
- dm: the density will be calculated by real space density matrix(DMR) of LCAO base. DMR is read in from file `dmrs1_nao.csr` in directory [read_file_dir](#read_file_dir).
- hr: the real space Hamiltonian matrix(HR) will be read in from file `hrs1_nao.csr` in directory [read_file_dir](#read_file_dir), and DMR and charge density will be calculated from it.
Expand Down
2 changes: 1 addition & 1 deletion source/source_cell/pseudo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void pseudo::check_betar()
}
if (min_flag)
{
std::cout << "WARNING: some of potential function is set to zero cause of less than 1e-30.\n";
std::cout << " WARNING: some of potential function is set to zero cause of less than 1e-30.\n";
}
}

Expand Down
20 changes: 10 additions & 10 deletions source/source_estate/module_charge/charge_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ void Charge::init_rho(const UnitCell& ucell,
{
for (int is = 0; is < nspin; ++is)
{
std::stringstream ssc;
std::stringstream ssc;

if(nspin==1)
{
ssc << PARAM.globalv.global_readin_dir << "chg.cube";
}
else
{
{
ssc << PARAM.globalv.global_readin_dir << "chgs" << is + 1 << ".cube";
}

Expand Down Expand Up @@ -118,7 +118,7 @@ void Charge::init_rho(const UnitCell& ucell,
{
const std::string warn_msg
= " WARNING: \"init_chg\" is enabled but ABACUS failed to read\n charge density from file.\n"
" Please check if there is chgsx.cube (x=1,2,etc.) or\n {suffix}-CHARGE-DENSITY.restart in the "
" Please check if there is chg.cube (for nspin=1) or chgsx.cube (x=1,2,etc.) or\n {suffix}-CHARGE-DENSITY.restart in the "
"directory.\n";
std::cout << warn_msg;
if (PARAM.inp.init_chg == "file")
Expand Down Expand Up @@ -230,7 +230,7 @@ void Charge::init_rho(const UnitCell& ucell,
}
catch (const std::exception& e)
{
// try to load from the output of `out_chg`
// try to load from the output of `out_chg`
std::stringstream ssc;
ssc << PARAM.globalv.global_readin_dir << "chgs" << is + 1 << ".cube";
if (ModuleIO::read_vdata_palgrid(pgrid,
Expand Down Expand Up @@ -262,7 +262,7 @@ void Charge::init_rho(const UnitCell& ucell,

ModuleIO::read_wf2rho_pw(pw_wfc, symm, *this,
PARAM.globalv.global_readin_dir,
GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::MY_RANK,
GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::MY_RANK,
GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL,
PARAM.inp.nbands, nspin, PARAM.globalv.npol,
kv->get_nkstot(),kv->ik2iktot,kv->isk,GlobalV::ofs_running);
Expand All @@ -273,7 +273,7 @@ void Charge::init_rho(const UnitCell& ucell,
// computes the core charge on the real space 3D mesh.
//==========================================================
void Charge::set_rho_core(const UnitCell& ucell,
const ModuleBase::ComplexMatrix& structure_factor,
const ModuleBase::ComplexMatrix& structure_factor,
const bool* numeric)
{
ModuleBase::TITLE("Charge","set_rho_core");
Expand All @@ -300,7 +300,7 @@ void Charge::set_rho_core(const UnitCell& ucell,
ModuleBase::GlobalFunc::ZEROS(rhocg, this->rhopw->ngg );

// three dimension.
std::complex<double> *vg = new std::complex<double>[this->rhopw->npw];
std::complex<double> *vg = new std::complex<double>[this->rhopw->npw];

for (int it = 0; it < ucell.ntype;it++)
{
Expand Down Expand Up @@ -425,11 +425,11 @@ void Charge::non_linear_core_correction
igl_end += igl_beg;

// G <> 0 term
for (int igl = igl_beg; igl < igl_end;igl++)
for (int igl = igl_beg; igl < igl_end;igl++)
{
gx = sqrt(this->rhopw->gg_uniq[igl] * tpiba2);
ModuleBase::Sphbes::Spherical_Bessel(mesh, r, gx, 0, aux);
for (int ir = 0;ir < mesh; ir++)
for (int ir = 0;ir < mesh; ir++)
{
aux [ir] = r[ir] * r[ir] * rhoc [ir] * aux [ir];
} // enddo
Expand All @@ -447,7 +447,7 @@ void Charge::non_linear_core_correction
}; // end kernel

// do not use omp parallel when this function is already in parallel block
//
//
// it is called in parallel block in Forces::cal_force_cc,
// but not in other funtcion such as Stress_Func::stress_cc.
ModuleBase::TRY_OMP_PARALLEL(kernel);
Expand Down
Loading