Hi lammps-user:
when I use REAXFF and oscillate electric field, a error happen. The following is my code about oscillate electric field and reaxff_setting:
#–this part is about oscillate electric field–#
variable E0 equal 1
variable f equal 1e14
variable e equal v_E0sin(2PIv_ftime*1e-15)
#–this part is about QEQ–#
fix ReaxQeq all qeq/reaxff 1 0.0 10.0 1e-6 reaxff
#–this part is about EF_setting–#
fix fxef all efield 0 0 v_e
The above is key code about this problem, if needed, the whole code will upload.
When I run the code, the error message " ERROR: Cannot (yet) use fix qeq/reaxff/omp with variable efield (src/REAXFF/fix_qeq_reaxff.cpp:408)" happened.
IF I use code fix fxef all efield 0 0 ${e}, there is no error happen. BUT the oscillate electric field seems no work, because I compare two situation(1. fix fxef all efield 0 0 ${e} 2. NO fix fxef all efield 0 0 ${e}), the temp’s change is the same.
SO what way to solve this problem, THANK.
Best
Wildon
As the error message indicates, you cannot use ReaxFF with an oscillating electric field. Full stop.
To understand the failure of your “workaround”, you just have to study the documentation of the variable command. There is a big difference between using a variable reference (v_name), when a command offers the option to evaluate a variable instead of a constant value and using variable expansion during the input file processing (${name}).
THANKS @akohlmey , I have a “tupid” wat to solve Oscillate EF and reaxff.
I write a loop, include fix efield.
so In a very small amount of time, EF can be seen as constant.
But before some step, the value will change.
The code like this:
" variable a loop 10
label loop_start
fix xef all efield 0 0 ${a}
run 100
unfix fxef
next a
jump SELF loop_start
"
I’ve never ran a ReaxFF simulation so someone else will have to test this (and GitHub’s API is down / weird right now). @WildonCao do you know how to apply a patch and recompile?
(dev question: with this, a step with qeq/reaxff + variable efield ends up updating the efield variables twice, once in pre_force and once in post_force, including the modify->clear/addstep wrapping. I’m assuming that’s meant to happen and it’s okay when it does.)
Thanks, been a bit too busy to fix it up but I will soon. There’s one main issue which is that efield with atom-style variable should patch in via the user-defined energy (not force dot displacement – since that only works for spatially uniform fields) and error out if that isn’t given. I’d also need to finish the documentation changes where needed. Can certainly submit within the week.
I compared this patch (I have patched to my lammps) and my “stupid loop way” to add ef, the temp has the same change but a little diffluent.
If you have more thorough found, pls let me know, THANKS. @srtee