Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish welding tutorial #49

Merged
merged 36 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a9f8326
save nb
chrisjonesBSU Sep 12, 2023
90a62e3
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Sep 15, 2023
9af4641
fix params in slabsim, update welding tutorial
chrisjonesBSU Sep 15, 2023
7d7f6dd
fix interface axis param in weld si
chrisjonesBSU Sep 15, 2023
9ceda77
updates to welding tutorial
chrisjonesBSU Sep 15, 2023
87a0089
clean up NB
chrisjonesBSU Sep 15, 2023
8b4d0e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 15, 2023
cedf624
nb changes
chrisjonesBSU Sep 15, 2023
4ca3c79
Merge branch 'weld-tutorial' of github.com:chrisjonesBSU/hoomd-organi…
chrisjonesBSU Sep 15, 2023
dc5d6b2
finished first section
chrisjonesBSU Sep 18, 2023
61c8309
almost done with welding tutorial, add pickle to gitignore
chrisjonesBSU Sep 18, 2023
35a380c
set colors for left and right sections of interface
chrisjonesBSU Sep 19, 2023
9dd65ba
add fresnel to environments
chrisjonesBSU Sep 19, 2023
2603059
plot LJ energies
chrisjonesBSU Sep 19, 2023
e856c95
clean up tutorial
chrisjonesBSU Sep 19, 2023
9322053
adding tensile test section to tutrial, thermalize particles in Tensi…
chrisjonesBSU Sep 19, 2023
12bef01
add cooling ramp step to weld sim
chrisjonesBSU Sep 19, 2023
b6af561
use nvt in tensile simulation, finish welding tutorial
chrisjonesBSU Sep 19, 2023
bf152ce
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Sep 19, 2023
f83573d
fix variable names in tensile test
chrisjonesBSU Sep 20, 2023
09f8086
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 20, 2023
0ba792a
add new plots
chrisjonesBSU Sep 20, 2023
d7e2adb
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Sep 20, 2023
fb076b3
fix conflicts with upstream
chrisjonesBSU Sep 20, 2023
319af7e
fix conflicts
chrisjonesBSU Sep 21, 2023
ca01df4
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Sep 25, 2023
812679b
add new api changes
chrisjonesBSU Sep 25, 2023
f214bb0
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
4ba6dca
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
3e6cc1a
add notebook back after merge with upstream
chrisjonesBSU Oct 3, 2023
e970c86
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
17aaa43
remove duplicate params
chrisjonesBSU Oct 3, 2023
24bc44c
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
075dcce
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
d3dce7d
Merge branch 'main' of github.com:cmelab/hoomd-organics into weld-tut…
chrisjonesBSU Oct 3, 2023
113a8e0
fix unit test
chrisjonesBSU Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions environment-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
dependencies:
- boltons
- foyer
- fresnel
- freud>=2.13.1
- gsd>=3.0
- hoomd=4.1=*cpu*
Expand Down
1 change: 1 addition & 0 deletions environment-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
dependencies:
- boltons
- foyer
- fresnel
- freud>=2.13.1
- gsd>=3.0
- hoomd=4.1=*gpu*
Expand Down
10 changes: 4 additions & 6 deletions hoomd_organics/library/simulations/tensile.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def strain(self):
)
return delta_L / self.initial_length

