Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: autoset bx/by/bz when set nx/ny/nz manually #2791

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

hongriTianqi
Copy link

@hongriTianqi hongriTianqi commented Aug 3, 2023

Fix #2726

The bug in #2726 happens because 0 is put in the denominator:
This happens only in LCAO calculation. In pw, bx = by = bz = 1 is set in input.cpp line 2693. It happens in

void ESolver_FP::Init
{
...
            if (inp.nx * inp.ny * inp.nz == 0)
            this->pw_rho->initgrids(inp.ref_cell_factor * cell.lat0, cell.latvec, inp.ecutrho);
	    else
            this->pw_rho->initgrids(inp.ref_cell_factor * cell.lat0, cell.latvec, inp.nx, inp.ny, inp.nz);
...
}

where, if users have set nx, ny, nz, it will go to the second branch, then in the following function:

virtual void initgrids(
    const double lat0_in,
    const ModuleBase::Matrix3 latvec_in, // Unitcell lattice vectors
    const int nx_in, int ny_in, int nz_in
    )
{
...
        if(this->nx%this->bx != 0) this->nx += (this->bx - this->nx % this->bx);
        if(this->ny%this->by != 0) this->ny += (this->by - this->ny % this->by);
        if(this->nz%this->bz != 0) this->nz += (this->bz - this->nz % this->bz);
...
}

bx, by, bz are now zero, aborting the whole process.

