Minor changes in sprkkr test example.
This commit is contained in:
parent
6a3492846f
commit
bec694b16e
|
@ -115,7 +115,7 @@ class ForeignPotential(object):
|
||||||
class SPRKKRPotential(ForeignPotential):
|
class SPRKKRPotential(ForeignPotential):
|
||||||
def __init__(self, atoms, potfile, *exported_files):
|
def __init__(self, atoms, potfile, *exported_files):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
"""
|
||||||
def read(content, pattern, types):
|
def read(content, pattern, types):
|
||||||
# compile the pattern for regex matching
|
# compile the pattern for regex matching
|
||||||
pat = re.compile(pattern, re.MULTILINE)
|
pat = re.compile(pattern, re.MULTILINE)
|
||||||
|
@ -152,7 +152,7 @@ class SPRKKRPotential(ForeignPotential):
|
||||||
(r'^\s*OCCUPATION\s*\n(\s*(?P<KEYS>IQ.*)\n'
|
(r'^\s*OCCUPATION\s*\n(\s*(?P<KEYS>IQ.*)\n'
|
||||||
r'(?P<DATA>(.*\n)+?))\*+'),
|
r'(?P<DATA>(.*\n)+?))\*+'),
|
||||||
[int] * 5 + [float])
|
[int] * 5 + [float])
|
||||||
|
"""
|
||||||
for f in exported_files:
|
for f in exported_files:
|
||||||
# get the IT from the filename
|
# get the IT from the filename
|
||||||
# m=re.match('SPRKKR-IT_(?P<IT>\d+)-PHAGEN.*', os.path.basename(f))
|
# m=re.match('SPRKKR-IT_(?P<IT>\d+)-PHAGEN.*', os.path.basename(f))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from msspec.calculator import MSSPEC
|
from msspec.calculator import MSSPEC
|
||||||
from msspec.utils import get_atom_index
|
from msspec.utils import get_atom_index
|
||||||
|
@ -36,6 +37,23 @@ if 'sprkkr' in sys.argv:
|
||||||
# calc2.input.control_section.set(POTFIL="Fe.pot_new")
|
# calc2.input.control_section.set(POTFIL="Fe.pot_new")
|
||||||
# calc2.phagen()
|
# calc2.phagen()
|
||||||
|
|
||||||
|
#
|
||||||
|
# EXPORT POTENTIAL FOR PHAGEN
|
||||||
|
#
|
||||||
|
#change task and command
|
||||||
|
calc.set_command('PHAGEN')
|
||||||
|
# Change output file
|
||||||
|
calc.set_outfile('Cu_phagen.out')
|
||||||
|
#to change task we need to replace input file tempate
|
||||||
|
calc.set_inpfile("Cu_phagen.inp")
|
||||||
|
calc.input.control_section.set(DATASET="PHAGEN", ADSI="PHAGEN")
|
||||||
|
#set potetential file to converged potential
|
||||||
|
conv_potfile=os.path.join(calc.potfile+'_new')
|
||||||
|
|
||||||
|
calc.set_potfile(conv_potfile)
|
||||||
|
#run given task
|
||||||
|
calc.phagen()
|
||||||
|
|
||||||
|
|
||||||
# ######### MsSpec part
|
# ######### MsSpec part
|
||||||
if 'msspec' in sys.argv:
|
if 'msspec' in sys.argv:
|
||||||
|
|
Loading…
Reference in New Issue