#needs description
echo both
units    metal

variable E equal 0.1
variable L equal 10.0
#variable N equal 100
variable N equal 80
variable T equal 1000
variable n0 equal 0.0001
variable dn equal 2.0*${n0}
variable dt equal 0.0000001
variable s equal 1

timestep  ${dt}

atom_style  atomic
lattice         fcc 1.0 
variable a equal 0.5*$L
region    simRegion block -$a $a  0 1 0 1
boundary  f p p
create_box  1 simRegion
mass    1 1.0 # need to keep this
atom_modify     sort 0 1

#          ID  group atc PhysicsType ParameterFile
fix        AtC all   atc drift_diffusion-schrodinger  SiGe_ddm_schrodinger.mat

#          ID  part keywords    nx ny nz region
fix_modify AtC mesh  create $N 1  1  simRegion f p p
variable a   equal 0.2*$L+0.001
fix_modify AtC mesh create_elementset well -$a $a -INF INF -INF INF
fix_modify AtC mesh create_nodeset    well -$a $a -INF INF -INF INF
fix_modify AtC material well Ge

variable b   equal $a-0.002
fix_modify AtC mesh create_nodeset lbc -$a -$b -INF INF -INF INF 
fix_modify AtC mesh create_nodeset rbc  $b  $a -INF INF -INF INF

# ics/bcs
fix_modify AtC  initial temperature          all 300.0
fix_modify AtC  fix     temperature          all 300.0
#
fix_modify AtC  initial electron_temperature all $T
fix_modify AtC  fix     electron_temperature all $T 
#
fix_modify AtC  initial electron_density     all 0.0
#fix_modify AtC  fix electron_density         all -0.001
#fix_modify AtC  fix electron_density        well  0.002
#
fix_modify AtC  initial electric_potential   all 0.0
#fix_modify AtC  fix     electric_potential   lbc 0.5 
#fix_modify AtC  fix     electric_potential   rbc 0.5 
fix_modify AtC  fix     electric_potential   lbc 0.0
fix_modify AtC  fix     electric_potential   rbc 0.0
#
fix_modify AtC  initial electron_wavefunction all 0.0
fix_modify AtC  fix electron_wavefunction lbc 0.0
fix_modify AtC  fix electron_wavefunction rbc 0.0


thermo  $s
# f_AtC:1 thermal energy, 2 avg T, 3 electron energy, 4 avg Te, 5 total n
thermo_style custom step cpu f_AtC[1] f_AtC[2] f_AtC[3] f_AtC[4] f_AtC[5]
thermo_modify  format 1 %5i format 2 %7.2g
fix_modify      AtC  output   finite_wellFE $s text
fix_modify AtC extrinsic electron_integration implicit 3
fix_modify AtC extrinsic schrodinger_poisson_solver self_consistency 3 # 30
variable m equal 1*$s
# (A) no field
run     $m
# (B) fixed boundary field
fix_modify AtC  fix electric_potential lbc linear 0 0 0 $E 0 0 1
fix_modify AtC  fix electric_potential rbc linear 0 0 0 $E 0 0 1
run     $m
