|
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 210 |
60 | 59 |
|
61 | 60 |
|
62 | 61 | /**
|
@@ -856,6 +855,7 @@ void set_defaults(SPARC_INPUT_OBJ *pSPARC_Input, SPARC_OBJ *pSPARC) {
|
856 | 855 | /* Default cell relaxation parameters*/
|
857 | 856 | pSPARC_Input->max_dilatation = 1.06; // maximum lattice dilatation
|
858 | 857 | pSPARC_Input->TOL_RELAX_CELL = 1e-2; // in GPa (all periodic)
|
| 858 | + pSPARC_Input->relaxPrTarget = 0; // Default relaxation pressure in 0 GPa |
859 | 859 |
|
860 | 860 | /* Default band structure calculation parameters */
|
861 | 861 | pSPARC_Input->BandStructFlag = 0;
|
@@ -1575,6 +1575,7 @@ void SPARC_copy_input(SPARC_OBJ *pSPARC, SPARC_INPUT_OBJ *pSPARC_Input) {
|
1575 | 1575 | pSPARC->OFDFT_lambda = pSPARC_Input->OFDFT_lambda;
|
1576 | 1576 | pSPARC->twist = pSPARC_Input->twist;
|
1577 | 1577 | pSPARC->is_hubbard = pSPARC_Input->is_hubbard; // DFT+U
|
| 1578 | + pSPARC->relaxPrTarget = pSPARC_Input->relaxPrTarget; // Target pressure for cell relaxation |
1578 | 1579 |
|
1579 | 1580 | // char type values
|
1580 | 1581 | strncpy(pSPARC->MDMeth , pSPARC_Input->MDMeth,sizeof(pSPARC->MDMeth));
|
@@ -1704,7 +1705,7 @@ void SPARC_copy_input(SPARC_OBJ *pSPARC, SPARC_INPUT_OBJ *pSPARC_Input) {
|
1704 | 1705 | if (pSPARC->BandStructFlag == 1) {
|
1705 | 1706 | pSPARC->MAXIT_SCF = 1;
|
1706 | 1707 | pSPARC->MINIT_SCF = 1;
|
1707 |
| - if (pSPARC->is_hubbard) pSPARC->MAXIT_SCF = 50; |
| 1708 | + // if (pSPARC->is_hubbard) pSPARC->MAXIT_SCF = 50; // need to work on hubbard band |
1708 | 1709 | pSPARC->PrintElecDensFlag = 0;
|
1709 | 1710 | pSPARC->PrintEigenFlag = 1;
|
1710 | 1711 | }
|
@@ -3856,6 +3857,10 @@ void write_output_init(SPARC_OBJ *pSPARC) {
|
3856 | 3857 | }
|
3857 | 3858 | }
|
3858 | 3859 |
|
| 3860 | + if (pSPARC->RelaxFlag > 1) { |
| 3861 | + fprintf(output_fp,"RELAX_PRESSURE: %.15g\n",pSPARC->relaxPrTarget); |
| 3862 | + } |
| 3863 | + |
3859 | 3864 | fprintf(output_fp,"CALC_STRESS: %d\n",pSPARC->Calc_stress);
|
3860 | 3865 | if(pSPARC->Calc_stress == 0)
|
3861 | 3866 | fprintf(output_fp,"CALC_PRES: %d\n",pSPARC->Calc_pres);
|
@@ -4355,6 +4360,7 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4355 | 4360 | MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE,
|
4356 | 4361 | MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE,
|
4357 | 4362 | MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE,
|
| 4363 | + MPI_DOUBLE, |
4358 | 4364 | MPI_CHAR, MPI_CHAR, MPI_CHAR, MPI_CHAR, MPI_CHAR,
|
4359 | 4365 | MPI_CHAR, MPI_CHAR, MPI_CHAR, MPI_CHAR, MPI_CHAR};
|
4360 | 4366 | int blens[N_MEMBR] = {3, 3, 7, /* int array */
|
@@ -4397,7 +4403,7 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4397 | 4403 | 1, 1, 1, 1, 1,
|
4398 | 4404 | 1, 1, 1, 1, 1,
|
4399 | 4405 | 1, 1, 1, 1, 1,
|
4400 |
| - 1, /* double */ |
| 4406 | + 1, 1, /* double */ |
4401 | 4407 | 32, 32, 32, L_STRING, L_STRING, /* char */
|
4402 | 4408 | L_STRING, L_STRING, L_STRING, L_STRING, L_STRING};
|
4403 | 4409 |
|
@@ -4611,6 +4617,8 @@ void SPARC_Input_MPI_create(MPI_Datatype *pSPARC_INPUT_MPI) {
|
4611 | 4617 | MPI_Get_address(&sparc_input_tmp.xi_3_SOAP, addr + i++);
|
4612 | 4618 | MPI_Get_address(&sparc_input_tmp.F_tol_SOAP, addr + i++);
|
4613 | 4619 | MPI_Get_address(&sparc_input_tmp.F_rel_scale, addr + i++);
|
| 4620 | + |
| 4621 | + MPI_Get_address(&sparc_input_tmp.relaxPrTarget, addr + i++); |
4614 | 4622 |
|
4615 | 4623 |
|
4616 | 4624 | // char type
|
|
0 commit comments