Skip to content

Commit

Permalink
updated WF modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kosuke-nakano committed May 15, 2024
1 parent afde697 commit 2487587
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions turbogenius/pyturbo/io_fort10.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,15 @@ def onebody_list(self):
self.read()
return [i.v for i in self.__onebody_list]

@onebody_list.setter
def onebody_list(self, value_list):
self.read()
if len(self.__onebody_list) != len(value_list):
raise ValueError
for onebody, value in zip(self.__onebody_list, value_list):
if onebody.v != value:
onebody.replace(value=value, in_place=self.in_place)

@property
def start_lineno(self):
return pygrep_lineno(self.fort10, self.start_keyword) + 1
Expand Down
4 changes: 2 additions & 2 deletions turbogenius/pyturbo/makefort10.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,14 @@ def read_default_namelist(
# onebody part
if flag_onebody:
for ntyp in range(structure.ntyp):
namelist.set_parameter(f"onebodypar({ntyp + 1})", 1.0, "&electrons")
namelist.set_parameter(f"onebodypar({ntyp + 1})", 1.5, "&electrons")
namelist.comment_out("onebodypar")
else:
namelist.comment_out("onebodypar")

# twobody part
for i in range(num_twobody):
namelist.set_parameter(f"twobodypar({i+1})", 1.0, "&electrons")
namelist.set_parameter(f"twobodypar({i+1})", 0.5, "&electrons")
namelist.comment_out("twobodypar")

# spin (i.e., neldiff)
Expand Down
8 changes: 8 additions & 0 deletions turbogenius/wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,14 @@ def to_agp(

if only_generate_template:
logger.warning("A template AGP file, fort.10_out, is generated.")
# convertfort10
convertfort10_genius = Convertfort10_genius(
in_fort10="fort.10_in",
out_fort10="fort.10_out",
grid_size=grid_size,
)

convertfort10_genius.generate_input(input_name="convertfort10.input")
else:
# convertfort10
convertfort10_genius = Convertfort10_genius(
Expand Down

0 comments on commit 2487587

Please sign in to comment.