Skip to content

Commit

Permalink
WIP: removed manual input of weights for lammps speed balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Birks committed Feb 15, 2024
1 parent ffbff8f commit 027f7ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions matscipy/fracture_mechanics/thin_strip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def write_potential_and_buffer(atoms,lammps_filename):
#get the potential and buffer array from atoms
potential = atoms.arrays['potential']
buffer = atoms.arrays['buffer']
ids = atoms.arrays['id']
ids = np.arange(1,len(atoms)+1)

#write to file
#create a vertical array of ids, potential
Expand All @@ -677,7 +677,7 @@ def write_potential_and_buffer(atoms,lammps_filename):
def set_up_simulation_lammps(lmps,tmp_file_path,atomic_mass,calc_commands,
sim_tstep=0.001,damping_strength_right=0.1,damping_strength_left=0.1,dump_freq=100, dump_files=True,
dump_name='dump.lammpstrj',thermo_freq=100,left_damp_thickness=60,
right_damp_thickness=60,multi_potential=False, pot_speedup=None,y_fixed_length=1):
right_damp_thickness=60,multi_potential=False, y_fixed_length=1):
"""Set up the simulation by passing an active LAMMPS object a number of commands"""

# ---------- Initialize Simulation ---------------------
Expand Down
4 changes: 1 addition & 3 deletions scripts/fracture_mechanics/thin_strip_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
multi_potential = parameter('multi_potential',False) #if True, use dual potentials, for different regions of the crack
if multi_potential:
partition_type = parameter('partition_type') #get the type of partitioning to use between potentials
pot_speedup = parameter('pot_speedup') #get the relative speedup between the two potentials
#if the partition type is strip, then get the strip width
buffer_thickness = parameter('buffer_thickness',6.0)
if partition_type == 'strip':
Expand All @@ -92,7 +91,6 @@
else:
partition_type = None
partition_width = None
pot_speedup = None

y_threshold = parameter('y_threshold',1)
cpnum = initial_checkpoint_num
Expand Down Expand Up @@ -227,7 +225,7 @@
set_up_simulation_lammps(lmp,temp_path,mass,cmds,sim_tstep=sim_tstep,damping_strength_right=damping_strength_right,damping_strength_left=damping_strength_left
, dump_freq=dump_freq, dump_name=dump_name, thermo_freq=thermo_freq, dump_files=dump_files,
left_damp_thickness=left_damp_thickness, right_damp_thickness=right_damp_thickness,multi_potential=multi_potential,
pot_speedup=pot_speedup,y_fixed_length=y_fixed_length)
y_fixed_length=y_fixed_length)
if (i < initial_damping_time) and (initial_damp):
#add a lammps command to set a thermostat for all atoms initially
lmp.command(f'fix therm2 nve_atoms langevin 0.0 0.0 {initial_damping_strengths[i]} 1029')
Expand Down

0 comments on commit 027f7ff

Please sign in to comment.