Skip to content

Commit

Permalink
Automatic Py27 merge for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Oct 28, 2016
2 parents 0b95ad9 + 1290b1e commit 4925bb6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 30 deletions.
34 changes: 11 additions & 23 deletions pymatgen/io/vasp/sets.py
Expand Up @@ -1023,11 +1023,9 @@ class MVLSlabSet(MPRelaxSet):
**kwargs:
Other kwargs supported by :class:`DictSet`.
"""
def __init__(self, structure, gpu=False, k_product=50, bulk=False,
**kwargs):
def __init__(self, structure, k_product=50, bulk=False, **kwargs):
super(MVLSlabSet, self).__init__(structure, **kwargs)
self.structure = structure
self.gpu = gpu
self.k_product = k_product
self.bulk = bulk
self.kwargs = kwargs
Expand Down Expand Up @@ -1064,27 +1062,17 @@ def kpoints(self):

@property
def incar(self):
incar = super(MVLSlabSet, self).incar

incar.update({"EDIFF": 1e-6, "EDIFFG": -0.01, "ENCUT": 400,
"ISMEAR": 0, "SIGMA": 0.05, "ISIF": 3})

settings = self.config_dict["INCAR"]
settings.update({"EDIFF": 1e-6, "EDIFFG": -0.01, "ENCUT": 400,
"ISMEAR": 0, "SIGMA": 0.05, "ISIF": 3})
if not self.bulk:
incar["ISIF"] = 2
incar["AMIN"] = 0.01
incar["AMIX"] = 0.2
incar["BMIX"] = 0.001
incar["NELMIN"] = 8

if self.gpu:
# Sets KPAR to allow for the use of VASP-gpu
if "KPAR" not in incar:
# KPAR setting of 1 is the safest setting,
# but for optimal performance, we normally
# use the square root of the number of KPOINTS
incar["KPAR"] = 1
if "NPAR" in incar:
del incar["NPAR"]
settings["ISIF"] = 2
settings["AMIN"] = 0.01
settings["AMIX"] = 0.2
settings["BMIX"] = 0.001
settings["NELMIN"] = 8

incar = super(MVLSlabSet, self).incar

# To get input sets, the input structure has to has the same number
# of required parameters as a Structure object (ie. 4). Slab
Expand Down
12 changes: 6 additions & 6 deletions pymatgen/io/vasp/tests/test_sets.py
Expand Up @@ -455,24 +455,24 @@ def setUp(self):

vis_bulk = MVLSlabSet(self.bulk, bulk=True)
vis = MVLSlabSet(self.slab)
vis_bulk_gpu = MVLSlabSet(self.bulk, bulk=True, gpu=True)

self.d_bulk = vis_bulk.all_input
self.d_slab = vis.all_input
self.d_bulk_gpu = vis_bulk_gpu.all_input

def test_user_incar_settings(self):
# Make sure user incar settings properly override AMIX.
si = self.get_structure('Si')
vis = MVLSlabSet(si, user_incar_settings={"AMIX": 0.1})
self.assertEqual(vis.incar["AMIX"], 0.1)

def test_bulk(self):

incar_bulk = self.d_bulk["INCAR"]
incar_bulk_gpu = self.d_bulk_gpu["INCAR"]
poscar_bulk = self.d_bulk["POSCAR"]

self.assertEqual(incar_bulk["ISIF"], 3)
self.assertEqual(poscar_bulk.structure.formula,
self.bulk.formula)
# Test VASP-gpu compatibility
self.assertEqual(incar_bulk_gpu["KPAR"], 1)
self.assertTrue("NPAR" not in incar_bulk_gpu.keys())

def test_slab(self):

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -8,4 +8,4 @@ tabulate==0.7.5
enum34==1.1.6; python_version < '3.5'
matplotlib==1.5.3
palettable==2.1.1
spglib==1.9.7.1
spglib==1.9.7.9

0 comments on commit 4925bb6

Please sign in to comment.