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
32 changes: 18 additions & 14 deletions source/source_lcao/module_deepks/LCAO_deepks_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,24 @@ void LCAO_Deepks_Interface<TK, TR>::out_deepks_labels(const double& etot,
// 7. atom.npy, box.npy, overlap.npy
//================================================================================

if( ((PARAM.inp.deepks_out_labels == 2) && is_after_scf )
|| ( PARAM.inp.deepks_out_freq_elec ) )// need overlap when deepks_out_freq_elec
{
if (PARAM.inp.deepks_v_delta > 0)
{
// prepare for overlap.npy, very much like h_tot except for p_ham->getSk()
std::vector<TH> s_tot(nks);
DeePKS_domain::get_h_tot<TK, TH, TR>(*ParaV, p_ham, s_tot, nlocal, nks, 'S');
const std::string file_stot = get_filename("overlap", PARAM.inp.deepks_out_labels, iter);
LCAO_deepks_io::save_npy_h<TK, TH>(s_tot,
file_stot,
nlocal,
nks,
rank,
1.0); // don't need unit_scale for overlap
}
}

if ( is_after_scf ) // don't need to output in multiple electronic steps
{
if (PARAM.inp.deepks_out_labels == 2)
Expand All @@ -632,20 +650,6 @@ void LCAO_Deepks_Interface<TK, TR>::out_deepks_labels(const double& etot,
DeePKS_domain::prepare_box(ucell, box_out);
const std::string file_box = PARAM.globalv.global_out_dir + "deepks_box.npy";
LCAO_deepks_io::save_tensor2npy<double>(file_box, box_out, rank);

if (PARAM.inp.deepks_v_delta > 0)
{
// prepare for overlap.npy, very much like h_tot except for p_ham->getSk()
std::vector<TH> s_tot(nks);
DeePKS_domain::get_h_tot<TK, TH, TR>(*ParaV, p_ham, s_tot, nlocal, nks, 'S');
const std::string file_stot = PARAM.globalv.global_out_dir + "deepks_overlap.npy";
LCAO_deepks_io::save_npy_h<TK, TH>(s_tot,
file_stot,
nlocal,
nks,
rank,
1.0); // don't need unit_scale for overlap
}
}

//================================================================================
Expand Down
2 changes: 2 additions & 0 deletions tests/09_DeePKS/103_NO_GO_deepks_out_freq_elec/result.ref
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ deepks_f_label_elec .06676003678176294
deepks_fdelta_elec .017979102769780632
deepks_s_label_elec .06851710382835817
deepks_sdelta_elec .013725178909672755
deepks_overlap 61.931587180384426
deepks_overlap_elec 309.657935901922130
totaltimeref 3.76
2 changes: 2 additions & 0 deletions tests/09_DeePKS/103_NO_KP_deepks_out_freq_elec/result.ref
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ deepks_f_label_elec .0667600367817765
deepks_fdelta_elec .017979102769778977
deepks_s_label_elec .06851710382837811
deepks_sdelta_elec .013725178909649378
deepks_overlap 61.931587180384426
deepks_overlap_elec 309.657935901922130
totaltimeref 3.52
5 changes: 5 additions & 0 deletions tests/integrate/tools/catch_deepks_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ if ! test -z "$deepks_out_labels" && [ $deepks_out_labels == 1 ]; then
# Process deepks_out_freq_elec > 0
if [ ! -z "$deepks_out_freq_elec" ] && [ $deepks_out_freq_elec -gt 0 ]; then
process_many_npys "multi" "_elec" "$1"
if ! test -z "$deepks_v_delta" && [[ $deepks_v_delta -gt 0 ]]; then
process_npy "single" "abs" "overlap" "" "deepks_overlap" "$1"
process_npy "multi" "abs" "overlap" "" "deepks_overlap_elec" "$1"

fi
fi
fi

Expand Down
Loading