Skip to content

Commit 4fee456

Browse files
committed
Check smooth width and abort when it's not proper
1 parent 3ac98d1 commit 4fee456

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

source/source_hamilt/module_vdw/vdwd4.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ Vdwd4::Vdwd4(const UnitCell& unit_in, const std::string& xc_name, const Input_pa
100100
"vdw_cutoff_width3 must satisfy 0 <= width <= three-body cutoff");
101101
}
102102

103+
if (smooth_width_2b_ < 0.0 || smooth_width_2b_ > cutoff_disp2_)
104+
{
105+
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
106+
"vdw_cutoff_smooth_width_2b must satisfy 0 <= width <= two-body cutoff");
107+
}
108+
if (smooth_width_3b_ < 0.0 || smooth_width_3b_ > cutoff_disp3_)
109+
{
110+
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
111+
"vdw_cutoff_smooth_width_3b must satisfy 0 <= width <= three-body cutoff");
112+
}
113+
103114
double valence_charge = 0.0;
104115
for (int it = 0; it < ucell_.ntype; ++it)
105116
{

0 commit comments

Comments
 (0)