def run_tensile(self, strain, n_steps, period):
def run_tensile(self, strain, n_steps, kT, tau_kt, period):
"""Run a tensile test simulation.

Parameters
Expand All @@ -88,6 +88,8 @@ def run_tensile(self, strain, n_steps, period):
The strain to apply to the simulation.
n_steps : int, required
The number of steps to run the simulation for.
tau_kt : float, required
Thermostat coupling period (in simulation time units).
period : int, required
The period of the strain application.

Expand Down Expand Up @@ -119,8 +121,4 @@ def run_tensile(self, strain, n_steps, period):
)
self.operations.updaters.append(box_resizer)
self.operations.updaters.append(particle_updater)
self.set_integrator_method(
integrator_method=hoomd.md.methods.ConstantVolume,
method_kwargs={"filter": self.integrate_group},
)
self.run(n_steps + 1)
self.run_NVT(n_steps=n_steps + 1, kT=kT, tau_kt=tau_kt)
23 changes: 12 additions & 11 deletions hoomd_organics/modules/welding.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def __init__(
wall_epsilon=1.0,
wall_r_cut=2.5,
wall_r_extrap=0,
r_cut=2.5,
reference_values=dict(),
dt=0.0001,
r_cut=2.5,
device=hoomd.device.auto_select(),
seed=42,
gsd_write_freq=1e4,
Expand All @@ -175,8 +175,8 @@ def __init__(
super(SlabSimulation, self).__init__(
initial_state=initial_state,
forcefield=forcefield,
r_cut=r_cut,
reference_values=reference_values,
r_cut=r_cut,
dt=dt,
device=device,
seed=seed,
Expand All @@ -186,8 +186,7 @@ def __init__(
log_file_name=log_file_name,
thermostat=thermostat,
)
self.interface_axis = interface_axis
# self._axis_index = np.where(interface_axis != 0)[0]
self.interface_axis = np.asarray(interface_axis)
self.add_walls(
self.interface_axis,
wall_sigma,
Expand All @@ -208,14 +207,14 @@ def __init__(
self,
initial_state,
forcefield,
interface_axis="x",
interface_axis=(1, 0, 0),
wall_sigma=1.0,
wall_epsilon=1.0,
wall_r_cut=2.5,
wall_r_extrap=0,
r_cut=2.5,
reference_values=dict(),
dt=0.0001,
r_cut=2.5,
device=hoomd.device.auto_select(),
seed=42,
gsd_write_freq=1e4,
Expand All @@ -227,9 +226,9 @@ def __init__(
super(WeldSimulation, self).__init__(
initial_state=initial_state,
forcefield=forcefield,
r_cut=r_cut,
reference_values=reference_values,
dt=dt,
r_cut=r_cut,
device=device,
seed=seed,
gsd_write_freq=gsd_write_freq,
Expand All @@ -238,9 +237,11 @@ def __init__(
log_file_name=log_file_name,
thermostat=thermostat,
)
axis_dict = {"x": (1, 0, 0), "y": (0, 1, 0), "z": (0, 0, 1)}
self.interface_axis = interface_axis.lower()
self.wall_axis = axis_dict[self.interface_axis]
self.interface_axis = interface_axis
self.add_walls(
self.wall_axis, wall_sigma, wall_epsilon, wall_r_cut, wall_r_extrap
self.interface_axis,
wall_sigma,
wall_epsilon,
wall_r_cut,
wall_r_extrap,
)
4 changes: 3 additions & 1 deletion hoomd_organics/tests/library/test_tensile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ def test_tensile(self):
log_write_freq=1e6,
gsd_write_freq=1e6,
)
tensile_sim.run_tensile(strain=0.05, n_steps=1e3, period=10)
tensile_sim.run_tensile(
strain=0.05, kT=2.0, n_steps=1e3, period=10, tau_kt=0.001
)
assert np.allclose(tensile_sim.strain, 0.05, 1e-4)
8 changes: 6 additions & 2 deletions hoomd_organics/tests/modules/test_weld.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

from hoomd_organics import Simulation
from hoomd_organics.modules.utils import add_void_particles
from hoomd_organics.modules.welding import Interface, SlabSimulation
from hoomd_organics.modules.welding import (
Interface,
SlabSimulation,
WeldSimulation,
)
from hoomd_organics.tests.base_test import BaseTest


Expand Down Expand Up @@ -92,7 +96,7 @@ def test_weld_sim(self, polyethylene_system):
interface = Interface(
gsd_file="restart.gsd", interface_axis="x", gap=0.1
)
sim = SlabSimulation(
sim = WeldSimulation(
initial_state=interface.hoomd_snapshot,
forcefield=polyethylene_system.hoomd_forcefield,
)
Expand Down
Loading
Loading