Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85643931
fix_nh_eff.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Sep 30, 15:45
Size
3 KB
Mime Type
text/x-c
Expires
Wed, Oct 2, 15:45 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
21227967
Attached To
rLAMMPS lammps
fix_nh_eff.cpp
View Options
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Andres Jaramillo-Botero (Caltech)
------------------------------------------------------------------------- */
#include "math.h"
#include "fix_nh_eff.h"
#include "atom.h"
#include "atom_vec.h"
#include "group.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{NOBIAS,BIAS};
/* ---------------------------------------------------------------------- */
FixNHEff::FixNHEff(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg)
{
if (!atom->electron_flag)
error->all("Fix nvt/nph/npt/eff requires atom style electron");
}
/* ----------------------------------------------------------------------
perform half-step update of electron radial velocities
-----------------------------------------------------------------------*/
void FixNHEff::nve_v()
{
// standard nve_v velocity update
FixNH::nve_v();
double *erforce = atom->erforce;
double *ervel = atom->ervel;
double *mass = atom->mass;
int *spin = atom->spin;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
int itype;
double dtfm;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (fabs(spin[i])==1) {
dtfm = dtf / mass[type[i]];
ervel[i] = dtfm * erforce[i] / 0.75;
}
}
}
}
/* ----------------------------------------------------------------------
perform full-step update of electron radii
-----------------------------------------------------------------------*/
void FixNHEff::nve_x()
{
// standard nve_x position update
FixNH::nve_x();
double *eradius = atom->eradius;
double *ervel = atom->ervel;
int *spin = atom->spin;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (fabs(spin[i])==1) eradius[i] += dtv * ervel[i];
}
/* ----------------------------------------------------------------------
perform half-step scaling of electron radial velocities
-----------------------------------------------------------------------*/
void FixNHEff::nh_v_temp()
{
// standard nh_v_temp velocity scaling
FixNH::nh_v_temp();
double *ervel = atom->ervel;
int *spin = atom->spin;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (fabs(spin[i])==1) ervel[i] *= factor_eta;
}
Event Timeline
Log In to Comment