Skip to content

Commit

Permalink
Add ngrid_coarse checks
Browse files Browse the repository at this point in the history
  • Loading branch information
timcallow committed Oct 11, 2023
1 parent e6d4062 commit ad0aea7
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/boundary_conditions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _run(bc):
4,
4,
scf_params={"maxscf": 5, "mixfrac": 0.3},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 600},
band_params={"nkpts": nkpts},
)

Expand Down
5 changes: 4 additions & 1 deletion tests/conductivity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ def _run_SCF():

# run the SCF calculation
output = model.CalcEnergy(
4, 4, scf_params={"mixfrac": 0.3, "maxscf": 6}, grid_params={"ngrid": 1200}
4,
4,
scf_params={"mixfrac": 0.3, "maxscf": 6},
grid_params={"ngrid": 1200, "ngrid_coarse": 300},
)

output_dict = {"Atom": F_at, "model": model, "SCF_out": output}
Expand Down
5 changes: 4 additions & 1 deletion tests/energy_alt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def _run(unbound):

# run the SCF calculation
output = model.CalcEnergy(
10, 5, scf_params={"maxscf": 6, "mixfrac": 0.3}, grid_params={"ngrid": 1000}
10,
5,
scf_params={"maxscf": 6, "mixfrac": 0.3},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
)

# construct the EnergyAlt object
Expand Down
2 changes: 2 additions & 0 deletions tests/exceptions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class TestCalcEnergy:
({"ngrid_coarse": "a"}),
({"ngrid_coarse": -100}),
({"x0": -2}),
({"s0": 1e-7}),
({"s0": 1e-1}),
],
)
def test_grid_params(self, grid_input):
Expand Down
2 changes: 1 addition & 1 deletion tests/functionals_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _run(func):
6,
6,
scf_params={"maxscf": 5, "mixfrac": 0.3},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 90},
band_params={"nkpts": 30},
)

Expand Down
5 changes: 4 additions & 1 deletion tests/gramschmidt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def _run_SCF():

# run SCF calculation
output = model.CalcEnergy(
4, 4, scf_params={"mixfrac": 0.3, "maxscf": 5}, grid_params={"ngrid": 1000}
4,
4,
scf_params={"mixfrac": 0.3, "maxscf": 5},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
)

return output
Expand Down
2 changes: 1 addition & 1 deletion tests/localization_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _run_SCF(spinpol):
3,
2,
scf_params={"mixfrac": 0.3, "maxscf": 50},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
)

output_dict = {"Atom": Al_at, "model": model, "SCF_out": output}
Expand Down
2 changes: 1 addition & 1 deletion tests/pressure_log_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _run_SCF():
3,
3,
scf_params={"maxscf": 5, "mixfrac": 0.3},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
band_params={"nkpts": 50},
verbosity=1,
grid_type="log",
Expand Down
2 changes: 1 addition & 1 deletion tests/pressure_sqrt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _run_SCF():
6,
8,
scf_params={"maxscf": 5, "mixfrac": 0.3},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
band_params={"nkpts": 50},
verbosity=1,
grid_type="sqrt",
Expand Down
2 changes: 1 addition & 1 deletion tests/serial_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _run(ngrid):
2,
scf_params={"maxscf": 1, "mixfrac": 0.7},
band_params={"nkpts": 30},
grid_params={"ngrid": ngrid},
grid_params={"ngrid": ngrid, "ngrid_coarse": 300},
)

# extract the total free energy
Expand Down
2 changes: 1 addition & 1 deletion tests/spin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _run(spinmag):
5,
scf_params={"maxscf": 4, "mixfrac": 0.3},
band_params={"nkpts": 50},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
)

# extract the total free energy
Expand Down
2 changes: 1 addition & 1 deletion tests/unbound_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _run():
3,
3,
scf_params={"maxscf": 3, "mixfrac": 0.3},
grid_params={"ngrid": 1000},
grid_params={"ngrid": 1000, "ngrid_coarse": 300},
force_bound=[[0, 0, 0]],
)

Expand Down

0 comments on commit ad0aea7

Please sign in to comment.