From 5f122279f10ef2bc178a7f91812b022a057ef58b Mon Sep 17 00:00:00 2001 From: dyzheng Date: Fri, 22 Apr 2022 17:21:36 +0800 Subject: [PATCH] Fix : don't print cube file if out_chg is 0 --- source/src_io/write_rho_cube.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/src_io/write_rho_cube.cpp b/source/src_io/write_rho_cube.cpp index 9604289fc6..eac8cec179 100644 --- a/source/src_io/write_rho_cube.cpp +++ b/source/src_io/write_rho_cube.cpp @@ -9,7 +9,10 @@ void Charge::write_rho_cube( const int &precision) { ModuleBase::TITLE("Charge","write_rho_cube"); - + if (out_chg==0) + { + return; + } time_t start, end; std::ofstream ofs;