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
74 changes: 39 additions & 35 deletions source/module_basis/module_nao/atomic_radials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,51 +221,55 @@ void AtomicRadials::read_abacus_orb(std::ifstream& ifs, std::ofstream* ptr_log,
is_read[i] = false;
}

int l = 0;
int izeta = 0;
for (int i = 0; i != nchi_; ++i)
for (int l = 0; l <= lmax_; ++l)
{
if (rank == 0)
for (int izeta = 0; izeta < nzeta_[l]; ++izeta)
{
/*
* read the orbital information, including
*
* 1. angular momentum
* 2. zeta number
* 3. values on the grid
* */
// ifs >> tmp >> tmp >> tmp; // skip "Type" "L" "N"
ifs >> tmp >> tmp >> tmp;
#ifdef __DEBUG
assert(tmp == "N");
#endif

ifs >> tmp >> l >> izeta;
#ifdef __DEBUG
assert(l >= 0 && l <= lmax_);
assert(izeta >= 0 && izeta < nzeta_[l]);
#endif

for (int ir = 0; ir != ngrid; ++ir)
if (rank == 0)
{
ifs >> rvalue[ir];
/*
* read the orbital information, including
*
* 1. angular momentum
* 2. zeta number
* 3. values on the grid
* */
while (ifs.good())
{
while (ifs >> tmp)
{
if (tmp == "N")
{
break;
}
}
int read_l, read_izeta;
ifs >> tmp >> read_l >> read_izeta;
if (l == read_l && izeta == read_izeta)
{
break;
}
}

for (int ir = 0; ir != ngrid; ++ir)
{
ifs >> rvalue[ir];
}
}
}

#ifdef __MPI
Parallel_Common::bcast_int(l);
Parallel_Common::bcast_int(izeta);
Parallel_Common::bcast_double(rvalue, ngrid);
Parallel_Common::bcast_double(rvalue, ngrid);
#endif
#ifdef __DEBUG
assert(index(l, izeta) >= 0 && index(l, izeta) < nchi_);
assert(!is_read[index(l, izeta)]);
assert(index(l, izeta) >= 0 && index(l, izeta) < nchi_);
assert(!is_read[index(l, izeta)]);
#endif
is_read[index(l, izeta)] = true;
is_read[index(l, izeta)] = true;

// skip the initialization of sbt_ in this stage
chi_[index(l, izeta)].build(l, true, ngrid, rgrid, rvalue, 0, izeta, symbol_, itype_, false);
chi_[index(l, izeta)].normalize();
// skip the initialization of sbt_ in this stage
chi_[index(l, izeta)].build(l, true, ngrid, rgrid, rvalue, 0, izeta, symbol_, itype_, false);
chi_[index(l, izeta)].normalize();
}
}

delete[] is_read;
Expand Down
2 changes: 1 addition & 1 deletion tests/PP_ORB/Ti_gga_8au_100Ry_4s2p2d1f.orb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Element Ti
Energy Cutoff(Ry) 100
Radius Cutoff(a.u.) 8
Lmax 3
Number of Sorbital--> 4
Number of Sorbital--> 3
Number of Porbital--> 2
Number of Dorbital--> 2
Number of Forbital--> 1
Expand Down
10 changes: 5 additions & 5 deletions tests/integrate/284_NO_KP_symmetry/result.ref
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
etotref -23542.4694009632003144
etotperatomref -1569.4979600642
totalforceref 735.306633
totalstressref 771.858070
etotref -23542.3282006428744353
etotperatomref -1569.4885467095
totalforceref 685.072329
totalstressref 829.696556
pointgroupref C_1h
spacegroupref D_3h
nksibzref 4
totaltimeref 18.68
totaltimeref 21.81
Loading