Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
marjanalbooyeh committed Jan 22, 2024
1 parent d2cb45e commit 746b85f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
49 changes: 26 additions & 23 deletions flowermd/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,29 +621,32 @@ def run_update_volume(
and a box matching a density of 1.1 g/cm^3 is passed into
`final_box_lengths`.
import unyt
from flowermd.base import Pack, Simulation
from flowermd.library import PPS, OPLS_AA_PPS
pps_mols = PPS(num_mols=20, lengths=15)
pps_system = Pack(
molecules=[pps_mols],
force_field=OPLS_AA_PPS(),
r_cut=2.5,
density=0.5,
auto_scale=True,
scale_charges=True
)
sim = Simulation(
initial_state=pps_system.hoomd_snapshot,
forcefield=pps_system.hoomd_forcefield
)
target_box = flowermd.utils.get_target_box_mass_density(
density=1.1 * unyt.g/unyt.cm**3, mass=sim.mass.to("g")
)
sim.run_update_volume(
n_steps=1e4, kT=1.0, tau_kt=1.0, final_box_lengths=target_box
)
::
import unyt
from flowermd.base import Pack, Simulation
from flowermd.library import PPS, OPLS_AA_PPS
pps_mols = PPS(num_mols=20, lengths=15)
pps_system = Pack(
molecules=[pps_mols],
force_field=OPLS_AA_PPS(),
r_cut=2.5,
density=0.5,
auto_scale=True,
scale_charges=True
)
sim = Simulation(
initial_state=pps_system.hoomd_snapshot,
forcefield=pps_system.hoomd_forcefield
)
target_box = flowermd.utils.get_target_box_mass_density(
density=1.1 * unyt.g/unyt.cm**3, mass=sim.mass.to("g")
)
sim.run_update_volume(
n_steps=1e4, kT=1.0, tau_kt=1.0, final_box_lengths=target_box
)
"""
if self.reference_length and hasattr(final_box_lengths, "to"):
ref_unit = self.reference_length.units
Expand Down
5 changes: 5 additions & 0 deletions flowermd/utils/base_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@


class HOOMDThermostats:
"""Types of HOOMD thermostats used in NVT or NPT simulations."""

BERENDSEN = hoomd.md.methods.thermostats.Berendsen
"""The Berendsen thermostat."""
BUSSI = hoomd.md.methods.thermostats.Bussi
"""The Bussi-Donadio-Parrinello thermostat."""
MTTK = hoomd.md.methods.thermostats.MTTK
"""The Nosé-Hoover thermostat."""

0 comments on commit 746b85f

Please sign in to comment.