File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -931,6 +931,12 @@ def kpoints(self):
931
931
style = Kpoints .supported_modes .Reciprocal ,
932
932
num_kpts = len (ir_kpts ),
933
933
kpts = kpts , kpts_weights = weights )
934
+
935
+ # override pymatgen kpoints if provided
936
+ user_kpoints = self .kwargs .get ("user_kpoints_settings" , None )
937
+ if isinstance (user_kpoints , Kpoints ):
938
+ kpoints = user_kpoints
939
+
934
940
return kpoints
935
941
936
942
@classmethod
Original file line number Diff line number Diff line change @@ -428,6 +428,18 @@ def test_optics(self):
428
428
self .assertTrue (vis .incar ["LOPTICS" ])
429
429
self .assertEqual (vis .kpoints .style , Kpoints .supported_modes .Reciprocal )
430
430
431
+ def test_user_kpoint_override (self ):
432
+ user_kpoints_override = Kpoints (
433
+ style = Kpoints .supported_modes .Gamma ,
434
+ kpts = ((1 , 1 , 1 ),)) # the default kpoints style is reciprocal
435
+
436
+ prev_run = self .TEST_FILES_DIR / "relaxation"
437
+ vis = MPNonSCFSet .from_prev_calc (
438
+ prev_calc_dir = prev_run , copy_chgcar = False , optics = True ,
439
+ mode = "Uniform" , nedos = 2001 ,
440
+ user_kpoints_settings = user_kpoints_override )
441
+ self .assertEqual (vis .kpoints .style , Kpoints .supported_modes .Gamma )
442
+
431
443
def tearDown (self ):
432
444
shutil .rmtree (self .tmp )
433
445
warnings .simplefilter ("default" )
You can’t perform that action at this time.
0 commit comments