forked from deepmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: UnitTest for module_tddft (deepmodeling#2580)
* Merge develop branch to TDDFT branch (deepmodeling#2249) * Add the dipole and spectrum post-processing script. (deepmodeling#1928) * Add the Dipole and post-processing script necessary to calculate the spectrum using TDDFT. * fix td_val test bug. * Fix: bug in parsing strings mixed with " ", "\t" (deepmodeling#1951) * Use template to reconstruct parse_expression * Feature: output R matrix at each MD step * Modify'matrix_HS' to 'matrix' for R matrix output * Merge branches 'develop' and 'develop' of https://github.com/1041176461/abacus-develop into develop * Fix: modify index in parse_expression * Fix: bug in parsing strings mixed with " ", "\t" --------- Co-authored-by: jiyuang <[email protected]> * solve conflicts * solve conflicts * solve conflicts * solve conflicts * solve conflicts * Fix : bug of multi-kpoint for tddft (deepmodeling#2023) * fix bug of electric field in tddft * fix bug of dipole and electric field * fix bug of multi-kpoint for tddft * unit conversion of out_efield * delete useless paramters for tddft (td_val_elec*) * delete useless parameters for tddft * pack all changes in tddft * solve conflicts * delete td_val --------- Co-authored-by: HeFuxiang94 <[email protected]> Co-authored-by: jiyuyang <[email protected]> Co-authored-by: jiyuang <[email protected]> * New propagator for better Convergence (deepmodeling#2253) * New propagator for better Convergence * Add files via upload * Add files via upload * Modified the code's implementation approach. I have modified the implementation approach of the code, and this one involves less changes to the original code. It also includes handling for multiple k-points. * Delete module_esolver directory * Delete module_hamilt_general directory * Delete module_hamilt_lcao directory * Add files via upload * Update dipole.py (deepmodeling#2270) * Simplify matrix multiplication and add new propagator method (deepmodeling#2272) * Add the dipole and spectrum post-processing script. (deepmodeling#1928) * Add the Dipole and post-processing script necessary to calculate the spectrum using TDDFT. * fix td_val test bug. * Fix: bug in parsing strings mixed with " ", "\t" (deepmodeling#1951) * Use template to reconstruct parse_expression * Feature: output R matrix at each MD step * Modify'matrix_HS' to 'matrix' for R matrix output * Merge branches 'develop' and 'develop' of https://github.com/1041176461/abacus-develop into develop * Fix: modify index in parse_expression * Fix: bug in parsing strings mixed with " ", "\t" --------- Co-authored-by: jiyuang <[email protected]> * solve conflicts * solve conflicts * solve conflicts * solve conflicts * solve conflicts * Fix : bug of multi-kpoint for tddft (deepmodeling#2023) * fix bug of electric field in tddft * fix bug of dipole and electric field * fix bug of multi-kpoint for tddft * unit conversion of out_efield * delete useless paramters for tddft (td_val_elec*) * delete useless parameters for tddft * pack all changes in tddft * solve conflicts * delete td_val * simplify matrix multiplication and update new propagator for tddft * add autotests for new propagator * fix bug of ekb in tddft * delete temp output * update ref of new propagator * update CASES --------- Co-authored-by: HeFuxiang94 <[email protected]> Co-authored-by: jiyuyang <[email protected]> Co-authored-by: jiyuang <[email protected]> Co-authored-by: Qianrui <[email protected]> * delete td_htype and update ref of tddft autotests * delete td_htype * refactor tddft code * move read_paramter of electric field to input_conv.cpp for tddft * sve conflicts * move definition of tag * convert read_parameter * add namespace module_tddft * remove tmp file * move read_paramters of electric field in tddft to input_conv.cpp * add force of tddft efield * add annotations * move read_parameters from H_TDDFT_pw.cpp to input_conv.cpp * add ifdef __LCAO * remove input parameter of read_td_efield * remove input parameter of read_td_efield * fix bug for input UTs * change name of parameters of compute_force in H_TDDFT_pw.h * improve annotation * solve conflicts * solve conflicts * add UT for read_td_efield * add ifdef __LCAO * add ifdef __LCAO * mistake for TEST and TEST_F * fix ReadTdEfieldTest * fix ReadTdEfieldTest * add doublenear() for EXPECT_EQ in ReadEfieldTest * add nampspace for doublenear * add nampspace for doublenear * mistake * replace doublenear with EXPECT_NEAR * TEST_F * delete nband in propagator * add UT for module tddft * comment add_test * fix bug of prepare() in H_TDDFT_pw.cpp * split tddft_test * fix bug * fix bug of UT for tddft * add tddft prefix * add UT for cblacs_gridinit * fix bug of UT for tddft * fix bug of UT for tddft --------- Co-authored-by: HeFuxiang94 <[email protected]> Co-authored-by: jiyuyang <[email protected]> Co-authored-by: jiyuang <[email protected]> Co-authored-by: HTZhao <[email protected]> Co-authored-by: Omega <[email protected]> Co-authored-by: Qianrui <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,208 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "../blacs_connector.h" | ||
|
||
#include <mpi.h> | ||
|
||
#include "gtest/gtest.h" | ||
|
||
/************************************************ | ||
* unit test of functions in blacs_connector.h | ||
***********************************************/ | ||
|
||
/** | ||
* - Tested Function | ||
* - Cblacs_gridinit | ||
* - Initializes a grid of processors with a given number of rows and columns. | ||
* The function creates a cartesian topology of all the processors initialized | ||
* by the BLS library. In this topology, each processor is identified by its | ||
* coordinates (row, col) in the grid. | ||
*/ | ||
|
||
TEST(blacs_connector, Cblacs_gridinit) | ||
{ | ||
int icontxt; | ||
char layout[] = "ROW"; | ||
int nprow = 1; | ||
int npcol = 1; | ||
|
||
int myid, nprocs; | ||
Cblacs_pinfo(&myid, &nprocs); | ||
Cblacs_get(-1, 0, &icontxt); | ||
|
||
// Call the Cblacs_gridinit() function | ||
Cblacs_gridinit(&icontxt, layout, nprow, npcol); | ||
|
||
// Check if the grid context handle is created successfully | ||
EXPECT_EQ(icontxt, 0); | ||
} | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
int myrank; | ||
int mysize; | ||
|
||
MPI_Init(&argc, &argv); | ||
MPI_Comm_size(MPI_COMM_WORLD, &mysize); | ||
MPI_Comm_rank(MPI_COMM_WORLD, &myrank); | ||
|
||
testing::InitGoogleTest(&argc, argv); | ||
|
||
int result = 0; | ||
result = RUN_ALL_TESTS(); | ||
MPI_Finalize(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,8 @@ if(ENABLE_LCAO) | |
add_coverage(tddft) | ||
endif() | ||
|
||
IF (BUILD_TESTING) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.