Skip to content

Commit dd70a51

Browse files
committed
Check smooth width and abort when it's not proper
1 parent b7de4a8 commit dd70a51

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
@@ -89,6 +89,17 @@ Vdwd4::Vdwd4(const UnitCell& unit_in, const std::string& xc_name, const Input_pa
8989
smooth_width_2b_ = input.vdw_cutoff_smooth_width_2b;
9090
smooth_width_3b_ = input.vdw_cutoff_smooth_width_3b;
9191

92+
if (smooth_width_2b_ < 0.0 || smooth_width_2b_ > cutoff_disp2_)
93+
{
94+
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
95+
"vdw_cutoff_smooth_width_2b must satisfy 0 <= width <= two-body cutoff");
96+
}
97+
if (smooth_width_3b_ < 0.0 || smooth_width_3b_ > cutoff_disp3_)
98+
{
99+
ModuleBase::WARNING_QUIT("Vdwd4::Vdwd4",
100+
"vdw_cutoff_smooth_width_3b must satisfy 0 <= width <= three-body cutoff");
101+
}
102+
92103
double valence_charge = 0.0;
93104
for (int it = 0; it < ucell_.ntype; ++it)
94105
{

0 commit comments

Comments
 (0)