Skip to content

Commit

Permalink
Merge pull request #365 from pyiron/style_full_without_bonds
Browse files Browse the repository at this point in the history
Support full style without bonds
  • Loading branch information
sudarsan-surendralal authored Sep 23, 2021
2 parents 6c1a4c7 + 67d1c99 commit c5409f4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pyiron_atomistics/lammps/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, project, job_name):
self._check_opened = False
self._interactive_run_command = None
self._interactive_grand_canonical = True
self._interactive_water_bonds = False
if "stress" in self.interactive_output_functions.keys():
del self.interactive_output_functions["stress"]

Expand All @@ -52,6 +53,16 @@ def structure(self, structure):
self._prism = UnfoldingPrism(structure.cell)
GenericInteractive.structure.fset(self, structure)

@property
def interactive_water_bonds(self):
return self._interactive_water_bonds

@interactive_water_bonds.setter
def interactive_water_bonds(self, reset):
if not isinstance(reset, bool):
raise AssertionError()
self._interactive_water_bonds = reset

def _interactive_lib_command(self, command):
self._logger.debug("Lammps library: " + command)
self._interactive_library.command(command)
Expand Down Expand Up @@ -196,7 +207,7 @@ def _interactive_set_potential(self):
self._interactive_lib_command(line.split("\n")[0])
if len(potential_lst) == 0:
self._interactive_lib_command(line.split("\n")[0])
if style_full:
if style_full and self._interactive_water_bonds:
# Currently supports only water molecules. Please feel free to expand this
self._interactive_water_setter()

Expand Down Expand Up @@ -454,9 +465,6 @@ def interactive_structure_setter(self, structure):
self._interactive_library.scatter_atoms("x", positions)
self._interactive_library.scatter_atoms("type", elem_all)
self._interactive_lib_command("change_box all remap")
# if self.input.control['atom_style'] == "full":
# Do not scatter or manipulate when you have water/ use atom_style full in your system
# self._interactive_water_setter()
self._interactive_lammps_input()
self._interactive_set_potential()

Expand Down

0 comments on commit c5409f4

Please sign in to comment.