|
55 | 55 | #define min(x,y) ((x)<(y)?(x):(y))
|
56 | 56 | #define max(x,y) ((x)>(y)?(x):(y))
|
57 | 57 |
|
58 |
| -//#define N_MEMBR 209 |
59 |
| -#define N_MEMBR 208 |
| 58 | +#define N_MEMBR 209 |
| 59 | +// #define N_MEMBR 208 |
60 | 60 |
|
61 | 61 |
|
62 | 62 | /**
|
@@ -300,8 +300,8 @@ void Initialize(SPARC_OBJ *pSPARC, int argc, char *argv[]) {
|
300 | 300 | t1 = MPI_Wtime();
|
301 | 301 | #endif
|
302 | 302 |
|
303 |
| - // broadcast hubbard flag |
304 |
| - MPI_Bcast(&pSPARC->is_hubbard, 1, MPI_INT, 0, MPI_COMM_WORLD); |
| 303 | + // // broadcast hubbard flag |
| 304 | + // MPI_Bcast(&pSPARC->is_hubbard, 1, MPI_INT, 0, MPI_COMM_WORLD); |
305 | 305 |
|
306 | 306 | // broadcast Ntypes read from ion file
|
307 | 307 | MPI_Ibcast(&pSPARC->Ntypes, 1, MPI_INT, 0, MPI_COMM_WORLD, &req);
|
@@ -341,8 +341,8 @@ void Initialize(SPARC_OBJ *pSPARC, int argc, char *argv[]) {
|
341 | 341 | t2 = MPI_Wtime();
|
342 | 342 | if (rank == 0) printf("Broadcasting the input parameters took %.3f ms\n",(t2-t1)*1000);
|
343 | 343 | #endif
|
344 |
| - // broadcast hubbard flag |
345 |
| - MPI_Bcast(&pSPARC->is_hubbard, 1, MPI_INT, 0, MPI_COMM_WORLD); |
| 344 | + // // broadcast hubbard flag |
| 345 | + // MPI_Bcast(&pSPARC->is_hubbard, 1, MPI_INT, 0, MPI_COMM_WORLD); |
346 | 346 |
|
347 | 347 | // broadcast Ntypes read from ion file
|
348 | 348 | MPI_Ibcast(&pSPARC->Ntypes, 1, MPI_INT, 0, MPI_COMM_WORLD, &req);
|
@@ -967,6 +967,9 @@ void set_defaults(SPARC_INPUT_OBJ *pSPARC_Input, SPARC_OBJ *pSPARC) {
|
967 | 967 | // read in initial density
|
968 | 968 | pSPARC_Input->readInitDens = 0;
|
969 | 969 |
|
| 970 | + // DFT+U |
| 971 | + pSPARC_Input->is_hubbard = 0; |
| 972 | + |
970 | 973 | /* Default socket options
|
971 | 974 | Note to future developers: please keep the USE_SOCKET macro
|
972 | 975 | as the LAST PART of the initialization function!!
|
@@ -1571,6 +1574,7 @@ void SPARC_copy_input(SPARC_OBJ *pSPARC, SPARC_INPUT_OBJ *pSPARC_Input) {
|
1571 | 1574 | pSPARC->OFDFT_tol = pSPARC_Input->OFDFT_tol;
|
1572 | 1575 | pSPARC->OFDFT_lambda = pSPARC_Input->OFDFT_lambda;
|
1573 | 1576 | pSPARC->twist = pSPARC_Input->twist;
|
| 1577 | + pSPARC->is_hubbard = pSPARC_Input->is_hubbard; // DFT+U |
1574 | 1578 |
|
1575 | 1579 | // char type values
|
1576 | 1580 | strncpy(pSPARC->MDMeth , pSPARC_Input->MDMeth,sizeof(pSPARC->MDMeth));
|
@@ -3716,7 +3720,7 @@ void write_output_init(SPARC_OBJ *pSPARC) {
|
3716 | 3720 | }
|
3717 | 3721 |
|
3718 | 3722 | fprintf(output_fp,"***************************************************************************\n");
|
3719 |
| - fprintf(output_fp,"* SPARC (version May 29, 2025) *\n"); |
| 3723 | + fprintf(output_fp,"* SPARC (version June 3, 2025) *\n"); |
3720 | 3724 | fprintf(output_fp,"* Copyright (c) 2020 Material Physics & Mechanics Group, Georgia Tech *\n");
|
3721 | 3725 | fprintf(output_fp,"* Distributed under GNU General Public License 3 (GPL) *\n");
|
3722 | 3726 | fprintf(output_fp,"* Start time: %s *\n",c_time_str);
|
@@ -3777,6 +3781,8 @@ void write_output_init(SPARC_OBJ *pSPARC) {
|
3777 | 3781 | fprintf(output_fp,"EXX_RANGE_FOCK: %.6f\n", pSPARC->hyb_range_fock);
|
3778 | 3782 | fprintf(output_fp,"EXX_RANGE_PBE: %.6f\n", pSPARC->hyb_range_pbe);
|
3779 | 3783 | }
|
| 3784 | + // DFT+U |
| 3785 | + fprintf(output_fp, "HUBBARD_FLAG: %d\n", pSPARC->is_hubbard); |
3780 | 3786 | if (pSPARC->sqAmbientFlag == 1 || pSPARC->sqHighTFlag == 1) {
|
3781 | 3787 | if (pSPARC->sqAmbientFlag) fprintf(output_fp,"SQ_AMBIENT_FLAG: %d\n", pSPARC->sqAmbientFlag);
|
3782 | 3788 | if (pSPARC->sqHighTFlag) fprintf(output_fp,"SQ_HIGHT_FLAG: %d\n", pSPARC->sqHighTFlag);
|
@@ -4056,6 +4062,7 @@ void write_output_init(SPARC_OBJ *pSPARC) {
|
4056 | 4062 | pSPARC->stress_rel_scale[4], pSPARC->stress_rel_scale[5]);
|
4057 | 4063 | fprintf(output_fp, "MLFF_DFT_FQ: %d\n", pSPARC->MLFF_DFT_fq);
|
4058 | 4064 | }
|
| 4065 | + |
4059 | 4066 |
|
4060 | 4067 | fprintf(output_fp,"VERBOSITY: %d\n",pSPARC->Verbosity);
|
4061 | 4068 | fprintf(output_fp,"PRINT_FORCES: %d\n",pSPARC->PrintForceFlag);
|
@@ -4329,7 +4336,7 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4329 | 4336 | MPI_INT, MPI_INT, MPI_INT, MPI_INT, MPI_INT,
|
4330 | 4337 | MPI_INT, MPI_INT, MPI_INT, MPI_INT, MPI_INT,
|
4331 | 4338 | MPI_INT, MPI_INT, MPI_INT, MPI_INT, MPI_INT,
|
4332 |
| - MPI_INT, MPI_INT, MPI_INT, /* int array */ |
| 4339 | + MPI_INT, MPI_INT, MPI_INT, MPI_INT, /* int array */ |
4333 | 4340 |
|
4334 | 4341 | MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE,
|
4335 | 4342 | MPI_DOUBLE, MPI_DOUBLE,
|
@@ -4373,7 +4380,7 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4373 | 4380 | 1, 1, 1, 1, 1,
|
4374 | 4381 | 1, 1, 1, 1, 1,
|
4375 | 4382 | 1, 1, 1, 1, 1,
|
4376 |
| - 1, 1, 1, /* int */ |
| 4383 | + 1, 1, 1, 1, /* int */ |
4377 | 4384 | 9, 3, L_QMASS, L_kpoint, L_kpoint,
|
4378 | 4385 | L_kpoint, 6, /* double array */
|
4379 | 4386 | 1, 1, 1, 1, 1,
|
@@ -4520,6 +4527,7 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4520 | 4527 | MPI_Get_address(&sparc_input_tmp.N_rgrid_MLFF, addr + i++);
|
4521 | 4528 | MPI_Get_address(&sparc_input_tmp.MLFF_DFT_fq, addr + i++);
|
4522 | 4529 | MPI_Get_address(&sparc_input_tmp.REFERENCE_CUTOFF_FAC, addr + i++);
|
| 4530 | + MPI_Get_address(&sparc_input_tmp.is_hubbard, addr + i++); |
4523 | 4531 |
|
4524 | 4532 | // double array type
|
4525 | 4533 | MPI_Get_address(&sparc_input_tmp.LatVec, addr + i++);
|
|
0 commit comments