#AtC Mechanical Coupling
# This benchmark tests momentum flux as a BC to the MD region to generate shear flow.
# Currently heat will be generated as it will have no where to go.
log shear_flow.log
units		real
atom_style	atomic
# create domain
#lattice	type reduced density rho* = 4*(sigma/a)^3, where N=4 for fcc, s = 3.405 A (Wagner) and a = 5.25 A (Ashcroft & Mermin, p. 70)
# NOTE following 3 lines added for restart
boundary        f p p
pair_style      lj/cut 13.5
#read_data       temp.init
read_data	post_eq.init
lattice         fcc 5.405 origin 0.25 0.25 0.25
# create atoms, NOTE commented out for restart
#region		mdRegion block -8 8 -3 3 -3 3
#boundary	f p p
#create_box	2 mdRegion
#create_atoms	1 region mdRegion
#mass		* 39.95
# specify interal/ghost atoms
#region		mdInternal block -6 6 -3 3 -3 3
#region		mdGhost block -6 6 -3 3 -3 3 side out
#create_atoms    1 region mdGhost
#lattice         fcc 6.5 origin 0.25 0.25 0.25
#create_atoms	2 region mdInternal
group		internal type 2
group		ghost type 1
# velocities have Vcm = 0, NOTE next four lines commented out for restart
#velocity	internal create 100. 87287 mom yes loop geom
#pair_style	lj/cut 13.5
##pair_coeff	1 1 0.010323166 3.405 13.5
#pair_coeff  	* * .238 3.405 13.5
#write_restart  tinit.dat
neighbor	5. bin
neigh_modify	every 10 delay 0 check no

# equilibrate MD field
variable xdof equal 3*count(ghost)
compute_modify thermo_temp extra ${xdof}
thermo_style custom step cpu etotal pe temp
thermo_modify  format 1 %6i format 2 %7.2g
#fix             NVT internal nvt temp 100 100 10 drag 0.2
#dump            D1 all atom 200 shear_flow_init.dmp
timestep        2
#thermo          200
#run             2000
#write_restart  post_eq.dat

#               ID  group atc PhysicsType ParameterFile
lattice         fcc 5.405 origin 0.25 0.25 0.25
region		atcRegion block -6.25 6.25 -3 3 -3 3
fix             AtC internal   atc shear     Ar_viscosity.mat
#               ID  part keywords    nx ny nz region    periodicity
fix_modify      AtC mesh create 6 1  1   atcRegion f p p
#fix_modify      AtC  time_integration fractional_step
##fix_modify	AtC atom_element_map eulerian 10 # NOTE this introduces a minor amount of time integration error tracking the atomic temperature
fix_modify      AtC  internal_quadrature off
#fix_modify	AtC  mass_matrix fe
# add nodesets
#               ID  mesh create_nodeset tag xmin xmax ymin ymax zmin zmax
fix_modify      AtC mesh create_elementset rbc  4.12  6.3   -INF  INF   -INF  INF
#used for restarting
fix_modify	AtC  consistent_fe_initialization on
#fix_modify     AtC  initial velocity x all 0.

# turn on kinetostat
reset_timestep 0
fix_modify	AtC  reset_time
fix_modify	AtC  source velocity y rbc .0000001
fix_modify      AtC control momentum flux no_boundary
fix_modify	AtC control tolerance 1.e-14
fix_modify	AtC control localized_lambda on
#fix_modify      AtC  filter type exponential
#fix_modify      AtC  filter scale 1000.0
#fix_modify      AtC  filter on

# ouput commands
fix_modify      AtC  output shear_flowFE 100 text #binary
#undump          D1
#dump		D1 all custom 100 shear_flow.dmp id type xs ys zs vx vy vz
# set-up non-equilibrium IC
thermo		100
run 		2000
