Commit e53583d9 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #590 from lammps/fortran-dftb

update of Fortran-DFTB interface to be compatible with fix msst
parents 3f833968 551001f1
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ keyword = {q} or {mu} or {p0} or {v0} or {e0} or {tscale} or {beta} or {dftb} :l
  {e0} value = initial total energy (energy units)
  {tscale} value = reduction in initial temperature (unitless fraction between 0.0 and 1.0) 
  {dftb} value = {yes} or {no} for whether using MSST in conjunction with DFTB+
  {beta} value = scale factor on energy contribution of DFTB+ :pre
  {beta} value = scale factor for improved energy conservation :pre
:ule

[Examples:]
@@ -72,6 +72,14 @@ be calculated on the first step, after the energy specified by
{tscale} is removed.  The value of {e0} is not used in the dynamical
equations, but is used in calculating the deviation from the Hugoniot.

The keyword {beta} is a scaling term that can be added to the MSST
ionic equations of motion to account for drift in the conserved
quantity during long timescale simulations, similar to a Berendson
thermostat. See "(Reed)"_#Reed and "(Goldman)"_#Goldman for more
details.  The value of {beta} must be between 0.0 and 1.0 inclusive.
A value of 0.0 means no contribution, a value of 1.0 means a full
contribution.

Values of shockvel less than a critical value determined by the
material response will not have compressive solutions. This will be
reflected in lack of significant change of the volume in the MSST.
@@ -95,23 +103,15 @@ or "_MSST_pe". The group for the new computes is "all".

:line

The {dftb} and {beta} keywords are to allow this fix to be used when
LAMMPS is being driven by DFTB+, a density-functional tight-binding
code.

If the keyword {dftb} is used with a value of {yes}, then the MSST
equations are altered to account for an energy contribution compute by
DFTB+.  In this case, you must define a "fix
external"_fix_external.html command in your input script, which is
used to callback to DFTB+ during the LAMMPS timestepping.  DFTB+ will
communicate its info to LAMMPS via that fix.

The keyword {beta} is a scale factor on the DFTB+ energy contribution.
The value of {beta} must be between 0.0 and 1.0 inclusive.  A value of
0.0 means no contribution, a value of 1.0 means a full contribution.

(July 2017) More information about these keywords and the use of
LAMMPS with DFTB+ will be added to the LAMMMPS documention soon.
The {dftb} keyword is to allow this fix to be used when LAMMPS is
being driven by DFTB+, a density-functional tight-binding code. If the
keyword {dftb} is used with a value of {yes}, then the MSST equations
are altered to account for the electron entropy contribution to the
Hugonio relations and total energy.  See "(Reed2)"_#Reed2 and
"(Goldman)"_#Goldman for details on this contribution.  In this case,
you must define a "fix external"_fix_external.html command in your
input script, which is used to callback to DFTB+ during the LAMMPS
timestepping.  DFTB+ will communicate its info to LAMMPS via that fix.

:line

@@ -182,4 +182,12 @@ timestep.
:line

:link(Reed)
[(Reed)] Reed, Fried, and Joannopoulos, Phys. Rev. Lett., 90, 235503 (2003).
[(Reed)] Reed, Fried, and Joannopoulos, Phys. Rev. Lett., 90, 235503
(2003).

:link(Reed2)
[(Reed2)] Reed, J. Phys. Chem. C, 116, 2205 (2012).

:link(Goldman)
[(Goldman)] Goldman, Srinivasan, Hamel, Fried, Gaus, and Elstner,
J. Phys. Chem. C, 117, 7885 (2013).
+2 −2
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ fortran a simple wrapper on the LAMMPS library API that
 		      can be called from Fortran
fortran2            a more sophisticated wrapper on the LAMMPS library API that
 		      can be called from Fortran
fortran3            wrapper written by Nir Goldman (LLNL), as an
fortran_dftb        wrapper written by Nir Goldman (LLNL), as an
                      extension to fortran2, used for calling LAMMPS
                      from Fortran DFTB+ code
                      from Fortran DFTB+ tight-binding code

Each sub-directory has its own README with more details.
+25 −1
Original line number Diff line number Diff line
@@ -47,11 +47,35 @@ void lammps_set_callback (void *ptr) {
  return;
}

void lammps_set_external_vector_length (void *ptr, int n) {
  class LAMMPS *lmp = (class LAMMPS *) ptr;
  int ifix = lmp->modify->find_fix_by_style("external");
  FixExternal *fix = (FixExternal *) lmp->modify->fix[ifix];
  fix->set_vector_length(n);
  return;
}

void lammps_set_external_vector (void *ptr, int n, double val) {
  class LAMMPS *lmp = (class LAMMPS *) ptr;
  int ifix = lmp->modify->find_fix_by_style("external");
  FixExternal *fix = (FixExternal *) lmp->modify->fix[ifix];
  fix->set_vector (n, val);
  return;
}

void lammps_set_user_energy (void *ptr, double energy) {
  class LAMMPS *lmp = (class LAMMPS *) ptr;
  int ifix = lmp->modify->find_fix_by_style("external");
  FixExternal *fix = (FixExternal *) lmp->modify->fix[ifix];
  fix->set_energy(energy);
  fix->set_energy_global(energy);
  return;
}

void lammps_set_user_virial (void *ptr, double *virial) {
  class LAMMPS *lmp = (class LAMMPS *) ptr;
  int ifix = lmp->modify->find_fix_by_style("external");
  FixExternal *fix = (FixExternal *) lmp->modify->fix[ifix];
  fix->set_virial_global(virial);
  return;
}
Loading