Skip to content

Commit

Permalink
Update generateLJFF.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Oct 23, 2023
1 parent 48907d9 commit 94ee6c1
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions ppafm/cli/generateLJFF.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
#!/usr/bin/python
import os
from pathlib import Path

import numpy as np

import ppafm as PPU
import ppafm.fieldFFT as fFFT
import ppafm.HighLevel as PPH
from ppafm import elements
from .. import common
from ..HighLevel import computeLJ


def main():
parser = common.CLIParser(description="Generate a Lennard-Jones, Morse, or vdW force field. The generated force field is saved to FFLJ_{x,y,z}.[ext].")

parser = PPU.CLIParser(
description='Generate a Lennard-Jones, Morse, or vdW force field. '
'The generated force field is saved to FFLJ_{x,y,z}.[ext].'
)

parser.add_arguments(['input', 'input_format', 'output_format', 'ffModel', 'energy', 'noPBC'])
parser.add_arguments(["input", "input_format", "output_format", "ffModel", "energy", "noPBC"])
args = parser.parse_args()

try:
PPU.loadParams( 'params.ini' )
except ValueError as e:
print(e)
print("no params.ini provided => using default params ")
common.loadParams("params.ini")
except Exception:
print("No params.ini provided => using default parameters.")

PPU.apply_options(vars(args))
common.apply_options(vars(args))

speciesFile = 'atomtypes.ini' if os.path.isfile('atomtypes.ini') else None
species_file = "atomtypes.ini" if Path("atomtypes.ini").is_file() else None

PPH.computeLJ( args.input, geometry_format=args.input_format, speciesFile=speciesFile, save_format=args.output_format, computeVpot=args.energy, ffModel=args.ffModel )
computeLJ(args.input, geometry_format=args.input_format, speciesFile=species_file, save_format=args.output_format, computeVpot=args.energy, ffModel=args.ffModel)


if __name__ == "__main__":
Expand Down

0 comments on commit 94ee6c1

Please sign in to comment.