From db2197f521500701110e6b0c06c86526c2d1016e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 May 2023 02:13:22 +0000 Subject: [PATCH 1/8] split init_rho from main charge.cpp file --- source/Makefile.Objects | 1 + source/module_elecstate/CMakeLists.txt | 1 + .../module_elecstate/module_charge/charge.cpp | 121 --------------- .../module_charge/charge_init.cpp | 140 ++++++++++++++++++ 4 files changed, 142 insertions(+), 121 deletions(-) create mode 100644 source/module_elecstate/module_charge/charge_init.cpp diff --git a/source/Makefile.Objects b/source/Makefile.Objects index aef11c48dd..c19d108653 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -440,6 +440,7 @@ OBJS_SRCPW=H_Ewald_pw.o\ VNL_in_pw.o\ VNL_grad_pw.o\ charge.o\ + charge_init.o\ charge_broyden.o\ charge_extra.o\ charge_mixing.o\ diff --git a/source/module_elecstate/CMakeLists.txt b/source/module_elecstate/CMakeLists.txt index 0520618143..bcad749d7f 100644 --- a/source/module_elecstate/CMakeLists.txt +++ b/source/module_elecstate/CMakeLists.txt @@ -16,6 +16,7 @@ list(APPEND objects potentials/potential_types.cpp potentials/write_pot.cpp module_charge/charge.cpp + module_charge/charge_init.cpp module_charge/charge_broyden.cpp module_charge/charge_extra.cpp module_charge/charge_mixing.cpp diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index 7c19bfb370..3d27ee4d9d 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -158,127 +158,6 @@ void Charge::allocate(const int &nspin_in) return; } -void Charge::init_rho(elecstate::efermi& eferm_iout, const ModuleBase::ComplexMatrix& strucFac) -{ - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "init_chg", GlobalV::init_chg); - - std::cout << " START CHARGE : " << GlobalV::init_chg << std::endl; - if (GlobalV::init_chg == "atomic") // mohan add 2007-10-17 - { - this->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho, strucFac); - } - else if (GlobalV::init_chg == "file") - { - GlobalV::ofs_running << " try to read charge from file : "; - for (int is = 0; is < GlobalV::NSPIN; ++is) - { - std::stringstream ssc; - ssc << GlobalV::global_readin_dir << "SPIN" << is + 1 << "_CHG.cube"; - GlobalV::ofs_running << ssc.str() << std::endl; - double& ef_tmp = eferm_iout.get_ef(is); - if (ModuleIO::read_rho( -#ifdef __MPI - &(GlobalC::Pgrid), -#endif - is, - GlobalV::NSPIN, - ssc.str(), - this->rho[is], - this->rhopw->nx, - this->rhopw->ny, - this->rhopw->nz, - ef_tmp, - &(GlobalC::ucell), - this->prenspin)) - { - GlobalV::ofs_running << " Read in the charge density: " << ssc.str() << std::endl; - } - else if(is > 0) - { - if (prenspin == 1) - { - GlobalV::ofs_running << " Didn't read in the charge density but autoset it for spin " << is + 1 - << std::endl; - for (int ir = 0; ir < this->rhopw->nrxx; ir++) - { - this->rho[is][ir] = 0.0; - } - } - // - else if (prenspin == 2) - { // read up and down , then rearrange them. - if (is == 1) - { - ModuleBase::WARNING_QUIT("Charge::init_rho", "Incomplete charge density file!"); - } - else if (is == 2) - { - GlobalV::ofs_running << " Didn't read in the charge density but would rearrange it later. " - << std::endl; - } - else if (is == 3) - { - GlobalV::ofs_running << " rearrange charge density " << std::endl; - for (int ir = 0; ir < this->rhopw->nrxx; ir++) - { - this->rho[3][ir] = this->rho[0][ir] - this->rho[1][ir]; - this->rho[0][ir] = this->rho[0][ir] + this->rho[1][ir]; - this->rho[1][ir] = 0.0; - this->rho[2][ir] = 0.0; - } - } - } - } - else - { - ModuleBase::WARNING_QUIT("init_rho","!!! Couldn't find the charge file !!! The default directory \n of SPIN1_CHG.cube is OUT.suffix, or you must set read_file_dir \n to a specific directory. "); - } - } - - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - for (int is = 0; is < GlobalV::NSPIN; is++) - { - std::stringstream ssc; - ssc << GlobalV::global_readin_dir << "SPIN" << is + 1 << "_TAU.cube"; - GlobalV::ofs_running << " try to read kinetic energy density from file : " << ssc.str() << std::endl; - // mohan update 2012-02-10, sunliang update 2023-03-09 - if (ModuleIO::read_rho( -#ifdef __MPI - &(GlobalC::Pgrid), -#endif - is, - GlobalV::NSPIN, - ssc.str(), - this->kin_r[is], - this->rhopw->nx, - this->rhopw->ny, - this->rhopw->nz, - eferm_iout.ef, - &(GlobalC::ucell), - this->prenspin)) - { - GlobalV::ofs_running << " Read in the kinetic energy density: " << ssc.str() << std::endl; - } - } - } - } - else - { - ModuleBase::WARNING_QUIT("Charge::init_rho", "init_chg is wrong!"); - } - - // Peize Lin add 2020.04.04 - if (GlobalC::restart.info_load.load_charge && !GlobalC::restart.info_load.load_charge_finish) - { - for (int is = 0; is < GlobalV::NSPIN; ++is) - { - GlobalC::restart.load_disk("charge", is, this->nrxx, rho); - } - GlobalC::restart.info_load.load_charge_finish = true; - } -} - double Charge::sum_rho(void) const { ModuleBase::TITLE("Charge","sum_rho"); diff --git a/source/module_elecstate/module_charge/charge_init.cpp b/source/module_elecstate/module_charge/charge_init.cpp new file mode 100644 index 0000000000..e264398156 --- /dev/null +++ b/source/module_elecstate/module_charge/charge_init.cpp @@ -0,0 +1,140 @@ +#include + +#include "charge.h" +#include "module_base/global_function.h" +#include "module_base/global_variable.h" +#include "module_base/libm/libm.h" +#include "module_base/math_integral.h" +#include "module_base/math_sphbes.h" +#include "module_base/memory.h" +#include "module_base/parallel_reduce.h" +#include "module_base/timer.h" +#include "module_base/tool_threading.h" +#include "module_elecstate/magnetism.h" +#include "module_hamilt_pw/hamilt_pwdft/global.h" +#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" +#include "module_io/rho_io.h" + +void Charge::init_rho(elecstate::efermi& eferm_iout, const ModuleBase::ComplexMatrix& strucFac) +{ + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "init_chg", GlobalV::init_chg); + + std::cout << " START CHARGE : " << GlobalV::init_chg << std::endl; + if (GlobalV::init_chg == "atomic") // mohan add 2007-10-17 + { + this->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho, strucFac); + } + else if (GlobalV::init_chg == "file") + { + GlobalV::ofs_running << " try to read charge from file : "; + for (int is = 0; is < GlobalV::NSPIN; ++is) + { + std::stringstream ssc; + ssc << GlobalV::global_readin_dir << "SPIN" << is + 1 << "_CHG.cube"; + GlobalV::ofs_running << ssc.str() << std::endl; + double& ef_tmp = eferm_iout.get_ef(is); + if (ModuleIO::read_rho( +#ifdef __MPI + &(GlobalC::Pgrid), +#endif + is, + GlobalV::NSPIN, + ssc.str(), + this->rho[is], + this->rhopw->nx, + this->rhopw->ny, + this->rhopw->nz, + ef_tmp, + &(GlobalC::ucell), + this->prenspin)) + { + GlobalV::ofs_running << " Read in the charge density: " << ssc.str() << std::endl; + } + else if (is > 0) + { + if (prenspin == 1) + { + GlobalV::ofs_running << " Didn't read in the charge density but autoset it for spin " << is + 1 + << std::endl; + for (int ir = 0; ir < this->rhopw->nrxx; ir++) + { + this->rho[is][ir] = 0.0; + } + } + // + else if (prenspin == 2) + { // read up and down , then rearrange them. + if (is == 1) + { + ModuleBase::WARNING_QUIT("Charge::init_rho", "Incomplete charge density file!"); + } + else if (is == 2) + { + GlobalV::ofs_running << " Didn't read in the charge density but would rearrange it later. " + << std::endl; + } + else if (is == 3) + { + GlobalV::ofs_running << " rearrange charge density " << std::endl; + for (int ir = 0; ir < this->rhopw->nrxx; ir++) + { + this->rho[3][ir] = this->rho[0][ir] - this->rho[1][ir]; + this->rho[0][ir] = this->rho[0][ir] + this->rho[1][ir]; + this->rho[1][ir] = 0.0; + this->rho[2][ir] = 0.0; + } + } + } + } + else + { + ModuleBase::WARNING_QUIT( + "init_rho", + "!!! Couldn't find the charge file !!! The default directory \n of SPIN1_CHG.cube is OUT.suffix, " + "or you must set read_file_dir \n to a specific directory. "); + } + } + + if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) + { + for (int is = 0; is < GlobalV::NSPIN; is++) + { + std::stringstream ssc; + ssc << GlobalV::global_readin_dir << "SPIN" << is + 1 << "_TAU.cube"; + GlobalV::ofs_running << " try to read kinetic energy density from file : " << ssc.str() << std::endl; + // mohan update 2012-02-10, sunliang update 2023-03-09 + if (ModuleIO::read_rho( +#ifdef __MPI + &(GlobalC::Pgrid), +#endif + is, + GlobalV::NSPIN, + ssc.str(), + this->kin_r[is], + this->rhopw->nx, + this->rhopw->ny, + this->rhopw->nz, + eferm_iout.ef, + &(GlobalC::ucell), + this->prenspin)) + { + GlobalV::ofs_running << " Read in the kinetic energy density: " << ssc.str() << std::endl; + } + } + } + } + else + { + ModuleBase::WARNING_QUIT("Charge::init_rho", "init_chg is wrong!"); + } + + // Peize Lin add 2020.04.04 + if (GlobalC::restart.info_load.load_charge && !GlobalC::restart.info_load.load_charge_finish) + { + for (int is = 0; is < GlobalV::NSPIN; ++is) + { + GlobalC::restart.load_disk("charge", is, this->nrxx, rho); + } + GlobalC::restart.info_load.load_charge_finish = true; + } +} From 0b4b3ea7477ae56703839187e53da21075907b44 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 May 2023 03:18:49 +0000 Subject: [PATCH 2/8] remove GlobalC::ucell in charge.cpp --- .../module_elecstate/module_charge/charge.cpp | 1435 +++++++---------- .../module_elecstate/module_charge/charge.h | 11 +- .../module_charge/charge_extra.cpp | 4 +- .../module_charge/charge_init.cpp | 194 ++- source/module_esolver/esolver_ks.cpp | 2 +- source/module_esolver/esolver_of.cpp | 2 +- 6 files changed, 825 insertions(+), 823 deletions(-) diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index 3d27ee4d9d..7cf02e3dc3 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -24,23 +24,20 @@ #include "module_base/global_variable.h" #include "module_base/libm/libm.h" #include "module_base/math_integral.h" -#include "module_base/math_sphbes.h" #include "module_base/memory.h" #include "module_base/parallel_reduce.h" #include "module_base/timer.h" #include "module_base/tool_threading.h" +#include "module_cell/unitcell.h" +#include "module_elecstate/elecstate_getters.h" #include "module_elecstate/magnetism.h" -#include "module_hamilt_pw/hamilt_pwdft/global.h" -#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" -#include "module_io/rho_io.h" Charge::Charge() { - allocate_rho = false; - allocate_rho_final_scf = false; //LiuXh add 20180619 + allocate_rho = false; + allocate_rho_final_scf = false; // LiuXh add 20180619 } - Charge::~Charge() { this->destroy(); @@ -48,20 +45,20 @@ Charge::~Charge() void Charge::set_rhopw(ModulePW::PW_Basis* rhopw_in) { - this->rhopw = rhopw_in; + this->rhopw = rhopw_in; } void Charge::destroy() { - if(allocate_rho || allocate_rho_final_scf) //LiuXh add 20180619 + if (allocate_rho || allocate_rho_final_scf) // LiuXh add 20180619 { - for(int i=0; inrxx = this->rhopw->nrxx; - this->nxyz = this->rhopw->nxyz; - this->ngmc = this->rhopw->npw; + ModuleBase::TITLE("Charge", "allocate"); + this->nrxx = this->rhopw->nrxx; + this->nxyz = this->rhopw->nxyz; + this->ngmc = this->rhopw->npw; - if(allocate_rho == true) + if (allocate_rho == true) { this->destroy(); allocate_rho = false; } - assert(allocate_rho == false); + assert(allocate_rho == false); - // mohan add 2021-02-20 - this->nspin = nspin_in; + // mohan add 2021-02-20 + this->nspin = nspin_in; if (GlobalV::test_charge > 1) { - std::cout << "\n spin_number = " << nspin - << " real_point_number = " << nrxx; + std::cout << "\n spin_number = " << nspin << " real_point_number = " << nrxx; + } + + // allocate memory + rho = new double*[nspin]; + rhog = new std::complex*[nspin]; + rho_save = new double*[nspin]; + rhog_save = new std::complex*[nspin]; + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + kin_r = new double*[nspin]; + kin_r_save = new double*[nspin]; + } + + for (int is = 0; is < nspin; is++) + { + rho[is] = new double[nrxx]; + rhog[is] = new std::complex[ngmc]; + rho_save[is] = new double[nrxx]; + rhog_save[is] = new std::complex[ngmc]; + ModuleBase::GlobalFunc::ZEROS(rho[is], nrxx); + ModuleBase::GlobalFunc::ZEROS(rhog[is], ngmc); + ModuleBase::GlobalFunc::ZEROS(rho_save[is], nrxx); + ModuleBase::GlobalFunc::ZEROS(rhog_save[is], ngmc); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + kin_r[is] = new double[nrxx]; + ModuleBase::GlobalFunc::ZEROS(kin_r[is], nrxx); + kin_r_save[is] = new double[nrxx]; + ModuleBase::GlobalFunc::ZEROS(kin_r_save[is], nrxx); + } } - // allocate memory - rho = new double*[nspin]; - rhog = new std::complex*[nspin]; - rho_save = new double*[nspin]; - rhog_save = new std::complex*[nspin]; - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - kin_r = new double*[nspin]; - kin_r_save = new double*[nspin]; - } - - for(int is=0; is[ngmc]; - rho_save[is] = new double[nrxx]; - rhog_save[is] = new std::complex[ngmc]; - ModuleBase::GlobalFunc::ZEROS(rho[is], nrxx); - ModuleBase::GlobalFunc::ZEROS(rhog[is], ngmc); - ModuleBase::GlobalFunc::ZEROS(rho_save[is], nrxx); - ModuleBase::GlobalFunc::ZEROS(rhog_save[is], ngmc); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - kin_r[is] = new double[nrxx]; - ModuleBase::GlobalFunc::ZEROS(kin_r[is], nrxx); - kin_r_save[is] = new double[nrxx]; - ModuleBase::GlobalFunc::ZEROS(kin_r_save[is], nrxx); - } - } - - ModuleBase::Memory::record("Chg::rho", sizeof(double) * nspin*nrxx); - ModuleBase::Memory::record("Chg::rho_save", sizeof(double) * nspin*nrxx); - ModuleBase::Memory::record("Chg::rhog", sizeof(double) * nspin*ngmc); - ModuleBase::Memory::record("Chg::rhog_save", sizeof(double) * nspin*ngmc); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - ModuleBase::Memory::record("Chg::kin_r", sizeof(double) * nspin*ngmc); - ModuleBase::Memory::record("Chg::kin_r_save", sizeof(double) * nspin*ngmc); - } + ModuleBase::Memory::record("Chg::rho", sizeof(double) * nspin * nrxx); + ModuleBase::Memory::record("Chg::rho_save", sizeof(double) * nspin * nrxx); + ModuleBase::Memory::record("Chg::rhog", sizeof(double) * nspin * ngmc); + ModuleBase::Memory::record("Chg::rhog_save", sizeof(double) * nspin * ngmc); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + ModuleBase::Memory::record("Chg::kin_r", sizeof(double) * nspin * ngmc); + ModuleBase::Memory::record("Chg::kin_r_save", sizeof(double) * nspin * ngmc); + } this->rho_core = new double[nrxx]; // core charge in real space - ModuleBase::GlobalFunc::ZEROS( rho_core, nrxx); + ModuleBase::GlobalFunc::ZEROS(rho_core, nrxx); - this->rhog_core = new std::complex[ngmc]; // reciprocal core charge - ModuleBase::GlobalFunc::ZEROS( rhog_core, ngmc); + this->rhog_core = new std::complex[ngmc]; // reciprocal core charge + ModuleBase::GlobalFunc::ZEROS(rhog_core, ngmc); ModuleBase::Memory::record("Chg::rho_core", sizeof(double) * nrxx); ModuleBase::Memory::record("Chg::rhog_core", sizeof(double) * ngmc); - this->allocate_rho = true; + this->allocate_rho = true; return; } double Charge::sum_rho(void) const { - ModuleBase::TITLE("Charge","sum_rho"); + ModuleBase::TITLE("Charge", "sum_rho"); double sum_rho = 0.0; int nspin0 = 1; - if(nspin==2) - { - nspin0 = 2; - } - - for(int is=0; isrho[is][ir]; - } - } - - // multiply the sum of charge density by a factor - sum_rho *= GlobalC::ucell.omega / static_cast( this->rhopw->nxyz ); - Parallel_Reduce::reduce_double_pool( sum_rho ); - - // mohan fixed bug 2010-01-18, - // sum_rho may be smaller than 1, like Na bcc. + if (nspin == 2) + { + nspin0 = 2; + } + + for (int is = 0; is < nspin0; is++) + { + for (int ir = 0; ir < nrxx; ir++) + { + sum_rho += this->rho[is][ir]; + } + } + + // multiply the sum of charge density by a factor + sum_rho *= elecstate::get_ucell_omega() / static_cast(this->rhopw->nxyz); + Parallel_Reduce::reduce_double_pool(sum_rho); + + // mohan fixed bug 2010-01-18, + // sum_rho may be smaller than 1, like Na bcc. if (sum_rho <= 0.1) { - GlobalV::ofs_warning << " sum_rho=" << sum_rho << std::endl; - ModuleBase::WARNING_QUIT("Charge::renormalize_rho","Can't find even an electron!"); + GlobalV::ofs_warning << " sum_rho=" << sum_rho << std::endl; + ModuleBase::WARNING_QUIT("Charge::renormalize_rho", "Can't find even an electron!"); } return sum_rho; } - void Charge::renormalize_rho(void) { - ModuleBase::TITLE("Charge","renormalize_rho"); + ModuleBase::TITLE("Charge", "renormalize_rho"); const double sr = this->sum_rho(); - GlobalV::ofs_warning << std::setprecision(15); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning,"charge before normalized",sr); + GlobalV::ofs_warning << std::setprecision(15); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning, "charge before normalized", sr); const double normalize_factor = GlobalV::nelec / sr; - for(int is=0; issum_rho()); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning, "charge after normalized", this->sum_rho()); - GlobalV::ofs_running << std::setprecision(6); + GlobalV::ofs_running << std::setprecision(6); return; } @@ -221,583 +216,391 @@ void Charge::renormalize_rho(void) // rho_at (read from pseudopotential files) // allocate work space (psic must already be allocated) //------------------------------------------------------- -void Charge::atomic_rho(const int spin_number_need, const double& omega, double** rho_in, const ModuleBase::ComplexMatrix &strucFac)const // Peize Lin refactor 2021.04.08 +void Charge::atomic_rho(const int spin_number_need, + const double& omega, + double** rho_in, + const ModuleBase::ComplexMatrix& strucFac, + const UnitCell& ucell) const // Peize Lin refactor 2021.04.08 { - ModuleBase::TITLE("Charge","atomic_rho"); - ModuleBase::timer::tick("Charge","atomic_rho"); - - ModuleBase::ComplexMatrix rho_g3d = [&]()->ModuleBase::ComplexMatrix - { - // use interpolation to get three dimension charge density. - ModuleBase::ComplexMatrix rho_g3d( spin_number_need, this->rhopw->npw); - - for (int it = 0;it < GlobalC::ucell.ntype;it++) - { - // check the start magnetization - const int startmag_type = [&]()->int - { - if( GlobalC::ucell.magnet.start_magnetization[it] != 0.0) return 1; - return 2; - }(); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning,"startmag_type",startmag_type); - - const Atom* const atom = &GlobalC::ucell.atoms[it]; - - if(!atom->flag_empty_element) // Peize Lin add for bsse 2021.04.07 - { - const std::vector rho_lgl = [&]()->std::vector - { - // one dimension of charge in G space. - std::vector rho_lgl(this->rhopw->ngg,0); - - // mesh point of this element. - const int mesh = atom->ncpp.msh; - - //---------------------------------------------------------- - // Here we check the electron number - //---------------------------------------------------------- - const std::vector rhoatm = [&]()->std::vector - { - std::vector rhoatm(mesh); - for(int ir=0; irncpp.r[ir]*atom->ncpp.r[ir]; - rhoatm[ir]=atom->ncpp.rho_at[ir]/ModuleBase::FOUR_PI/r2; - } - rhoatm[0] = pow( (rhoatm[2]/rhoatm[1]), 1./(atom->ncpp.r[2]-atom->ncpp.r[1]) );//zws add - rhoatm[0] = pow(rhoatm[0], atom->ncpp.r[1]); - rhoatm[0] = rhoatm[1] / rhoatm[0]; - - double charge = 0.0; - ModuleBase::Integral::Simpson_Integral(atom->ncpp.msh,atom->ncpp.rho_at,atom->ncpp.rab,charge); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning,"charge from rho_at",charge); - assert(charge!=0.0 || charge==atom->ncpp.zv); // Peize Lin add charge==atom->zv for bsse 2021.04.07 - - double scale=1.0; - if(charge!=atom->ncpp.zv) - { - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning,"charge should be",atom->ncpp.zv); - scale = atom->ncpp.zv/charge; - } - - for(int ir=0; irncpp.r[ir]*atom->ncpp.r[ir]); - } - return rhoatm; - }(); - - assert(GlobalC::ucell.meshx>0); - //---------------------------------------------------------- - // Here we compute the G=0 term - //---------------------------------------------------------- - int gstart = 0; - if(this->rhopw->gg_uniq[0] < 1e-8) - { - std::vector rho1d(GlobalC::ucell.meshx); - for (int ir = 0;ir < mesh;ir++) - { - // rho1d [ir] = atom->rho_at[ir]; - rho1d[ir] = rhoatm[ir]; - } - ModuleBase::Integral::Simpson_Integral(mesh, rho1d.data(), atom->ncpp.rab, rho_lgl[0]); - gstart = 1; - } - if (GlobalV::test_charge>0) std::cout<<"\n |G|=0 term done." <0 term - // But if in parallel case - // G=0 term only belong to 1 cpu. - // Other processors start from '0' - //---------------------------------------------------------- + ModuleBase::TITLE("Charge", "atomic_rho"); + ModuleBase::timer::tick("Charge", "atomic_rho"); + + ModuleBase::ComplexMatrix rho_g3d = [&]() -> ModuleBase::ComplexMatrix { + // use interpolation to get three dimension charge density. + ModuleBase::ComplexMatrix rho_g3d(spin_number_need, this->rhopw->npw); + + for (int it = 0; it < ucell.ntype; it++) + { + // check the start magnetization + const int startmag_type = [&]() -> int { + if (ucell.magnet.start_magnetization[it] != 0.0) + return 1; + return 2; + }(); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning, "startmag_type", startmag_type); + + const Atom* const atom = &ucell.atoms[it]; + + if (!atom->flag_empty_element) // Peize Lin add for bsse 2021.04.07 + { + const std::vector rho_lgl = [&]() -> std::vector { + // one dimension of charge in G space. + std::vector rho_lgl(this->rhopw->ngg, 0); + + // mesh point of this element. + const int mesh = atom->ncpp.msh; + + //---------------------------------------------------------- + // Here we check the electron number + //---------------------------------------------------------- + const std::vector rhoatm = [&]() -> std::vector { + std::vector rhoatm(mesh); + for (int ir = 0; ir < mesh; ++ir) + { + double r2 = atom->ncpp.r[ir] * atom->ncpp.r[ir]; + rhoatm[ir] = atom->ncpp.rho_at[ir] / ModuleBase::FOUR_PI / r2; + } + rhoatm[0] = pow((rhoatm[2] / rhoatm[1]), 1. / (atom->ncpp.r[2] - atom->ncpp.r[1])); // zws add + rhoatm[0] = pow(rhoatm[0], atom->ncpp.r[1]); + rhoatm[0] = rhoatm[1] / rhoatm[0]; + + double charge = 0.0; + ModuleBase::Integral::Simpson_Integral(atom->ncpp.msh, + atom->ncpp.rho_at, + atom->ncpp.rab, + charge); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning, "charge from rho_at", charge); + assert(charge != 0.0 + || charge == atom->ncpp.zv); // Peize Lin add charge==atom->zv for bsse 2021.04.07 + + double scale = 1.0; + if (charge != atom->ncpp.zv) + { + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_warning, "charge should be", atom->ncpp.zv); + scale = atom->ncpp.zv / charge; + } + + for (int ir = 0; ir < mesh; ++ir) + { + rhoatm[ir] *= scale; + rhoatm[ir] *= (ModuleBase::FOUR_PI * atom->ncpp.r[ir] * atom->ncpp.r[ir]); + } + return rhoatm; + }(); + + assert(ucell.meshx > 0); + //---------------------------------------------------------- + // Here we compute the G=0 term + //---------------------------------------------------------- + int gstart = 0; + if (this->rhopw->gg_uniq[0] < 1e-8) + { + std::vector rho1d(ucell.meshx); + for (int ir = 0; ir < mesh; ir++) + { + // rho1d [ir] = atom->rho_at[ir]; + rho1d[ir] = rhoatm[ir]; + } + ModuleBase::Integral::Simpson_Integral(mesh, rho1d.data(), atom->ncpp.rab, rho_lgl[0]); + gstart = 1; + } + if (GlobalV::test_charge > 0) + std::cout << "\n |G|=0 term done." << std::endl; + //---------------------------------------------------------- + // Here we compute the G<>0 term + // But if in parallel case + // G=0 term only belong to 1 cpu. + // Other processors start from '0' + //---------------------------------------------------------- #ifdef _OPENMP #pragma omp parallel -{ + { #endif - std::vector rho1d(GlobalC::ucell.meshx); + std::vector rho1d(ucell.meshx); #ifdef _OPENMP #pragma omp for #endif - for (int igg = gstart; igg < this->rhopw->ngg ;++igg) - { - const double gx = sqrt(this->rhopw->gg_uniq[igg]) * GlobalC::ucell.tpiba; - for (int ir = 0; ir < mesh;ir++) - { - if ( atom->ncpp.r[ir] < 1.0e-8 ) - { - rho1d[ir] = rhoatm[ir]; - //rho1d[ir] = atom->rho_at[ir]; - } - else - { - const double gxx = gx * atom->ncpp.r[ir]; - rho1d[ir] = rhoatm[ir] * ModuleBase::libm::sin(gxx) / gxx; - } - } - ModuleBase::Integral::Simpson_Integral(mesh, rho1d.data(), atom->ncpp.rab, rho_lgl[igg]); - } + for (int igg = gstart; igg < this->rhopw->ngg; ++igg) + { + const double gx = sqrt(this->rhopw->gg_uniq[igg]) * ucell.tpiba; + for (int ir = 0; ir < mesh; ir++) + { + if (atom->ncpp.r[ir] < 1.0e-8) + { + rho1d[ir] = rhoatm[ir]; + // rho1d[ir] = atom->rho_at[ir]; + } + else + { + const double gxx = gx * atom->ncpp.r[ir]; + rho1d[ir] = rhoatm[ir] * ModuleBase::libm::sin(gxx) / gxx; + } + } + ModuleBase::Integral::Simpson_Integral(mesh, rho1d.data(), atom->ncpp.rab, rho_lgl[igg]); + } #ifdef _OPENMP #pragma omp single #endif - { if (GlobalV::test_charge>0) std::cout<<" |G|>0 term done." < 0) + std::cout << " |G|>0 term done." << std::endl; + } + //---------------------------------------------------------- + // EXPLAIN : Complete the transfer of rho from real space to + // reciprocal space + //---------------------------------------------------------- #ifdef _OPENMP #pragma omp for #endif - for (int igg=0; igg< this->rhopw->ngg ; igg++) - rho_lgl[igg] /= omega; + for (int igg = 0; igg < this->rhopw->ngg; igg++) + rho_lgl[igg] /= omega; #ifdef _OPENMP -} + } #endif - return rho_lgl; - }(); - //---------------------------------------------------------- - // EXPLAIN : compute the 3D atomic charge in reciprocal space - //---------------------------------------------------------- - if(spin_number_need==1) - { + return rho_lgl; + }(); + //---------------------------------------------------------- + // EXPLAIN : compute the 3D atomic charge in reciprocal space + //---------------------------------------------------------- + if (spin_number_need == 1) + { #ifdef _OPENMP #pragma omp parallel for #endif - for (int ig=0; ig< this->rhopw->npw ;ig++) - { - rho_g3d(0, ig) += strucFac(it, ig) * rho_lgl[ this->rhopw->ig2igg[ig] ]; - } - } - // mohan add 2011-06-14, initialize the charge density according to each atom - else if(spin_number_need==2) - { - if(startmag_type==1) - { + for (int ig = 0; ig < this->rhopw->npw; ig++) + { + rho_g3d(0, ig) += strucFac(it, ig) * rho_lgl[this->rhopw->ig2igg[ig]]; + } + } + // mohan add 2011-06-14, initialize the charge density according to each atom + else if (spin_number_need == 2) + { + if (startmag_type == 1) + { #ifdef _OPENMP #pragma omp parallel for #endif - for (int ig = 0; ig < this->rhopw->npw ; ig++) - { - const std::complex swap = strucFac(it, ig)* rho_lgl[this->rhopw->ig2igg[ig]]; - const double up = 0.5 * ( 1 + GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv ); - const double dw = 0.5 * ( 1 - GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv ); - rho_g3d(0, ig) += swap * up; - rho_g3d(1, ig) += swap * dw; - } - } - // mohan add 2011-06-14 - else if(startmag_type==2) - { - std::complex ci_tpi = ModuleBase::NEG_IMAG_UNIT * ModuleBase::TWO_PI; - for (int ia = 0; ia < atom->na; ia++) - { - //const double up = 0.5 * ( 1 + atom->mag[ia] ); - //const double dw = 0.5 * ( 1 - atom->mag[ia] ); - const double up = 0.5 * ( 1 + atom->mag[ia] / atom->ncpp.zv ); - const double dw = 0.5 * ( 1 - atom->mag[ia] / atom->ncpp.zv ); - //std::cout << " atom " << ia << " up=" << up << " dw=" << dw << std::endl; + for (int ig = 0; ig < this->rhopw->npw; ig++) + { + const std::complex swap = strucFac(it, ig) * rho_lgl[this->rhopw->ig2igg[ig]]; + const double up = 0.5 * (1 + ucell.magnet.start_magnetization[it] / atom->ncpp.zv); + const double dw = 0.5 * (1 - ucell.magnet.start_magnetization[it] / atom->ncpp.zv); + rho_g3d(0, ig) += swap * up; + rho_g3d(1, ig) += swap * dw; + } + } + // mohan add 2011-06-14 + else if (startmag_type == 2) + { + std::complex ci_tpi = ModuleBase::NEG_IMAG_UNIT * ModuleBase::TWO_PI; + for (int ia = 0; ia < atom->na; ia++) + { + // const double up = 0.5 * ( 1 + atom->mag[ia] ); + // const double dw = 0.5 * ( 1 - atom->mag[ia] ); + const double up = 0.5 * (1 + atom->mag[ia] / atom->ncpp.zv); + const double dw = 0.5 * (1 - atom->mag[ia] / atom->ncpp.zv); + // std::cout << " atom " << ia << " up=" << up << " dw=" << dw << std::endl; #ifdef _OPENMP #pragma omp parallel for #endif - for (int ig = 0; ig < this->rhopw->npw ; ig++) - { - const double Gtau = - this->rhopw->gcar[ig][0] * atom->tau[ia].x + - this->rhopw->gcar[ig][1] * atom->tau[ia].y + - this->rhopw->gcar[ig][2] * atom->tau[ia].z; - - std::complex swap = ModuleBase::libm::exp(ci_tpi * Gtau) * rho_lgl[this->rhopw->ig2igg[ig]]; - - rho_g3d(0, ig) += swap * up; - rho_g3d(1, ig) += swap * dw; - } - } - } - } - else if(spin_number_need==4) - { - //noncolinear case - if(startmag_type == 1) - { - double sin_a1, sin_a2, cos_a1, cos_a2; - if(GlobalV::DOMAG) - {//will not be used now, will be deleted later - ModuleBase::libm::sincos(atom->angle1[0], &sin_a1, &cos_a1); - ModuleBase::libm::sincos(atom->angle2[0], &sin_a2, &cos_a2); - } + for (int ig = 0; ig < this->rhopw->npw; ig++) + { + const double Gtau = this->rhopw->gcar[ig][0] * atom->tau[ia].x + + this->rhopw->gcar[ig][1] * atom->tau[ia].y + + this->rhopw->gcar[ig][2] * atom->tau[ia].z; + + std::complex swap + = ModuleBase::libm::exp(ci_tpi * Gtau) * rho_lgl[this->rhopw->ig2igg[ig]]; + + rho_g3d(0, ig) += swap * up; + rho_g3d(1, ig) += swap * dw; + } + } + } + } + else if (spin_number_need == 4) + { + // noncolinear case + if (startmag_type == 1) + { + double sin_a1, sin_a2, cos_a1, cos_a2; + if (GlobalV::DOMAG) + { // will not be used now, will be deleted later + ModuleBase::libm::sincos(atom->angle1[0], &sin_a1, &cos_a1); + ModuleBase::libm::sincos(atom->angle2[0], &sin_a2, &cos_a2); + } #ifdef _OPENMP #pragma omp parallel for #endif - for (int ig = 0; ig < this->rhopw->npw ; ig++) - { - const std::complex swap = strucFac(it, ig)* rho_lgl[this->rhopw->ig2igg[ig]]; - rho_g3d(0, ig) += swap ; - if(GlobalV::DOMAG) - {//will not be used now, will be deleted later - rho_g3d(1, ig) += swap * (GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv) - * sin_a1 * cos_a2; - rho_g3d(2, ig) += swap * (GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv) - * sin_a1 * sin_a2; - rho_g3d(3, ig) += swap * (GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv) - * cos_a1; - } - else if(GlobalV::DOMAG_Z) - { - rho_g3d(1, ig) = 0.0; - rho_g3d(2, ig) = 0.0; - rho_g3d(3, ig) += swap * (GlobalC::ucell.magnet.start_magnetization[it] / atom->ncpp.zv); - } - } - } - else if(startmag_type == 2) - {//zdy-warning-not-available - std::complex ci_tpi = ModuleBase::NEG_IMAG_UNIT * ModuleBase::TWO_PI; - for(int ia = 0;iana;ia++) - { - double sin_a1, sin_a2, cos_a1, cos_a2; - if(GlobalV::DOMAG || GlobalV::DOMAG_Z) - { - ModuleBase::libm::sincos(atom->angle1[ia], &sin_a1, &cos_a1); - } - if(GlobalV::DOMAG) - { - ModuleBase::libm::sincos(atom->angle2[ia], &sin_a2, &cos_a2); - } + for (int ig = 0; ig < this->rhopw->npw; ig++) + { + const std::complex swap = strucFac(it, ig) * rho_lgl[this->rhopw->ig2igg[ig]]; + rho_g3d(0, ig) += swap; + if (GlobalV::DOMAG) + { // will not be used now, will be deleted later + rho_g3d(1, ig) + += swap * (ucell.magnet.start_magnetization[it] / atom->ncpp.zv) * sin_a1 * cos_a2; + rho_g3d(2, ig) + += swap * (ucell.magnet.start_magnetization[it] / atom->ncpp.zv) * sin_a1 * sin_a2; + rho_g3d(3, ig) + += swap * (ucell.magnet.start_magnetization[it] / atom->ncpp.zv) * cos_a1; + } + else if (GlobalV::DOMAG_Z) + { + rho_g3d(1, ig) = 0.0; + rho_g3d(2, ig) = 0.0; + rho_g3d(3, ig) += swap * (ucell.magnet.start_magnetization[it] / atom->ncpp.zv); + } + } + } + else if (startmag_type == 2) + { // zdy-warning-not-available + std::complex ci_tpi = ModuleBase::NEG_IMAG_UNIT * ModuleBase::TWO_PI; + for (int ia = 0; ia < atom->na; ia++) + { + double sin_a1, sin_a2, cos_a1, cos_a2; + if (GlobalV::DOMAG || GlobalV::DOMAG_Z) + { + ModuleBase::libm::sincos(atom->angle1[ia], &sin_a1, &cos_a1); + } + if (GlobalV::DOMAG) + { + ModuleBase::libm::sincos(atom->angle2[ia], &sin_a2, &cos_a2); + } #ifdef _OPENMP #pragma omp parallel for #endif - for (int ig = 0; ig < this->rhopw->npw ; ig++) - { - const double Gtau = - this->rhopw->gcar[ig][0] * atom->tau[ia].x + - this->rhopw->gcar[ig][1] * atom->tau[ia].y + - this->rhopw->gcar[ig][2] * atom->tau[ia].z; - - std::complex swap = exp(ci_tpi * Gtau) * rho_lgl[this->rhopw->ig2igg[ig]]; - - //calculate rho_total - rho_g3d(0, ig) += swap; - //calculate mag_z - if(GlobalV::DOMAG || GlobalV::DOMAG_Z) - { - rho_g3d(3, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) - * cos_a1; - } - //calculate mag_x and mag_y - if(GlobalV::DOMAG) - { - rho_g3d(1, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) - * sin_a1 * cos_a2; - rho_g3d(2, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) - * sin_a1 * sin_a2; - } - else - { - rho_g3d(1, ig) = 0.0; - rho_g3d(2, ig) = 0.0; - } - } - } - } - } - else - { - ModuleBase::WARNING_QUIT("Charge::spin_number_need"," Either 1 or 2 or 4, check SPIN number !"); - } - } - } - return rho_g3d; - }(); - - assert( spin_number_need > 0 ); - std::vector ne(spin_number_need); - for (int is = 0; is < spin_number_need;is++) + for (int ig = 0; ig < this->rhopw->npw; ig++) + { + const double Gtau = this->rhopw->gcar[ig][0] * atom->tau[ia].x + + this->rhopw->gcar[ig][1] * atom->tau[ia].y + + this->rhopw->gcar[ig][2] * atom->tau[ia].z; + + std::complex swap = exp(ci_tpi * Gtau) * rho_lgl[this->rhopw->ig2igg[ig]]; + + // calculate rho_total + rho_g3d(0, ig) += swap; + // calculate mag_z + if (GlobalV::DOMAG || GlobalV::DOMAG_Z) + { + rho_g3d(3, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) * cos_a1; + } + // calculate mag_x and mag_y + if (GlobalV::DOMAG) + { + rho_g3d(1, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) * sin_a1 * cos_a2; + rho_g3d(2, ig) += swap * (atom->mag[ia] / atom->ncpp.zv) * sin_a1 * sin_a2; + } + else + { + rho_g3d(1, ig) = 0.0; + rho_g3d(2, ig) = 0.0; + } + } + } + } + } + else + { + ModuleBase::WARNING_QUIT("Charge::spin_number_need", " Either 1 or 2 or 4, check SPIN number !"); + } + } + } + return rho_g3d; + }(); + + assert(spin_number_need > 0); + std::vector ne(spin_number_need); + for (int is = 0; is < spin_number_need; is++) { - this->rhopw->recip2real( &rho_g3d(is,0), rho_in[is]); + this->rhopw->recip2real(&rho_g3d(is, 0), rho_in[is]); - for(int ir=0; irrhopw->nrxx; ++ir) - ne[is] += rho_in[is][ir]; - ne[is] *= omega/(double)this->rhopw->nxyz; - Parallel_Reduce::reduce_double_pool( ne[is] ); + for (int ir = 0; ir < this->rhopw->nrxx; ++ir) + ne[is] += rho_in[is][ir]; + ne[is] *= omega / (double)this->rhopw->nxyz; + Parallel_Reduce::reduce_double_pool(ne[is]); // we check that everything is correct double neg = 0.0; double rea = 0.0; double ima = 0.0; - double sumrea = 0.0; - for (int ir=0;ir < this->rhopw->nrxx; ir++) + double sumrea = 0.0; + for (int ir = 0; ir < this->rhopw->nrxx; ir++) { rea = this->rhopw->ft.get_auxr_data()[ir].real(); - sumrea += rea; + sumrea += rea; neg += std::min(0.0, rea); ima += abs(this->rhopw->ft.get_auxr_data()[ir].imag()); } - Parallel_Reduce::reduce_double_pool( neg ); - Parallel_Reduce::reduce_double_pool( ima ); - Parallel_Reduce::reduce_double_pool( sumrea ); + Parallel_Reduce::reduce_double_pool(neg); + Parallel_Reduce::reduce_double_pool(ima); + Parallel_Reduce::reduce_double_pool(sumrea); - // mohan fix bug 2011-04-03 + // mohan fix bug 2011-04-03 neg = neg / (double)this->rhopw->nxyz * omega; ima = ima / (double)this->rhopw->nxyz * omega; - sumrea = sumrea / (double)this->rhopw->nxyz * omega; + sumrea = sumrea / (double)this->rhopw->nxyz * omega; - if( ((neg<-1.0e-4) && (is==0||GlobalV::NSPIN==2)) || ima>1.0e-4) + if (((neg < -1.0e-4) && (is == 0 || GlobalV::NSPIN == 2)) || ima > 1.0e-4) { - GlobalV::ofs_warning << " Warning: negative or imaginary starting charge : " ; - GlobalV::ofs_warning << " neg = " << neg - << " ima = " << ima - << " SPIN = " << is << std::endl; + GlobalV::ofs_warning << " Warning: negative or imaginary starting charge : "; + GlobalV::ofs_warning << " neg = " << neg << " ima = " << ima << " SPIN = " << is << std::endl; } -// std::cout << " sum rho for spin " << is << " = " << sumrea << std::endl; -// std::cout << " sum rho for spin " << is << " = " << sumrea << std::endl; - - }//end is - - - double ne_tot = 0.0; - int spin0=1; - if(spin_number_need == 2) spin0 = spin_number_need; - for(int is=0; isrhopw->nrxx; ++ir) - rho_in[is][ir] = rho_in[is][ir] / ne_tot * GlobalV::nelec; - - //wenfei 2021-7-29 : initial tau = 3/5 rho^2/3, Thomas-Fermi - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - const double pi = 3.141592653589790; - double fact = (3.0/5.0)*pow(3.0*pi*pi,2.0/3.0); - int nspin = spin_number_need; - //ofstream test_tau0("tau0"); - for(int is=0; isrhopw->nrxx; ++ir) - { - kin_r[is][ir] = fact * pow(abs(rho_in[is][ir])*nspin,5.0/3.0)/nspin; - //test_tau0 << rho_in[is][ir] << " " << kin_r[is][ir] << endl; - } - } - - ModuleBase::timer::tick("Charge","atomic_rho"); - return; -} + // std::cout << " sum rho for spin " << is << " = " << sumrea << std::endl; + // std::cout << " sum rho for spin " << is << " = " << sumrea << std::endl; + } // end is -//========================================================== -// computes the core charge on the real space 3D mesh. -//========================================================== -void Charge::set_rho_core( - const ModuleBase::ComplexMatrix &structure_factor -) -{ - ModuleBase::TITLE("Charge","set_rho_core"); - ModuleBase::timer::tick("Charge","set_rho_core"); - - // double eps = 1.e-10; - //---------------------------------------------------------- - // LOCAL VARIABLES : - // counter on mesh points - // counter on atomic types - // counter on g vectors - //---------------------------------------------------------- - // int ir = 0; - // int it = 0; - // int ig = 0; - - bool bl = false; - for (int it = 0; itrhopw->nrxx; ++ir) + rho_in[is][ir] = rho_in[is][ir] / ne_tot * GlobalV::nelec; + + // wenfei 2021-7-29 : initial tau = 3/5 rho^2/3, Thomas-Fermi + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) { - ModuleBase::GlobalFunc::ZEROS( this->rho_core, this->rhopw->nrxx); - ModuleBase::timer::tick("Charge","set_rho_core"); - return; - } - - double *rhocg = new double[this->rhopw->ngg]; - ModuleBase::GlobalFunc::ZEROS(rhocg, this->rhopw->ngg ); - - // three dimension. - std::complex *vg = new std::complex[this->rhopw->npw]; - - for (int it = 0; it < GlobalC::ucell.ntype;it++) - { - if (GlobalC::ucell.atoms[it].ncpp.nlcc) - { -//---------------------------------------------------------- -// EXPLAIN : drhoc compute the radial fourier transform for -// each shell of g vec -//---------------------------------------------------------- - this->non_linear_core_correction( - GlobalC::ppcell.numeric, - GlobalC::ucell.atoms[it].ncpp.msh, - GlobalC::ucell.atoms[it].ncpp.r, - GlobalC::ucell.atoms[it].ncpp.rab, - GlobalC::ucell.atoms[it].ncpp.rho_atc, - rhocg); -//---------------------------------------------------------- -// EXPLAIN : multiply by the structure factor and sum -//---------------------------------------------------------- - for (int ig = 0; ig < this->rhopw->npw ; ig++) + const double pi = 3.141592653589790; + double fact = (3.0 / 5.0) * pow(3.0 * pi * pi, 2.0 / 3.0); + int nspin = spin_number_need; + // ofstream test_tau0("tau0"); + for (int is = 0; is < spin_number_need; ++is) + for (int ir = 0; ir < this->rhopw->nrxx; ++ir) { - vg[ig] += structure_factor(it, ig) * rhocg[this->rhopw->ig2igg[ig]]; + kin_r[is][ir] = fact * pow(abs(rho_in[is][ir]) * nspin, 5.0 / 3.0) / nspin; + // test_tau0 << rho_in[is][ir] << " " << kin_r[is][ir] << endl; } - } - } - - // for tmp use. - for(int ig=0; ig< this->rhopw->npw; ig++) - { - this->rhog_core[ig] = vg[ig]; - } - - this->rhopw->recip2real(vg, this->rho_core); - - // test on the charge and computation of the core energy - double rhoima = 0.0; - double rhoneg = 0.0; - for (int ir = 0; ir < this->rhopw->nrxx; ir++) - { - rhoneg += min(0.0, this->rhopw->ft.get_auxr_data()[ir].real()); - rhoima += abs(this->rhopw->ft.get_auxr_data()[ir].imag()); - // NOTE: Core charge is computed in reciprocal space and brought to real - // space by FFT. For non smooth core charges (or insufficient cut-off) - // this may result in negative values in some grid points. - // Up to October 1999 the core charge was forced to be positive definite. - // This induces an error in the force, and probably stress, calculation if - // the number of grid points where the core charge would be otherwise neg - // is large. The error disappears for sufficiently high cut-off, but may be - // rather large and it is better to leave the core charge as it is. - // If you insist to have it positive definite (with the possible problems - // mentioned above) uncomment the following lines. SdG, Oct 15 1999 - } - - // mohan fix bug 2011-04-03 - Parallel_Reduce::reduce_double_pool( rhoneg ); - Parallel_Reduce::reduce_double_pool( rhoima ); - - // mohan changed 2010-2-2, make this same as in atomic_rho. - // still lack something...... - rhoneg /= this->rhopw->nxyz * GlobalC::ucell.omega; - rhoima /= this->rhopw->nxyz * GlobalC::ucell.omega; - - // calculate core_only exch-corr energy etxcc=E_xc[rho_core] if required - // The term was present in previous versions of the code but it shouldn't - delete [] rhocg; - delete [] vg; - ModuleBase::timer::tick("Charge","set_rho_core"); - return; -} // end subroutine set_rhoc - - - -void Charge::non_linear_core_correction -( - const bool &numeric, - const int mesh, - const double *r, - const double *rab, - const double *rhoc, - double *rhocg) const -{ - ModuleBase::TITLE("charge","drhoc"); - - // use labmda instead of repeating codes - const auto kernel = [&](int num_threads, int thread_id) - { - - double gx = 0.0; - double rhocg1 = 0.0; - double *aux; - - // here we compute the fourier transform is the charge in numeric form - if (numeric) - { - aux = new double [mesh]; - // G=0 term - - int igl0 = 0; - if (this->rhopw->gg_uniq [0] < 1.0e-8) - { - // single thread term - if (thread_id == 0) - { - for (int ir = 0;ir < mesh; ir++) - { - aux [ir] = r [ir] * r [ir] * rhoc [ir]; - } - ModuleBase::Integral::Simpson_Integral(mesh, aux, rab, rhocg1); - //rhocg [1] = fpi * rhocg1 / omega; - rhocg [0] = ModuleBase::FOUR_PI * rhocg1 / GlobalC::ucell.omega;//mohan modify 2008-01-19 - } - igl0 = 1; - } - - int igl_beg, igl_end; - // exclude igl0 - ModuleBase::TASK_DIST_1D(num_threads, thread_id, this->rhopw->ngg - igl0, igl_beg, igl_end); - igl_beg += igl0; - igl_end += igl_beg; - - // G <> 0 term - for (int igl = igl_beg; igl < igl_end;igl++) - { - gx = sqrt(this->rhopw->gg_uniq[igl] * GlobalC::ucell.tpiba2); - ModuleBase::Sphbes::Spherical_Bessel(mesh, r, gx, 0, aux); - for (int ir = 0;ir < mesh; ir++) - { - aux [ir] = r[ir] * r[ir] * rhoc [ir] * aux [ir]; - } // enddo - ModuleBase::Integral::Simpson_Integral(mesh, aux, rab, rhocg1); - rhocg [igl] = ModuleBase::FOUR_PI * rhocg1 / GlobalC::ucell.omega; - } // enddo - delete [] aux; } - else - { - // here the case where the charge is in analytic form, - // check old version before 2008-12-9 - } - - }; // end kernel - - // do not use omp parallel when this function is already in parallel block - // - // it is called in parallel block in Forces::cal_force_cc, - // but not in other funtcion such as Stress_Func::stress_cc. - ModuleBase::TRY_OMP_PARALLEL(kernel); + ModuleBase::timer::tick("Charge", "atomic_rho"); return; } - #ifdef __MPI void Charge::rho_mpi(const int& nbz, const int& bz) { - ModuleBase::TITLE("Charge","rho_mpi"); - if (GlobalV::NPROC==1) return; - if(GlobalV::ESOLVER_TYPE == "sdft" && GlobalV::NPROC_IN_STOGROUP==1) - return;//qinarui add it temporarily. - ModuleBase::timer::tick("Charge","rho_mpi"); - int ir;//counters on real space mesh point. - int iz;//counters on z direction of fft grid. - int ip;//counters on processors + ModuleBase::TITLE("Charge", "rho_mpi"); + if (GlobalV::NPROC == 1) + return; + if (GlobalV::ESOLVER_TYPE == "sdft" && GlobalV::NPROC_IN_STOGROUP == 1) + return; // qinarui add it temporarily. + ModuleBase::timer::tick("Charge", "rho_mpi"); + int ir; // counters on real space mesh point. + int iz; // counters on z direction of fft grid. + int ip; // counters on processors //========================================= // There are two steps to do before getting @@ -810,54 +613,54 @@ void Charge::rho_mpi(const int& nbz, const int& bz) // Searching in all planes, and calculated each // plane belong to which processor. // Count number of planes for each cpu in this pool - // num_z: how many planes on processor 'ip' + // num_z: how many planes on processor 'ip' //================================================= - int *num_z = new int[GlobalV::NPROC_IN_POOL]; + int* num_z = new int[GlobalV::NPROC_IN_POOL]; ModuleBase::GlobalFunc::ZEROS(num_z, GlobalV::NPROC_IN_POOL); - for (iz=0;izrhopw->nx * this->rhopw->ny; - for (ip=0;iprhopw->nrxx]; - double *rho_tot = new double[this->rhopw->nxyz]; - double *rho_tot_aux = new double[this->rhopw->nxyz]; - ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); - - double *tau_tmp; - double *tau_tot; - double *tau_tot_aux; - - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - tau_tmp = new double[this->rhopw->nrxx]; - tau_tot = new double[this->rhopw->nxyz]; - tau_tot_aux = new double[this->rhopw->nxyz]; - ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); - } - - for (int is=0; is< GlobalV::NSPIN; is++) + double* rho_tmp = new double[this->rhopw->nrxx]; + double* rho_tot = new double[this->rhopw->nxyz]; + double* rho_tot_aux = new double[this->rhopw->nxyz]; + ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); + + double* tau_tmp; + double* tau_tot; + double* tau_tot_aux; + + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tmp = new double[this->rhopw->nrxx]; + tau_tot = new double[this->rhopw->nxyz]; + tau_tot_aux = new double[this->rhopw->nxyz]; + ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); + } + + for (int is = 0; is < GlobalV::NSPIN; is++) { ModuleBase::GlobalFunc::ZEROS(rho_tot, this->rhopw->nxyz); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) ModuleBase::GlobalFunc::ZEROS(tau_tot, this->rhopw->nxyz); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + ModuleBase::GlobalFunc::ZEROS(tau_tot, this->rhopw->nxyz); - for (ir=0;irrhopw->nrxx;ir++) - { - rho_tmp[ir] = this->rho[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - tau_tmp[ir] = this->kin_r[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); - } - } + for (ir = 0; ir < this->rhopw->nrxx; ir++) + { + rho_tmp[ir] = this->rho[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tmp[ir] = this->kin_r[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); + } + } MPI_Allgatherv(rho_tmp, this->rhopw->nrxx, MPI_DOUBLE, rho_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - MPI_Allgatherv(tau_tmp, this->rhopw->nrxx, MPI_DOUBLE, tau_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); - } + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allgatherv(tau_tmp, this->rhopw->nrxx, MPI_DOUBLE, tau_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); + } //================================================================= // Change the order of rho_tot in each pool , make them consistent // this is the most complicated part !! //================================================================= ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); - } + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); + } - for (ip=0;iprhopw->nz' - // (3) however, the data rearrange is occured - // between [ start_z[ip], start_z[ip]+num_z[ip] ) - // (4) start_z[ip] + iz yields correct z coordiante. - // ------------------------------------------------- - // rot_tot: suitable for local pool. - // (1) the data save along z direction, only - // in a small distance. - // (2) however, the number of z in each processor - // 'ip' is num_z[ip] - // (3) the index of data increases with the ip, - // so the data on large 'ip' processor must - // have large 'start position', which we label - // start_z[ip] * ncxy. - // ------------------------------------------------- - rho_tot_aux[this->rhopw->nz*ir + start_z[ip] + iz] - = rho_tot[num_z[ip]*ir + start_z[ip]*ncxy + iz]; - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - tau_tot_aux[this->rhopw->nz*ir + start_z[ip] + iz] - = tau_tot[num_z[ip]*ir + start_z[ip]*ncxy + iz]; - } + // ------------------------------------------------- + // very carefully with the order of charge density. + // the data (ir,iz) is now in processor 'ip'. + // different POOL has different ordering. + // we want to collect them in each processor + // in a unit format, + // and then reduce among all POOLS to yield + // the correct charge density. + // we know the division of 'z' is indipendent + // in each processor, so the 'unit format' + // must have no relationship with 'z' divide method. + // ------------------------------------------------- + // rot_tot_aux : suitable among all pools. + // (1) the data save along z direction. + // (2) and each element number of group 'z data' + // is 'this->rhopw->nz' + // (3) however, the data rearrange is occured + // between [ start_z[ip], start_z[ip]+num_z[ip] ) + // (4) start_z[ip] + iz yields correct z coordiante. + // ------------------------------------------------- + // rot_tot: suitable for local pool. + // (1) the data save along z direction, only + // in a small distance. + // (2) however, the number of z in each processor + // 'ip' is num_z[ip] + // (3) the index of data increases with the ip, + // so the data on large 'ip' processor must + // have large 'start position', which we label + // start_z[ip] * ncxy. + // ------------------------------------------------- + rho_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] + = rho_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] + = tau_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; + } } } } //================================== // Reduce all the rho in each cpu //================================== - if(GlobalV::ESOLVER_TYPE == "sdft") //qinarui add it temporarily. - { - MPI_Allreduce(rho_tot_aux,rho_tot,this->rhopw->nxyz,MPI_DOUBLE,MPI_SUM,STO_WORLD); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - MPI_Allreduce(tau_tot_aux,tau_tot,this->rhopw->nxyz,MPI_DOUBLE,MPI_SUM,STO_WORLD); - } - } - else - MPI_Allreduce(rho_tot_aux,rho_tot,this->rhopw->nxyz,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - MPI_Allreduce(tau_tot_aux,tau_tot,this->rhopw->nxyz,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); - } - - //===================================== + if (GlobalV::ESOLVER_TYPE == "sdft") // qinarui add it temporarily. + { + MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); + } + } + else + MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + } + + //===================================== // Change the order of rho in each cpu //===================================== - for (ir =0;irrho[is][num_z[GlobalV::RANK_IN_POOL]*ir+iz] = rho_tot[this->rhopw->nz*ir + this->rhopw->startz_current + iz ]; - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - this->kin_r[is][num_z[GlobalV::RANK_IN_POOL]*ir+iz] = tau_tot[this->rhopw->nz*ir + this->rhopw->startz_current + iz ]; - } + this->rho[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] + = rho_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + this->kin_r[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] + = tau_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; + } } } } delete[] rho_tot_aux; delete[] rho_tot; delete[] rho_tmp; - - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) - { - delete[] tau_tot_aux; - delete[] tau_tot; - delete[] tau_tmp; - } + + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + delete[] tau_tot_aux; + delete[] tau_tot; + delete[] tau_tmp; + } delete[] rec; delete[] dis; delete[] num_z; delete[] start_z; - ModuleBase::timer::tick("Charge","rho_mpi"); + ModuleBase::timer::tick("Charge", "rho_mpi"); return; } #endif - void Charge::save_rho_before_sum_band(void) { - for(int is=0; isrhopw->nrxx); - if(XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) ModuleBase::GlobalFunc::DCOPY( kin_r[is], kin_r_save[is], this->rhopw->nrxx); + for (int is = 0; is < GlobalV::NSPIN; is++) + { + ModuleBase::GlobalFunc::DCOPY(rho[is], rho_save[is], this->rhopw->nrxx); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + ModuleBase::GlobalFunc::DCOPY(kin_r[is], kin_r_save[is], this->rhopw->nrxx); } return; } - -double Charge::check_ne(const double *rho_in) const +double Charge::check_ne(const double* rho_in) const { - double ne= 0.0; - for(int ir=0; irrhopw->nrxx; ir++) - { - ne += rho_in[ir]; - } - Parallel_Reduce::reduce_double_pool( ne ); - ne = ne * GlobalC::ucell.omega / (double)this->rhopw->nxyz; - std::cout << std::setprecision(10); - std::cout << " check the electrons number from rho, ne =" << ne << std::endl; - std::cout << std::setprecision(6); - return ne; + double ne = 0.0; + for (int ir = 0; ir < this->rhopw->nrxx; ir++) + { + ne += rho_in[ir]; + } + Parallel_Reduce::reduce_double_pool(ne); + ne = ne * elecstate::get_ucell_omega() / (double)this->rhopw->nxyz; + std::cout << std::setprecision(10); + std::cout << " check the electrons number from rho, ne =" << ne << std::endl; + std::cout << std::setprecision(6); + return ne; } - -//LiuXh add 20180619 +// LiuXh add 20180619 void Charge::init_final_scf() { - ModuleBase::TITLE("Charge","init_after_scf"); + ModuleBase::TITLE("Charge", "init_after_scf"); - assert(allocate_rho_final_scf == false); + assert(allocate_rho_final_scf == false); if (GlobalV::test_charge > 1) { - std::cout << "\n spin_number = " << GlobalV::NSPIN - << " real_point_number = " << this->rhopw->nrxx; + std::cout << "\n spin_number = " << GlobalV::NSPIN << " real_point_number = " << this->rhopw->nrxx; } - // allocate memory - rho = new double*[GlobalV::NSPIN]; - rhog = new std::complex*[GlobalV::NSPIN]; - rho_save = new double*[GlobalV::NSPIN]; - rhog_save = new std::complex*[GlobalV::NSPIN]; - - for(int is=0; isrhopw->nrxx]; - rhog[is] = new std::complex[this->rhopw->npw]; - rho_save[is] = new double[this->rhopw->nrxx]; - rhog_save[is] = new std::complex[this->rhopw->npw]; - ModuleBase::GlobalFunc::ZEROS(rho[is], this->rhopw->nrxx); - ModuleBase::GlobalFunc::ZEROS(rhog[is], this->rhopw->npw); - ModuleBase::GlobalFunc::ZEROS(rho_save[is], this->rhopw->nrxx); - ModuleBase::GlobalFunc::ZEROS(rhog_save[is], this->rhopw->npw); - } - - ModuleBase::Memory::record("Chg::rho", sizeof(double) * GlobalV::NSPIN*this->rhopw->nrxx); - ModuleBase::Memory::record("Chg::rho_save", sizeof(double) * GlobalV::NSPIN*this->rhopw->nrxx); - ModuleBase::Memory::record("Chg::rhog", sizeof(double) * GlobalV::NSPIN*this->rhopw->npw); - ModuleBase::Memory::record("Chg::rhog_save", sizeof(double) * GlobalV::NSPIN*this->rhopw->npw); + // allocate memory + rho = new double*[GlobalV::NSPIN]; + rhog = new std::complex*[GlobalV::NSPIN]; + rho_save = new double*[GlobalV::NSPIN]; + rhog_save = new std::complex*[GlobalV::NSPIN]; + + for (int is = 0; is < GlobalV::NSPIN; is++) + { + rho[is] = new double[this->rhopw->nrxx]; + rhog[is] = new std::complex[this->rhopw->npw]; + rho_save[is] = new double[this->rhopw->nrxx]; + rhog_save[is] = new std::complex[this->rhopw->npw]; + ModuleBase::GlobalFunc::ZEROS(rho[is], this->rhopw->nrxx); + ModuleBase::GlobalFunc::ZEROS(rhog[is], this->rhopw->npw); + ModuleBase::GlobalFunc::ZEROS(rho_save[is], this->rhopw->nrxx); + ModuleBase::GlobalFunc::ZEROS(rhog_save[is], this->rhopw->npw); + } + + ModuleBase::Memory::record("Chg::rho", sizeof(double) * GlobalV::NSPIN * this->rhopw->nrxx); + ModuleBase::Memory::record("Chg::rho_save", sizeof(double) * GlobalV::NSPIN * this->rhopw->nrxx); + ModuleBase::Memory::record("Chg::rhog", sizeof(double) * GlobalV::NSPIN * this->rhopw->npw); + ModuleBase::Memory::record("Chg::rhog_save", sizeof(double) * GlobalV::NSPIN * this->rhopw->npw); this->rho_core = new double[this->rhopw->nrxx]; // core charge in real space - ModuleBase::GlobalFunc::ZEROS( rho_core, this->rhopw->nrxx); + ModuleBase::GlobalFunc::ZEROS(rho_core, this->rhopw->nrxx); - this->rhog_core = new std::complex[this->rhopw->npw]; // reciprocal core charge - ModuleBase::GlobalFunc::ZEROS( rhog_core, this->rhopw->npw); + this->rhog_core = new std::complex[this->rhopw->npw]; // reciprocal core charge + ModuleBase::GlobalFunc::ZEROS(rhog_core, this->rhopw->npw); ModuleBase::Memory::record("Chg::rho_core", sizeof(double) * this->rhopw->nrxx); ModuleBase::Memory::record("Chg::rhog_core", sizeof(double) * this->rhopw->npw); - this->allocate_rho_final_scf = true; + this->allocate_rho_final_scf = true; return; } @@ -1091,31 +894,31 @@ void Charge::init_final_scf() // calculate total number of electrons (GlobalV::nelec) and default // number of bands (GlobalV::NBANDS). //========================================================= -#include "module_elecstate/occupy.h" -void Charge::cal_nelec(void) +//#include "module_elecstate/occupy.h" +void Charge::cal_nelec(const UnitCell& ucell) { - ModuleBase::TITLE("UnitCell","cal_nelec"); - //======================================================= - // calculate the total number of electrons in the system - // if GlobalV::nelec <>0; use input number (setup.f90) - //======================================================= - - GlobalV::ofs_running << "\n SETUP THE ELECTRONS NUMBER" << std::endl; - - if (GlobalV::nelec == 0) - { - for (int it = 0; it < GlobalC::ucell.ntype;it++) - { - std::stringstream ss1, ss2; - ss1 << "electron number of element " << GlobalC::ucell.atoms[it].label; - const int nelec_it = GlobalC::ucell.atoms[it].ncpp.zv * GlobalC::ucell.atoms[it].na; - GlobalV::nelec += nelec_it; - ss2 << "total electron number of element " << GlobalC::ucell.atoms[it].label; - - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,ss1.str(),GlobalC::ucell.atoms[it].ncpp.zv); - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,ss2.str(),nelec_it); - } - ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "AUTOSET number of electrons: ", GlobalV::nelec); - } - return; + ModuleBase::TITLE("UnitCell", "cal_nelec"); + //======================================================= + // calculate the total number of electrons in the system + // if GlobalV::nelec <>0; use input number (setup.f90) + //======================================================= + + GlobalV::ofs_running << "\n SETUP THE ELECTRONS NUMBER" << std::endl; + + if (GlobalV::nelec == 0) + { + for (int it = 0; it < ucell.ntype; it++) + { + std::stringstream ss1, ss2; + ss1 << "electron number of element " << ucell.atoms[it].label; + const int nelec_it = ucell.atoms[it].ncpp.zv * ucell.atoms[it].na; + GlobalV::nelec += nelec_it; + ss2 << "total electron number of element " << ucell.atoms[it].label; + + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, ss1.str(), ucell.atoms[it].ncpp.zv); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, ss2.str(), nelec_it); + } + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "AUTOSET number of electrons: ", GlobalV::nelec); + } + return; } diff --git a/source/module_elecstate/module_charge/charge.h b/source/module_elecstate/module_charge/charge.h index 5c2107ae6d..0cdc50bc0a 100644 --- a/source/module_elecstate/module_charge/charge.h +++ b/source/module_elecstate/module_charge/charge.h @@ -8,6 +8,9 @@ #include "module_basis/module_pw/pw_basis.h" #include "module_elecstate/fp_energy.h" +//a forward declaration of UnitCell +class UnitCell; + //========================================================== // Electron Charge Density //========================================================== @@ -51,11 +54,15 @@ class Charge // mohan update 2021-02-20 void allocate(const int &nspin_in); - void atomic_rho(const int spin_number_need, const double& omega, double **rho_in, const ModuleBase::ComplexMatrix &strucFac) const; + void atomic_rho(const int spin_number_need, + const double& omega, + double** rho_in, + const ModuleBase::ComplexMatrix& strucFac, + const UnitCell& ucell) const; void set_rho_core(const ModuleBase::ComplexMatrix &structure_factor); - void cal_nelec(); // calculate total number of electrons Yu Liu add 2021-07-03 + void cal_nelec(const UnitCell& ucell); // calculate total number of electrons Yu Liu add 2021-07-03 void renormalize_rho(void); diff --git a/source/module_elecstate/module_charge/charge_extra.cpp b/source/module_elecstate/module_charge/charge_extra.cpp index 6f9c365916..0407b11d7e 100644 --- a/source/module_elecstate/module_charge/charge_extra.cpp +++ b/source/module_elecstate/module_charge/charge_extra.cpp @@ -120,7 +120,7 @@ void Charge_Extra::extrapolate_charge(Charge* chr, Structure_Factor* sf) ModuleBase::GlobalFunc::ZEROS(rho_atom[is], chr->rhopw->nrxx); } - chr->atomic_rho(GlobalV::NSPIN, omega_old, rho_atom, sf->strucFac); + chr->atomic_rho(GlobalV::NSPIN, omega_old, rho_atom, sf->strucFac, GlobalC::ucell); #ifdef _OPENMP #pragma omp parallel for collapse(2) schedule(static, 512) #endif @@ -215,7 +215,7 @@ void Charge_Extra::extrapolate_charge(Charge* chr, Structure_Factor* sf) ModuleBase::GlobalFunc::ZEROS(rho_atom[is] + irbeg, irlen); } }); - chr->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho_atom, sf->strucFac); + chr->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho_atom, sf->strucFac, GlobalC::ucell); #ifdef _OPENMP #pragma omp parallel for collapse(2) schedule(static, 512) #endif diff --git a/source/module_elecstate/module_charge/charge_init.cpp b/source/module_elecstate/module_charge/charge_init.cpp index e264398156..d4ec5a1175 100644 --- a/source/module_elecstate/module_charge/charge_init.cpp +++ b/source/module_elecstate/module_charge/charge_init.cpp @@ -22,7 +22,7 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, const ModuleBase::ComplexMa std::cout << " START CHARGE : " << GlobalV::init_chg << std::endl; if (GlobalV::init_chg == "atomic") // mohan add 2007-10-17 { - this->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho, strucFac); + this->atomic_rho(GlobalV::NSPIN, GlobalC::ucell.omega, rho, strucFac, GlobalC::ucell); } else if (GlobalV::init_chg == "file") { @@ -138,3 +138,195 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, const ModuleBase::ComplexMa GlobalC::restart.info_load.load_charge_finish = true; } } + +//========================================================== +// computes the core charge on the real space 3D mesh. +//========================================================== +void Charge::set_rho_core( + const ModuleBase::ComplexMatrix &structure_factor +) +{ + ModuleBase::TITLE("Charge","set_rho_core"); + ModuleBase::timer::tick("Charge","set_rho_core"); + + // double eps = 1.e-10; + //---------------------------------------------------------- + // LOCAL VARIABLES : + // counter on mesh points + // counter on atomic types + // counter on g vectors + //---------------------------------------------------------- + // int ir = 0; + // int it = 0; + // int ig = 0; + + bool bl = false; + for (int it = 0; itrho_core, this->rhopw->nrxx); + ModuleBase::timer::tick("Charge","set_rho_core"); + return; + } + + double *rhocg = new double[this->rhopw->ngg]; + ModuleBase::GlobalFunc::ZEROS(rhocg, this->rhopw->ngg ); + + // three dimension. + std::complex *vg = new std::complex[this->rhopw->npw]; + + for (int it = 0; it < GlobalC::ucell.ntype;it++) + { + if (GlobalC::ucell.atoms[it].ncpp.nlcc) + { +//---------------------------------------------------------- +// EXPLAIN : drhoc compute the radial fourier transform for +// each shell of g vec +//---------------------------------------------------------- + this->non_linear_core_correction( + GlobalC::ppcell.numeric, + GlobalC::ucell.atoms[it].ncpp.msh, + GlobalC::ucell.atoms[it].ncpp.r, + GlobalC::ucell.atoms[it].ncpp.rab, + GlobalC::ucell.atoms[it].ncpp.rho_atc, + rhocg); +//---------------------------------------------------------- +// EXPLAIN : multiply by the structure factor and sum +//---------------------------------------------------------- + for (int ig = 0; ig < this->rhopw->npw ; ig++) + { + vg[ig] += structure_factor(it, ig) * rhocg[this->rhopw->ig2igg[ig]]; + } + } + } + + // for tmp use. + for(int ig=0; ig< this->rhopw->npw; ig++) + { + this->rhog_core[ig] = vg[ig]; + } + + this->rhopw->recip2real(vg, this->rho_core); + + // test on the charge and computation of the core energy + double rhoima = 0.0; + double rhoneg = 0.0; + for (int ir = 0; ir < this->rhopw->nrxx; ir++) + { + rhoneg += min(0.0, this->rhopw->ft.get_auxr_data()[ir].real()); + rhoima += abs(this->rhopw->ft.get_auxr_data()[ir].imag()); + // NOTE: Core charge is computed in reciprocal space and brought to real + // space by FFT. For non smooth core charges (or insufficient cut-off) + // this may result in negative values in some grid points. + // Up to October 1999 the core charge was forced to be positive definite. + // This induces an error in the force, and probably stress, calculation if + // the number of grid points where the core charge would be otherwise neg + // is large. The error disappears for sufficiently high cut-off, but may be + // rather large and it is better to leave the core charge as it is. + // If you insist to have it positive definite (with the possible problems + // mentioned above) uncomment the following lines. SdG, Oct 15 1999 + } + + // mohan fix bug 2011-04-03 + Parallel_Reduce::reduce_double_pool( rhoneg ); + Parallel_Reduce::reduce_double_pool( rhoima ); + + // mohan changed 2010-2-2, make this same as in atomic_rho. + // still lack something...... + rhoneg /= this->rhopw->nxyz * GlobalC::ucell.omega; + rhoima /= this->rhopw->nxyz * GlobalC::ucell.omega; + + // calculate core_only exch-corr energy etxcc=E_xc[rho_core] if required + // The term was present in previous versions of the code but it shouldn't + delete [] rhocg; + delete [] vg; + ModuleBase::timer::tick("Charge","set_rho_core"); + return; +} // end subroutine set_rhoc + +void Charge::non_linear_core_correction +( + const bool &numeric, + const int mesh, + const double *r, + const double *rab, + const double *rhoc, + double *rhocg) const +{ + ModuleBase::TITLE("charge","drhoc"); + + // use labmda instead of repeating codes + const auto kernel = [&](int num_threads, int thread_id) + { + + double gx = 0.0; + double rhocg1 = 0.0; + double *aux; + + // here we compute the fourier transform is the charge in numeric form + if (numeric) + { + aux = new double [mesh]; + // G=0 term + + int igl0 = 0; + if (this->rhopw->gg_uniq [0] < 1.0e-8) + { + // single thread term + if (thread_id == 0) + { + for (int ir = 0;ir < mesh; ir++) + { + aux [ir] = r [ir] * r [ir] * rhoc [ir]; + } + ModuleBase::Integral::Simpson_Integral(mesh, aux, rab, rhocg1); + //rhocg [1] = fpi * rhocg1 / omega; + rhocg [0] = ModuleBase::FOUR_PI * rhocg1 / GlobalC::ucell.omega;//mohan modify 2008-01-19 + } + igl0 = 1; + } + + int igl_beg, igl_end; + // exclude igl0 + ModuleBase::TASK_DIST_1D(num_threads, thread_id, this->rhopw->ngg - igl0, igl_beg, igl_end); + igl_beg += igl0; + igl_end += igl_beg; + + // G <> 0 term + for (int igl = igl_beg; igl < igl_end;igl++) + { + gx = sqrt(this->rhopw->gg_uniq[igl] * GlobalC::ucell.tpiba2); + ModuleBase::Sphbes::Spherical_Bessel(mesh, r, gx, 0, aux); + for (int ir = 0;ir < mesh; ir++) + { + aux [ir] = r[ir] * r[ir] * rhoc [ir] * aux [ir]; + } // enddo + ModuleBase::Integral::Simpson_Integral(mesh, aux, rab, rhocg1); + rhocg [igl] = ModuleBase::FOUR_PI * rhocg1 / GlobalC::ucell.omega; + } // enddo + delete [] aux; + } + else + { + // here the case where the charge is in analytic form, + // check old version before 2008-12-9 + } + + }; // end kernel + + // do not use omp parallel when this function is already in parallel block + // + // it is called in parallel block in Forces::cal_force_cc, + // but not in other funtcion such as Stress_Func::stress_cc. + ModuleBase::TRY_OMP_PARALLEL(kernel); + + return; +} \ No newline at end of file diff --git a/source/module_esolver/esolver_ks.cpp b/source/module_esolver/esolver_ks.cpp index e43d229e2b..40a8e74c57 100644 --- a/source/module_esolver/esolver_ks.cpp +++ b/source/module_esolver/esolver_ks.cpp @@ -50,7 +50,7 @@ namespace ModuleESolver void ESolver_KS::Init(Input& inp, UnitCell& ucell) { ESolver_FP::Init(inp,ucell); - chr.cal_nelec(); + chr.cal_nelec(ucell); /* it has been established that that xc_func is same for all elements, therefore diff --git a/source/module_esolver/esolver_of.cpp b/source/module_esolver/esolver_of.cpp index 07bbb2a6ad..3a3b370a5e 100644 --- a/source/module_esolver/esolver_of.cpp +++ b/source/module_esolver/esolver_of.cpp @@ -31,7 +31,7 @@ void ESolver_OF::Init(Input &inp, UnitCell &ucell) this->of_tolp = inp.of_tolp; this->maxIter = inp.scf_nmax; - chr.cal_nelec(); + chr.cal_nelec(ucell); if(ucell.atoms[0].ncpp.xc_func=="HSE"||ucell.atoms[0].ncpp.xc_func=="PBE0") { From 237df57aa7eeead315f6345cacbbf9288193101f Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 May 2023 03:32:56 +0000 Subject: [PATCH 3/8] split rho_mpi func from main charge.cpp --- source/Makefile.Objects | 1 + source/module_elecstate/CMakeLists.txt | 1 + .../module_elecstate/module_charge/charge.cpp | 227 ----------------- .../module_charge/charge_mpi.cpp | 234 ++++++++++++++++++ 4 files changed, 236 insertions(+), 227 deletions(-) create mode 100644 source/module_elecstate/module_charge/charge_mpi.cpp diff --git a/source/Makefile.Objects b/source/Makefile.Objects index c19d108653..fa432dd007 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -441,6 +441,7 @@ OBJS_SRCPW=H_Ewald_pw.o\ VNL_grad_pw.o\ charge.o\ charge_init.o\ + charge_mpi.o\ charge_broyden.o\ charge_extra.o\ charge_mixing.o\ diff --git a/source/module_elecstate/CMakeLists.txt b/source/module_elecstate/CMakeLists.txt index bcad749d7f..c0903908e2 100644 --- a/source/module_elecstate/CMakeLists.txt +++ b/source/module_elecstate/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND objects potentials/write_pot.cpp module_charge/charge.cpp module_charge/charge_init.cpp + module_charge/charge_mpi.cpp module_charge/charge_broyden.cpp module_charge/charge_extra.cpp module_charge/charge_mixing.cpp diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index 7cf02e3dc3..236bc2077c 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -589,233 +589,6 @@ void Charge::atomic_rho(const int spin_number_need, return; } -#ifdef __MPI -void Charge::rho_mpi(const int& nbz, const int& bz) -{ - ModuleBase::TITLE("Charge", "rho_mpi"); - if (GlobalV::NPROC == 1) - return; - if (GlobalV::ESOLVER_TYPE == "sdft" && GlobalV::NPROC_IN_STOGROUP == 1) - return; // qinarui add it temporarily. - ModuleBase::timer::tick("Charge", "rho_mpi"); - int ir; // counters on real space mesh point. - int iz; // counters on z direction of fft grid. - int ip; // counters on processors - - //========================================= - // There are two steps to do before getting - // the final charge: - // (1) sum up the plane rhos in each pool. - // (2) sum up all the rhos from all pools. - //========================================= - - //================================================= - // Searching in all planes, and calculated each - // plane belong to which processor. - // Count number of planes for each cpu in this pool - // num_z: how many planes on processor 'ip' - //================================================= - int* num_z = new int[GlobalV::NPROC_IN_POOL]; - ModuleBase::GlobalFunc::ZEROS(num_z, GlobalV::NPROC_IN_POOL); - for (iz = 0; iz < nbz; iz++) - { - ip = iz % GlobalV::NPROC_IN_POOL; - num_z[ip]++; - } - - // mohan update 2011-04-26 - for (int ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) - { - num_z[ip] *= bz; - } - - //======================================= - // Find current number of planes (nz) - // start_z: start position of z in - // processor ip. - //======================================= - int* start_z = new int[GlobalV::NPROC_IN_POOL]; - ModuleBase::GlobalFunc::ZEROS(start_z, GlobalV::NPROC_IN_POOL); - for (ip = 1; ip < GlobalV::NPROC_IN_POOL; ip++) - { - start_z[ip] = start_z[ip - 1] + num_z[ip - 1]; - } - - //==================================================== - // Find "number of data" in each processor in each pool - //==================================================== - int* rec = new int[GlobalV::NPROC_IN_POOL]; - ModuleBase::GlobalFunc::ZEROS(rec, GlobalV::NPROC_IN_POOL); - const int ncxy = this->rhopw->nx * this->rhopw->ny; - for (ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) - { - rec[ip] = num_z[ip] * ncxy; - } - - //====================================================== - // Find current "index of data" in each cpu in this pool - // also, we mean start position of data. - //====================================================== - int* dis = new int[GlobalV::NPROC_IN_POOL]; - ModuleBase::GlobalFunc::ZEROS(dis, GlobalV::NPROC_IN_POOL); - for (ip = 1; ip < GlobalV::NPROC_IN_POOL; ip++) - { - dis[ip] = dis[ip - 1] + rec[ip - 1]; - } - - //========================================== - // Collection of rho in each pool - // ( according to different k distribution, - // so the rho in each pool is different - //========================================== - double* rho_tmp = new double[this->rhopw->nrxx]; - double* rho_tot = new double[this->rhopw->nxyz]; - double* rho_tot_aux = new double[this->rhopw->nxyz]; - ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); - - double* tau_tmp; - double* tau_tot; - double* tau_tot_aux; - - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - tau_tmp = new double[this->rhopw->nrxx]; - tau_tot = new double[this->rhopw->nxyz]; - tau_tot_aux = new double[this->rhopw->nxyz]; - ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); - } - - for (int is = 0; is < GlobalV::NSPIN; is++) - { - ModuleBase::GlobalFunc::ZEROS(rho_tot, this->rhopw->nxyz); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - ModuleBase::GlobalFunc::ZEROS(tau_tot, this->rhopw->nxyz); - - for (ir = 0; ir < this->rhopw->nrxx; ir++) - { - rho_tmp[ir] = this->rho[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - tau_tmp[ir] = this->kin_r[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); - } - } - - MPI_Allgatherv(rho_tmp, this->rhopw->nrxx, MPI_DOUBLE, rho_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - MPI_Allgatherv(tau_tmp, this->rhopw->nrxx, MPI_DOUBLE, tau_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); - } - //================================================================= - // Change the order of rho_tot in each pool , make them consistent - // this is the most complicated part !! - //================================================================= - ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); - } - - for (ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) - { - for (ir = 0; ir < ncxy; ir++) - { - for (iz = 0; iz < num_z[ip]; iz++) - { - // ------------------------------------------------- - // very carefully with the order of charge density. - // the data (ir,iz) is now in processor 'ip'. - // different POOL has different ordering. - // we want to collect them in each processor - // in a unit format, - // and then reduce among all POOLS to yield - // the correct charge density. - // we know the division of 'z' is indipendent - // in each processor, so the 'unit format' - // must have no relationship with 'z' divide method. - // ------------------------------------------------- - // rot_tot_aux : suitable among all pools. - // (1) the data save along z direction. - // (2) and each element number of group 'z data' - // is 'this->rhopw->nz' - // (3) however, the data rearrange is occured - // between [ start_z[ip], start_z[ip]+num_z[ip] ) - // (4) start_z[ip] + iz yields correct z coordiante. - // ------------------------------------------------- - // rot_tot: suitable for local pool. - // (1) the data save along z direction, only - // in a small distance. - // (2) however, the number of z in each processor - // 'ip' is num_z[ip] - // (3) the index of data increases with the ip, - // so the data on large 'ip' processor must - // have large 'start position', which we label - // start_z[ip] * ncxy. - // ------------------------------------------------- - rho_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] - = rho_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - tau_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] - = tau_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; - } - } - } - } - //================================== - // Reduce all the rho in each cpu - //================================== - if (GlobalV::ESOLVER_TYPE == "sdft") // qinarui add it temporarily. - { - MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); - } - } - else - MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - } - - //===================================== - // Change the order of rho in each cpu - //===================================== - for (ir = 0; ir < ncxy; ir++) - { - for (iz = 0; iz < num_z[GlobalV::RANK_IN_POOL]; iz++) - { - this->rho[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] - = rho_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - this->kin_r[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] - = tau_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; - } - } - } - } - delete[] rho_tot_aux; - delete[] rho_tot; - delete[] rho_tmp; - - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) - { - delete[] tau_tot_aux; - delete[] tau_tot; - delete[] tau_tmp; - } - delete[] rec; - delete[] dis; - - delete[] num_z; - delete[] start_z; - ModuleBase::timer::tick("Charge", "rho_mpi"); - return; -} -#endif - void Charge::save_rho_before_sum_band(void) { for (int is = 0; is < GlobalV::NSPIN; is++) diff --git a/source/module_elecstate/module_charge/charge_mpi.cpp b/source/module_elecstate/module_charge/charge_mpi.cpp new file mode 100644 index 0000000000..9670715f87 --- /dev/null +++ b/source/module_elecstate/module_charge/charge_mpi.cpp @@ -0,0 +1,234 @@ +#include "charge.h" + +#include "module_base/global_function.h" +#include "module_base/global_variable.h" +#include "module_base/parallel_reduce.h" +#include "module_base/timer.h" +#include "module_elecstate/elecstate_getters.h" + +#ifdef __MPI +void Charge::rho_mpi(const int& nbz, const int& bz) +{ + ModuleBase::TITLE("Charge", "rho_mpi"); + if (GlobalV::NPROC == 1) + return; + if (GlobalV::ESOLVER_TYPE == "sdft" && GlobalV::NPROC_IN_STOGROUP == 1) + return; // qinarui add it temporarily. + ModuleBase::timer::tick("Charge", "rho_mpi"); + int ir; // counters on real space mesh point. + int iz; // counters on z direction of fft grid. + int ip; // counters on processors + + //========================================= + // There are two steps to do before getting + // the final charge: + // (1) sum up the plane rhos in each pool. + // (2) sum up all the rhos from all pools. + //========================================= + + //================================================= + // Searching in all planes, and calculated each + // plane belong to which processor. + // Count number of planes for each cpu in this pool + // num_z: how many planes on processor 'ip' + //================================================= + int* num_z = new int[GlobalV::NPROC_IN_POOL]; + ModuleBase::GlobalFunc::ZEROS(num_z, GlobalV::NPROC_IN_POOL); + for (iz = 0; iz < nbz; iz++) + { + ip = iz % GlobalV::NPROC_IN_POOL; + num_z[ip]++; + } + + // mohan update 2011-04-26 + for (int ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) + { + num_z[ip] *= bz; + } + + //======================================= + // Find current number of planes (nz) + // start_z: start position of z in + // processor ip. + //======================================= + int* start_z = new int[GlobalV::NPROC_IN_POOL]; + ModuleBase::GlobalFunc::ZEROS(start_z, GlobalV::NPROC_IN_POOL); + for (ip = 1; ip < GlobalV::NPROC_IN_POOL; ip++) + { + start_z[ip] = start_z[ip - 1] + num_z[ip - 1]; + } + + //==================================================== + // Find "number of data" in each processor in each pool + //==================================================== + int* rec = new int[GlobalV::NPROC_IN_POOL]; + ModuleBase::GlobalFunc::ZEROS(rec, GlobalV::NPROC_IN_POOL); + const int ncxy = this->rhopw->nx * this->rhopw->ny; + for (ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) + { + rec[ip] = num_z[ip] * ncxy; + } + + //====================================================== + // Find current "index of data" in each cpu in this pool + // also, we mean start position of data. + //====================================================== + int* dis = new int[GlobalV::NPROC_IN_POOL]; + ModuleBase::GlobalFunc::ZEROS(dis, GlobalV::NPROC_IN_POOL); + for (ip = 1; ip < GlobalV::NPROC_IN_POOL; ip++) + { + dis[ip] = dis[ip - 1] + rec[ip - 1]; + } + + //========================================== + // Collection of rho in each pool + // ( according to different k distribution, + // so the rho in each pool is different + //========================================== + double* rho_tmp = new double[this->rhopw->nrxx]; + double* rho_tot = new double[this->rhopw->nxyz]; + double* rho_tot_aux = new double[this->rhopw->nxyz]; + ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); + + double* tau_tmp; + double* tau_tot; + double* tau_tot_aux; + + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tmp = new double[this->rhopw->nrxx]; + tau_tot = new double[this->rhopw->nxyz]; + tau_tot_aux = new double[this->rhopw->nxyz]; + ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); + } + + for (int is = 0; is < GlobalV::NSPIN; is++) + { + ModuleBase::GlobalFunc::ZEROS(rho_tot, this->rhopw->nxyz); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + ModuleBase::GlobalFunc::ZEROS(tau_tot, this->rhopw->nxyz); + + for (ir = 0; ir < this->rhopw->nrxx; ir++) + { + rho_tmp[ir] = this->rho[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tmp[ir] = this->kin_r[is][ir] / static_cast(GlobalV::NPROC_IN_POOL); + } + } + + MPI_Allgatherv(rho_tmp, this->rhopw->nrxx, MPI_DOUBLE, rho_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allgatherv(tau_tmp, this->rhopw->nrxx, MPI_DOUBLE, tau_tot, rec, dis, MPI_DOUBLE, POOL_WORLD); + } + //================================================================= + // Change the order of rho_tot in each pool , make them consistent + // this is the most complicated part !! + //================================================================= + ModuleBase::GlobalFunc::ZEROS(rho_tot_aux, this->rhopw->nxyz); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + ModuleBase::GlobalFunc::ZEROS(tau_tot_aux, this->rhopw->nxyz); + } + + for (ip = 0; ip < GlobalV::NPROC_IN_POOL; ip++) + { + for (ir = 0; ir < ncxy; ir++) + { + for (iz = 0; iz < num_z[ip]; iz++) + { + // ------------------------------------------------- + // very carefully with the order of charge density. + // the data (ir,iz) is now in processor 'ip'. + // different POOL has different ordering. + // we want to collect them in each processor + // in a unit format, + // and then reduce among all POOLS to yield + // the correct charge density. + // we know the division of 'z' is indipendent + // in each processor, so the 'unit format' + // must have no relationship with 'z' divide method. + // ------------------------------------------------- + // rot_tot_aux : suitable among all pools. + // (1) the data save along z direction. + // (2) and each element number of group 'z data' + // is 'this->rhopw->nz' + // (3) however, the data rearrange is occured + // between [ start_z[ip], start_z[ip]+num_z[ip] ) + // (4) start_z[ip] + iz yields correct z coordiante. + // ------------------------------------------------- + // rot_tot: suitable for local pool. + // (1) the data save along z direction, only + // in a small distance. + // (2) however, the number of z in each processor + // 'ip' is num_z[ip] + // (3) the index of data increases with the ip, + // so the data on large 'ip' processor must + // have large 'start position', which we label + // start_z[ip] * ncxy. + // ------------------------------------------------- + rho_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] + = rho_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + tau_tot_aux[this->rhopw->nz * ir + start_z[ip] + iz] + = tau_tot[num_z[ip] * ir + start_z[ip] * ncxy + iz]; + } + } + } + } + //================================== + // Reduce all the rho in each cpu + //================================== + if (GlobalV::ESOLVER_TYPE == "sdft") // qinarui add it temporarily. + { + MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, STO_WORLD); + } + } + else + MPI_Allreduce(rho_tot_aux, rho_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + MPI_Allreduce(tau_tot_aux, tau_tot, this->rhopw->nxyz, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + } + + //===================================== + // Change the order of rho in each cpu + //===================================== + for (ir = 0; ir < ncxy; ir++) + { + for (iz = 0; iz < num_z[GlobalV::RANK_IN_POOL]; iz++) + { + this->rho[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] + = rho_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + this->kin_r[is][num_z[GlobalV::RANK_IN_POOL] * ir + iz] + = tau_tot[this->rhopw->nz * ir + this->rhopw->startz_current + iz]; + } + } + } + } + delete[] rho_tot_aux; + delete[] rho_tot; + delete[] rho_tmp; + + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + { + delete[] tau_tot_aux; + delete[] tau_tot; + delete[] tau_tmp; + } + delete[] rec; + delete[] dis; + + delete[] num_z; + delete[] start_z; + ModuleBase::timer::tick("Charge", "rho_mpi"); + return; +} +#endif \ No newline at end of file From f03984fdd507adced29737e6e8c8841028dc9171 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 May 2023 04:48:15 +0000 Subject: [PATCH 4/8] add test file charge_test.cpp --- .../module_elecstate/module_charge/charge.cpp | 13 +++-- source/module_elecstate/test/CMakeLists.txt | 14 ++++++ source/module_elecstate/test/charge_test.cpp | 49 +++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 source/module_elecstate/test/charge_test.cpp diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index 236bc2077c..fcdc1d8b8e 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -175,7 +175,10 @@ double Charge::sum_rho(void) const // multiply the sum of charge density by a factor sum_rho *= elecstate::get_ucell_omega() / static_cast(this->rhopw->nxyz); + +#ifdef __MPI Parallel_Reduce::reduce_double_pool(sum_rho); +#endif // mohan fixed bug 2010-01-18, // sum_rho may be smaller than 1, like Na bcc. @@ -519,8 +522,9 @@ void Charge::atomic_rho(const int spin_number_need, for (int ir = 0; ir < this->rhopw->nrxx; ++ir) ne[is] += rho_in[is][ir]; ne[is] *= omega / (double)this->rhopw->nxyz; +#ifdef __MPI Parallel_Reduce::reduce_double_pool(ne[is]); - +#endif // we check that everything is correct double neg = 0.0; double rea = 0.0; @@ -534,10 +538,11 @@ void Charge::atomic_rho(const int spin_number_need, ima += abs(this->rhopw->ft.get_auxr_data()[ir].imag()); } +#ifdef __MPI Parallel_Reduce::reduce_double_pool(neg); Parallel_Reduce::reduce_double_pool(ima); Parallel_Reduce::reduce_double_pool(sumrea); - +#endif // mohan fix bug 2011-04-03 neg = neg / (double)this->rhopw->nxyz * omega; ima = ima / (double)this->rhopw->nxyz * omega; @@ -607,7 +612,9 @@ double Charge::check_ne(const double* rho_in) const { ne += rho_in[ir]; } +#ifdef __MPI Parallel_Reduce::reduce_double_pool(ne); +#endif ne = ne * elecstate::get_ucell_omega() / (double)this->rhopw->nxyz; std::cout << std::setprecision(10); std::cout << " check the electrons number from rho, ne =" << ne << std::endl; @@ -694,4 +701,4 @@ void Charge::cal_nelec(const UnitCell& ucell) ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "AUTOSET number of electrons: ", GlobalV::nelec); } return; -} +} \ No newline at end of file diff --git a/source/module_elecstate/test/CMakeLists.txt b/source/module_elecstate/test/CMakeLists.txt index b912b7a835..d4b6f87bc0 100644 --- a/source/module_elecstate/test/CMakeLists.txt +++ b/source/module_elecstate/test/CMakeLists.txt @@ -78,4 +78,18 @@ AddTest( TARGET potentials_new LIBS ${math_libs} base device SOURCES potential_new_test.cpp ../potentials/potential_new.cpp +) + +AddTest( + TARGET charge_test + LIBS ${math_libs} base device + SOURCES charge_test.cpp ../module_charge/charge.cpp + ../../module_basis/module_pw/pw_basis.cpp + ../../module_basis/module_pw/pw_init.cpp + ../../module_basis/module_pw/pw_distributeg.cpp + ../../module_basis/module_pw/pw_distributer.cpp + ../../module_basis/module_pw/pw_distributeg_method1.cpp + ../../module_basis/module_pw/pw_distributeg_method2.cpp + ../../module_basis/module_pw/pw_transform.cpp + ../../module_basis/module_pw/fft.cpp ) \ No newline at end of file diff --git a/source/module_elecstate/test/charge_test.cpp b/source/module_elecstate/test/charge_test.cpp new file mode 100644 index 0000000000..5a21096196 --- /dev/null +++ b/source/module_elecstate/test/charge_test.cpp @@ -0,0 +1,49 @@ +#include "gtest/gtest.h" + +#define private public +#include "module_elecstate/module_charge/charge.h" + +namespace elecstate +{ +int tmp_xc_func_type = 1; +int get_xc_func_type() +{ + return tmp_xc_func_type; +} +double get_ucell_omega() +{ + return 500.0; +} +void Set_GlobalV_Default() +{ + GlobalV::NSPIN = 1; + GlobalV::device_flag = "cpu"; + GlobalV::precision_flag = "double"; +} +} // namespace elecstate + +/************************************************ + * unit test of module_charge/charge.cpp + ***********************************************/ + +/** + * - Tested Functions: + */ + +class ChargeTest : public ::testing::Test +{ + protected: + void SetUp() override + { + elecstate::Set_GlobalV_Default(); + } + void TearDown() override + { + } +}; + +TEST_F(ChargeTest, Constructor) +{ +} + +#undef private \ No newline at end of file From 194e03409f41d6d339bf08e8dcb9f269913fb642 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 May 2023 09:43:46 +0000 Subject: [PATCH 5/8] add two tests --- .../module_elecstate/module_charge/charge.cpp | 8 +- source/module_elecstate/test/CMakeLists.txt | 14 + source/module_elecstate/test/charge_test.cpp | 90 +- .../module_elecstate/test/prepare_unitcell.h | 341 +++++ .../test/prepare_unitcell.h.bak | 341 +++++ source/module_elecstate/test/support/Si.upf | 1226 +++++++++++++++++ 6 files changed, 2011 insertions(+), 9 deletions(-) create mode 100644 source/module_elecstate/test/prepare_unitcell.h create mode 100644 source/module_elecstate/test/prepare_unitcell.h.bak create mode 100644 source/module_elecstate/test/support/Si.upf diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index fcdc1d8b8e..c65600158a 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -98,7 +98,7 @@ void Charge::allocate(const int& nspin_in) if (GlobalV::test_charge > 1) { - std::cout << "\n spin_number = " << nspin << " real_point_number = " << nrxx; + std::cout << "\n spin_number = " << nspin << " real_point_number = " << nrxx << std::endl; } // allocate memory @@ -159,11 +159,7 @@ double Charge::sum_rho(void) const ModuleBase::TITLE("Charge", "sum_rho"); double sum_rho = 0.0; - int nspin0 = 1; - if (nspin == 2) - { - nspin0 = 2; - } + int nspin0 = (nspin == 2) ? 2 : 1; for (int is = 0; is < nspin0; is++) { diff --git a/source/module_elecstate/test/CMakeLists.txt b/source/module_elecstate/test/CMakeLists.txt index d4b6f87bc0..9b18940d45 100644 --- a/source/module_elecstate/test/CMakeLists.txt +++ b/source/module_elecstate/test/CMakeLists.txt @@ -84,6 +84,7 @@ AddTest( TARGET charge_test LIBS ${math_libs} base device SOURCES charge_test.cpp ../module_charge/charge.cpp + # PW_Basis dependencies ../../module_basis/module_pw/pw_basis.cpp ../../module_basis/module_pw/pw_init.cpp ../../module_basis/module_pw/pw_distributeg.cpp @@ -92,4 +93,17 @@ AddTest( ../../module_basis/module_pw/pw_distributeg_method2.cpp ../../module_basis/module_pw/pw_transform.cpp ../../module_basis/module_pw/fft.cpp + # UnitCell dependencies + ../../module_cell/unitcell.cpp + ../../module_cell/read_atoms.cpp + ../../module_cell/read_cell_pseudopots.cpp + ../../module_cell/atom_spec.cpp + ../../module_cell/atom_pseudo.cpp + ../../module_cell/pseudo_nc.cpp + ../../module_cell/read_pp.cpp + ../../module_cell/read_pp_upf201.cpp + ../../module_cell/read_pp_upf100.cpp + ../../module_cell/read_pp_vwr.cpp + ../../module_cell/read_pp_blps.cpp + ../../module_io/output.cpp ) \ No newline at end of file diff --git a/source/module_elecstate/test/charge_test.cpp b/source/module_elecstate/test/charge_test.cpp index 5a21096196..70a8c05569 100644 --- a/source/module_elecstate/test/charge_test.cpp +++ b/source/module_elecstate/test/charge_test.cpp @@ -1,8 +1,28 @@ #include "gtest/gtest.h" #define private public +#define protected public +#include "module_cell/unitcell.h" #include "module_elecstate/module_charge/charge.h" +#include "prepare_unitcell.h" +// mock functions for UnitCell +#ifdef __LCAO +InfoNonlocal::InfoNonlocal() +{ +} +InfoNonlocal::~InfoNonlocal() +{ +} +#endif +Magnetism::Magnetism() +{ +} +Magnetism::~Magnetism() +{ +} + +// mock functions for Charge namespace elecstate { int tmp_xc_func_type = 1; @@ -10,15 +30,16 @@ int get_xc_func_type() { return tmp_xc_func_type; } +double tmp_ucell_omega = 500.0; double get_ucell_omega() { - return 500.0; + return tmp_ucell_omega; } +double tmp_gridecut = 80.0; void Set_GlobalV_Default() { GlobalV::NSPIN = 1; - GlobalV::device_flag = "cpu"; - GlobalV::precision_flag = "double"; + GlobalV::test_charge = 0; } } // namespace elecstate @@ -28,11 +49,20 @@ void Set_GlobalV_Default() /** * - Tested Functions: + * - Constructor: Charge::Charge() and Charge::~Charge() + * - this is a trivial test + * - Allocate: Charge::set_rhopw(), Charge::allocate(), Charge::destroy() + * - allocate rho, rhog, rho_save, rhog_save, kin_r, kin_r_save + * - using rhopw and GlobalV::NSPIN + * - SumRho: Charge::sum_rho() + * - calculate \sum_{spin}\sum_{nrxx} rho[is][ir] */ class ChargeTest : public ::testing::Test { protected: + UnitCell* ucell; + Charge* charge; void SetUp() override { elecstate::Set_GlobalV_Default(); @@ -44,6 +74,60 @@ class ChargeTest : public ::testing::Test TEST_F(ChargeTest, Constructor) { + charge = new Charge; + EXPECT_FALSE(charge->allocate_rho); + EXPECT_FALSE(charge->allocate_rho_final_scf); + delete charge; } +TEST_F(ChargeTest, Allocate) +{ + UcellTestPrepare utp = UcellTestLib["Si"]; + ucell = utp.SetUcellInfo(); + // init ucell + EXPECT_DOUBLE_EQ(ucell->omega, 265.302); + // init rhopw + ModulePW::PW_Basis* rhopw = new ModulePW::PW_Basis; + rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); + EXPECT_DOUBLE_EQ(rhopw->lat0, 10.2); + EXPECT_EQ(rhopw->nx, 24); + EXPECT_EQ(rhopw->ny, 24); + EXPECT_EQ(rhopw->nz, 24); + EXPECT_EQ(rhopw->nxyz, 13824); + rhopw->distribute_r(); + EXPECT_EQ(rhopw->nrxx, 13824); + rhopw->initparameters(false, elecstate::tmp_gridecut); + rhopw->distribute_g(); + EXPECT_EQ(rhopw->npw, 3143); + EXPECT_EQ(rhopw->npwtot, 3143); + // call Charge::allocate() + charge = new Charge; + GlobalV::test_charge = 2; + elecstate::tmp_xc_func_type = 3; + charge->set_rhopw(rhopw); + EXPECT_FALSE(charge->allocate_rho); + charge->allocate(GlobalV::NSPIN); + EXPECT_TRUE(charge->allocate_rho); + // test if Charge::allocate() be called twice + + EXPECT_NO_THROW(charge->allocate(GlobalV::NSPIN)); + EXPECT_TRUE(charge->allocate_rho); + // delete rhopw; + //charge->destroy(); + /* + if (charge->rhopw != nullptr) + { + delete charge->rhopw; + charge->rhopw = nullptr; + } + */ +} + +/* +TEST_F(ChargeTest, SumRho) +{ + +}*/ + +#undef protected #undef private \ No newline at end of file diff --git a/source/module_elecstate/test/prepare_unitcell.h b/source/module_elecstate/test/prepare_unitcell.h new file mode 100644 index 0000000000..0136324ec3 --- /dev/null +++ b/source/module_elecstate/test/prepare_unitcell.h @@ -0,0 +1,341 @@ +#ifndef PREPARE_UNITCELL_H +#define PREPARE_UNITCELL_H +#include +#include +#include "module_base/mathzone.h" + +class UcellTestPrepare +{ +public: + UcellTestPrepare()=default; + UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in); + UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in, + std::valarray mbl_in, + std::valarray velocity_in); + UcellTestPrepare(const UcellTestPrepare &utp); + + std::string latname; + int lmaxmax; + bool init_vel; + bool selective_dynamics; + bool relax_new; + std::string fixed_axes; + double lat0; + std::valarray latvec; + std::vector elements; + std::vector pp_files; + std::vector pp_types; + std::vector orb_files; + std::valarray natom; + std::vector atomic_mass; + std::string coor_type; + std::valarray coordinates; + std::valarray mbl; + std::valarray velocity; + // ntype + int ntype; + int atomic_index; + + UnitCell* SetUcellInfo() + { + //basic info + this->ntype = this->elements.size(); + UnitCell* ucell = new UnitCell; + ucell->setup(this->latname, + this->ntype, + this->lmaxmax, + this->init_vel, + this->fixed_axes); + delete[] ucell->atom_label; + delete[] ucell->atom_mass; + delete[] ucell->pseudo_fn; + delete[] ucell->pseudo_type; + delete[] ucell->orbital_fn; + delete[] ucell->magnet.start_magnetization; //mag set here + ucell->atom_label = new std::string[ucell->ntype]; + ucell->atom_mass = new double[ucell->ntype]; + ucell->pseudo_fn = new std::string[ucell->ntype]; + ucell->pseudo_type = new std::string[ucell->ntype]; + ucell->orbital_fn = new std::string[ucell->ntype]; + ucell->magnet.start_magnetization = new double[ucell->ntype]; //mag set here + ucell->magnet.ux_[0] = 0.0; // ux_ set here + ucell->magnet.ux_[1] = 0.0; + ucell->magnet.ux_[2] = 0.0; + for(int it=0;itntype;++it) + { + ucell->atom_label[it] = this->elements[it]; + ucell->atom_mass[it] = this->atomic_mass[it]; + ucell->pseudo_fn[it] = this->pp_files[it]; + ucell->pseudo_type[it] = this->pp_types[it]; + ucell->orbital_fn[it] = this->orb_files[it]; + ucell->magnet.start_magnetization[it] = 0.0; //mag set here + } + //lattice info + ucell->lat0 = this->lat0; + ucell->lat0_angstrom = ucell->lat0 * 0.529177; + ucell->tpiba = ModuleBase::TWO_PI/ucell->lat0; + ucell->tpiba2 = ucell->tpiba * ucell->tpiba; + ucell->latvec.e11 = this->latvec[0]; + ucell->latvec.e12 = this->latvec[1]; + ucell->latvec.e13 = this->latvec[2]; + ucell->latvec.e21 = this->latvec[3]; + ucell->latvec.e22 = this->latvec[4]; + ucell->latvec.e23 = this->latvec[5]; + ucell->latvec.e31 = this->latvec[6]; + ucell->latvec.e32 = this->latvec[7]; + ucell->latvec.e33 = this->latvec[8]; + ucell->a1.x = ucell->latvec.e11; + ucell->a1.y = ucell->latvec.e12; + ucell->a1.z = ucell->latvec.e13; + ucell->a2.x = ucell->latvec.e21; + ucell->a2.y = ucell->latvec.e22; + ucell->a2.z = ucell->latvec.e23; + ucell->a3.x = ucell->latvec.e31; + ucell->a3.y = ucell->latvec.e32; + ucell->a3.z = ucell->latvec.e33; + ucell->GT = ucell->latvec.Inverse(); + ucell->G = ucell->GT.Transpose(); + ucell->GGT = ucell->G*ucell->GT; + ucell->invGGT = ucell->GGT.Inverse(); + ucell->omega = abs(ucell->latvec.Det())*(ucell->lat0)*(ucell->lat0)*(ucell->lat0); + //atomic info + ucell->Coordinate = this->coor_type; + ucell->atoms = new Atom[ucell->ntype]; + ucell->set_atom_flag = true; + this->atomic_index = 0; + for(int it=0;itntype;++it) + { + ucell->atoms[it].label = this->elements[it]; + ucell->atoms[it].nw = 0; + ucell->atoms[it].nwl = 2; + delete[] ucell->atoms[it].l_nchi; + ucell->atoms[it].l_nchi = new int[ ucell->atoms[it].nwl+1]; + for(int L=0; Latoms[it].nwl+1; L++) + { + ucell->atoms[it].l_nchi[L] = 1; + ucell->atoms[it].nw += (2*L + 1) * ucell->atoms[it].l_nchi[L]; + } + ucell->atoms[it].na = this->natom[it]; + //coordinates and related physical quantities + delete[] ucell->atoms[it].tau; + delete[] ucell->atoms[it].dis; + delete[] ucell->atoms[it].taud; + delete[] ucell->atoms[it].vel; + delete[] ucell->atoms[it].mag; + delete[] ucell->atoms[it].angle1; + delete[] ucell->atoms[it].angle2; + delete[] ucell->atoms[it].m_loc_; + delete[] ucell->atoms[it].mbl; + ucell->atoms[it].tau = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].dis = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].taud = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].vel = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mag = new double[ucell->atoms[it].na]; + ucell->atoms[it].angle1 = new double[ucell->atoms[it].na]; + ucell->atoms[it].angle2 = new double[ucell->atoms[it].na]; + ucell->atoms[it].m_loc_ = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mbl = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here + for(int ia=0; iaatoms[it].na; ++ia) + { + if (ucell->Coordinate == "Direct") + { + ucell->atoms[it].taud[ia].x = this->coordinates[this->atomic_index*3+0]; + ucell->atoms[it].taud[ia].y = this->coordinates[this->atomic_index*3+1]; + ucell->atoms[it].taud[ia].z = this->coordinates[this->atomic_index*3+2]; + ucell->atoms[it].tau[ia] = ucell->atoms[it].taud[ia]*ucell->latvec; + } + else if (ucell->Coordinate == "Cartesian") + { + ucell->atoms[it].tau[ia].x = this->coordinates[this->atomic_index*3+0]; + ucell->atoms[it].tau[ia].y = this->coordinates[this->atomic_index*3+1]; + ucell->atoms[it].tau[ia].z = this->coordinates[this->atomic_index*3+2]; + ModuleBase::Mathzone::Cartesian_to_Direct( + ucell->atoms[it].tau[ia].x, ucell->atoms[it].tau[ia].y, ucell->atoms[it].tau[ia].z, + ucell->latvec.e11, ucell->latvec.e12, ucell->latvec.e13, + ucell->latvec.e21, ucell->latvec.e22, ucell->latvec.e23, + ucell->latvec.e31, ucell->latvec.e32, ucell->latvec.e33, + ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); + } + ucell->atoms[it].dis[ia].set(0, 0, 0); + if(this->init_vel) + { + ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; + ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; + ucell->atoms[it].vel[ia].z = this->velocity[this->atomic_index*3+2]; + } + else + { + ucell->atoms[it].vel[ia].set(0,0,0); + } + ucell->atoms[it].m_loc_[ia].set(0,0,0); + ucell->atoms[it].angle1[ia] = 0; + ucell->atoms[it].angle2[ia] = 0; + if(this->selective_dynamics) + { + ucell->atoms[it].mbl[ia].x = this->mbl[this->atomic_index*3+0]; + ucell->atoms[it].mbl[ia].y = this->mbl[this->atomic_index*3+1]; + ucell->atoms[it].mbl[ia].z = this->mbl[this->atomic_index*3+2]; + } + else + { + ucell->atoms[it].mbl[ia] = {1,1,1}; + } + ++(this->atomic_index); + } + } + ucell->nat = this->natom.sum(); + return ucell; + } +}; + +UcellTestPrepare::UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in): + latname(latname_in), + lmaxmax(lmaxmax_in), + init_vel(init_vel_in), + selective_dynamics(selective_dynamics_in), + relax_new(relax_new_in), + fixed_axes(fixed_axes_in), + lat0(lat0_in), + latvec(latvec_in), + elements(elements_in), + pp_files(pp_files_in), + pp_types(pp_types_in), + orb_files(orb_files_in), + natom(natom_in), + atomic_mass(atomic_mass_in), + coor_type(coor_type_in), + coordinates(coordinates_in) +{ + mbl = {0}; + velocity = {0}; +} + +UcellTestPrepare::UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in, + std::valarray mbl_in, + std::valarray velocity_in): + latname(latname_in), + lmaxmax(lmaxmax_in), + init_vel(init_vel_in), + selective_dynamics(selective_dynamics_in), + relax_new(relax_new_in), + fixed_axes(fixed_axes_in), + lat0(lat0_in), + latvec(latvec_in), + elements(elements_in), + pp_files(pp_files_in), + pp_types(pp_types_in), + orb_files(orb_files_in), + natom(natom_in), + atomic_mass(atomic_mass_in), + coor_type(coor_type_in), + coordinates(coordinates_in), + mbl(mbl_in), + velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() +{} + +UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): + latname(utp.latname), + lmaxmax(utp.lmaxmax), + init_vel(utp.init_vel), + selective_dynamics(utp.selective_dynamics), + relax_new(utp.relax_new), + fixed_axes(utp.fixed_axes), + lat0(utp.lat0), + latvec(utp.latvec), + elements(utp.elements), + pp_files(utp.pp_files), + pp_types(utp.pp_types), + orb_files(utp.orb_files), + natom(utp.natom), + atomic_mass(utp.atomic_mass), + coor_type(utp.coor_type), + coordinates(utp.coordinates), + mbl(utp.mbl), + velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() +{} + +std::map UcellTestLib +{ + {"Si", UcellTestPrepare( + "fcc", //latname + 2, //lmaxmax + true, //init_vel + true, //selective_dyanmics + true, //relax_new + "volume", //fixed_axes + 10.2, //lat0 + {-0.5,0.0,0.5, //latvec + 0.0,0.5,0.5, + -0.5,0.5,0.0}, + {"Si"}, //elements + {"Si.upf"}, //upf file + {"upf201"}, //upf types + {"Si.orb"}, //orb file + {2}, //number of each elements + {28.0}, //atomic mass + "Cartesian", //coordination type + {0.0,0.0,0.0, //atomic coordinates + 0.25,0.25,0.25})} +}; +#endif diff --git a/source/module_elecstate/test/prepare_unitcell.h.bak b/source/module_elecstate/test/prepare_unitcell.h.bak new file mode 100644 index 0000000000..7460869cf0 --- /dev/null +++ b/source/module_elecstate/test/prepare_unitcell.h.bak @@ -0,0 +1,341 @@ +#ifndef PREPARE_UNITCELL_H +#define PREPARE_UNITCELL_H +#include +#include +#include "module_base/mathzone.h" + +class UcellTestPrepare +{ +public: + UcellTestPrepare()=default; + UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in); + UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in, + std::valarray mbl_in, + std::valarray velocity_in); + UcellTestPrepare(const UcellTestPrepare &utp); + + std::string latname; + int lmaxmax; + bool init_vel; + bool selective_dynamics; + bool relax_new; + std::string fixed_axes; + double lat0; + std::valarray latvec; + std::vector elements; + std::vector pp_files; + std::vector pp_types; + std::vector orb_files; + std::valarray natom; + std::vector atomic_mass; + std::string coor_type; + std::valarray coordinates; + std::valarray mbl; + std::valarray velocity; + // ntype + int ntype; + int atomic_index; + + std::unique_ptr SetUcellInfo() + { + //basic info + this->ntype = this->elements.size(); + std::unique_ptr ucell(new UnitCell); + ucell->setup(this->latname, + this->ntype, + this->lmaxmax, + this->init_vel, + this->fixed_axes); + delete[] ucell->atom_label; + delete[] ucell->atom_mass; + delete[] ucell->pseudo_fn; + delete[] ucell->pseudo_type; + delete[] ucell->orbital_fn; + delete[] ucell->magnet.start_magnetization; //mag set here + ucell->atom_label = new std::string[ucell->ntype]; + ucell->atom_mass = new double[ucell->ntype]; + ucell->pseudo_fn = new std::string[ucell->ntype]; + ucell->pseudo_type = new std::string[ucell->ntype]; + ucell->orbital_fn = new std::string[ucell->ntype]; + ucell->magnet.start_magnetization = new double[ucell->ntype]; //mag set here + ucell->magnet.ux_[0] = 0.0; // ux_ set here + ucell->magnet.ux_[1] = 0.0; + ucell->magnet.ux_[2] = 0.0; + for(int it=0;itntype;++it) + { + ucell->atom_label[it] = this->elements[it]; + ucell->atom_mass[it] = this->atomic_mass[it]; + ucell->pseudo_fn[it] = this->pp_files[it]; + ucell->pseudo_type[it] = this->pp_types[it]; + ucell->orbital_fn[it] = this->orb_files[it]; + ucell->magnet.start_magnetization[it] = 0.0; //mag set here + } + //lattice info + ucell->lat0 = this->lat0; + ucell->lat0_angstrom = ucell->lat0 * 0.529177; + ucell->tpiba = ModuleBase::TWO_PI/ucell->lat0; + ucell->tpiba2 = ucell->tpiba * ucell->tpiba; + ucell->latvec.e11 = this->latvec[0]; + ucell->latvec.e12 = this->latvec[1]; + ucell->latvec.e13 = this->latvec[2]; + ucell->latvec.e21 = this->latvec[3]; + ucell->latvec.e22 = this->latvec[4]; + ucell->latvec.e23 = this->latvec[5]; + ucell->latvec.e31 = this->latvec[6]; + ucell->latvec.e32 = this->latvec[7]; + ucell->latvec.e33 = this->latvec[8]; + ucell->a1.x = ucell->latvec.e11; + ucell->a1.y = ucell->latvec.e12; + ucell->a1.z = ucell->latvec.e13; + ucell->a2.x = ucell->latvec.e21; + ucell->a2.y = ucell->latvec.e22; + ucell->a2.z = ucell->latvec.e23; + ucell->a3.x = ucell->latvec.e31; + ucell->a3.y = ucell->latvec.e32; + ucell->a3.z = ucell->latvec.e33; + ucell->GT = ucell->latvec.Inverse(); + ucell->G = ucell->GT.Transpose(); + ucell->GGT = ucell->G*ucell->GT; + ucell->invGGT = ucell->GGT.Inverse(); + ucell->omega = abs(ucell->latvec.Det())*(ucell->lat0)*(ucell->lat0)*(ucell->lat0); + //atomic info + ucell->Coordinate = this->coor_type; + ucell->atoms = new Atom[ucell->ntype]; + ucell->set_atom_flag = true; + this->atomic_index = 0; + for(int it=0;itntype;++it) + { + ucell->atoms[it].label = this->elements[it]; + ucell->atoms[it].nw = 0; + ucell->atoms[it].nwl = 2; + delete[] ucell->atoms[it].l_nchi; + ucell->atoms[it].l_nchi = new int[ ucell->atoms[it].nwl+1]; + for(int L=0; Latoms[it].nwl+1; L++) + { + ucell->atoms[it].l_nchi[L] = 1; + ucell->atoms[it].nw += (2*L + 1) * ucell->atoms[it].l_nchi[L]; + } + ucell->atoms[it].na = this->natom[it]; + //coordinates and related physical quantities + delete[] ucell->atoms[it].tau; + delete[] ucell->atoms[it].dis; + delete[] ucell->atoms[it].taud; + delete[] ucell->atoms[it].vel; + delete[] ucell->atoms[it].mag; + delete[] ucell->atoms[it].angle1; + delete[] ucell->atoms[it].angle2; + delete[] ucell->atoms[it].m_loc_; + delete[] ucell->atoms[it].mbl; + ucell->atoms[it].tau = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].dis = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].taud = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].vel = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mag = new double[ucell->atoms[it].na]; + ucell->atoms[it].angle1 = new double[ucell->atoms[it].na]; + ucell->atoms[it].angle2 = new double[ucell->atoms[it].na]; + ucell->atoms[it].m_loc_ = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mbl = new ModuleBase::Vector3[ucell->atoms[it].na]; + ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here + for(int ia=0; iaatoms[it].na; ++ia) + { + if (ucell->Coordinate == "Direct") + { + ucell->atoms[it].taud[ia].x = this->coordinates[this->atomic_index*3+0]; + ucell->atoms[it].taud[ia].y = this->coordinates[this->atomic_index*3+1]; + ucell->atoms[it].taud[ia].z = this->coordinates[this->atomic_index*3+2]; + ucell->atoms[it].tau[ia] = ucell->atoms[it].taud[ia]*ucell->latvec; + } + else if (ucell->Coordinate == "Cartesian") + { + ucell->atoms[it].tau[ia].x = this->coordinates[this->atomic_index*3+0]; + ucell->atoms[it].tau[ia].y = this->coordinates[this->atomic_index*3+1]; + ucell->atoms[it].tau[ia].z = this->coordinates[this->atomic_index*3+2]; + ModuleBase::Mathzone::Cartesian_to_Direct( + ucell->atoms[it].tau[ia].x, ucell->atoms[it].tau[ia].y, ucell->atoms[it].tau[ia].z, + ucell->latvec.e11, ucell->latvec.e12, ucell->latvec.e13, + ucell->latvec.e21, ucell->latvec.e22, ucell->latvec.e23, + ucell->latvec.e31, ucell->latvec.e32, ucell->latvec.e33, + ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); + } + ucell->atoms[it].dis[ia].set(0, 0, 0); + if(this->init_vel) + { + ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; + ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; + ucell->atoms[it].vel[ia].z = this->velocity[this->atomic_index*3+2]; + } + else + { + ucell->atoms[it].vel[ia].set(0,0,0); + } + ucell->atoms[it].m_loc_[ia].set(0,0,0); + ucell->atoms[it].angle1[ia] = 0; + ucell->atoms[it].angle2[ia] = 0; + if(this->selective_dynamics) + { + ucell->atoms[it].mbl[ia].x = this->mbl[this->atomic_index*3+0]; + ucell->atoms[it].mbl[ia].y = this->mbl[this->atomic_index*3+1]; + ucell->atoms[it].mbl[ia].z = this->mbl[this->atomic_index*3+2]; + } + else + { + ucell->atoms[it].mbl[ia] = {1,1,1}; + } + ++(this->atomic_index); + } + } + ucell->nat = this->natom.sum(); + return ucell; + } +}; + +UcellTestPrepare::UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in): + latname(latname_in), + lmaxmax(lmaxmax_in), + init_vel(init_vel_in), + selective_dynamics(selective_dynamics_in), + relax_new(relax_new_in), + fixed_axes(fixed_axes_in), + lat0(lat0_in), + latvec(latvec_in), + elements(elements_in), + pp_files(pp_files_in), + pp_types(pp_types_in), + orb_files(orb_files_in), + natom(natom_in), + atomic_mass(atomic_mass_in), + coor_type(coor_type_in), + coordinates(coordinates_in) +{ + mbl = {0}; + velocity = {0}; +} + +UcellTestPrepare::UcellTestPrepare(std::string latname_in, + int lmaxmax_in, + bool init_vel_in, + bool selective_dynamics_in, + bool relax_new_in, + std::string fixed_axes_in, + double lat0_in, + std::valarray latvec_in, + std::vector elements_in, + std::vector pp_files_in, + std::vector pp_types_in, + std::vector orb_files_in, + std::valarray natom_in, + std::vector atomic_mass_in, + std::string coor_type_in, + std::valarray coordinates_in, + std::valarray mbl_in, + std::valarray velocity_in): + latname(latname_in), + lmaxmax(lmaxmax_in), + init_vel(init_vel_in), + selective_dynamics(selective_dynamics_in), + relax_new(relax_new_in), + fixed_axes(fixed_axes_in), + lat0(lat0_in), + latvec(latvec_in), + elements(elements_in), + pp_files(pp_files_in), + pp_types(pp_types_in), + orb_files(orb_files_in), + natom(natom_in), + atomic_mass(atomic_mass_in), + coor_type(coor_type_in), + coordinates(coordinates_in), + mbl(mbl_in), + velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() +{} + +UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): + latname(utp.latname), + lmaxmax(utp.lmaxmax), + init_vel(utp.init_vel), + selective_dynamics(utp.selective_dynamics), + relax_new(utp.relax_new), + fixed_axes(utp.fixed_axes), + lat0(utp.lat0), + latvec(utp.latvec), + elements(utp.elements), + pp_files(utp.pp_files), + pp_types(utp.pp_types), + orb_files(utp.orb_files), + natom(utp.natom), + atomic_mass(utp.atomic_mass), + coor_type(utp.coor_type), + coordinates(utp.coordinates), + mbl(utp.mbl), + velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() +{} + +std::map UcellTestLib +{ + {"Si", UcellTestPrepare( + "fcc", //latname + 2, //lmaxmax + true, //init_vel + true, //selective_dyanmics + true, //relax_new + "volume", //fixed_axes + 10.2, //lat0 + {-0.5,0.0,0.5, //latvec + 0.0,0.5,0.5, + -0.5,0.5,0.0}, + {"Si"}, //elements + {"Si.upf"}, //upf file + {"upf201"}, //upf types + {"Si.orb"}, //orb file + {2}, //number of each elements + {28.0}, //atomic mass + "Cartesian", //coordination type + {0.0,0.0,0.0, //atomic coordinates + 0.25,0.25,0.25})} +}; +#endif diff --git a/source/module_elecstate/test/support/Si.upf b/source/module_elecstate/test/support/Si.upf new file mode 100644 index 0000000000..ad493e5e7d --- /dev/null +++ b/source/module_elecstate/test/support/Si.upf @@ -0,0 +1,1226 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann + The code is available through a link at URL www.mat-simresearch.com. + Documentation with the package provides a full discription of the + input data below. + + + While it is not required under the terms of the GNU GPL, it is + suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) + in any publication using these pseudopotentials. + + + Copyright 2015 The Regents of the University of California + + This work is licensed under the Creative Commons Attribution-ShareAlike + 4.0 International License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + + This pseudopotential is part of the Schlipf-Gygi norm-conserving + pseudopotential library. Its construction parameters were tuned to + reproduce materials of a training set with very high accuracy and + should be suitable as a general purpose pseudopotential to treat a + variety of different compounds. For details of the construction and + testing of the pseudopotential please refer to: + + [insert reference to paper here] + + We kindly ask that you include this reference in all publications + associated to this pseudopotential. + + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + Si 14.00 3 2 4 upf +# +# n l f energy (Ha) + 1 0 2.00 + 2 0 2.00 + 2 1 6.00 + 3 0 2.00 + 3 1 2.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 1 +# +# l, rc, ep, ncon, nbas, qcut + 0 2.26557 -0.39736 5 8 4.77946 + 1 3.56481 -0.14998 5 8 3.13498 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 1.32451 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 0.46066 + 1 2 0.90802 +# +# MODEL CORE CHARGE +# icmod, fcfact + 0 0.00000 +# +# LOG DERIVATIVE ANALYSIS +# epsh1, epsh2, depsh + -5.00 3.00 0.02 +# +# OUTPUT GRID +# rlmax, drl + 6.00 0.01 +# +# TEST CONFIGURATIONS +# ncnf + 0 +# nvcnf +# n l f + + + + + + + + + 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 + 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 + 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 + 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 + 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 + 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 + 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 + 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 + 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 + 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 + 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 + 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 + 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 + 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 + 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 + 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 + 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 + 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 + 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 + 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 + 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 + 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 + 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 + 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 + 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 + 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 + 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 + 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 + 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 + 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 + 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 + 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 + 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 + 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 + 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 + 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 + 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 + 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 + 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 + 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 + 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 + 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 + 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 + 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 + 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 + 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 + 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 + 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 + 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 + 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 + 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 + 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 + 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 + 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 + 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 + 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 + 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 + 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 + 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 + 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 + 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 + 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 + 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 + 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 + 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 + 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 + 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 + 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 + 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 + 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 + 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 + 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 + 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 + 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 + 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 + 6.0000 6.0100 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 + + + + -1.5477468977E+01 -2.7324392973E+01 -2.9782345566E+01 -2.7767388805E+01 + -2.6195584738E+01 -2.5542861880E+01 -2.5276294367E+01 -2.5144829399E+01 + -2.5059579659E+01 -2.4989528517E+01 -2.4923311832E+01 -2.4856476245E+01 + -2.4787146143E+01 -2.4714474972E+01 -2.4638058414E+01 -2.4557697869E+01 + -2.4473298719E+01 -2.4384823413E+01 -2.4292268116E+01 -2.4195650120E+01 + -2.4095000446E+01 -2.3990359167E+01 -2.3881772210E+01 -2.3769289057E+01 + -2.3652961011E+01 -2.3532839844E+01 -2.3408976724E+01 -2.3281421360E+01 + -2.3150221310E+01 -2.3015421452E+01 -2.2877063569E+01 -2.2735186076E+01 + -2.2589823854E+01 -2.2441008210E+01 -2.2288766939E+01 -2.2133124532E+01 + -2.1974102457E+01 -2.1811719599E+01 -2.1645992791E+01 -2.1476937450E+01 + -2.1304568340E+01 -2.1128900413E+01 -2.0949949739E+01 -2.0767734522E+01 + -2.0582276162E+01 -2.0393600368E+01 -2.0201738292E+01 -2.0006727663E+01 + -1.9808613876E+01 -1.9607451068E+01 -1.9403303174E+01 -1.9196244743E+01 + -1.8986361617E+01 -1.8773751894E+01 -1.8558525992E+01 -1.8340807162E+01 + -1.8120731547E+01 -1.7898447890E+01 -1.7674117421E+01 -1.7447913057E+01 + -1.7220018739E+01 -1.6990628533E+01 -1.6759945130E+01 -1.6528179076E+01 + -1.6295546870E+01 -1.6062269594E+01 -1.5828571461E+01 -1.5594678052E+01 + -1.5360814860E+01 -1.5127205772E+01 -1.4894071606E+01 -1.4661628903E+01 + -1.4430088792E+01 -1.4199656058E+01 -1.3970528303E+01 -1.3742895224E+01 + -1.3516938355E+01 -1.3292830722E+01 -1.3070736720E+01 -1.2850812115E+01 + -1.2633204161E+01 -1.2418051812E+01 -1.2205485995E+01 -1.1995629942E+01 + -1.1788599541E+01 -1.1584503703E+01 -1.1383444728E+01 -1.1185518645E+01 + -1.0990815535E+01 -1.0799419817E+01 -1.0611410493E+01 -1.0426861352E+01 + -1.0245841141E+01 -1.0068413676E+01 -9.8946379323E+00 -9.7245680859E+00 + -9.5582535264E+00 -9.3957390062E+00 -9.2370641453E+00 -9.0822637260E+00 + -8.9313675523E+00 -8.7844003324E+00 -8.6413815779E+00 -8.5023256728E+00 + -8.3672414787E+00 -8.2361319944E+00 -8.1089947620E+00 -7.9858215764E+00 + -7.8665987003E+00 -7.7513061799E+00 -7.6399175688E+00 -7.5324006017E+00 + -7.4287170592E+00 -7.3288227456E+00 -7.2326658677E+00 -7.1401888582E+00 + -7.0513282531E+00 -6.9660137762E+00 -6.8841675317E+00 -6.8057056592E+00 + -6.7305390121E+00 -6.6585689368E+00 -6.5896908110E+00 -6.5237944650E+00 + -6.4607608247E+00 -6.4004630980E+00 -6.3427691680E+00 -6.2875378105E+00 + -6.2346187529E+00 -6.1838567238E+00 -6.1350858423E+00 -6.0881305667E+00 + -6.0428108557E+00 -5.9989315760E+00 -5.9563018739E+00 -5.9147249878E+00 + -5.8740370536E+00 -5.8340831668E+00 -5.7947320866E+00 -5.7558838066E+00 + -5.7174427527E+00 -5.6793530761E+00 -5.6415637619E+00 -5.6040426965E+00 + -5.5667749928E+00 -5.5297469228E+00 -5.4929637112E+00 -5.4564282638E+00 + -5.4201521955E+00 -5.3841477741E+00 -5.3484295396E+00 -5.3130120785E+00 + -5.2779105659E+00 -5.2431380847E+00 -5.2087081915E+00 -5.1746314481E+00 + -5.1409182521E+00 -5.1075764790E+00 -5.0746128917E+00 -5.0420327126E+00 + -5.0098392753E+00 -4.9780353204E+00 -4.9466212706E+00 -4.9155976412E+00 + -4.8849625533E+00 -4.8547146028E+00 -4.8248501916E+00 -4.7953663228E+00 + -4.7662581823E+00 -4.7375215062E+00 -4.7091506720E+00 -4.6811404592E+00 + -4.6534847522E+00 -4.6261776585E+00 -4.5992128032E+00 -4.5725838773E+00 + -4.5462844112E+00 -4.5203079036E+00 -4.4946478992E+00 -4.4692978981E+00 + -4.4442515244E+00 -4.4195024428E+00 -4.3950443916E+00 -4.3708713315E+00 + -4.3469771307E+00 -4.3233561448E+00 -4.3000023802E+00 -4.2769105927E+00 + -4.2540751126E+00 -4.2314909275E+00 -4.2091528328E+00 -4.1870559746E+00 + -4.1651956747E+00 -4.1435672010E+00 -4.1221664144E+00 -4.1009887053E+00 + -4.0800303394E+00 -4.0592871449E+00 -4.0387554470E+00 -4.0184316203E+00 + -3.9983120170E+00 -3.9783935042E+00 -3.9586725412E+00 -3.9391462647E+00 + -3.9198115421E+00 -3.9006654703E+00 -3.8817053769E+00 -3.8629283341E+00 + -3.8443319617E+00 -3.8259135965E+00 -3.8076708201E+00 -3.7896013199E+00 + -3.7717026269E+00 -3.7539726370E+00 -3.7364090596E+00 -3.7190097434E+00 + -3.7017726254E+00 -3.6846955167E+00 -3.6677764559E+00 -3.6510133854E+00 + -3.6344042806E+00 -3.6179471887E+00 -3.6016401035E+00 -3.5854810749E+00 + -3.5694681444E+00 -3.5535993312E+00 -3.5378727398E+00 -3.5222863844E+00 + -3.5068383741E+00 -3.4915269703E+00 -3.4763502626E+00 -3.4613065798E+00 + -3.4463942648E+00 -3.4316115920E+00 -3.4169569188E+00 -3.4024285517E+00 + -3.3880247672E+00 -3.3737440896E+00 -3.3595849224E+00 -3.3455456969E+00 + -3.3316249364E+00 -3.3178210774E+00 -3.3041326374E+00 -3.2905582043E+00 + -3.2770962736E+00 -3.2637454490E+00 -3.2505043664E+00 -3.2373715747E+00 + -3.2243457535E+00 -3.2114255903E+00 -3.1986096896E+00 -3.1858967973E+00 + -3.1732856542E+00 -3.1607749207E+00 -3.1483634008E+00 -3.1360498903E+00 + -3.1238331067E+00 -3.1117119036E+00 -3.0996851338E+00 -3.0877515736E+00 + -3.0759101174E+00 -3.0641596773E+00 -3.0524990903E+00 -3.0409272833E+00 + -3.0294432293E+00 -3.0180458288E+00 -3.0067340322E+00 -2.9955068756E+00 + -2.9843633257E+00 -2.9733023477E+00 -2.9623230421E+00 -2.9514244449E+00 + -2.9406055280E+00 -2.9298654572E+00 -2.9192033229E+00 -2.9086181497E+00 + -2.8981091154E+00 -2.8876753764E+00 -2.8773160286E+00 -2.8670302370E+00 + -2.8568172300E+00 -2.8466761789E+00 -2.8366062277E+00 -2.8266066756E+00 + -2.8166767555E+00 -2.8068156351E+00 -2.7970226322E+00 -2.7872970399E+00 + -2.7776381027E+00 -2.7680450991E+00 -2.7585173970E+00 -2.7490543163E+00 + -2.7396551053E+00 -2.7303191888E+00 -2.7210459310E+00 -2.7118346568E+00 + -2.7026847368E+00 -2.6935956102E+00 -2.6845666748E+00 -2.6755972644E+00 + -2.6666868674E+00 -2.6578349224E+00 -2.6490408387E+00 -2.6403040399E+00 + -2.6316240357E+00 -2.6230002915E+00 -2.6144322274E+00 -2.6059193575E+00 + -2.5974611946E+00 -2.5890572296E+00 -2.5807069106E+00 -2.5724098107E+00 + -2.5641654513E+00 -2.5559733347E+00 -2.5478329753E+00 -2.5397439514E+00 + -2.5317058077E+00 -2.5237180602E+00 -2.5157802749E+00 -2.5078920358E+00 + -2.5000529075E+00 -2.4922624221E+00 -2.4845201831E+00 -2.4768257811E+00 + -2.4691787986E+00 -2.4615787838E+00 -2.4540253663E+00 -2.4465181449E+00 + -2.4390567145E+00 -2.4316406471E+00 -2.4242695821E+00 -2.4169431302E+00 + -2.4096608977E+00 -2.4024224760E+00 -2.3952275121E+00 -2.3880756283E+00 + -2.3809664422E+00 -2.3738995587E+00 -2.3668746343E+00 -2.3598913020E+00 + -2.3529491911E+00 -2.3460479148E+00 -2.3391871420E+00 -2.3323665165E+00 + -2.3255856806E+00 -2.3188442508E+00 -2.3121419122E+00 -2.3054783204E+00 + -2.2988531312E+00 -2.2922659659E+00 -2.2857165237E+00 -2.2792044767E+00 + -2.2727294942E+00 -2.2662912082E+00 -2.2598893247E+00 -2.2535235433E+00 + -2.2471935506E+00 -2.2408990002E+00 -2.2346395919E+00 -2.2284150639E+00 + -2.2222251242E+00 -2.2160694683E+00 -2.2099477827E+00 -2.2038598291E+00 + -2.1978053318E+00 -2.1917840153E+00 -2.1857955713E+00 -2.1798397640E+00 + -2.1739163327E+00 -2.1680250136E+00 -2.1621655213E+00 -2.1563376011E+00 + -2.1505410203E+00 -2.1447755279E+00 -2.1390408686E+00 -2.1333367626E+00 + -2.1276630036E+00 -2.1220193519E+00 -2.1164055679E+00 -2.1108213893E+00 + -2.1052665912E+00 -2.0997409596E+00 -2.0942442661E+00 -2.0887762796E+00 + -2.0833367418E+00 -2.0779254678E+00 -2.0725422396E+00 -2.0671868395E+00 + -2.0618590326E+00 -2.0565586038E+00 -2.0512853643E+00 -2.0460391061E+00 + -2.0408196217E+00 -2.0356266749E+00 -2.0304600880E+00 -2.0253196691E+00 + -2.0202052199E+00 -2.0151165385E+00 -2.0100534025E+00 -2.0050156523E+00 + -2.0000030990E+00 -1.9950155537E+00 -1.9900528158E+00 -1.9851146899E+00 + -1.9802010173E+00 -1.9753116178E+00 -1.9704463115E+00 -1.9656049008E+00 + -1.9607872123E+00 -1.9559930895E+00 -1.9512223606E+00 -1.9464748539E+00 + -1.9417503771E+00 -1.9370487734E+00 -1.9323698900E+00 -1.9277135633E+00 + -1.9230796294E+00 -1.9184679026E+00 -1.9138782381E+00 -1.9093104884E+00 + -1.9047644975E+00 -1.9002401093E+00 -1.8957371459E+00 -1.8912554699E+00 + -1.8867949408E+00 -1.8823554098E+00 -1.8779367281E+00 -1.8735387272E+00 + -1.8691612728E+00 -1.8648042327E+00 -1.8604674651E+00 -1.8561508281E+00 + -1.8518541638E+00 -1.8475773371E+00 -1.8433202255E+00 -1.8390826938E+00 + -1.8348646068E+00 -1.8306658183E+00 -1.8264861889E+00 -1.8223256068E+00 + -1.8181839431E+00 -1.8140610690E+00 -1.8099568515E+00 -1.8058711430E+00 + -1.8018038438E+00 -1.7977548310E+00 -1.7937239816E+00 -1.7897111726E+00 + -1.7857162590E+00 -1.7817391401E+00 -1.7777797032E+00 -1.7738378311E+00 + -1.7699134066E+00 -1.7660062999E+00 -1.7621163950E+00 -1.7582435938E+00 + -1.7543877846E+00 -1.7505488557E+00 -1.7467266942E+00 -1.7429211656E+00 + -1.7391321872E+00 -1.7353596525E+00 -1.7316034550E+00 -1.7278634881E+00 + -1.7241396316E+00 -1.7204317838E+00 -1.7167398544E+00 -1.7130637420E+00 + -1.7094033448E+00 -1.7057585614E+00 -1.7021292665E+00 -1.6985153863E+00 + -1.6949168243E+00 -1.6913334837E+00 -1.6877652676E+00 -1.6842120706E+00 + -1.6806737906E+00 -1.6771503506E+00 -1.6736416581E+00 -1.6701476209E+00 + -1.6666681466E+00 -1.6632031275E+00 -1.6597524814E+00 -1.6563161283E+00 + -1.6528939800E+00 -1.6494859485E+00 -1.6460919458E+00 -1.6427118637E+00 + -1.6393456356E+00 -1.6359931797E+00 -1.6326544123E+00 -1.6293292493E+00 + -1.6260176054E+00 -1.6227193778E+00 -1.6194345069E+00 -1.6161629127E+00 + -1.6129045151E+00 -1.6096592341E+00 -1.6064269863E+00 -1.6032076774E+00 + -1.6000012493E+00 -1.5968076257E+00 -1.5936267302E+00 -1.5904584866E+00 + -1.5873028146E+00 -1.5841596253E+00 -1.5810288631E+00 -1.5779104552E+00 + -1.5748043290E+00 -1.5717104115E+00 -1.5686286273E+00 -1.5655588892E+00 + -1.5625011455E+00 -1.5594553268E+00 -1.5564213638E+00 -1.5533991872E+00 + -1.5503887270E+00 -1.5473898951E+00 -1.5444026446E+00 -1.5414269094E+00 + -1.5384626235E+00 -1.5355097207E+00 -1.5325681348E+00 -1.5296377836E+00 + -1.5267186161E+00 -1.5238105728E+00 -1.5209135906E+00 -1.5180276066E+00 + -1.5151525575E+00 -1.5122883695E+00 -1.5094349837E+00 -1.5065923482E+00 + -1.5037604031E+00 -1.5009390881E+00 -1.4981283433E+00 -1.4953281043E+00 + -1.4925383011E+00 -1.4897588911E+00 -1.4869898169E+00 -1.4842310213E+00 + -1.4814824468E+00 -1.4787440363E+00 -1.4760157177E+00 -1.4732974468E+00 + -1.4705891727E+00 -1.4678908407E+00 -1.4652023962E+00 -1.4625237845E+00 + -1.4598549454E+00 -1.4571958183E+00 -1.4545463634E+00 -1.4519065286E+00 + -1.4492762619E+00 -1.4466555110E+00 -1.4440442241E+00 -1.4414423359E+00 + -1.4388498046E+00 -1.4362665850E+00 -1.4336926274E+00 -1.4311278823E+00 + -1.4285722999E+00 -1.4260258291E+00 -1.4234884065E+00 -1.4209600000E+00 + -1.4184405624E+00 -1.4159300463E+00 -1.4134284044E+00 -1.4109355893E+00 + -1.4084515477E+00 -1.4059762282E+00 -1.4035095964E+00 -1.4010516072E+00 + -1.3986022154E+00 -1.3961613759E+00 -1.3937290435E+00 -1.3913051642E+00 + -1.3888896954E+00 -1.3864826015E+00 -1.3840838394E+00 -1.3816933662E+00 + -1.3793111388E+00 -1.3769371141E+00 -1.3745712387E+00 -1.3722134757E+00 + -1.3698637895E+00 -1.3675221392E+00 -1.3651884837E+00 -1.3628627820E+00 + -1.3605449931E+00 -1.3582350654E+00 -1.3559329645E+00 -1.3536386564E+00 + -1.3513521020E+00 -1.3490732621E+00 -1.3468020977E+00 -1.3445385696E+00 + -1.3422826293E+00 -1.3400342423E+00 -1.3377933771E+00 -1.3355599965E+00 + -1.3333340631E+00 -1.3311155397E+00 + + + + 0.0000000000E+00 -2.8841736740E-02 -5.7679700157E-02 -8.6510048419E-02 + -1.1532880303E-01 -1.4413178139E-01 -1.7291453039E-01 -2.0167226144E-01 + -2.3039978723E-01 -2.5909146053E-01 -2.8774111545E-01 -3.1634201134E-01 + -3.4488677974E-01 -3.7336737464E-01 -4.0177502622E-01 -4.3010019855E-01 + -4.5833255122E-01 -4.8646090534E-01 -5.1447321404E-01 -5.4235653759E-01 + -5.7009702342E-01 -5.9767989113E-01 -6.2508942258E-01 -6.5230895724E-01 + -6.7932089284E-01 -7.0610669141E-01 -7.3264689061E-01 -7.5892112067E-01 + -7.8490812659E-01 -8.1058579577E-01 -8.3593119106E-01 -8.6092058898E-01 + -8.8552952315E-01 -9.0973283265E-01 -9.3350471611E-01 -9.5681878859E-01 + -9.7964814634E-01 -1.0019654323E+00 -1.0237429081E+00 -1.0449525307E+00 + -1.0655660300E+00 -1.0855549925E+00 -1.1048909467E+00 -1.1235454528E+00 + -1.1414901936E+00 -1.1586970687E+00 -1.1751382906E+00 -1.1907864820E+00 + -1.2056147736E+00 -1.2195969045E+00 -1.2327073278E+00 -1.2449213050E+00 + -1.2562149999E+00 -1.2665656036E+00 -1.2759514043E+00 -1.2843519027E+00 + -1.2917479077E+00 -1.2981216179E+00 -1.3034567334E+00 -1.3077385247E+00 + -1.3109539290E+00 -1.3130916419E+00 -1.3141421523E+00 -1.3140978881E+00 + -1.3129532218E+00 -1.3107045400E+00 -1.3073503532E+00 -1.3028912932E+00 + -1.2973301675E+00 -1.2906720157E+00 -1.2829241456E+00 -1.2740961357E+00 + -1.2641998629E+00 -1.2532495073E+00 -1.2412615620E+00 -1.2282548327E+00 + -1.2142504052E+00 -1.1992716289E+00 -1.1833440842E+00 -1.1664955415E+00 + -1.1487559102E+00 -1.1301571793E+00 -1.1107333490E+00 -1.0905203527E+00 + -1.0695559710E+00 -1.0478797354E+00 -1.0255328250E+00 -1.0025579532E+00 + -9.7899924704E-01 -9.5490211799E-01 -9.3031312559E-01 -9.0527983331E-01 + -8.7985065792E-01 -8.5407471242E-01 -8.2800164342E-01 -8.0168146341E-01 + -7.7516437895E-01 -7.4850067036E-01 -7.2174037077E-01 -6.9493318906E-01 + -6.6812831402E-01 -6.4137422471E-01 -6.1471851007E-01 -5.8820776129E-01 + -5.6188728413E-01 -5.3580082473E-01 -5.0999061020E-01 -4.8449711394E-01 + -4.5935903385E-01 -4.3461289437E-01 -4.1029282854E-01 -3.8643077334E-01 + -3.6305632845E-01 -3.4019666040E-01 -3.1787578979E-01 -2.9611530750E-01 + -2.7493426793E-01 -2.5434879517E-01 -2.3437186083E-01 -2.1501393233E-01 + -1.9628312291E-01 -1.7818400288E-01 -1.6071890003E-01 -1.4388794209E-01 + -1.2768840921E-01 -1.1211543946E-01 -9.7162452476E-02 -8.2820764671E-02 + -6.9080267705E-02 -5.5929689780E-02 -4.3356685252E-02 -3.1348689619E-02 + -1.9892453765E-02 -8.9755400134E-03 1.4132949100E-03 1.1285244724E-02 + 2.0647249979E-02 2.9506164420E-02 3.7866552512E-02 4.5731336842E-02 + 5.3103421637E-02 5.9984217384E-02 6.6375758237E-02 7.2279934730E-02 + 7.7699630296E-02 8.2637946624E-02 8.7099818936E-02 9.1090647717E-02 + 9.4617493782E-02 9.7688622888E-02 1.0031329865E-01 1.0250261932E-01 + 1.0426803941E-01 1.0562305440E-01 1.0658140112E-01 1.0715832691E-01 + 1.0736954932E-01 1.0723177394E-01 1.0676219438E-01 1.0597870952E-01 + 1.0489948361E-01 1.0354333092E-01 1.0192892530E-01 1.0007570434E-01 + 9.8002447271E-02 9.5728910965E-02 9.3273634771E-02 9.0656382360E-02 + 8.7895165189E-02 8.5009436085E-02 8.2016446203E-02 7.8935016989E-02 + 7.5781461937E-02 7.2573649515E-02 6.9326833237E-02 6.6057608575E-02 + 6.2780100681E-02 5.9509318826E-02 5.6258240942E-02 5.3039993600E-02 + 4.9866428133E-02 4.6748524948E-02 4.3697051508E-02 4.0720635210E-02 + 3.7828999347E-02 3.5028298091E-02 3.2327216093E-02 2.9729756158E-02 + 2.7242535996E-02 2.4868549730E-02 2.2611791776E-02 2.0474556066E-02 + 1.8458191433E-02 1.6564349954E-02 1.4791967083E-02 1.3141917674E-02 + 1.1611519754E-02 1.0199648749E-02 8.9033992507E-03 7.7195320342E-03 + 6.6448388461E-03 5.6745688076E-03 4.8048020119E-03 4.0301691924E-03 + 3.3455682929E-03 2.7455765903E-03 2.2244016523E-03 1.7761668655E-03 + 1.3950914183E-03 1.0749457295E-03 8.0991718345E-04 5.9427096241E-04 + 4.2157571283E-04 2.8706150887E-04 1.8468089406E-04 1.0950377224E-04 + 5.7290159029E-05 2.2098943961E-05 1.4043713425E-06 -9.1475939153E-06 + -1.3065809747E-05 -1.1927614655E-05 -9.4909833879E-06 -6.2689914936E-06 + -3.1648973687E-06 -2.1668137544E-06 -1.6967307725E-06 -1.2459024843E-06 + -6.1448207011E-07 -1.0876324063E-07 9.0543951786E-08 8.6861537626E-08 + 2.6499782029E-09 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 -2.5499846128E-02 -5.0963631551E-02 -7.6355278930E-02 + -1.0163867803E-01 -1.2677767022E-01 -1.5173603410E-01 -1.7647747261E-01 + -2.0096560203E-01 -2.2516394317E-01 -2.4903591511E-01 -2.7254483189E-01 + -2.9565390231E-01 -3.1832623334E-01 -3.4052483735E-01 -3.6221264334E-01 + -3.8335251258E-01 -4.0390725883E-01 -4.2383967332E-01 -4.4311255476E-01 + -4.6168874444E-01 -4.7953116669E-01 -4.9660287473E-01 -5.1286710199E-01 + -5.2828731901E-01 -5.4282729593E-01 -5.5645117060E-01 -5.6912352219E-01 + -5.8080945024E-01 -5.9147465915E-01 -6.0108554800E-01 -6.0960930534E-01 + -6.1701400875E-01 -6.2326872873E-01 -6.2834363913E-01 -6.3221012613E-01 + -6.3484090962E-01 -6.3621015814E-01 -6.3629361305E-01 -6.3506871510E-01 + -6.3251472853E-01 -6.2861287012E-01 -6.2334643796E-01 -6.1670094052E-01 + -6.0866422512E-01 -5.9922660535E-01 -5.8838098663E-01 -5.7612298909E-01 + -5.6245106515E-01 -5.4736661636E-01 -5.3087411047E-01 -5.1298117723E-01 + -4.9369869916E-01 -4.7304093336E-01 -4.5102555728E-01 -4.2767376444E-01 + -4.0301032570E-01 -3.7706362942E-01 -3.4986574285E-01 -3.2145242097E-01 + -2.9186313188E-01 -2.6114106556E-01 -2.2933308765E-01 -1.9648976164E-01 + -1.6266525856E-01 -1.2791730544E-01 -9.2307124587E-02 -5.5899311402E-02 + -1.8761727170E-02 1.9034634393E-02 5.7415808473E-02 9.6305030940E-02 + 1.3562293197E-01 1.7528774423E-01 2.1521554118E-01 2.5532050734E-01 + 2.9551518735E-01 3.3571078458E-01 3.7581747060E-01 4.1574471215E-01 + 4.5540161494E-01 4.9469728327E-01 5.3354119431E-01 5.7184358574E-01 + 6.0951585551E-01 6.4647097188E-01 6.8262389228E-01 7.1789198884E-01 + 7.5219547875E-01 7.8545785698E-01 8.1760632906E-01 8.4857224113E-01 + 8.7829150456E-01 9.0670501185E-01 9.3375904074E-01 9.5940564292E-01 + 9.8360301384E-01 1.0063156411E+00 1.0275151786E+00 1.0471803022E+00 + 1.0652970378E+00 1.0818590107E+00 1.0968676219E+00 1.1103320100E+00 + 1.1222694618E+00 1.1327056016E+00 1.1416738466E+00 1.1492155073E+00 + 1.1553794409E+00 1.1602223039E+00 1.1638081688E+00 1.1662076632E+00 + 1.1674976628E+00 1.1677609339E+00 1.1670855043E+00 1.1655634179E+00 + 1.1632903010E+00 1.1603644915E+00 1.1568850242E+00 1.1529510633E+00 + 1.1486621370E+00 1.1441127675E+00 1.1393934173E+00 1.1345907714E+00 + 1.1297814738E+00 1.1250306703E+00 1.1203954935E+00 1.1159162834E+00 + 1.1116127680E+00 1.1074927451E+00 1.1035362725E+00 1.0996938818E+00 + 1.0959012846E+00 1.0920455902E+00 1.0879988385E+00 1.0836105505E+00 + 1.0787357826E+00 1.0732335554E+00 1.0669727659E+00 1.0598494096E+00 + 1.0517600455E+00 1.0426432692E+00 1.0324442831E+00 1.0211309106E+00 + 1.0086974564E+00 9.9513941686E-01 9.8048565811E-01 9.6476298028E-01 + 9.4801679818E-01 9.3029765691E-01 9.1166312028E-01 8.9217700415E-01 + 8.7190551339E-01 8.5091810388E-01 8.2928600217E-01 8.0708019407E-01 + 7.8437291255E-01 7.6123503195E-01 7.3773682848E-01 7.1394785394E-01 + 6.8993469226E-01 6.6576460714E-01 6.4149956841E-01 6.1720376331E-01 + 5.9293411021E-01 5.6875106784E-01 5.4470633307E-01 5.2085608675E-01 + 4.9724677659E-01 4.7392982827E-01 4.5094649337E-01 4.2834301168E-01 + 4.0615554838E-01 3.8442475541E-01 3.6318187258E-01 3.4246158365E-01 + 3.2229041408E-01 3.0269672724E-01 2.8370258812E-01 2.6532973765E-01 + 2.4759605771E-01 2.3051645396E-01 2.1410489041E-01 1.9836936853E-01 + 1.8332013731E-01 1.6895843397E-01 1.5529087448E-01 1.4231303001E-01 + 1.3002573509E-01 1.1842164378E-01 1.0749494628E-01 9.7236030275E-02 + 8.7632867669E-02 7.8673622274E-02 7.0341038628E-02 6.2620696294E-02 + 5.5491976604E-02 4.8936078440E-02 4.2931388291E-02 3.7455225566E-02 + 3.2484559702E-02 2.7994596392E-02 2.3960159627E-02 2.0355841281E-02 + 1.7154989586E-02 1.4331325306E-02 1.1858828622E-02 9.7091684407E-03 + 7.8581651254E-03 6.2779355258E-03 4.9436416616E-03 3.8313730451E-03 + 2.9136122090E-03 2.1710092204E-03 1.5784495142E-03 1.1155195012E-03 + 7.6470967044E-04 5.0175154346E-04 3.1554414334E-04 1.8801461325E-04 + 1.0414480240E-04 5.5955438871E-05 2.7570255813E-05 1.4588279462E-05 + 1.1186579074E-05 7.6842075616E-06 6.7823719599E-06 5.5465121341E-06 + 2.8487720314E-06 5.2111264156E-07 -3.9464775839E-07 -3.7859747049E-07 + -1.1550279582E-08 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 7.8689664316E-04 3.1454849895E-03 7.0694669237E-03 + 1.2548367677E-02 1.9567568879E-02 2.8108354660E-02 3.8147970645E-02 + 4.9659695613E-02 6.2612925578E-02 7.6973269978E-02 9.2702659630E-02 + 1.0975946606E-01 1.2809863177E-01 1.4767181101E-01 1.6842752051E-01 + 1.9031129964E-01 2.1326587945E-01 2.3723135997E-01 2.6214539514E-01 + 2.8794338475E-01 3.1455867261E-01 3.4192275042E-01 3.6996546645E-01 + 3.9861523844E-01 4.2779926988E-01 4.5744376898E-01 4.8747416961E-01 + 5.1781535324E-01 5.4839187151E-01 5.7912816823E-01 6.0994880048E-01 + 6.4077865766E-01 6.7154317807E-01 7.0216856249E-01 7.3258198299E-01 + 7.6271178818E-01 7.9248770211E-01 8.2184101791E-01 8.5070478462E-01 + 8.7901398683E-01 9.0670571683E-01 9.3371933847E-01 9.5999664233E-01 + 9.8548199181E-01 1.0101224597E+00 1.0338679546E+00 1.0566713378E+00 + 1.0784885294E+00 1.0992786034E+00 1.1190038697E+00 1.1376299494E+00 + 1.1551258416E+00 1.1714639587E+00 1.1866201832E+00 1.2005738845E+00 + 1.2133079353E+00 1.2248087257E+00 1.2350661417E+00 1.2440735637E+00 + 1.2518278296E+00 1.2583291864E+00 1.2635812831E+00 1.2675910394E+00 + 1.2703686393E+00 1.2719274506E+00 1.2722838762E+00 1.2714573200E+00 + 1.2694700760E+00 1.2663471931E+00 1.2621163473E+00 1.2568077467E+00 + 1.2504539862E+00 1.2430899169E+00 1.2347524899E+00 1.2254805888E+00 + 1.2153149129E+00 1.2042978062E+00 1.1924730970E+00 1.1798859351E+00 + 1.1665826263E+00 1.1526104660E+00 1.1380175710E+00 1.1228527110E+00 + 1.1071651403E+00 1.0910044287E+00 1.0744202947E+00 1.0574624389E+00 + 1.0401803793E+00 1.0226232893E+00 1.0048398376E+00 9.8687803142E-01 + 9.6878506336E-01 9.5060716146E-01 9.3238944395E-01 9.1417577821E-01 + 8.9600864463E-01 8.7792905115E-01 8.5997627535E-01 8.4218785507E-01 + 8.2459945446E-01 8.0724474863E-01 7.9015532164E-01 7.7336060159E-01 + 7.5688770713E-01 7.4076134353E-01 7.2500381942E-01 7.0963493956E-01 + 6.9467197272E-01 6.8012951658E-01 6.6601946395E-01 6.5235103708E-01 + 6.3913072735E-01 6.2636224631E-01 6.1404647327E-01 6.0218153886E-01 + 5.9076277341E-01 5.7978268777E-01 5.6923105865E-01 5.5909492331E-01 + 5.4935849547E-01 5.4000346162E-01 5.3100887326E-01 5.2235106392E-01 + 5.1400401562E-01 5.0593939456E-01 4.9812626716E-01 4.9053163402E-01 + 4.8312060787E-01 4.7585581537E-01 4.6869837210E-01 4.6160789286E-01 + 4.5454157451E-01 4.4745597594E-01 4.4030887064E-01 4.3305602914E-01 + 4.2566460975E-01 4.1810242870E-01 4.1034448118E-01 4.0237407184E-01 + 3.9417513629E-01 3.8574261721E-01 3.7707221321E-01 3.6816483782E-01 + 3.5902563915E-01 3.4966050609E-01 3.4007990559E-01 3.3029423687E-01 + 3.2031613648E-01 3.1015868738E-01 2.9983597276E-01 2.8936208558E-01 + 2.7875202936E-01 2.6802009448E-01 2.5718149261E-01 2.4625064086E-01 + 2.3524250402E-01 2.2417155048E-01 2.1305234144E-01 2.0189931952E-01 + 1.9072662047E-01 1.7954859797E-01 1.6837898447E-01 1.5723198741E-01 + 1.4612095857E-01 1.3505990101E-01 1.2406179107E-01 1.1314036280E-01 + 1.0230820196E-01 9.1578698050E-02 8.0964015123E-02 7.0477109117E-02 + 6.0129682155E-02 4.9934153222E-02 3.9901720205E-02 3.0044148296E-02 + 2.0372092226E-02 1.0896535872E-02 1.6275583313E-03 -7.4247710965E-03 + -1.6250975081E-02 -2.4842030413E-02 -3.3189085010E-02 -4.1284281300E-02 + -4.9119420596E-02 -5.6687905791E-02 -6.3982234773E-02 -7.0996992492E-02 + -7.7725846191E-02 -8.4164147947E-02 -9.0307021902E-02 -9.6150511095E-02 + -1.0169127425E-01 -1.0692606621E-01 -1.1185306063E-01 -1.1646982177E-01 + -1.2077576795E-01 -1.2476987675E-01 -1.2845224096E-01 -1.3182339508E-01 + -1.3488416376E-01 -1.3763646539E-01 -1.4008207629E-01 -1.4222393722E-01 + -1.4406512629E-01 -1.4560930382E-01 -1.4686074397E-01 -1.4782401128E-01 + -1.4850427703E-01 -1.4890714395E-01 -1.4903856659E-01 -1.4890492508E-01 + -1.4851321313E-01 -1.4787033758E-01 -1.4698406464E-01 -1.4586217040E-01 + -1.4451259796E-01 -1.4294442162E-01 -1.4116568778E-01 -1.3918568305E-01 + -1.3701372423E-01 -1.3465862889E-01 -1.3213076264E-01 -1.2943918116E-01 + -1.2659359926E-01 -1.2360484373E-01 -1.2048175512E-01 -1.1723500505E-01 + -1.1387480839E-01 -1.1041034939E-01 -1.0685287514E-01 -1.0321162700E-01 + -9.9496051548E-02 -9.5717741016E-02 -9.1884720206E-02 -8.8006899164E-02 + -8.4094973959E-02 -8.0156599487E-02 -7.6201678966E-02 -7.2239679929E-02 + -6.8277905197E-02 -6.4325987090E-02 -6.0392061807E-02 -5.6482945729E-02 + -5.2607776635E-02 -4.8773342055E-02 -4.4985824952E-02 -4.1253654652E-02 + -3.7582321167E-02 -3.3977226624E-02 -3.0445897204E-02 -2.6992628159E-02 + -2.3621905154E-02 -2.0340182893E-02 -1.7150699592E-02 -1.4056912238E-02 + -1.1064068087E-02 -8.1745036098E-03 -5.3905691228E-03 -2.7162071242E-03 + -1.5300574375E-04 2.2978251543E-03 4.6336987090E-03 6.8536457700E-03 + 8.9575776284E-03 1.0944258005E-02 1.2813255266E-02 1.4565522669E-02 + 1.6201103373E-02 1.7720091913E-02 1.9124341510E-02 2.0415029515E-02 + 2.1592850071E-02 2.2660355075E-02 2.3619538415E-02 2.4472139642E-02 + 2.5220873974E-02 2.5868469868E-02 2.6417599773E-02 2.6871204813E-02 + 2.7232489610E-02 2.7504736033E-02 2.7691408444E-02 2.7795853393E-02 + 2.7821662379E-02 2.7772915036E-02 2.7653031836E-02 2.7465693716E-02 + 2.7215100029E-02 2.6905285129E-02 2.6539602582E-02 2.6121967073E-02 + 2.5657327251E-02 2.5148538347E-02 2.4599330573E-02 2.4014169150E-02 + 2.3396913842E-02 2.2750425333E-02 2.2078328798E-02 2.1385602467E-02 + 2.0674341995E-02 1.9947678250E-02 1.9209481011E-02 1.8463397283E-02 + 1.7711221562E-02 1.6955804200E-02 1.6201213181E-02 1.5449238255E-02 + 1.4701752242E-02 1.3961229026E-02 1.3231393287E-02 1.2512590200E-02 + 1.1806616800E-02 1.1115859670E-02 1.0442401139E-02 9.7865046746E-03 + 9.1494239439E-03 8.5332760049E-03 7.9387373364E-03 7.3659625001E-03 + 6.8156689090E-03 6.2895328596E-03 5.7871851830E-03 5.3086138841E-03 + 4.8540379184E-03 4.4245632121E-03 4.0191780084E-03 3.6376474493E-03 + 3.2798096638E-03 2.9459728619E-03 2.6350196381E-03 2.3464098185E-03 + 2.0796363904E-03 1.8343618101E-03 1.6095149398E-03 1.4043138594E-03 + 1.2179638690E-03 1.0496804426E-03 8.9850551883E-04 7.6351988791E-04 + 6.4375088891E-04 5.3809002421E-04 4.4577524737E-04 3.6585211833E-04 + 2.9731727687E-04 2.3879084297E-04 1.8979225833E-04 1.4942270281E-04 + 1.1675960049E-04 9.0307189055E-05 6.9787452965E-05 5.4476506959E-05 + 4.3583168954E-05 3.6476658981E-05 3.2149854062E-05 2.9603414592E-05 + 2.7878590677E-05 2.3699218774E-05 1.6944121547E-05 1.0219571001E-05 + 4.0280730137E-06 -4.8429645228E-07 -1.6699852801E-06 -1.7757868061E-06 + -1.1375782949E-06 -9.8926485858E-08 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 1.0819359206E-03 4.3213968368E-03 9.6993737685E-03 + 1.7184290121E-02 2.6732158724E-02 3.8286800643E-02 5.1780124740E-02 + 6.7132466654E-02 8.4252985604E-02 1.0304011714E-01 1.2338207973E-01 + 1.4515743270E-01 1.6823568304E-01 1.9247793806E-01 2.1773760090E-01 + 2.4386110561E-01 2.7068868820E-01 2.9805519018E-01 3.2579089076E-01 + 3.5372236353E-01 3.8167335396E-01 4.0946567319E-01 4.3692010412E-01 + 4.6385731528E-01 4.9009877838E-01 5.1546768498E-01 5.3978985805E-01 + 5.6289465375E-01 5.8461584970E-01 6.0479251498E-01 6.2326985788E-01 + 6.3990004724E-01 6.5454300371E-01 6.6706715647E-01 6.7735016327E-01 + 6.8527958662E-01 6.9075352903E-01 6.9368121818E-01 6.9398354001E-01 + 6.9159352255E-01 6.8645676125E-01 6.7853178687E-01 6.6779037366E-01 + 6.5421778592E-01 6.3781296170E-01 6.1858863247E-01 5.9657137806E-01 + 5.7180162208E-01 5.4433355421E-01 5.1423496910E-01 4.8158708445E-01 + 4.4648430238E-01 4.0903376687E-01 3.6935509660E-01 3.2757985241E-01 + 2.8385102185E-01 2.3832251237E-01 1.9115841909E-01 1.4253245422E-01 + 9.2627162495E-02 4.1633085624E-02 -1.0251790878E-02 -6.2823336834E-02 + -1.1587178320E-01 -1.6918266866E-01 -2.2253814257E-01 -2.7571757857E-01 + -3.2849861507E-01 -3.8065829197E-01 -4.3197411535E-01 -4.8222491420E-01 + -5.3119194130E-01 -5.7865986305E-01 -6.2441784604E-01 -6.6826065185E-01 + -7.0998945596E-01 -7.4941289319E-01 -7.8634800943E-01 -8.2062118418E-01 + -8.5206902001E-01 -8.8053919470E-01 -9.0589127236E-01 -9.2799746951E-01 + -9.4674337264E-01 -9.6202860373E-01 -9.7376743021E-01 -9.8188931632E-01 + -9.8633941271E-01 -9.8707898141E-01 -9.8408575345E-01 -9.7735421673E-01 + -9.6689583184E-01 -9.5273917380E-01 -9.3492999829E-01 -9.1353123085E-01 + -8.8862287835E-01 -8.6030193315E-01 -8.2868199446E-01 -7.9389297780E-01 + -7.5608071324E-01 -7.1540644359E-01 -6.7204625099E-01 -6.2619061876E-01 + -5.7804343671E-01 -5.2782076140E-01 -4.7575053184E-01 -4.2207139301E-01 + -3.6703221026E-01 -3.1088999895E-01 -2.5390812020E-01 -1.9635635064E-01 + -1.3850955034E-01 -8.0646487963E-02 -2.3044542245E-02 3.4017714934E-02 + 9.0261996456E-02 1.4541413457E-01 1.9920831009E-01 2.5138425644E-01 + 3.0168655497E-01 3.4987916939E-01 3.9573691954E-01 4.3904553823E-01 + 4.7961427227E-01 5.1727419219E-01 5.5187202935E-01 5.8328462909E-01 + 6.1142066997E-01 6.3620895529E-01 6.5761931988E-01 6.7566088493E-01 + 6.9036700920E-01 7.0183094593E-01 7.1016929319E-01 7.1553181715E-01 + 7.1807015343E-01 7.1794179320E-01 7.1530231392E-01 7.1028763988E-01 + 7.0304223439E-01 6.9367458816E-01 6.8229508316E-01 6.6899824944E-01 + 6.5385916840E-01 6.3695886974E-01 6.1835124797E-01 5.9809900519E-01 + 5.7625224766E-01 5.5286168663E-01 5.2797714783E-01 5.0164627897E-01 + 4.7392125748E-01 4.4485281725E-01 4.1449700824E-01 3.8291115436E-01 + 3.5015689988E-01 3.1629875773E-01 2.8140479300E-01 2.4554664940E-01 + 2.0879850712E-01 1.7123868072E-01 1.3294648394E-01 9.4006109867E-02 + 5.4500719404E-02 1.4519321051E-02 -2.5852429674E-02 -6.6521981192E-02 + -1.0740246310E-01 -1.4839920512E-01 -1.8942525395E-01 -2.3038534935E-01 + -2.7119340185E-01 -3.1175515658E-01 -3.5198613429E-01 -3.9179471585E-01 + -4.3109858039E-01 -4.6981037671E-01 -5.0785031236E-01 -5.4513689518E-01 + -5.8159309491E-01 -6.1714476801E-01 -6.5171781084E-01 -6.8524673378E-01 + -7.1766054837E-01 -7.4890343463E-01 -7.7890784764E-01 -8.0762677081E-01 + -8.3500111127E-01 -8.6098809257E-01 -8.8554019013E-01 -9.0861788311E-01 + -9.3018616071E-01 -9.5020877843E-01 -9.6866322827E-01 -9.8551737033E-01 + -1.0007583031E+00 -1.0143650417E+00 -1.0263275266E+00 -1.0366380773E+00 + -1.0452897067E+00 -1.0522866929E+00 -1.0576274300E+00 -1.0613239199E+00 + -1.0633854793E+00 -1.0638268824E+00 -1.0626686745E+00 -1.0599296910E+00 + -1.0556384234E+00 -1.0498221200E+00 -1.0425128258E+00 -1.0337461541E+00 + -1.0235589473E+00 -1.0119923612E+00 -9.9908969762E-01 -9.8489627707E-01 + -9.6945964427E-01 -9.5283164494E-01 -9.3506215486E-01 -9.1620635286E-01 + -8.9632025854E-01 -8.7545856553E-01 -8.5368350296E-01 -8.3105150494E-01 + -8.0762265517E-01 -7.8346299282E-01 -7.5862848445E-01 -7.3318506111E-01 + -7.0719626807E-01 -6.8072010094E-01 -6.5382629676E-01 -6.2657311189E-01 + -5.9902002658E-01 -5.7123913698E-01 -5.4328139913E-01 -5.1520895376E-01 + -4.8708862873E-01 -4.5896877673E-01 -4.3091136124E-01 -4.0297556530E-01 + -3.7520714821E-01 -3.4766617984E-01 -3.2040328376E-01 -2.9346073420E-01 + -2.6689521180E-01 -2.4074847999E-01 -2.1505835866E-01 -1.8987669769E-01 + -1.6523660432E-01 -1.4117047538E-01 -1.1772401308E-01 -9.4922260567E-02 + -7.2791306047E-02 -5.1369567408E-02 -3.0674883768E-02 -1.0726313654E-02 + 8.4459182774E-03 2.6830176780E-02 4.4414912749E-02 6.1178726707E-02 + 7.7115190271E-02 9.2220430874E-02 1.0648217092E-01 1.1989835623E-01 + 1.3247258272E-01 1.4420158738E-01 1.5508719254E-01 1.6513983297E-01 + 1.7436467814E-01 1.8276741874E-01 1.9036426093E-01 1.9716769779E-01 + 2.0318786574E-01 2.0844526804E-01 2.1295765034E-01 2.1674201622E-01 + 2.1982011290E-01 2.2221414601E-01 2.2394687775E-01 2.2504204140E-01 + 2.2552435189E-01 2.2541994389E-01 2.2475669296E-01 2.2355944422E-01 + 2.2185575066E-01 2.1967757514E-01 2.1705012946E-01 2.1400081446E-01 + 2.1056139169E-01 2.0676200599E-01 2.0262674581E-01 1.9818432655E-01 + 1.9347172309E-01 1.8850876157E-01 1.8332223328E-01 1.7794460011E-01 + 1.7240346002E-01 1.6671845698E-01 1.6091511955E-01 1.5502924089E-01 + 1.4907444646E-01 1.4307219091E-01 1.3704940698E-01 1.3103127027E-01 + 1.2502896654E-01 1.1906151939E-01 1.1315684793E-01 1.0732600449E-01 + 1.0158057467E-01 9.5936479894E-02 9.0418614113E-02 8.5027359818E-02 + 7.9773524791E-02 7.4672020229E-02 6.9735535696E-02 6.4963821259E-02 + 6.0363563601E-02 5.5947324659E-02 5.1717686638E-02 4.7673573081E-02 + 4.3817712959E-02 4.0159108076E-02 3.6693171723E-02 3.3417611204E-02 + 3.0331592851E-02 2.7439699166E-02 2.4733343280E-02 2.2208672490E-02 + 1.9862171831E-02 1.7692777030E-02 1.5691652648E-02 1.3852990287E-02 + 1.2170962695E-02 1.0640179456E-02 9.2526598582E-03 8.0012591530E-03 + 6.8784359580E-03 5.8759418251E-03 4.9872643035E-03 4.2047925780E-03 + 3.5202708014E-03 2.9234428052E-03 2.4099988923E-03 1.9727011227E-03 + 1.6038559756E-03 1.2914976270E-03 1.0342565986E-03 8.2600646278E-04 + 6.6046203043E-04 5.2544829096E-04 4.2158434729E-04 3.4492901606E-04 + 2.9093082723E-04 2.5592791361E-04 2.3416159170E-04 2.1991358634E-04 + 2.0768854321E-04 1.7693021525E-04 1.2762902492E-04 7.7540325051E-05 + 3.0749107451E-05 -3.5959949057E-06 -1.2399963972E-05 -1.3185560783E-05 + -8.4467390465E-06 -7.3454830717E-07 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 1.3407893002E+01 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 8.2017334117E-01 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 5.4916098536E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 5.9649632002E-01 + + + + + + 0.0000000000E+00 2.5419674474E-06 1.0239117766E-05 2.3305314630E-05 + 4.2097395025E-05 6.7115759737E-05 9.9005188437E-05 1.3855586792E-04 + 1.8670461894E-04 2.4453630403E-04 3.1328539613E-04 3.9433768476E-04 + 4.8923209454E-04 5.9966258825E-04 7.2748012474E-04 8.7469464048E-04 + 1.0434770217E-03 1.2361610330E-03 1.4552451679E-03 1.7033943852E-03 + 1.9834416956E-03 2.2983895623E-03 2.6514110803E-03 3.0458508989E-03 + 3.4852258532E-03 3.9732252714E-03 4.5137109246E-03 5.1107165905E-03 + 5.7684472025E-03 6.4912775550E-03 7.2837505409E-03 8.1505749004E-03 + 9.0966224631E-03 1.0126924871E-02 1.1246669709E-02 1.2461196207E-02 + 1.3775990182E-02 1.5196678628E-02 1.6729023593E-02 1.8378915477E-02 + 2.0152365858E-02 2.2055499672E-02 2.4094546852E-02 2.6275833413E-02 + 2.8605772000E-02 3.1090851913E-02 3.3737628615E-02 3.6552712759E-02 + 3.9542758814E-02 4.2714453133E-02 4.6074501405E-02 4.9629616250E-02 + 5.3386504438E-02 5.7351852299E-02 6.1532313366E-02 6.5934493520E-02 + 7.0564936756E-02 7.5430111266E-02 8.0536393800E-02 8.5890055767E-02 + 9.1497247769E-02 9.7363984045E-02 1.0349612943E-01 1.0989938077E-01 + 1.1657925479E-01 1.2354107271E-01 1.3078994280E-01 1.3833074809E-01 + 1.4616813119E-01 1.5430647894E-01 1.6274990792E-01 1.7150225136E-01 + 1.8056704495E-01 1.8994751351E-01 1.9964655756E-01 2.0966674031E-01 + 2.2001027610E-01 2.3067901833E-01 2.4167444803E-01 2.5299766310E-01 + 2.6464936803E-01 2.7662986427E-01 2.8893904119E-01 3.0157636773E-01 + 3.1454088472E-01 3.2783119795E-01 3.4144547200E-01 3.5538142481E-01 + 3.6963632313E-01 3.8420697881E-01 3.9908974591E-01 4.1428051878E-01 + 4.2977473104E-01 4.4556735548E-01 4.6165290501E-01 4.7802543446E-01 + 4.9467854349E-01 5.1160537712E-01 5.2879863905E-01 5.4625059162E-01 + 5.6395306353E-01 5.8189745835E-01 6.0007476350E-01 6.1847555543E-01 + 6.3709001774E-01 6.5590796096E-01 6.7491882146E-01 6.9411168042E-01 + 7.1347526836E-01 7.3299799955E-01 7.5266799746E-01 7.7247308731E-01 + 7.9240081527E-01 8.1243846459E-01 8.3257313677E-01 8.5279170184E-01 + 8.7308081911E-01 8.9342699339E-01 9.1381663144E-01 9.3423599263E-01 + 9.5467117730E-01 9.7510833180E-01 9.9553351413E-01 1.0159326940E+00 + 1.0362919213E+00 1.0565972888E+00 1.0768348472E+00 1.0969907892E+00 + 1.1170514532E+00 1.1370031748E+00 1.1568325360E+00 1.1765263198E+00 + 1.1960713391E+00 1.2154548101E+00 1.2346641303E+00 1.2536867995E+00 + 1.2725108686E+00 1.2911244698E+00 1.3095160984E+00 1.3276746963E+00 + 1.3455893033E+00 1.3632496056E+00 1.3806454769E+00 1.3977671986E+00 + 1.4146055850E+00 1.4311515877E+00 1.4473969084E+00 1.4633334020E+00 + 1.4789535055E+00 1.4942500540E+00 1.5092162591E+00 1.5238459259E+00 + 1.5381330827E+00 1.5520724561E+00 1.5656589889E+00 1.5788882391E+00 + 1.5917560813E+00 1.6042589027E+00 1.6163934742E+00 1.6281570149E+00 + 1.6395471445E+00 1.6505619077E+00 1.6611997214E+00 1.6714594392E+00 + 1.6813402211E+00 1.6908417031E+00 1.6999637345E+00 1.7087066956E+00 + 1.7170710738E+00 1.7250579458E+00 1.7326683887E+00 1.7399041178E+00 + 1.7467667578E+00 1.7532585947E+00 1.7593817655E+00 1.7651390496E+00 + 1.7705330700E+00 1.7755670135E+00 1.7802439720E+00 1.7845674460E+00 + 1.7885409886E+00 1.7921683156E+00 1.7954534405E+00 1.7984001956E+00 + 1.8010130561E+00 1.8032958796E+00 1.8052535989E+00 1.8068901248E+00 + 1.8082105198E+00 1.8092190408E+00 1.8099206382E+00 1.8103200034E+00 + 1.8104218535E+00 1.8102313454E+00 1.8097528950E+00 1.8089920997E+00 + 1.8079532572E+00 1.8066417875E+00 1.8050624593E+00 1.8032202360E+00 + 1.8011204053E+00 1.7987674731E+00 1.7961670773E+00 1.7933236344E+00 + 1.7902424184E+00 1.7869284021E+00 1.7833862367E+00 1.7796214581E+00 + 1.7756383569E+00 1.7714422334E+00 1.7670378524E+00 1.7624298518E+00 + 1.7576236021E+00 1.7526233195E+00 1.7474341449E+00 1.7420607613E+00 + 1.7365076062E+00 1.7307799865E+00 1.7248819575E+00 1.7188183898E+00 + 1.7125940001E+00 1.7062129768E+00 1.6996803139E+00 1.6930001663E+00 + 1.6861769223E+00 1.6792154193E+00 1.6721195159E+00 1.6648937853E+00 + 1.6575425742E+00 1.6500697812E+00 1.6424799935E+00 1.6347770993E+00 + 1.6269650210E+00 1.6190483015E+00 1.6110304263E+00 1.6029153974E+00 + 1.5947074105E+00 1.5864098616E+00 1.5780266990E+00 1.5695617637E+00 + 1.5610183858E+00 1.5524004121E+00 1.5437113690E+00 1.5349544997E+00 + 1.5261335186E+00 1.5172516787E+00 1.5083121141E+00 1.4993183815E+00 + 1.4902735001E+00 1.4811804737E+00 1.4720426810E+00 1.4628629433E+00 + 1.4536441158E+00 1.4443893832E+00 1.4351014005E+00 1.4257828593E+00 + 1.4164367389E+00 1.4070655546E+00 1.3976718233E+00 1.3882583110E+00 + 1.3788274147E+00 1.3693814702E+00 1.3599230261E+00 1.3504543760E+00 + 1.3409776734E+00 1.3314952490E+00 1.3220093016E+00 1.3125218054E+00 + 1.3030348777E+00 1.2935506227E+00 1.2840708442E+00 1.2745974555E+00 + 1.2651324575E+00 1.2556774970E+00 1.2462343219E+00 1.2368047427E+00 + 1.2273903367E+00 1.2179926786E+00 1.2086133794E+00 1.1992539510E+00 + 1.1899158094E+00 1.1806003873E+00 1.1713091011E+00 1.1620432336E+00 + 1.1528040728E+00 1.1435928870E+00 1.1344108671E+00 1.1252591714E+00 + 1.1161389197E+00 1.1070511954E+00 1.0979970512E+00 1.0889774933E+00 + 1.0799934504E+00 1.0710458968E+00 1.0621357345E+00 1.0532637879E+00 + 1.0444308788E+00 1.0356378487E+00 1.0268854572E+00 1.0181743308E+00 + 1.0095052623E+00 1.0008789329E+00 9.9229592528E-01 9.8375680248E-01 + 9.7526224410E-01 9.6681280159E-01 9.5840886795E-01 9.5005102008E-01 + 9.4173978657E-01 9.3347559466E-01 9.2525868745E-01 9.1708965586E-01 + 9.0896888248E-01 9.0089662812E-01 8.9287315362E-01 8.8489892670E-01 + 8.7697423681E-01 8.6909918643E-01 8.6127407599E-01 8.5349924965E-01 + 8.4577491323E-01 8.3810102415E-01 8.3047793044E-01 8.2290585874E-01 + 8.1538494061E-01 8.0791500503E-01 8.0049644445E-01 7.9312937940E-01 + 7.8581385326E-01 7.7854965407E-01 7.7133713787E-01 7.6417635765E-01 + 7.5706727817E-01 7.5000966357E-01 7.4300381728E-01 7.3604974264E-01 + 7.2914734777E-01 7.2229635206E-01 7.1549702307E-01 7.0874932178E-01 + 7.0205312346E-01 6.9540807583E-01 6.8881442916E-01 6.8227210864E-01 + 6.7578098175E-01 6.6934059354E-01 6.6295119600E-01 6.5661268454E-01 + 6.5032491613E-01 6.4408738499E-01 6.3790027838E-01 6.3176349531E-01 + 6.2567686953E-01 6.1963992609E-01 6.1365268971E-01 6.0771510530E-01 + 6.0182698789E-01 5.9598792208E-01 5.9019772528E-01 5.8445641120E-01 + 5.7876378019E-01 5.7311950540E-01 5.6752315326E-01 5.6197482752E-01 + 5.5647431798E-01 5.5102138141E-01 5.4561539761E-01 5.4025647334E-01 + 5.3494442631E-01 5.2967900833E-01 5.2445973140E-01 5.1928636757E-01 + 5.1415888005E-01 5.0907701922E-01 5.0404046623E-01 4.9904861172E-01 + 4.9410157954E-01 4.8919912174E-01 4.8434096157E-01 4.7952655114E-01 + 4.7475570907E-01 4.7002834677E-01 4.6534419342E-01 4.6070292249E-01 + 4.5610388085E-01 4.5154718889E-01 4.4703258403E-01 4.4255977762E-01 + 4.3812826431E-01 4.3373773250E-01 4.2938813847E-01 4.2507920521E-01 + 4.2081063093E-01 4.1658176439E-01 4.1239259327E-01 4.0824292445E-01 + 4.0413247076E-01 4.0006087390E-01 3.9602751376E-01 3.9203248096E-01 + 3.8807550411E-01 3.8415628971E-01 3.8027438007E-01 3.7642935839E-01 + 3.7262122176E-01 3.6884969468E-01 3.6511448074E-01 3.6141505150E-01 + 3.5775114608E-01 3.5412268939E-01 3.5052940491E-01 3.4697099635E-01 + 3.4344689227E-01 3.3995693768E-01 3.3650100942E-01 3.3307883263E-01 + 3.2969011384E-01 3.2633426489E-01 3.2301118654E-01 3.1972073255E-01 + 3.1646263208E-01 3.1323659677E-01 3.1004204670E-01 3.0687888928E-01 + 3.0374697998E-01 3.0064605396E-01 2.9757582994E-01 2.9453576024E-01 + 2.9152571124E-01 2.8854556401E-01 2.8559506139E-01 2.8267393087E-01 + 2.7978168026E-01 2.7691808918E-01 2.7408308660E-01 2.7127642447E-01 + 2.6849784036E-01 2.6574692033E-01 2.6302331400E-01 2.6032701841E-01 + 2.5765779571E-01 2.5501539464E-01 2.5239950107E-01 2.4980959577E-01 + 2.4724576061E-01 2.4470776882E-01 2.4219538115E-01 2.3970834578E-01 + 2.3724611307E-01 2.3480869149E-01 2.3239592265E-01 2.3000757992E-01 + 2.2764342496E-01 2.2530304881E-01 2.2298619982E-01 2.2069285226E-01 + 2.1842279247E-01 2.1617579596E-01 2.1395161399E-01 2.1174970662E-01 + 2.0957018865E-01 2.0741285965E-01 2.0527750910E-01 2.0316391640E-01 + 2.0107167680E-01 1.9900060876E-01 1.9695066995E-01 1.9492166386E-01 + 1.9291338464E-01 1.9092561701E-01 1.8895783701E-01 1.8701015968E-01 + 1.8508240762E-01 1.8317438957E-01 1.8128590557E-01 1.7941663962E-01 + 1.7756630605E-01 1.7573492767E-01 1.7392232749E-01 1.7212832053E-01 + 1.7035271371E-01 1.6859511444E-01 1.6685543737E-01 1.6513361867E-01 + 1.6342948789E-01 1.6174286711E-01 1.6007357096E-01 1.5842115760E-01 + 1.5678568794E-01 1.5516703519E-01 1.5356503607E-01 1.5197952041E-01 + 1.5041029418E-01 1.4885694140E-01 1.4731956763E-01 1.4579802359E-01 + 1.4429215368E-01 1.4280179595E-01 1.4132674017E-01 1.3986664113E-01 + 1.3842157919E-01 1.3699141261E-01 1.3557599384E-01 1.3417516943E-01 + 1.3278873315E-01 1.3141636920E-01 1.3005815123E-01 1.2871394529E-01 + 1.2738361207E-01 1.2606700683E-01 1.2476394550E-01 1.2347410398E-01 + 1.2219756623E-01 1.2093420620E-01 1.1968389293E-01 1.1844649046E-01 + 1.1722185305E-01 1.1600961490E-01 1.1480988514E-01 1.1362254567E-01 + 1.1244747386E-01 1.1128454252E-01 1.1013361985E-01 1.0899438532E-01 + 1.0786687001E-01 1.0675100218E-01 1.0564666745E-01 1.0455374727E-01 + 1.0347211885E-01 1.0240153438E-01 1.0134190575E-01 1.0029322413E-01 + 9.9255383231E-02 9.8228272939E-02 9.7211779280E-02 9.6205738671E-02 + 9.5209921903E-02 9.4224391716E-02 9.3249049703E-02 9.2283793952E-02 + 9.1328519020E-02 9.0383115919E-02 8.9447315106E-02 8.8521139658E-02 + 8.7604537370E-02 8.6697414241E-02 8.5799673049E-02 8.4911213329E-02 + 8.4031872982E-02 8.3161481377E-02 8.2300083224E-02 8.1447592112E-02 + 8.0603918686E-02 7.9768970636E-02 7.8942652678E-02 7.8124734992E-02 + 7.7315217146E-02 7.6514067040E-02 7.5721202817E-02 7.4936539921E-02 + 7.4159991092E-02 7.3391451531E-02 7.2630690521E-02 7.1877788724E-02 + 7.1132671382E-02 7.0395261286E-02 6.9665478760E-02 6.8943241650E-02 + 6.8228407339E-02 6.7520848622E-02 6.6820601369E-02 6.6127595294E-02 + 6.5441757866E-02 6.4763014302E-02 6.4091287554E-02 6.3426414155E-02 + 6.2768335464E-02 6.2117058079E-02 6.1472516171E-02 6.0834641868E-02 + 6.0203365237E-02 5.9578614280E-02 5.8960219478E-02 5.8348159215E-02 + 5.7742425333E-02 5.7142956410E-02 5.6549689157E-02 5.5962558410E-02 + 5.5381497121E-02 5.4806342437E-02 5.4237082048E-02 5.3673706048E-02 + 5.3116157327E-02 5.2564377073E-02 5.2018304769E-02 5.1477878181E-02 + 5.0942952065E-02 5.0413499378E-02 4.9889519793E-02 4.9370960385E-02 + 4.8857766686E-02 4.8349882671E-02 + + From 162a602e8765c83d74bc9a4d038b701eba05c5a7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 May 2023 03:03:22 +0000 Subject: [PATCH 6/8] add the third test --- source/module_elecstate/test/charge_test.cpp | 52 ++- .../module_elecstate/test/prepare_unitcell.h | 69 +--- .../test/prepare_unitcell.h.bak | 341 ------------------ 3 files changed, 53 insertions(+), 409 deletions(-) delete mode 100644 source/module_elecstate/test/prepare_unitcell.h.bak diff --git a/source/module_elecstate/test/charge_test.cpp b/source/module_elecstate/test/charge_test.cpp index 70a8c05569..8218d5115b 100644 --- a/source/module_elecstate/test/charge_test.cpp +++ b/source/module_elecstate/test/charge_test.cpp @@ -17,9 +17,13 @@ InfoNonlocal::~InfoNonlocal() #endif Magnetism::Magnetism() { + this->tot_magnetization = 0.0; + this->abs_magnetization = 0.0; + this->start_magnetization = nullptr; } Magnetism::~Magnetism() { + delete[] this->start_magnetization; } // mock functions for Charge @@ -61,33 +65,38 @@ void Set_GlobalV_Default() class ChargeTest : public ::testing::Test { protected: - UnitCell* ucell; + UcellTestPrepare utp = UcellTestLib["Si"]; + std::unique_ptr ucell; Charge* charge; + ModulePW::PW_Basis* rhopw; void SetUp() override { elecstate::Set_GlobalV_Default(); + ucell = utp.SetUcellInfo(); + charge = new Charge; + rhopw = new ModulePW::PW_Basis; } void TearDown() override { + delete charge; + delete rhopw; } }; TEST_F(ChargeTest, Constructor) { - charge = new Charge; EXPECT_FALSE(charge->allocate_rho); EXPECT_FALSE(charge->allocate_rho_final_scf); - delete charge; } TEST_F(ChargeTest, Allocate) { - UcellTestPrepare utp = UcellTestLib["Si"]; - ucell = utp.SetUcellInfo(); - // init ucell + // UcellTestPrepare utp = UcellTestLib["Si"]; + // ucell = utp.SetUcellInfo(); + // init ucell EXPECT_DOUBLE_EQ(ucell->omega, 265.302); // init rhopw - ModulePW::PW_Basis* rhopw = new ModulePW::PW_Basis; + rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); EXPECT_DOUBLE_EQ(rhopw->lat0, 10.2); EXPECT_EQ(rhopw->nx, 24); @@ -120,14 +129,39 @@ TEST_F(ChargeTest, Allocate) delete charge->rhopw; charge->rhopw = nullptr; } + delete charge; */ } -/* TEST_F(ChargeTest, SumRho) { + EXPECT_DOUBLE_EQ(ucell->omega, 265.302); + + rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); + EXPECT_DOUBLE_EQ(rhopw->lat0, 10.2); + EXPECT_EQ(rhopw->nx, 24); + EXPECT_EQ(rhopw->ny, 24); + EXPECT_EQ(rhopw->nz, 24); + EXPECT_EQ(rhopw->nxyz, 13824); + rhopw->distribute_r(); + EXPECT_EQ(rhopw->nrxx, 13824); + rhopw->initparameters(false, elecstate::tmp_gridecut); + rhopw->distribute_g(); + EXPECT_EQ(rhopw->npw, 3143); + EXPECT_EQ(rhopw->npwtot, 3143); + // call Charge::allocate() + charge = new Charge; + GlobalV::test_charge = 2; + elecstate::tmp_xc_func_type = 3; + charge->set_rhopw(rhopw); + EXPECT_FALSE(charge->allocate_rho); + charge->allocate(GlobalV::NSPIN); + EXPECT_TRUE(charge->allocate_rho); + // test if Charge::allocate() be called twice -}*/ + EXPECT_NO_THROW(charge->allocate(GlobalV::NSPIN)); + EXPECT_TRUE(charge->allocate_rho); +} #undef protected #undef private \ No newline at end of file diff --git a/source/module_elecstate/test/prepare_unitcell.h b/source/module_elecstate/test/prepare_unitcell.h index 0136324ec3..d2d66ee5ce 100644 --- a/source/module_elecstate/test/prepare_unitcell.h +++ b/source/module_elecstate/test/prepare_unitcell.h @@ -8,22 +8,6 @@ class UcellTestPrepare { public: UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); UcellTestPrepare(std::string latname_in, int lmaxmax_in, bool init_vel_in, @@ -66,12 +50,12 @@ class UcellTestPrepare int ntype; int atomic_index; - UnitCell* SetUcellInfo() - { + std::unique_ptr SetUcellInfo() + { //basic info this->ntype = this->elements.size(); - UnitCell* ucell = new UnitCell; - ucell->setup(this->latname, + std::unique_ptr ucell(new UnitCell); + ucell->setup(this->latname, this->ntype, this->lmaxmax, this->init_vel, @@ -188,7 +172,7 @@ class UcellTestPrepare ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); } ucell->atoms[it].dis[ia].set(0, 0, 0); - if(this->init_vel) + if(this->init_vel) { ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; @@ -219,43 +203,6 @@ class UcellTestPrepare } }; -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = {0}; - velocity = {0}; -} - UcellTestPrepare::UcellTestPrepare(std::string latname_in, int lmaxmax_in, bool init_vel_in, @@ -336,6 +283,10 @@ std::map UcellTestLib {28.0}, //atomic mass "Cartesian", //coordination type {0.0,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} + 0.25,0.25,0.25}, + {1,1,1, + 1,1,1}, + {0,0,0, + 0,0,0})}, }; #endif diff --git a/source/module_elecstate/test/prepare_unitcell.h.bak b/source/module_elecstate/test/prepare_unitcell.h.bak deleted file mode 100644 index 7460869cf0..0000000000 --- a/source/module_elecstate/test/prepare_unitcell.h.bak +++ /dev/null @@ -1,341 +0,0 @@ -#ifndef PREPARE_UNITCELL_H -#define PREPARE_UNITCELL_H -#include -#include -#include "module_base/mathzone.h" - -class UcellTestPrepare -{ -public: - UcellTestPrepare()=default; - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in); - UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in); - UcellTestPrepare(const UcellTestPrepare &utp); - - std::string latname; - int lmaxmax; - bool init_vel; - bool selective_dynamics; - bool relax_new; - std::string fixed_axes; - double lat0; - std::valarray latvec; - std::vector elements; - std::vector pp_files; - std::vector pp_types; - std::vector orb_files; - std::valarray natom; - std::vector atomic_mass; - std::string coor_type; - std::valarray coordinates; - std::valarray mbl; - std::valarray velocity; - // ntype - int ntype; - int atomic_index; - - std::unique_ptr SetUcellInfo() - { - //basic info - this->ntype = this->elements.size(); - std::unique_ptr ucell(new UnitCell); - ucell->setup(this->latname, - this->ntype, - this->lmaxmax, - this->init_vel, - this->fixed_axes); - delete[] ucell->atom_label; - delete[] ucell->atom_mass; - delete[] ucell->pseudo_fn; - delete[] ucell->pseudo_type; - delete[] ucell->orbital_fn; - delete[] ucell->magnet.start_magnetization; //mag set here - ucell->atom_label = new std::string[ucell->ntype]; - ucell->atom_mass = new double[ucell->ntype]; - ucell->pseudo_fn = new std::string[ucell->ntype]; - ucell->pseudo_type = new std::string[ucell->ntype]; - ucell->orbital_fn = new std::string[ucell->ntype]; - ucell->magnet.start_magnetization = new double[ucell->ntype]; //mag set here - ucell->magnet.ux_[0] = 0.0; // ux_ set here - ucell->magnet.ux_[1] = 0.0; - ucell->magnet.ux_[2] = 0.0; - for(int it=0;itntype;++it) - { - ucell->atom_label[it] = this->elements[it]; - ucell->atom_mass[it] = this->atomic_mass[it]; - ucell->pseudo_fn[it] = this->pp_files[it]; - ucell->pseudo_type[it] = this->pp_types[it]; - ucell->orbital_fn[it] = this->orb_files[it]; - ucell->magnet.start_magnetization[it] = 0.0; //mag set here - } - //lattice info - ucell->lat0 = this->lat0; - ucell->lat0_angstrom = ucell->lat0 * 0.529177; - ucell->tpiba = ModuleBase::TWO_PI/ucell->lat0; - ucell->tpiba2 = ucell->tpiba * ucell->tpiba; - ucell->latvec.e11 = this->latvec[0]; - ucell->latvec.e12 = this->latvec[1]; - ucell->latvec.e13 = this->latvec[2]; - ucell->latvec.e21 = this->latvec[3]; - ucell->latvec.e22 = this->latvec[4]; - ucell->latvec.e23 = this->latvec[5]; - ucell->latvec.e31 = this->latvec[6]; - ucell->latvec.e32 = this->latvec[7]; - ucell->latvec.e33 = this->latvec[8]; - ucell->a1.x = ucell->latvec.e11; - ucell->a1.y = ucell->latvec.e12; - ucell->a1.z = ucell->latvec.e13; - ucell->a2.x = ucell->latvec.e21; - ucell->a2.y = ucell->latvec.e22; - ucell->a2.z = ucell->latvec.e23; - ucell->a3.x = ucell->latvec.e31; - ucell->a3.y = ucell->latvec.e32; - ucell->a3.z = ucell->latvec.e33; - ucell->GT = ucell->latvec.Inverse(); - ucell->G = ucell->GT.Transpose(); - ucell->GGT = ucell->G*ucell->GT; - ucell->invGGT = ucell->GGT.Inverse(); - ucell->omega = abs(ucell->latvec.Det())*(ucell->lat0)*(ucell->lat0)*(ucell->lat0); - //atomic info - ucell->Coordinate = this->coor_type; - ucell->atoms = new Atom[ucell->ntype]; - ucell->set_atom_flag = true; - this->atomic_index = 0; - for(int it=0;itntype;++it) - { - ucell->atoms[it].label = this->elements[it]; - ucell->atoms[it].nw = 0; - ucell->atoms[it].nwl = 2; - delete[] ucell->atoms[it].l_nchi; - ucell->atoms[it].l_nchi = new int[ ucell->atoms[it].nwl+1]; - for(int L=0; Latoms[it].nwl+1; L++) - { - ucell->atoms[it].l_nchi[L] = 1; - ucell->atoms[it].nw += (2*L + 1) * ucell->atoms[it].l_nchi[L]; - } - ucell->atoms[it].na = this->natom[it]; - //coordinates and related physical quantities - delete[] ucell->atoms[it].tau; - delete[] ucell->atoms[it].dis; - delete[] ucell->atoms[it].taud; - delete[] ucell->atoms[it].vel; - delete[] ucell->atoms[it].mag; - delete[] ucell->atoms[it].angle1; - delete[] ucell->atoms[it].angle2; - delete[] ucell->atoms[it].m_loc_; - delete[] ucell->atoms[it].mbl; - ucell->atoms[it].tau = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].dis = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].taud = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].vel = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].mag = new double[ucell->atoms[it].na]; - ucell->atoms[it].angle1 = new double[ucell->atoms[it].na]; - ucell->atoms[it].angle2 = new double[ucell->atoms[it].na]; - ucell->atoms[it].m_loc_ = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].mbl = new ModuleBase::Vector3[ucell->atoms[it].na]; - ucell->atoms[it].mass = ucell->atom_mass[it]; // mass set here - for(int ia=0; iaatoms[it].na; ++ia) - { - if (ucell->Coordinate == "Direct") - { - ucell->atoms[it].taud[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].taud[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].taud[ia].z = this->coordinates[this->atomic_index*3+2]; - ucell->atoms[it].tau[ia] = ucell->atoms[it].taud[ia]*ucell->latvec; - } - else if (ucell->Coordinate == "Cartesian") - { - ucell->atoms[it].tau[ia].x = this->coordinates[this->atomic_index*3+0]; - ucell->atoms[it].tau[ia].y = this->coordinates[this->atomic_index*3+1]; - ucell->atoms[it].tau[ia].z = this->coordinates[this->atomic_index*3+2]; - ModuleBase::Mathzone::Cartesian_to_Direct( - ucell->atoms[it].tau[ia].x, ucell->atoms[it].tau[ia].y, ucell->atoms[it].tau[ia].z, - ucell->latvec.e11, ucell->latvec.e12, ucell->latvec.e13, - ucell->latvec.e21, ucell->latvec.e22, ucell->latvec.e23, - ucell->latvec.e31, ucell->latvec.e32, ucell->latvec.e33, - ucell->atoms[it].taud[ia].x, ucell->atoms[it].taud[ia].y, ucell->atoms[it].taud[ia].z); - } - ucell->atoms[it].dis[ia].set(0, 0, 0); - if(this->init_vel) - { - ucell->atoms[it].vel[ia].x = this->velocity[this->atomic_index*3+0]; - ucell->atoms[it].vel[ia].y = this->velocity[this->atomic_index*3+1]; - ucell->atoms[it].vel[ia].z = this->velocity[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].vel[ia].set(0,0,0); - } - ucell->atoms[it].m_loc_[ia].set(0,0,0); - ucell->atoms[it].angle1[ia] = 0; - ucell->atoms[it].angle2[ia] = 0; - if(this->selective_dynamics) - { - ucell->atoms[it].mbl[ia].x = this->mbl[this->atomic_index*3+0]; - ucell->atoms[it].mbl[ia].y = this->mbl[this->atomic_index*3+1]; - ucell->atoms[it].mbl[ia].z = this->mbl[this->atomic_index*3+2]; - } - else - { - ucell->atoms[it].mbl[ia] = {1,1,1}; - } - ++(this->atomic_index); - } - } - ucell->nat = this->natom.sum(); - return ucell; - } -}; - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in) -{ - mbl = {0}; - velocity = {0}; -} - -UcellTestPrepare::UcellTestPrepare(std::string latname_in, - int lmaxmax_in, - bool init_vel_in, - bool selective_dynamics_in, - bool relax_new_in, - std::string fixed_axes_in, - double lat0_in, - std::valarray latvec_in, - std::vector elements_in, - std::vector pp_files_in, - std::vector pp_types_in, - std::vector orb_files_in, - std::valarray natom_in, - std::vector atomic_mass_in, - std::string coor_type_in, - std::valarray coordinates_in, - std::valarray mbl_in, - std::valarray velocity_in): - latname(latname_in), - lmaxmax(lmaxmax_in), - init_vel(init_vel_in), - selective_dynamics(selective_dynamics_in), - relax_new(relax_new_in), - fixed_axes(fixed_axes_in), - lat0(lat0_in), - latvec(latvec_in), - elements(elements_in), - pp_files(pp_files_in), - pp_types(pp_types_in), - orb_files(orb_files_in), - natom(natom_in), - atomic_mass(atomic_mass_in), - coor_type(coor_type_in), - coordinates(coordinates_in), - mbl(mbl_in), - velocity(velocity_in) // velocity assume the existence of mbl in print_stru_file() -{} - -UcellTestPrepare::UcellTestPrepare(const UcellTestPrepare &utp): - latname(utp.latname), - lmaxmax(utp.lmaxmax), - init_vel(utp.init_vel), - selective_dynamics(utp.selective_dynamics), - relax_new(utp.relax_new), - fixed_axes(utp.fixed_axes), - lat0(utp.lat0), - latvec(utp.latvec), - elements(utp.elements), - pp_files(utp.pp_files), - pp_types(utp.pp_types), - orb_files(utp.orb_files), - natom(utp.natom), - atomic_mass(utp.atomic_mass), - coor_type(utp.coor_type), - coordinates(utp.coordinates), - mbl(utp.mbl), - velocity(utp.velocity) // velocity assume the existence of mbl in print_stru_file() -{} - -std::map UcellTestLib -{ - {"Si", UcellTestPrepare( - "fcc", //latname - 2, //lmaxmax - true, //init_vel - true, //selective_dyanmics - true, //relax_new - "volume", //fixed_axes - 10.2, //lat0 - {-0.5,0.0,0.5, //latvec - 0.0,0.5,0.5, - -0.5,0.5,0.0}, - {"Si"}, //elements - {"Si.upf"}, //upf file - {"upf201"}, //upf types - {"Si.orb"}, //orb file - {2}, //number of each elements - {28.0}, //atomic mass - "Cartesian", //coordination type - {0.0,0.0,0.0, //atomic coordinates - 0.25,0.25,0.25})} -}; -#endif From 3f07925650c34bb35f44f7e2c25436248989824c Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 May 2023 03:55:35 +0000 Subject: [PATCH 7/8] add 3 tests --- source/module_elecstate/test/CMakeLists.txt | 2 +- source/module_elecstate/test/charge_test.cpp | 63 ++++++-------------- 2 files changed, 20 insertions(+), 45 deletions(-) diff --git a/source/module_elecstate/test/CMakeLists.txt b/source/module_elecstate/test/CMakeLists.txt index 9b18940d45..042c75def3 100644 --- a/source/module_elecstate/test/CMakeLists.txt +++ b/source/module_elecstate/test/CMakeLists.txt @@ -106,4 +106,4 @@ AddTest( ../../module_cell/read_pp_vwr.cpp ../../module_cell/read_pp_blps.cpp ../../module_io/output.cpp -) \ No newline at end of file +) diff --git a/source/module_elecstate/test/charge_test.cpp b/source/module_elecstate/test/charge_test.cpp index 8218d5115b..7fbb75599d 100644 --- a/source/module_elecstate/test/charge_test.cpp +++ b/source/module_elecstate/test/charge_test.cpp @@ -1,4 +1,5 @@ #include "gtest/gtest.h" +#include "gmock/gmock.h" #define private public #define protected public @@ -59,7 +60,7 @@ void Set_GlobalV_Default() * - allocate rho, rhog, rho_save, rhog_save, kin_r, kin_r_save * - using rhopw and GlobalV::NSPIN * - SumRho: Charge::sum_rho() - * - calculate \sum_{spin}\sum_{nrxx} rho[is][ir] + * - calculate \sum_{is}^nspin \sum_{ir}^nrxx rho[is][ir] */ class ChargeTest : public ::testing::Test @@ -69,12 +70,17 @@ class ChargeTest : public ::testing::Test std::unique_ptr ucell; Charge* charge; ModulePW::PW_Basis* rhopw; + std::string output; void SetUp() override { elecstate::Set_GlobalV_Default(); ucell = utp.SetUcellInfo(); charge = new Charge; rhopw = new ModulePW::PW_Basis; + rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); + rhopw->distribute_r(); + rhopw->initparameters(false, elecstate::tmp_gridecut); + rhopw->distribute_g(); } void TearDown() override { @@ -91,26 +97,18 @@ TEST_F(ChargeTest, Constructor) TEST_F(ChargeTest, Allocate) { - // UcellTestPrepare utp = UcellTestLib["Si"]; - // ucell = utp.SetUcellInfo(); - // init ucell + // ucell info EXPECT_DOUBLE_EQ(ucell->omega, 265.302); - // init rhopw - - rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); + // rhopw info EXPECT_DOUBLE_EQ(rhopw->lat0, 10.2); EXPECT_EQ(rhopw->nx, 24); EXPECT_EQ(rhopw->ny, 24); EXPECT_EQ(rhopw->nz, 24); EXPECT_EQ(rhopw->nxyz, 13824); - rhopw->distribute_r(); EXPECT_EQ(rhopw->nrxx, 13824); - rhopw->initparameters(false, elecstate::tmp_gridecut); - rhopw->distribute_g(); EXPECT_EQ(rhopw->npw, 3143); EXPECT_EQ(rhopw->npwtot, 3143); // call Charge::allocate() - charge = new Charge; GlobalV::test_charge = 2; elecstate::tmp_xc_func_type = 3; charge->set_rhopw(rhopw); @@ -118,49 +116,26 @@ TEST_F(ChargeTest, Allocate) charge->allocate(GlobalV::NSPIN); EXPECT_TRUE(charge->allocate_rho); // test if Charge::allocate() be called twice - EXPECT_NO_THROW(charge->allocate(GlobalV::NSPIN)); EXPECT_TRUE(charge->allocate_rho); - // delete rhopw; - //charge->destroy(); - /* - if (charge->rhopw != nullptr) - { - delete charge->rhopw; - charge->rhopw = nullptr; - } - delete charge; - */ } TEST_F(ChargeTest, SumRho) { - EXPECT_DOUBLE_EQ(ucell->omega, 265.302); - - rhopw->initgrids(ucell->lat0, ucell->latvec, elecstate::tmp_gridecut); - EXPECT_DOUBLE_EQ(rhopw->lat0, 10.2); - EXPECT_EQ(rhopw->nx, 24); - EXPECT_EQ(rhopw->ny, 24); - EXPECT_EQ(rhopw->nz, 24); - EXPECT_EQ(rhopw->nxyz, 13824); - rhopw->distribute_r(); - EXPECT_EQ(rhopw->nrxx, 13824); - rhopw->initparameters(false, elecstate::tmp_gridecut); - rhopw->distribute_g(); - EXPECT_EQ(rhopw->npw, 3143); - EXPECT_EQ(rhopw->npwtot, 3143); - // call Charge::allocate() - charge = new Charge; - GlobalV::test_charge = 2; - elecstate::tmp_xc_func_type = 3; charge->set_rhopw(rhopw); EXPECT_FALSE(charge->allocate_rho); charge->allocate(GlobalV::NSPIN); EXPECT_TRUE(charge->allocate_rho); - // test if Charge::allocate() be called twice - - EXPECT_NO_THROW(charge->allocate(GlobalV::NSPIN)); - EXPECT_TRUE(charge->allocate_rho); + int nspin = (GlobalV::NSPIN == 2) ? 2 : 1; + for (int is = 0; is < nspin; is++) + { + for (int ir = 0; ir < rhopw->nrxx; ir++) + { + charge->rho[is][ir] = 0.1; + } + } + elecstate::tmp_ucell_omega = ucell->omega; + EXPECT_NEAR(charge->sum_rho(), 0.1 * nspin * rhopw->nrxx * ucell->omega / rhopw->nxyz, 1E-10); } #undef protected From 490be24fc5161310c9cde5766b9f37cb2152af48 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 May 2023 08:58:45 +0000 Subject: [PATCH 8/8] add more tests --- .../module_elecstate/module_charge/charge.cpp | 3 +- source/module_elecstate/test/charge_test.cpp | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index c65600158a..07b365c674 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -624,10 +624,9 @@ void Charge::init_final_scf() ModuleBase::TITLE("Charge", "init_after_scf"); assert(allocate_rho_final_scf == false); - if (GlobalV::test_charge > 1) { - std::cout << "\n spin_number = " << GlobalV::NSPIN << " real_point_number = " << this->rhopw->nrxx; + std::cout << "\n spin_number = " << GlobalV::NSPIN << " real_point_number = " << this->rhopw->nrxx << std::endl; } // allocate memory diff --git a/source/module_elecstate/test/charge_test.cpp b/source/module_elecstate/test/charge_test.cpp index 7fbb75599d..4c50265284 100644 --- a/source/module_elecstate/test/charge_test.cpp +++ b/source/module_elecstate/test/charge_test.cpp @@ -45,6 +45,7 @@ void Set_GlobalV_Default() { GlobalV::NSPIN = 1; GlobalV::test_charge = 0; + GlobalV::nelec = 8; } } // namespace elecstate @@ -61,6 +62,14 @@ void Set_GlobalV_Default() * - using rhopw and GlobalV::NSPIN * - SumRho: Charge::sum_rho() * - calculate \sum_{is}^nspin \sum_{ir}^nrxx rho[is][ir] + * - RenormalizeRho: Charge::renormalize_rho() + * - renormalize rho so as to ensure the sum of rho equals to total number of electrons + * - CheckNe: Charge::check_ne() + * - check the total number of electrons summed from rho[is] + * - SaveRhoBeforeSumBand: Charge::save_rho_before_sum_band() + * - meaning as the function name + * - InitFinalScf:: Charge::init_final_scf() + * - similar to Charge::allocate(), but for final scf */ class ChargeTest : public ::testing::Test @@ -138,5 +147,77 @@ TEST_F(ChargeTest, SumRho) EXPECT_NEAR(charge->sum_rho(), 0.1 * nspin * rhopw->nrxx * ucell->omega / rhopw->nxyz, 1E-10); } +TEST_F(ChargeTest, RenormalizeRho) +{ + charge->set_rhopw(rhopw); + EXPECT_FALSE(charge->allocate_rho); + charge->allocate(GlobalV::NSPIN); + EXPECT_TRUE(charge->allocate_rho); + int nspin = (GlobalV::NSPIN == 2) ? 2 : 1; + for (int is = 0; is < nspin; is++) + { + for (int ir = 0; ir < rhopw->nrxx; ir++) + { + charge->rho[is][ir] = 0.1; + } + } + EXPECT_EQ(GlobalV::nelec, 8); + elecstate::tmp_ucell_omega = ucell->omega; + charge->renormalize_rho(); + EXPECT_NEAR(charge->sum_rho(), 8.0, 1e-10); +} + +TEST_F(ChargeTest, CheckNe) +{ + charge->set_rhopw(rhopw); + EXPECT_FALSE(charge->allocate_rho); + charge->allocate(GlobalV::NSPIN); + EXPECT_TRUE(charge->allocate_rho); + int nspin = (GlobalV::NSPIN == 2) ? 2 : 1; + for (int is = 0; is < nspin; is++) + { + for (int ir = 0; ir < rhopw->nrxx; ir++) + { + charge->rho[is][ir] = 0.1; + } + } + EXPECT_EQ(GlobalV::nelec, 8); + elecstate::tmp_ucell_omega = ucell->omega; + charge->renormalize_rho(); + EXPECT_NEAR(charge->sum_rho(), 8.0, 1e-10); + EXPECT_NEAR(charge->check_ne(charge->rho[0]), 8.0, 1e-10); +} + +TEST_F(ChargeTest, SaveRhoBeforeSumBand) +{ + charge->set_rhopw(rhopw); + EXPECT_FALSE(charge->allocate_rho); + charge->allocate(GlobalV::NSPIN); + EXPECT_TRUE(charge->allocate_rho); + int nspin = (GlobalV::NSPIN == 2) ? 2 : 1; + for (int is = 0; is < nspin; is++) + { + for (int ir = 0; ir < rhopw->nrxx; ir++) + { + charge->rho[is][ir] = 0.1; + } + } + EXPECT_EQ(GlobalV::nelec, 8); + elecstate::tmp_xc_func_type = 3; + elecstate::tmp_ucell_omega = ucell->omega; + charge->renormalize_rho(); + charge->save_rho_before_sum_band(); + EXPECT_NEAR(charge->check_ne(charge->rho_save[0]), 8.0, 1e-10); +} + +TEST_F(ChargeTest, InitFinalScf) +{ + charge->set_rhopw(rhopw); + elecstate::tmp_xc_func_type = 1; + GlobalV::test_charge = 2; + charge->init_final_scf(); + EXPECT_TRUE(charge->allocate_rho_final_scf); +} + #undef protected #undef private \ No newline at end of file