|
| 1 | +using AtomsBase |
1 | 2 | using PseudoPotentialData |
2 | 3 | using Test |
| 4 | +using Unitful |
| 5 | + |
3 | 6 |
|
4 | 7 | @testset "PseudoPotentialData.jl" begin |
5 | 8 | @testset "Test one family can be loaded" begin |
@@ -59,6 +62,15 @@ using Test |
59 | 62 | @test occursin("PseudoFamily", String(take!(io))) |
60 | 63 | end |
61 | 64 |
|
| 65 | + @testset "Comparison of family objects" begin |
| 66 | + f1 = PseudoFamily("dojo.nc.sr.pbe.v0_4_1.stringent.upf") |
| 67 | + f2 = PseudoFamily("dojo.nc.sr.lda.v0_4_1.stringent.upf") |
| 68 | + |
| 69 | + @test f1 == f1 |
| 70 | + @test f2 == f2 |
| 71 | + @test f1 != f2 |
| 72 | + end |
| 73 | + |
62 | 74 | @testset "Pseudometa on families" begin |
63 | 75 | family = PseudoFamily("dojo.nc.sr.lda.v0_4_1.stringent.upf") |
64 | 76 | meta = pseudometa(family) |
@@ -114,4 +126,28 @@ using Test |
114 | 126 | end |
115 | 127 | end |
116 | 128 | end |
| 129 | + |
| 130 | + @testset "recommended_cutoff on systems" begin |
| 131 | + family = PseudoFamily("dojo.nc.sr.lda.v0_4_1.standard.upf") |
| 132 | + cutoffs_Si = recommended_cutoff(family, :Si) |
| 133 | + cutoffs_Ga = recommended_cutoff(family, :Ga) |
| 134 | + cutoffs_As = recommended_cutoff(family, :As) |
| 135 | + |
| 136 | + ref_Ecut = max(cutoffs_Ga.Ecut, cutoffs_As.Ecut, cutoffs_Si.Ecut) |
| 137 | + ref_Edens = max(cutoffs_Ga.Ecut_density, cutoffs_As.Ecut_density, |
| 138 | + cutoffs_Si.Ecut_density) |
| 139 | + ref_super = max(cutoffs_Ga.supersampling, cutoffs_As.supersampling, |
| 140 | + cutoffs_Si.supersampling) |
| 141 | + |
| 142 | + box = [[10, 0.0, 0.0], [0.0, 5, 0.0], [0.0, 0.0, 7]]u"Å" |
| 143 | + atoms = [:Si => [0.0, -0.125, 0.0], |
| 144 | + :Ga => [0.125, 0.0, 0.0], |
| 145 | + :As => [-0.125, 0.0, 0.0]] |
| 146 | + system = periodic_system(atoms, box; fractional=true) |
| 147 | + |
| 148 | + cutoffs = recommended_cutoff(family, system) |
| 149 | + @test cutoffs.Ecut == ref_Ecut |
| 150 | + @test cutoffs.Ecut_density == ref_Edens |
| 151 | + @test cutoffs.supersampling == ref_super |
| 152 | + end |
117 | 153 | end |
0 commit comments