@hongriTianqi hongriTianqi changed the title Fix: bx = 0 if nx is set mannualy in INPUT Fix: bx = 0 if nx is set manually in INPUT Aug 3, 2023
@hongriTianqi hongriTianqi changed the title Fix: bx = 0 if nx is set manually in INPUT Fix: autoset bx/by/bz when set nx/ny/nz manually Aug 3, 2023
@hongriTianqi hongriTianqi merged commit 0ece436 into deepmodeling:develop Aug 8, 2023
10 checks passed
@hongriTianqi hongriTianqi deleted the hotfix branch August 8, 2023 13:00
denghuilu added a commit to denghuilu/abacus-develop that referenced this pull request Aug 9, 2023
* Fix:  error in specific situations refers to  2208 (deepmodeling#2742)

* Test: simplify compiling ucell info in UNIT tests (deepmodeling#2747)

* Paw : added accumulate_rhoij (deepmodeling#2734)

* Added interface for calculation of rhoij

* Added new test case

* finished accumulate_rhoij, added test

---------

Co-authored-by: wenfei-li <[email protected]>

* Docs: fix dead links for vdw-d3 (deepmodeling#2741)

fix deepmodeling#2711

* support reusing blacs_ctxt in Parallel_2D::set_desc (deepmodeling#2744)

* Doc: add some details of UnitTest and Converge in Documentation (deepmodeling#2752)

* add some details of UnitTest and Converge

* Update docs/CONTRIBUTING.md

Co-authored-by: Chun Cai <[email protected]>

---------

Co-authored-by: Chun Cai <[email protected]>

* Fix : update code for S(t+dt/2)  (deepmodeling#2753)

* update code for S(t+dt/2) and fix restart

* update autotest

* update autotest

* Fix: change R in LCAO_Hamilt::calculate_HR_exx_sparse(), to alleviate the output Hexx(R) errors for few k-points (deepmodeling#2749)

Co-authored-by: Mohan Chen <[email protected]>

* Refactor: separate 2d-to-grid operation from `Local_Orbital_Charge` into an independent class `DMgamma_2dtoGrid` (deepmodeling#2748)

* separate 2d-to-grid operation from Local_Orbital_Charge into an independent class

* separate into new file

---------

Co-authored-by: Mohan Chen <[email protected]>

* Feature:  Add a output interface for hcontainer and a sparse matrix class for CSR io (deepmodeling#2745)

* Feature: Add CSR file reader classes in module_io (deepmodeling#2754)

* refactor sparse_matrix class to use map

* update output_hcontainer using new sparse matrix

* add csr file reader

* try to fix error

* fix error

---------

Co-authored-by: root <hongriTianqi>

* Refactor(input model): create the input (deepmodeling#2671)

* Refactor(input model): create the input
 rebuild class and function. This has no effect on the current code.
 Refactor deepmodeling#2549

* Refactor(input model):
Fix the annotations  in the last pull request.
And fix a bug in unit test
 Refactor deepmodeling#2549

* Refactor(input model): create the input
fix some compile bugs
 Refactor deepmodeling#2549

* fix namespace using bugs

* fix some namespace using bugs

* Update CMakeLists.txt

fix conflict in io_print_info

---------

Co-authored-by: Qianrui <[email protected]>
Co-authored-by: Xiaokuang Bai <[email protected]>

* Fix : DeePKS for nspin = 2 and gamma point (deepmodeling#2755)

* Fix : DeePKS for nspin = 2 and gamma point

* Fixed cal_f_delta_gamma

* fixed test

---------

Co-authored-by: wenfei-li <[email protected]>
Co-authored-by: dyzheng <[email protected]>

* Fix issue deepmodeling#2721 (deepmodeling#2739)

* Fix issue deepmodeling#2721: a correction on atom sequence check

Fix issue deepmodeling#2721

* Update read_atoms.cpp

* Update klist.cpp

* Revert "Update klist.cpp"

This reverts commit 0699982.

---------

Co-authored-by: Qianrui <[email protected]>
Co-authored-by: Zhao Tianqi <[email protected]>

* update version to v3.3.1 (deepmodeling#2766)

* Update xc_functional_vxc.cpp (deepmodeling#2756)

* Refactor: Two center integral implemented in module_nao (deepmodeling#2757)

* add lookup function to TwoCenterTable

* rabtab assumes uniform grid; table behavior change

* two_center_integral initial commit

* TwoCenterIntegrator implemented with test

* Refactor: CubicSpline class stores derivatives instead of polynomial coefficients (deepmodeling#2772)

* CubicSpline add support for derivative

* function name fix

* Refactor: add UnitTests and new functions and OverlapNew operator with HContainer (deepmodeling#2777)

* update demo1_SR

* Refactor: update demos in module_hcontainer

* Test: add unit test for parallel_orbitals.cpp

* update parallel_orbitals.h with get_indexes functions

* Refactor: small modifies for constructor of OperatorLCAO

* Refactor: update get_pointer() interface in AtomPair

* Refactor: add func_folding and UnitTest

* Feature: add new Operator for overlap of NAOs - OperatorNew

* Fix: bug in CI

* remove a useless head file in cal_dm.h (deepmodeling#2774)

* Feature: add a parameter `symmetry_autoclose` to control the behavior when symmetry error occurs (deepmodeling#2740)

* fix a debugging output in the 1st ion-step

* add parameter symmetry_autoclose

* Refactor: make `vl_grid_to_2D` and `Gint_inout` independent of `LCAO_Matrix` (deepmodeling#2758)

* remove LCAO_Matrix dependence in vl_grid_to_2D

* remove LCAO_Matrix dependence in Gint_inout

---------

Co-authored-by: Zhao Tianqi <[email protected]>

* Test: add a parallel script for parallel_2d_test (deepmodeling#2764)

* Test: add a parallel script for parallel_2d_test

* Update source/module_basis/module_ao/test/parallel_2d_test.sh

---------

Co-authored-by: root <hongriTianqi>
Co-authored-by: Peng Xingliang <[email protected]>

* Fix: add a initialization of lmaxmax in UnitTests `cell_unitcell_test_setupcell` (deepmodeling#2767)

* add a initialization of lmaxmax in UnitTests #test_setupcell

* Update source/module_cell/test/unitcell_test_setupcell.cpp

* Update source/module_cell/test_pw/unitcell_test_pw.cpp

* Update source/module_cell/test/unitcell_test_setupcell.cpp

* Update source/module_cell/test_pw/unitcell_test_pw.cpp

---------

Co-authored-by: Zhao Tianqi <[email protected]>

* Test: add parallel scripts for parallel_orbitals unit tests (deepmodeling#2778)

Co-authored-by: root <hongriTianqi>

* Test: add a unit test to constructor SR from reading csr file (deepmodeling#2780)

Co-authored-by: root <hongriTianqi>

* Docs: update conda-forge docs (deepmodeling#2784)

* Fix: check atom types cpmsostence between STRU and DP model (deepmodeling#2770)

* add cuda arch 3.5 compilation support for ABACUS (deepmodeling#2794)

* Fix: bug in print_PAOs() (deepmodeling#2790)

* Fix: autoset bx/by/bz when set nx/ny/nz manually (deepmodeling#2791)

* Fix: bx = 0 if nx is set mannualy in INPUT

* add a line of comment

* add autoset bx/by/bz when set nx/ny/nz manually

---------

Co-authored-by: root <hongriTianqi>

* make RealGauntTable singleton & doxygen style change (deepmodeling#2789)

Co-authored-by: Wenfei Li <[email protected]>

* new CubicSpline interface (deepmodeling#2800)

Co-authored-by: Wenfei Li <[email protected]>

* Test: add a unit test for zhegv in lapack_connector (deepmodeling#2796)

---------

Co-authored-by: dyzheng <[email protected]>
Co-authored-by: Zhao Tianqi <[email protected]>
Co-authored-by: Wenfei Li <[email protected]>
Co-authored-by: wenfei-li <[email protected]>
Co-authored-by: Chun Cai <[email protected]>
Co-authored-by: cyFortneu <[email protected]>
Co-authored-by: wqzhou <[email protected]>
Co-authored-by: lyb9812 <[email protected]>
Co-authored-by: PeizeLin <[email protected]>
Co-authored-by: Mohan Chen <[email protected]>
Co-authored-by: GRYS <[email protected]>
Co-authored-by: Qianrui <[email protected]>
Co-authored-by: Xiaokuang Bai <[email protected]>
Co-authored-by: Yike Huang <[email protected]>
Co-authored-by: jinzx10 <[email protected]>
Co-authored-by: Omega <[email protected]>
Co-authored-by: Peng Xingliang <[email protected]>
Co-authored-by: Yu Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion on introduction of input parameters nx/y/z and bx/y/z in online documentation
3 participants