Skip to content
Snippets Groups Projects
Commit 61c01151 authored by Nicolas Essing's avatar Nicolas Essing
Browse files

Merge regression test for constraint magnetism to the feature branch.

parents 24b073e2 7534ac95
No related branches found
No related tags found
No related merge requests found
# theta [deg], phi [deg], strenght [Ry]
30.0 0.0 4.0e-3
30.0 0.0 4.0e-3
# bcc Fe, constrained magnetic configuration
# LATTICE
alat = 5.423
bravais_a = 1.0 0.0 0.0
bravais_b = 0.0 1.0 0.0
bravais_c = 0.0 0.0 1.0
cartesian = t
# PHYSICS
kxc = 2
nsra = 2 # on
NSPIND = 2
KORBIT = 1
soc = t
# MAGNETIC FIELDS
noncobfield = t
external_bfield = t
mt_bfield = t
constr_bfield_mixing = 1.0
bfield_verbosity = 3
# SELF-CONSISTENCY OPTIONS
scfsteps = 2
imix = 1
mixing = 0.1
fcm = 20.0
target_rms = 1.0d-8
# ENERGY CONTOUR
emin = -0.5
emax = 1.5
npnt1 = 3
npnt2 = 6
npnt3 = 3
npol = 3
tempr = 800.0
# SOLVER
bzdivide = 4 4 4
# PARAMETERS FOR EWALD SUMS
rmax = 6.d0
gmax = 65.d0
# SHAPE-FUNCTION OPTIONS
rclust_voronoi = 1.8
r_log = 0.8
# OUTPUT
kte = 1
kforce = 1
0.000000000000000E+000 0.000000000000000E+000 2
60.0000000000000 0.000000000000000E+000 2
Source diff could not be displayed: it is too large. Options to address this: view the blob.
2
Fe bcc
Fe 0.0 0.0 0.0
Fe 0.5 0.5 0.5
This diff is collapsed.
......@@ -10,7 +10,7 @@ day=`date "+%Y%m%d%H%M"`
rm -f ./last
## run the test scripts
nohup python2.7 ./tests.py < /dev/null > ${day}_tests.txt
nohup python3 ./tests.py < /dev/null > ${day}_tests.txt
## clean the working directory
./clearfiles.sh
......
#!/usr/bin/python
#!/usr/bin/env python3
import unittest
import subprocess
......@@ -21,6 +21,7 @@ ShowMD5 = True
AllMPIs = 1 # 1=Yes, 0=No
HighLmax = True
testNocoSOC = True
testBconstr = True
verbose = False
MPIEXEC = 'mpirun' # 'srun'
......@@ -40,11 +41,11 @@ def get_energy(string):
match = list(re.finditer(r"^.*TOTAL ENERGY in ryd. :(.*)$", string, re.M))[-1] # get last match only
except:
print(string)
raise ArgumentError
raise ValueError("Error getting energy from output")
if match is not None:
return float(match.group(1))
else:
raise ArgumentError
raise ValueError("Error getting energy from output")
def KKRnano(inputdir, nranks=DEFAULT_nranks, nthreads=DEFAULT_nthreads, solver=DEFAULT_solver, lmax=DEFAULT_lmax, Lly=DEFAULT_Lly, **kwargs):
"""Run KKR-calculation with input from 'inputdir' and returns the total energy"""
......@@ -178,5 +179,13 @@ class Test_nocosocmaterials(unittest.TestCase):
self.assertAlmostEqual(KKRnano("MnGeB20", solver=iterative, nranks=4), Etot, DECIMALS) # takes longer than other tests
# total time ~6min
class Test_constrainedmagnetism(unittest.TestCase):
def test_bcc_Fe(self):
"""Test two-atom bcc Fe unit cell constrained to a 60 degree angle"""
Etot = -5082.33743334
if testBconstr:
self.assertAlmostEqual(KKRnano("Fe", solver=direct, nranks=2), Etot, DECIMALS)
# About 6min (Needs two iterations so that updated constraining fields are used.)
unittest.main()
......@@ -119,3 +119,23 @@ run_kkrnano:intel:MnGeB20:
- master
- develop
- kkrnano-chebyshev-tfQMRgpu
run_kkrnano:intel:Fe:
stage: run_kkrnano
tags:
- docker-executor
script:
- cd source/KKRnano/regtests
- mkdir -p test_bcc_Fe; cd test_bcc_Fe; ln -s ../* .
- python3 ./tests.py Test_constrainedmagnetism.test_bcc_Fe
artifacts:
paths:
- source/KKRnano/regtests/test_bcc_Fe
expire_in: 1 day
only:
- schedules
- triggers
- web
- master
- develop
- kkrnano-chebyshev-tfQMRgpu
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment