diff --git a/docs/advanced/output_files/output-specification.md b/docs/advanced/output_files/output-specification.md index 27a9d8376ec..834d18b6870 100644 --- a/docs/advanced/output_files/output-specification.md +++ b/docs/advanced/output_files/output-specification.md @@ -49,11 +49,18 @@ All output file naming conventions can be found in the online documentation (wit | `s12` | Non-collinear spin calculation | | `k#` | k-point index (e.g., `k1`, `k2`) | | `g#` | Ionic step index for relax/md (e.g., `g1`, `g2`) | +| `ini` | Initial state (before electronic iteration), used before or after `g#` | **Important:** - All index numbers start from 1 (not 0) - For Gamma-only algorithm in LCAO, no `k` index is included - Overlap matrix `s` does not distinguish spin, so only one matrix is output +- For initial charge density output (`out_chg = 2`): + - `out_freq_ion = 0`: `chg_ini.cube` (nspin=1) or `chgs{#}_ini.cube` (nspin=2/4) - output at every step (overwrite same file) + - `out_freq_ion > 0`: `chgg{#}_ini.cube` (nspin=1) or `chgs{#}g{#}_ini.cube` (nspin=2/4) - output every out_freq_ion steps +- For initial potential output (`out_pot = 3`): + - `out_freq_ion = 0`: `pot_ini.cube` (nspin=1) or `pots{#}_ini.cube` (nspin=2/4) - output at every step (overwrite same file) + - `out_freq_ion > 0`: `potg{#}_ini.cube` (nspin=1) or `pots{#}g{#}_ini.cube` (nspin=2/4) - output every out_freq_ion steps ### 2.2 Examples @@ -62,7 +69,22 @@ All output file naming conventions can be found in the online documentation (wit | `chgs1.cube` | Charge density, spin 1 | | `chgs2.cube` | Charge density, spin 2 | | `chgs3.cube` | Charge density, spin 3 (non-collinear with SOC) | +| `chg_ini.cube` | Initial charge density (out_freq_ion=0, nspin=1) | +| `chgs1_ini.cube` | Initial charge density (out_freq_ion=0, spin 1, nspin=2/4) | +| `chgg1_ini.cube` | Initial charge density, geometry step 1 (nspin=1) | +| `chgs1g1_ini.cube` | Initial charge density, spin 1, geometry step 1 (nspin=2/4) | +| `pot_ini.cube` | Initial potential (out_freq_ion=0, nspin=1) | +| `pots1_ini.cube` | Initial potential (out_freq_ion=0, spin 1, nspin=2/4) | +| `potg1_ini.cube` | Initial potential, geometry step 1 (nspin=1) | +| `pots1g1_ini.cube` | Initial potential, spin 1, geometry step 1 (nspin=2/4) | | `pots1.cube` | Local potential, spin 1 | +| `elftot.cube` | ELF, total (nspin=1/4) | +| `elfs1.cube` | ELF, spin 1 (nspin=2) | +| `elfs2.cube` | ELF, spin 2 (nspin=2) | +| `elftot.cube` | ELF, total (nspin=2) | +| `elftotg1.cube` | ELF, total, geometry step 1 (nspin=1/4) | +| `elfs1g1.cube` | ELF, spin 1, geometry step 1 (nspin=2) | +| `elftotg1.cube` | ELF, total, geometry step 1 (nspin=2) | | `eig_occ.txt` | Eigenvalues and occupations | | `doss1g1_nao.txt` | DOS, spin 1, geometry step 1, NAO basis | | `wf_pw.dat` | Wavefunction, plane wave basis | @@ -79,8 +101,25 @@ All output file naming conventions can be found in the online documentation (wit | `band.txt` | Band structure | | `chgs1.cube`, `chgs2.cube` | Charge density (spin 1, spin 2) | | `chg.cube` | Total charge density | +| Initial charge density (out_chg=2) | | +| `chg_ini.cube` | Initial charge density (out_freq_ion=0, nspin=1) | +| `chgs{#}_ini.cube` | Initial charge density (out_freq_ion=0, spin {#}, nspin=2/4) | +| `chgg{#}_ini.cube` | Initial charge density (out_freq_ion>0, geometry step {#}, nspin=1) | +| `chgs{#}g{#}_ini.cube` | Initial charge density (out_freq_ion>0, spin {#}, geometry step {#}, nspin=2/4) | +| Initial potential (out_pot=3) | | +| `pot_ini.cube` | Initial potential (out_freq_ion=0, nspin=1) | +| `pots{#}_ini.cube` | Initial potential (out_freq_ion=0, spin {#}, nspin=2/4) | +| `potg{#}_ini.cube` | Initial potential (out_freq_ion>0, geometry step {#}, nspin=1) | +| `pots{#}g{#}_ini.cube` | Initial potential (out_freq_ion>0, spin {#}, geometry step {#}, nspin=2/4) | | `taus1.cube`, `taus2.cube` | Kinetic energy density (tau) | | `pots1.cube`, `pots2.cube` | Local potential | +| ELF (out_elf) | | +| `elftot.cube` | ELF, total (nspin=1/4) | +| `elfs1.cube`, `elfs2.cube` | ELF, spin 1/2 (nspin=2) | +| `elftot.cube` | ELF, total (nspin=2) | +| `elftotg{#}.cube` | ELF, total, geometry step {#} (nspin=1/4) | +| `elfs{#}g{#}.cube` | ELF, spin {#}, geometry step {#} (nspin=2) | +| `elftotg{#}.cube` | ELF, total, geometry step {#} (nspin=2) | ## 3. File Format Standards diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT b/examples/18_md/01_LCAO_NVE_Si8/INPUT similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT rename to examples/18_md/01_LCAO_NVE_Si8/INPUT diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_2 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_2 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_2 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_2 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_3 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_3 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_3 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_3 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_4 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_4 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_4 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_4 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_5 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_5 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_5 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_5 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_6 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_6 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_6 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_6 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_7 b/examples/18_md/01_LCAO_NVE_Si8/INPUT_7 similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_7 rename to examples/18_md/01_LCAO_NVE_Si8/INPUT_7 diff --git a/examples/18_md/01_lcao_gamma_Si8/KPT b/examples/18_md/01_LCAO_NVE_Si8/KPT similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/KPT rename to examples/18_md/01_LCAO_NVE_Si8/KPT diff --git a/examples/18_md/01_lcao_gamma_Si8/README b/examples/18_md/01_LCAO_NVE_Si8/README similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/README rename to examples/18_md/01_LCAO_NVE_Si8/README diff --git a/examples/18_md/01_lcao_gamma_Si8/STRU b/examples/18_md/01_LCAO_NVE_Si8/STRU similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/STRU rename to examples/18_md/01_LCAO_NVE_Si8/STRU diff --git a/examples/18_md/01_lcao_gamma_Si8/run.sh b/examples/18_md/01_LCAO_NVE_Si8/run.sh similarity index 100% rename from examples/18_md/01_lcao_gamma_Si8/run.sh rename to examples/18_md/01_LCAO_NVE_Si8/run.sh diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_0 b/examples/18_md/01_lcao_gamma_Si8/INPUT_0 deleted file mode 100644 index 5827a8c0178..00000000000 --- a/examples/18_md/01_lcao_gamma_Si8/INPUT_0 +++ /dev/null @@ -1,33 +0,0 @@ -INPUT_PARAMETERS -#Parameters (1.General) -suffix Si_nve -calculation md -nbands 20 -symmetry 0 -pseudo_dir ../../../tests/PP_ORB -orbital_dir ../../../tests/PP_ORB - -#Parameters (2.Iteration) -ecutwfc 30 -scf_thr 1e-5 -scf_nmax 100 - -#Parameters (3.Basis) -basis_type lcao -ks_solver genelpa -gamma_only 1 - -#Parameters (4.Smearing) -smearing_method gaussian -smearing_sigma 0.001 - -#Parameters (5.Mixing) -mixing_type broyden -mixing_beta 0.3 -chg_extrap second-order - -#Parameters (6.MD) -md_type nve -md_nstep 10 -md_dt 1 -md_tfirst 300 diff --git a/examples/18_md/01_lcao_gamma_Si8/INPUT_1 b/examples/18_md/02_LCAO_NVT_Si8/INPUT similarity index 73% rename from examples/18_md/01_lcao_gamma_Si8/INPUT_1 rename to examples/18_md/02_LCAO_NVT_Si8/INPUT index c49ff60e925..c07ca1f9f4a 100644 --- a/examples/18_md/01_lcao_gamma_Si8/INPUT_1 +++ b/examples/18_md/02_LCAO_NVT_Si8/INPUT @@ -3,6 +3,7 @@ INPUT_PARAMETERS suffix Si_nhc_nvt calculation md nbands 20 +nspin 2 symmetry 0 pseudo_dir ../../../tests/PP_ORB orbital_dir ../../../tests/PP_ORB @@ -15,7 +16,7 @@ scf_nmax 100 #Parameters (3.Basis) basis_type lcao ks_solver genelpa -gamma_only 1 +gamma_only 0 #Parameters (4.Smearing) smearing_method gaussian @@ -28,8 +29,15 @@ chg_extrap second-order #Parameters (6.MD) md_type nvt -md_nstep 10 +md_nstep 5 md_dt 1 md_tfirst 300 md_tfreq 1 -md_tchain 1 \ No newline at end of file +md_tchain 1 + +# output initial charge density +out_chg 2 4 +out_pot 3 4 +out_elf 1 4 +out_dipole 1 +out_freq_ion 2 diff --git a/examples/18_md/02_LCAO_NVT_Si8/KPT b/examples/18_md/02_LCAO_NVT_Si8/KPT new file mode 100644 index 00000000000..f5f7f4ec34c --- /dev/null +++ b/examples/18_md/02_LCAO_NVT_Si8/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +2 2 2 0 0 0 diff --git a/examples/18_md/02_LCAO_NVT_Si8/STRU b/examples/18_md/02_LCAO_NVT_Si8/STRU new file mode 100644 index 00000000000..795530e8cf2 --- /dev/null +++ b/examples/18_md/02_LCAO_NVT_Si8/STRU @@ -0,0 +1,28 @@ +ATOMIC_SPECIES +Si 28.085 Si_ONCV_PBE-1.0.upf + +NUMERICAL_ORBITAL +Si_gga_8au_60Ry_2s2p1d.orb + +LATTICE_CONSTANT +1.8897270 # 1 Angstrom = 1.8897270 bohr + +LATTICE_VECTORS +5.43090 0.00000 0.00000 +0.00000 5.43090 0.00000 +0.00000 0.00000 5.43090 + +ATOMIC_POSITIONS +Direct + +Si +0.0 +8 +0.000 0.000 0.000 1 1 1 +0.000 0.500 0.500 1 1 1 +0.500 0.000 0.500 1 1 1 +0.500 0.500 0.000 1 1 1 +0.250 0.250 0.250 1 1 1 +0.250 0.750 0.750 1 1 1 +0.750 0.250 0.750 1 1 1 +0.750 0.750 0.250 1 1 1 \ No newline at end of file diff --git a/examples/22_rt-tddft/02_H2_velocity_gauge/INPUT b/examples/22_rt-tddft/02_H2_velocity_gauge/INPUT index b388f7dfa21..878e4f25e7e 100644 --- a/examples/22_rt-tddft/02_H2_velocity_gauge/INPUT +++ b/examples/22_rt-tddft/02_H2_velocity_gauge/INPUT @@ -20,7 +20,7 @@ smearing_method gauss #Parameters (5.MD Parameters) md_type nve -md_nstep 1000 +md_nstep 5 md_dt 0.005 md_tfirst 0 @@ -46,6 +46,9 @@ out_chg 1 out_efield 1 out_dipole 1 +out_elf 1 +out_freq_ion 0 + ### [1] Energy cutoff determines the quality of numerical quadratures in your calculations. ### So it is strongly recommended to test whether your result (such as converged SCF energies) is diff --git a/source/source_esolver/esolver_fp.cpp b/source/source_esolver/esolver_fp.cpp index 238c093580d..dbdd07d43f7 100644 --- a/source/source_esolver/esolver_fp.cpp +++ b/source/source_esolver/esolver_fp.cpp @@ -176,8 +176,10 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep) elecstate::cal_ux(ucell); //! output the initial charge density and potential - ModuleIO::write_chg_init(ucell, this->Pgrid, this->chr, this->pelec->eferm, istep, PARAM.inp); -// ModuleIO::write_pot_init(ucell, this->Pgrid, this->pelec, istep, PARAM.inp); + ModuleIO::write_chg_init(ucell, this->Pgrid, this->chr, this->pelec->eferm, istep, + PARAM.globalv.global_out_dir, PARAM.inp); + ModuleIO::write_pot_init(ucell, this->Pgrid, this->pelec, istep, + PARAM.globalv.global_out_dir, PARAM.inp); return; } diff --git a/source/source_io/module_chgpot/write_init.cpp b/source/source_io/module_chgpot/write_init.cpp index 8d41e617693..b455c3833dd 100644 --- a/source/source_io/module_chgpot/write_init.cpp +++ b/source/source_io/module_chgpot/write_init.cpp @@ -1,63 +1,118 @@ +// ===================================================================== +// This module handles the output of initial charge density and potential +// to cube files in real space. It is part of the module_io package. +// +// Output files are named according to the following convention: +// - out_freq_ion = 0: chg_ini.cube/pot_ini.cube, chgs1_ini.cube/chgs2_ini.cube +// - out_freq_ion > 0: chgg{#}_ini.cube/potg{#}_ini.cube, chgs{#}g{#}_ini.cube +// - Geometry step index starts from 1 (geom_step = istep + 1) +// +// Usage: +// ModuleIO::write_chg_init(ucell, para_grid, chr, efermi, istep, out_dir, inp); +// ModuleIO::write_pot_init(ucell, para_grid, pelec, istep, out_dir, inp); +// +// Module: module_io/module_chgpot +// ===================================================================== + #include "source_io/module_chgpot/write_init.h" #include "source_io/module_output/cube_io.h" +#include "source_base/tool_quit.h" #include #include +std::string ModuleIO::gen_ini_filename( + const std::string& prefix, + const std::string& out_dir, + const int nspin, + const int is, + const int istep, + const bool include_geom_step) +{ + std::stringstream ss; + ss << out_dir << prefix; + + if (nspin == 1) + { + if (include_geom_step) + { + ss << "g" << (istep + 1) << "_ini.cube"; + } + else + { + ss << "_ini.cube"; + } + } + else if (nspin == 2 || nspin == 4) + { + ss << "s" << (is + 1); + if (include_geom_step) + { + ss << "g" << (istep + 1); + } + ss << "_ini.cube"; + } + + return ss.str(); +} + void ModuleIO::write_chg_init( const UnitCell& ucell, const Parallel_Grid ¶_grid, const Charge &chr, const elecstate::Efermi &efermi, const int istep, + const std::string& out_dir, const Input_para& inp) { const int nspin = inp.nspin; - assert(nspin == 1 || nspin ==2 || nspin == 4); + assert(nspin == 1 || nspin == 2 || nspin == 4); + + if (istep < 0) + { + ModuleBase::WARNING_QUIT("write_chg_init", "istep must be >= 0"); + } if (inp.out_chg[0] == 2) { - for (int is = 0; is < nspin; is++) + bool should_output = (inp.out_freq_ion == 0) || + (inp.out_freq_ion > 0 && istep % inp.out_freq_ion == 0); + + if (should_output) { - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << "chg"; + bool include_geom_step = (inp.out_freq_ion > 0); - if(nspin==1) - { - ss << "ini.cube"; - } - else if(nspin==2 || nspin==4) + for (int is = 0; is < nspin; is++) { - ss << "s" << is + 1 << "ini.cube"; - } + std::string filename = gen_ini_filename("chg", out_dir, nspin, is, istep, include_geom_step); + + double fermi_energy = 0.0; + if (nspin == 1 || nspin == 4) + { + fermi_energy = efermi.ef; + } + else if (nspin == 2) + { + if (is == 0) + { + fermi_energy = efermi.ef_up; + } + else if (is == 1) + { + fermi_energy = efermi.ef_dw; + } + } - // mohan add 2025-10-18 - double fermi_energy = 0.0; - if(nspin == 1 || nspin ==4) - { - fermi_energy = efermi.ef; - } - else if(nspin == 2) - { - if(is==0) - { - fermi_energy = efermi.ef_up; - } - else if(is==1) - { - fermi_energy = efermi.ef_dw; - } - } - - ModuleIO::write_vdata_palgrid(para_grid, - chr.rho[is], - is, - nspin, - istep, - ss.str(), - fermi_energy, - &(ucell), - inp.out_chg[1]); + ModuleIO::write_vdata_palgrid(para_grid, + chr.rho[is], + is, + nspin, + istep, + filename, + fermi_energy, + &(ucell), + inp.out_chg[1]); + } } } return; @@ -69,39 +124,42 @@ void ModuleIO::write_pot_init( const Parallel_Grid ¶_grid, elecstate::ElecState *pelec, const int istep, + const std::string& out_dir, const Input_para& inp) { - //! output total local potential of the initial charge density const int nspin = inp.nspin; - assert(nspin == 1 || nspin ==2 || nspin == 4); + assert(nspin == 1 || nspin == 2 || nspin == 4); + + if (istep < 0) + { + ModuleBase::WARNING_QUIT("write_pot_init", "istep must be >= 0"); + } if (inp.out_pot[0] == 3) { - for (int is = 0; is < nspin; is++) + bool should_output = (inp.out_freq_ion == 0) || + (inp.out_freq_ion > 0 && istep % inp.out_freq_ion == 0); + + if (should_output) { - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << "pot"; + bool include_geom_step = (inp.out_freq_ion > 0); - if(nspin==1) - { - ss << "ini.cube"; - } - else if(nspin==2 || nspin==4) + for (int is = 0; is < nspin; is++) { - ss << "s" << is + 1 << "ini.cube"; - } + std::string filename = gen_ini_filename("pot", out_dir, nspin, is, istep, include_geom_step); - ModuleIO::write_vdata_palgrid(para_grid, - pelec->pot->get_eff_v(is), - is, - nspin, - istep, - ss.str(), - 0.0, // efermi - &(ucell), - 11, // precsion - 0); // out_fermi + ModuleIO::write_vdata_palgrid(para_grid, + pelec->pot->get_eff_v(is), + is, + nspin, + istep, + filename, + 0.0, + &(ucell), + inp.out_pot[1], + 0); + } } } - + return; } diff --git a/source/source_io/module_chgpot/write_init.h b/source/source_io/module_chgpot/write_init.h index 323cbe7af8f..7d5ecd5239b 100644 --- a/source/source_io/module_chgpot/write_init.h +++ b/source/source_io/module_chgpot/write_init.h @@ -1,30 +1,76 @@ +// ===================================================================== +// This module handles the output of initial charge density and potential +// to cube files in real space. It is part of the module_io package. +// +// Output files are named according to the following convention: +// - out_freq_ion = 0: chg_ini.cube/pot_ini.cube, chgs1_ini.cube/chgs2_ini.cube +// - out_freq_ion > 0: chgg{#}_ini.cube/potg{#}_ini.cube, chgs{#}g{#}_ini.cube +// - Geometry step index starts from 1 (geom_step = istep + 1) +// +// Usage: +// ModuleIO::write_chg_init(ucell, para_grid, chr, efermi, istep, out_dir, inp); +// ModuleIO::write_pot_init(ucell, para_grid, pelec, istep, out_dir, inp); +// +// Module: module_io/module_chgpot +// ===================================================================== + #ifndef WRITE_INIT_H #define WRITE_INIT_H -#include "source_io/module_parameter/input_parameter.h" // use inp -#include "source_estate/module_charge/charge.h" // use chg -#include "source_estate/fp_energy.h" // use efermi -#include "source_estate/elecstate.h" // use pelec +#include +#include "source_io/module_parameter/input_parameter.h" +#include "source_estate/module_charge/charge.h" +#include "source_estate/fp_energy.h" +#include "source_estate/elecstate.h" namespace ModuleIO { +// Generate initial data file name. +// prefix: "chg" or "pot" +std::string gen_ini_filename( + const std::string& prefix, + const std::string& out_dir, + const int nspin, + const int is, + const int istep, + const bool include_geom_step); + +// Write initial charge density to cube file in real space. +// Triggered when inp.out_chg[0] == 2. +// Output frequency is controlled by out_freq_ion: +// out_freq_ion = 0: every step output (overwrite same file) +// out_freq_ion > 0: output every out_freq_ion steps +// Output file naming convention: +// out_freq_ion = 0: chg_ini.cube (nspin=1), chgs1_ini.cube/chgs2_ini.cube (nspin=2/4) +// out_freq_ion > 0: chgg{geom_step}_ini.cube (nspin=1), chgs{spin}g{geom_step}_ini.cube (nspin=2/4) +// Note: geom_step starts from 1 (geom_step = istep + 1). void write_chg_init( const UnitCell& ucell, const Parallel_Grid ¶_grid, const Charge &chr, const elecstate::Efermi &efermi, const int istep, + const std::string& out_dir, const Input_para& inp); +// Write initial effective potential to cube file in real space. +// Triggered when inp.out_pot[0] == 3. +// Output frequency is controlled by out_freq_ion: +// out_freq_ion = 0: every step output (overwrite same file) +// out_freq_ion > 0: output every out_freq_ion steps +// Output file naming convention: +// out_freq_ion = 0: pot_ini.cube (nspin=1), pots1_ini.cube/pots2_ini.cube (nspin=2/4) +// out_freq_ion > 0: potg{geom_step}_ini.cube (nspin=1), pots{spin}g{geom_step}_ini.cube (nspin=2/4) +// Note: geom_step starts from 1 (geom_step = istep + 1). void write_pot_init( const UnitCell& ucell, const Parallel_Grid ¶_grid, elecstate::ElecState *pelec, const int istep, + const std::string& out_dir, const Input_para& inp); } - #endif diff --git a/source/source_io/module_ctrl/ctrl_output_fp.cpp b/source/source_io/module_ctrl/ctrl_output_fp.cpp index 710f4b87307..a36dae61750 100644 --- a/source/source_io/module_ctrl/ctrl_output_fp.cpp +++ b/source/source_io/module_ctrl/ctrl_output_fp.cpp @@ -1,10 +1,9 @@ #include "ctrl_output_fp.h" // use ctrl_output_fp() - -#include "../module_output/cube_io.h" // use write_vdata_palgrid -#include "../module_dipole/dipole_io.h" // use write_dipole +#include "../module_output/cube_io.h" // use write_vdata_palgrid +#include "../module_dipole/dipole_io.h" // use write_dipole #include "source_estate/module_charge/symmetry_rho.h" // use Symmetry_rho #include "source_hamilt/module_xc/xc_functional.h" // use XC_Functional -#include "source_io/module_chgpot/write_elecstat_pot.h" // use write_elecstat_pot +#include "source_io/module_chgpot/write_elecstat_pot.h" // use write_elecstat_pot #include "source_io/module_elf/write_elf.h" #ifdef USE_LIBXC @@ -49,17 +48,15 @@ void ctrl_output_fp(UnitCell& ucell, } std::string geom_block; - if (istep_in == -1) - { - // do nothing - } - else if (istep_in >= 0) + bool should_output = (PARAM.inp.out_freq_ion == 0); + if (istep_in >= 0) { geom_block = "g" + std::to_string(istep + 1); + should_output = true; } // 4) write charge density - if (PARAM.inp.out_chg[0] > 0) + if (PARAM.inp.out_chg[0] > 0 && should_output) { for (int is = 0; is < nspin; ++is) { @@ -107,7 +104,7 @@ void ctrl_output_fp(UnitCell& ucell, } // 5) write potential - if (PARAM.inp.out_pot[0] == 1 || PARAM.inp.out_pot[0] == 3) + if ((PARAM.inp.out_pot[0] == 1 || PARAM.inp.out_pot[0] == 3) && should_output) { for (int is = 0; is < nspin; is++) { @@ -129,7 +126,7 @@ void ctrl_output_fp(UnitCell& ucell, pelec->pot->get_eff_v(is), is, nspin, - istep_in, + istep, fn, 0.0, // efermi &(ucell), @@ -137,7 +134,7 @@ void ctrl_output_fp(UnitCell& ucell, 0); // out_fermi } } - else if (PARAM.inp.out_pot[0] == 2) + else if (PARAM.inp.out_pot[0] == 2 && should_output) { std::string fn = PARAM.globalv.global_out_dir + "potes"; fn += geom_block + ".cube"; @@ -154,11 +151,11 @@ void ctrl_output_fp(UnitCell& ucell, &(ucell), pelec->pot->get_fixed_v(), solvent, - PARAM.inp.out_pot[1]); + PARAM.inp.out_pot[1]); } // 6) write ELF - if (PARAM.inp.out_elf[0] > 0) + if (PARAM.inp.out_elf[0] > 0 && should_output) { chr.cal_elf = true; Symmetry_rho srho; @@ -168,12 +165,7 @@ void ctrl_output_fp(UnitCell& ucell, } std::string out_dir = PARAM.globalv.global_out_dir; - ModuleIO::write_elf( -#ifdef __MPI - pw_big->bz, - pw_big->nbz, -#endif - out_dir, + ModuleIO::write_elf(out_dir, istep, nspin, chr.rho, @@ -181,12 +173,13 @@ void ctrl_output_fp(UnitCell& ucell, pw_rhod, para_grid, &(ucell), - PARAM.inp.out_elf[1]); + PARAM.inp.out_elf[1], + geom_block); } #ifdef USE_LIBXC // 7) write xc(r) - if (PARAM.inp.out_xc_r[0] >= 0) + if (PARAM.inp.out_xc_r[0] >= 0 && should_output) { ModuleIO::write_libxc_r(PARAM.inp.out_xc_r[0], XC_Functional::get_func_id(), @@ -200,7 +193,7 @@ void ctrl_output_fp(UnitCell& ucell, #endif // 8) write dipole moment - if (PARAM.inp.out_dipole == 1) + if (PARAM.inp.out_dipole == 1 && should_output) { for (int is = 0; is < nspin; ++is) { diff --git a/source/source_io/module_elf/write_elf.cpp b/source/source_io/module_elf/write_elf.cpp index 347a119099b..daf830db623 100644 --- a/source/source_io/module_elf/write_elf.cpp +++ b/source/source_io/module_elf/write_elf.cpp @@ -1,74 +1,99 @@ #include "write_elf.h" #include "source_io/module_output/cube_io.h" +#ifdef _OPENMP +#include +#endif namespace ModuleIO { void write_elf( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif const std::string& out_dir, const int& istep_in, const int& nspin, const double* const* rho, const double* const* tau, - ModulePW::PW_Basis* rho_basis, + ModulePW::PW_Basis* const rho_basis, const Parallel_Grid& pgrid, const UnitCell* ucell_, - const int& precision) + const int& precision, + const std::string& geom_block) { - // For nspin = 4, we only calculate the total ELF using the rho_total and tau_total, - // containing in the first channel of rho and tau. - // What's more, we have not introduced the U(1) and SU(2) gauge invariance corrections - // proposed by Desmarais J K, Vignale G, Bencheikh K, et al. Physical Review Letters, 2024, 133(13): 136401, - // where the current density is also included in the ELF calculation. + ModuleBase::timer::start("ModuleIO", "write_elf"); + // For nspin = 4, we only calculate the total ELF using the + // rho_total and tau_total, containing in the first channel of + // rho and tau. + // What's more, we have not introduced the U(1) and SU(2) gauge + // invariance corrections proposed by Desmarais J K, Vignale G, + // Bencheikh K, et al. Physical Review Letters, 2024, + // 133(13): 136401, where the current density is also included + // in the ELF calculation. + + const int nspin_eff = (nspin == 4) ? 1 : nspin; + + const int nrxx = rho_basis->nrxx; + const int npw = rho_basis->npw; - int nspin_eff = (nspin == 4) ? 1 : nspin; + assert(nrxx>0); + assert(npw>0); - std::vector> elf(nspin_eff, std::vector(rho_basis->nrxx, 0.)); + std::vector> elf(nspin_eff, std::vector(nrxx, 0.)); // 1) calculate the kinetic energy density of vW KEDF - std::vector> tau_vw(nspin_eff, std::vector(rho_basis->nrxx, 0.)); - std::vector phi(rho_basis->nrxx, 0.); // phi = sqrt(rho) + std::vector> tau_vw(nspin_eff, std::vector(nrxx, 0.)); + std::vector phi(nrxx, 0.); for (int is = 0; is < nspin_eff; ++is) { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(nrxx) shared(phi, rho, rho_basis, is) + for (int ir = 0; ir < nrxx; ++ir) { phi[ir] = std::sqrt(std::abs(rho[is][ir])); } - - std::vector> gradient_phi(3, std::vector(rho_basis->nrxx, 0.)); - std::vector> recip_phi(rho_basis->npw, 0.0); - std::vector> recip_gradient_phi(rho_basis->npw, 0.0); - + + std::vector> gradient_phi(3, std::vector(nrxx, 0.)); + std::vector> recip_phi(npw, 0.0); + std::vector> recip_gradient_phi(npw, 0.0); + rho_basis->real2recip(phi.data(), recip_phi.data()); - + std::complex img(0.0, 1.0); for (int j = 0; j < 3; ++j) { - for (int ip = 0; ip < rho_basis->npw; ++ip) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(img, npw) \ + shared(recip_gradient_phi, rho_basis, recip_phi, j) + for (int ip = 0; ip < npw; ++ip) { - recip_gradient_phi[ip] = img * rho_basis->gcar[ip][j] * recip_phi[ip] * rho_basis->tpiba; + recip_gradient_phi[ip] + = img * rho_basis->gcar[ip][j] + * recip_phi[ip] * rho_basis->tpiba; } rho_basis->recip2real(recip_gradient_phi.data(), gradient_phi[j].data()); - for (int ir = 0; ir < rho_basis->nrxx; ++ir) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(nrxx) \ + shared(tau_vw, gradient_phi, is, j, rho_basis) + for (int ir = 0; ir < nrxx; ++ir) { - tau_vw[is][ir] += gradient_phi[j][ir] * gradient_phi[j][ir] / 2. * 2.; // convert Ha to Ry. + tau_vw[is][ir] += gradient_phi[j][ir] + * gradient_phi[j][ir] / 2. * 2.; } } } // 2) calculate the kinetic energy density of TF KEDF - std::vector> tau_TF(nspin_eff, std::vector(rho_basis->nrxx, 0.)); + std::vector> tau_TF(nspin_eff, std::vector(nrxx, 0.)); + const double c_tf = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0) - * 2.0; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2) + * 2.0; // convert unit from Hartree to Ry if (nspin == 1 || nspin == 4) { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(c_tf, nrxx) \ + shared(rho, tau_TF, rho_basis) + for (int ir = 0; ir < nrxx; ++ir) { if (rho[0][ir] > 0.0) { @@ -82,14 +107,19 @@ void write_elf( } else if (nspin == 2) { - // the spin-scaling law: tau_TF[rho_up, rho_dn] = 1/2 * (tau_TF[2*rho_up] + tau_TF[2*rho_dn]) + // spin-scaling: tau_TF[rho_up,rho_dn] + // = 1/2 * (tau_TF[2*rho_up] + tau_TF[2*rho_dn]) for (int is = 0; is < nspin; ++is) { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(c_tf, nrxx) \ + shared(rho, tau_TF, is, rho_basis) + for (int ir = 0; ir < nrxx; ++ir) { if (rho[is][ir] > 0.0) { - tau_TF[is][ir] = 0.5 * c_tf * std::pow(2.0 * rho[is][ir], 5.0 / 3.0); + tau_TF[is][ir] = 0.5 * c_tf + * std::pow(2.0 * rho[is][ir], 5.0 / 3.0); } else { @@ -99,15 +129,20 @@ void write_elf( } } - // 3) calculate the enhancement factor F = (tau_KS - tau_vw) / tau_TF, and then ELF = 1 / (1 + F^2) - double eps = 1.0e-5; // suppress the numerical instability in LCAO (Ref: Acta Phys. -Chim. Sin. 2011, 27(12), 2786-2792. doi: 10.3866/PKU.WHXB20112786) + // 3) calculate the enhancement factor F = (tau_KS - tau_vw) / + // tau_TF, and then ELF = 1 / (1 + F^2) + const double eps = 1.0e-5; for (int is = 0; is < nspin_eff; ++is) { - for (int ir = 0; ir < rho_basis->nrxx; ++ir) +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(eps, nrxx) \ + shared(elf, tau, tau_vw, tau_TF, is, rho_basis) + for (int ir = 0; ir < nrxx; ++ir) { if (tau_TF[is][ir] > 1.0e-12) { - elf[is][ir] = (tau[is][ir] - tau_vw[is][ir] + eps) / tau_TF[is][ir]; + elf[is][ir] = (tau[is][ir] - tau_vw[is][ir] + eps) + / tau_TF[is][ir]; elf[is][ir] = 1. / (1. + elf[is][ir] * elf[is][ir]); } else @@ -118,12 +153,12 @@ void write_elf( } // 4) output the ELF = 1 / (1 + F^2) to cube file - double ef_tmp = 0.0; - int out_fermi = 0; + const double ef_tmp = 0.0; + const int out_fermi = 0; if (nspin == 1 || nspin == 4) { - std::string fn = out_dir + "/elf.cube"; + std::string fn = out_dir + "elftot" + geom_block + ".cube"; int is = -1; ModuleIO::write_vdata_palgrid(pgrid, @@ -135,17 +170,16 @@ void write_elf( ef_tmp, ucell_, precision, - out_fermi); + out_fermi); } else if (nspin == 2) { for (int is = 0; is < nspin; ++is) { - std::string fn_temp = out_dir + "/elf"; - - fn_temp += std::to_string(is + 1) + ".cube"; + std::string fn_temp = out_dir + "elf" + "s" + + std::to_string(is + 1) + geom_block + ".cube"; - int ispin = is + 1; + const int ispin = is + 1; ModuleIO::write_vdata_palgrid(pgrid, elf[is].data(), @@ -156,16 +190,29 @@ void write_elf( ef_tmp, ucell_, precision, - out_fermi); + out_fermi); } - std::vector elf_tot(rho_basis->nrxx, 0.0); - for (int ir = 0; ir < rho_basis->nrxx; ++ir) + std::vector elf_tot(nrxx, 0.0); +#pragma omp parallel for schedule(static) \ + default(none) firstprivate(eps, nrxx) \ + shared(elf_tot, tau, tau_vw, tau_TF, rho_basis) + for (int ir = 0; ir < nrxx; ++ir) { - elf_tot[ir] = (tau[0][ir] + tau[1][ir] - tau_vw[0][ir] - tau_vw[1][ir]) / (tau_TF[0][ir] + tau_TF[1][ir]); - elf_tot[ir] = 1. / (1. + elf_tot[ir] * elf_tot[ir]); + if (tau_TF[0][ir] + tau_TF[1][ir] > 1.0e-12) + { + elf_tot[ir] = (tau[0][ir] + tau[1][ir] + - tau_vw[0][ir] - tau_vw[1][ir] + eps) + / (tau_TF[0][ir] + tau_TF[1][ir]); + elf_tot[ir] = 1. + / (1. + elf_tot[ir] * elf_tot[ir]); + } + else + { + elf_tot[ir] = 0.0; + } } - std::string fn = out_dir + "/elf.cube"; + std::string fn = out_dir + "elftot" + geom_block + ".cube"; int is = -1; ModuleIO::write_vdata_palgrid(pgrid, @@ -179,5 +226,6 @@ void write_elf( precision, out_fermi); } -} -} + ModuleBase::timer::end("ModuleIO", "write_elf"); +} // end write_elf +} // end namespace ModuleIO diff --git a/source/source_io/module_elf/write_elf.h b/source/source_io/module_elf/write_elf.h index 23a7e7c379e..7661a379b11 100644 --- a/source/source_io/module_elf/write_elf.h +++ b/source/source_io/module_elf/write_elf.h @@ -8,10 +8,6 @@ namespace ModuleIO { void write_elf( -#ifdef __MPI - const int& bz, - const int& nbz, -#endif const std::string& out_dir, const int& istep_in, const int& nspin, @@ -20,7 +16,8 @@ void write_elf( ModulePW::PW_Basis* rho_basis, const Parallel_Grid& pgrid, const UnitCell* ucell_, - const int& precision); + const int& precision, + const std::string& geom_block); } #endif diff --git a/source/source_io/module_parameter/read_input_item_output.cpp b/source/source_io/module_parameter/read_input_item_output.cpp index 4881cb7d48a..8bc0c895499 100644 --- a/source/source_io/module_parameter/read_input_item_output.cpp +++ b/source/source_io/module_parameter/read_input_item_output.cpp @@ -80,7 +80,18 @@ void ReadInput::item_output() - nspin = 1: `tau.cube`; - nspin = 2: `taus1.cube`, and `taus2.cube`; - nspin = 4: `taus1.cube`, `taus2.cube`, `taus3.cube`, and `taus4.cube`; - - 2: On top of 1, also output the initial charge density files with a suffix name as '_ini', such as `taus1_ini.cube`, etc. + - 2: On top of 1, also output the initial charge density files. The files are named as: + - out_freq_ion = 0: + - nspin = 1: `chg_ini.cube`; + - nspin = 2: `chgs1_ini.cube` and `chgs2_ini.cube`; + - nspin = 4: `chgs1_ini.cube`, `chgs2_ini.cube`, `chgs3_ini.cube`, and `chgs4_ini.cube`; + - output at every step (overwrite same file) + - out_freq_ion > 0: + - nspin = 1: `chgg{geom_step}_ini.cube` (e.g., `chgg1_ini.cube`); + - nspin = 2: `chgs1g{geom_step}_ini.cube` and `chgs2g{geom_step}_ini.cube`; + - nspin = 4: `chgs1g{geom_step}_ini.cube`, `chgs2g{geom_step}_ini.cube`, `chgs3g{geom_step}_ini.cube`, and `chgs4g{geom_step}_ini.cube`. + - output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). - -1: Disable the charge density auto-back-up file `{suffix}-CHARGE-DENSITY.restart`, useful for large systems. The second integer controls the precision of the charge density output. If not given, `3` is used as default. For restarting from this file and other high-precision calculations, `10` is recommended. @@ -120,9 +131,17 @@ In molecular dynamics simulations, the output frequency is controlled by out_fre * nspin = 4: pots1.cube, pots2.cube, pots3.cube, and pots4.cube * 2: Output the electrostatic potential on real space grids into OUT.{suffix}/pot_es.cube. The Python script named tools/average_pot/aveElecStatPot.py can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE. Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential. * 3: Apart from 1, also output the total local potential of the initial charge density. The files are named as: - * nspin = 1: pots1_ini.cube; - * nspin = 2: pots1_ini.cube and pots2_ini.cube; - * nspin = 4: pots1_ini.cube, pots2_ini.cube, pots3_ini.cube, and pots4_ini.cube + * out_freq_ion = 0: + * nspin = 1: `pot_ini.cube`; + * nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`; + * nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`; + * output at every step (overwrite same file) + * out_freq_ion > 0: + * nspin = 1: `potg{geom_step}_ini.cube` (e.g., `potg1_ini.cube`); + * nspin = 2: `pots1g{geom_step}_ini.cube` and `pots2g{geom_step}_ini.cube`; + * nspin = 4: `pots1g{geom_step}_ini.cube`, `pots2g{geom_step}_ini.cube`, `pots3g{geom_step}_ini.cube`, and `pots4g{geom_step}_ini.cube`. + * output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). The optional second integer controls the output precision. If not provided, the default precision is 8. @@ -966,12 +985,14 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r item.type = R"(Integer \[Integer\](optional))"; item.description = R"(Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as * nspin = 1: - * elf.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$; + * elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$; * nspin = 2: - * elf1.cube, elf2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; - * elf.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; + * elfs1.cube, elfs2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; + * elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; * nspin = 4 (noncollinear): - * elf.cube: ELF for total charge density, ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$ + * elftot.cube: ELF for total charge density, ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$ + +When `out_freq_ion > 0`, a geometry step suffix `g{#}` is appended to the file names (e.g., `elftotg1.cube`, `elfs1g1.cube`). The second integer controls the precision of the kinetic energy density output, if not given, will use 3 as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use 10. @@ -991,9 +1012,9 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr } }; item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.out_elf[0] > 0 && para.input.esolver_type != "ksdft" && para.input.esolver_type != "ofdft") + if (para.input.out_elf[0] > 0 && para.input.esolver_type != "ksdft" && para.input.esolver_type != "ofdft" && para.input.esolver_type != "tddft") { - ModuleBase::WARNING_QUIT("ReadInput", "ELF is only aviailable for ksdft and ofdft"); + ModuleBase::WARNING_QUIT("ReadInput", "ELF is only available for ksdft, ofdft and tddft"); } }; sync_intvec(input.out_elf, 2, 0); diff --git a/tests/01_PW/nscf_out_pot/INPUT b/tests/01_PW/nscf_out_pot/INPUT index 63fd05c8cc4..3afecb93938 100644 --- a/tests/01_PW/nscf_out_pot/INPUT +++ b/tests/01_PW/nscf_out_pot/INPUT @@ -5,7 +5,7 @@ calculation nscf nbands 8 symmetry 1 -out_pot 1 +out_pot 1 3 #Parameters (2.Iteration) ecutwfc 5 diff --git a/tests/01_PW/nscf_out_pot/pot.cube.ref b/tests/01_PW/nscf_out_pot/pot.cube.ref index b7de1a905ef..9490ba892b8 100644 --- a/tests/01_PW/nscf_out_pot/pot.cube.ref +++ b/tests/01_PW/nscf_out_pot/pot.cube.ref @@ -1,4 +1,4 @@ -Ionic_Step 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +Ionic_Step 1 Cubefile created from ABACUS. Inner loop is z, followed by y and x 1 # number of spin directions 1 0.0 0.0 0.0 9 0.000000 0.495556 0.495556 diff --git a/tests/01_PW/scf_out_elf/refelf.cube b/tests/01_PW/scf_out_elf/refelftot.cube similarity index 100% rename from tests/01_PW/scf_out_elf/refelf.cube rename to tests/01_PW/scf_out_elf/refelftot.cube diff --git a/tests/03_NAO_multik/nscf_out_pot1/pot.cube.ref b/tests/03_NAO_multik/nscf_out_pot1/pot.cube.ref index 9b45c89cf68..6bff38268fd 100644 --- a/tests/03_NAO_multik/nscf_out_pot1/pot.cube.ref +++ b/tests/03_NAO_multik/nscf_out_pot1/pot.cube.ref @@ -1,4 +1,4 @@ -Ionic_Step 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +Ionic_Step 1 Cubefile created from ABACUS. Inner loop is z, followed by y and x 1 # number of spin directions 2 0.0 0.0 0.0 12 0.000000 0.425000 0.425000 diff --git a/tests/03_NAO_multik/scf_out_chg_pot1/pot.cube.ref b/tests/03_NAO_multik/scf_out_chg_pot1/pot.cube.ref index 2b7ef788960..6dddbcfc4cd 100644 --- a/tests/03_NAO_multik/scf_out_chg_pot1/pot.cube.ref +++ b/tests/03_NAO_multik/scf_out_chg_pot1/pot.cube.ref @@ -1,4 +1,4 @@ -Ionic_Step 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +Ionic_Step 1 Cubefile created from ABACUS. Inner loop is z, followed by y and x 1 # number of spin directions 2 0.0 0.0 0.0 8 0.662500 0.000000 0.000000 diff --git a/tests/03_NAO_multik/scf_out_elf/refelf.cube b/tests/03_NAO_multik/scf_out_elf/refelftot.cube similarity index 100% rename from tests/03_NAO_multik/scf_out_elf/refelf.cube rename to tests/03_NAO_multik/scf_out_elf/refelftot.cube diff --git a/tests/07_OFDFT/24_OF_out_elf/refelf.cube b/tests/07_OFDFT/24_OF_out_elf/refelftot.cube similarity index 100% rename from tests/07_OFDFT/24_OF_out_elf/refelf.cube rename to tests/07_OFDFT/24_OF_out_elf/refelftot.cube diff --git a/tests/integrate/tools/catch_properties.sh b/tests/integrate/tools/catch_properties.sh index 859d35309fc..c6070a8fc44 100755 --- a/tests/integrate/tools/catch_properties.sh +++ b/tests/integrate/tools/catch_properties.sh @@ -219,8 +219,8 @@ fi # echo $out_elf #------------------------------- if ! test -z "$out_elf" && [ $out_elf == 1 ]; then - elf1ref=refelf.cube - elf1cal=OUT.autotest/elf.cube + elf1ref=refelftot.cube + elf1cal=OUT.autotest/elftot.cube python3 $COMPARE_SCRIPT $elf1ref $elf1cal 3 echo "ComparePot1_pass $?" >>$1 fi