Merge branch 'pppm_spin' of github.com:julient31/lammps into pppm_spin
Conflicts: doc/src/pair_spin_dipole.txt
This commit is contained in:
@ -12,49 +12,36 @@ pair_style spin/dipole/long/qsymp command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
pair_style spin/dipole/cut cutoff
|
||||
pair_style lj/cut/dipole/cut cutoff (cutoff2)
|
||||
pair_style lj/sf/dipole/sf cutoff (cutoff2)
|
||||
pair_style lj/cut/dipole/long cutoff (cutoff2)
|
||||
pair_style lj/long/dipole/long flag_lj flag_coul cutoff (cutoff2) :pre
|
||||
pair_style spin/dipole/cut cutoff
|
||||
pair_style spin/dipole/long cutoff
|
||||
pair_style spin/dipole/long/qsymp cutoff :pre
|
||||
|
||||
cutoff = global cutoff LJ (and Coulombic if only 1 arg) (distance units) :ulb,l
|
||||
cutoff2 = global cutoff for Coulombic and dipole (optional) (distance units) :l
|
||||
flag_lj = {long} or {cut} or {off} :l
|
||||
{long} = use long-range damping on dispersion 1/r^6 term
|
||||
{cut} = use a cutoff on dispersion 1/r^6 term
|
||||
{off} = omit disperion 1/r^6 term entirely :pre
|
||||
flag_coul = {long} or {off} :l
|
||||
{long} = use long-range damping on Coulombic 1/r and point-dipole terms
|
||||
{off} = omit Coulombic and point-dipole terms entirely :pre
|
||||
cutoff = global cutoff for Magnetic dipole energy and forces
|
||||
(optional) (distance units) :ulb,l
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
pair_style lj/cut/dipole/cut 10.0
|
||||
pair_coeff * * 1.0 1.0
|
||||
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
|
||||
pair_style spin/dipole/cut 10.0
|
||||
pair_coeff * * 10.0
|
||||
pair_coeff 2 3 8.0 :pre
|
||||
|
||||
pair_style lj/sf/dipole/sf 9.0
|
||||
pair_style spin/dipole/long 9.0
|
||||
pair_coeff * * 1.0 1.0
|
||||
pair_coeff 2 3 1.0 1.0 2.5 4.0 scale 0.5
|
||||
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
|
||||
|
||||
pair_style lj/cut/dipole/long 10.0
|
||||
pair_coeff * * 1.0 1.0
|
||||
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
|
||||
|
||||
pair_style lj/long/dipole/long long long 3.5 10.0
|
||||
pair_style spin/dipole/long/qsymp 10.0
|
||||
pair_coeff * * 1.0 1.0
|
||||
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Style {lj/cut/dipole/cut} computes interactions between pairs of particles
|
||||
that each have a charge and/or a point dipole moment. In addition to
|
||||
the usual Lennard-Jones interaction between the particles (Elj) the
|
||||
charge-charge (Eqq), charge-dipole (Eqp), and dipole-dipole (Epp)
|
||||
interactions are computed by these formulas for the energy (E), force
|
||||
Style {spin/dipole/cut} computes a short-range dipole-dipole
|
||||
interactions between pairs of magnetic particles that each
|
||||
have a magnetic spin.
|
||||
The magnetic dipole-dipole interactions are computed by the
|
||||
following formulas for the energy (E), force
|
||||
(F), and torque (T) between particles I and J.
|
||||
|
||||
:c,image(Eqs/pair_dipole.jpg)
|
||||
15009
examples/SPIN/dipole_spin/Fe_Mishin2006.eam.alloy
Normal file
15009
examples/SPIN/dipole_spin/Fe_Mishin2006.eam.alloy
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
2.4824 0.01948336
|
||||
2.8665 0.01109
|
||||
4.0538 -0.0002176
|
||||
4.753 -0.001714
|
||||
4.965 -0.001986
|
||||
@ -0,0 +1,32 @@
|
||||
#Program fitting the exchange interaction
|
||||
#Model curve: Bethe-Slater function
|
||||
import numpy as np, pylab, tkinter
|
||||
import matplotlib.pyplot as plt
|
||||
from scipy.optimize import curve_fit
|
||||
from decimal import *
|
||||
|
||||
print("Loop begin")
|
||||
|
||||
#Definition of the Bethe-Slater function
|
||||
def func(x,a,b,c):
|
||||
return 4*a*((x/c)**2)*(1-b*(x/c)**2)*np.exp(-(x/c)**2)
|
||||
|
||||
#Exchange coeff table (data to fit)
|
||||
rdata, Jdata = np.loadtxt('exchange_bcc_iron.dat', usecols=(0,1), unpack=True)
|
||||
plt.plot(rdata, Jdata, 'b-', label='data')
|
||||
|
||||
#Perform the fit
|
||||
popt, pcov = curve_fit(func, rdata, Jdata, bounds=(0, [500.,5.,5.]))
|
||||
plt.plot(rdata, func(rdata, *popt), 'r--', label='fit')
|
||||
|
||||
#Print the fitted params
|
||||
print("Parameters: a={:.10} (in meV), b={:.10} (adim), c={:.10} (in Ang)".format(*popt))
|
||||
|
||||
#Ploting the result
|
||||
plt.xlabel('r_ij')
|
||||
pylab.xlim([0,6.5])
|
||||
plt.ylabel('J_ij')
|
||||
plt.legend()
|
||||
plt.show()
|
||||
|
||||
print("Loop end")
|
||||
19
examples/SPIN/dipole_spin/fe_dd.dat
Normal file
19
examples/SPIN/dipole_spin/fe_dd.dat
Normal file
@ -0,0 +1,19 @@
|
||||
6 8
|
||||
Optimal parameter set
|
||||
1 4.100199340884814 F
|
||||
2 1.565647547483517 F
|
||||
1 0.9332056681088162 T 3.000000000000000
|
||||
2 -1.162558782567700 T 2.866666666666670
|
||||
3 -0.3502026949249225 T 2.733333333333330
|
||||
4 0.4287820835430028 T 2.600000000000000
|
||||
5 4.907925057809273 T 2.400000000000000
|
||||
6 -5.307049068415304 T 2.300000000000000
|
||||
1 -0.1960674387419232 F 4.100000000000000
|
||||
2 0.3687525935422963 F 3.800000000000000
|
||||
3 -1.505333614924853 F 3.500000000000000
|
||||
4 4.948907078156191 T 3.200000000000000
|
||||
5 -4.894613262753399 T 2.900000000000000
|
||||
6 3.468897724782442 T 2.600000000000000
|
||||
7 -1.792218099820337 T 2.400000000000000
|
||||
8 80.22069592246987 T 2.300000000000000
|
||||
|
||||
59
examples/SPIN/dipole_spin/in.spin.iron_dipole_cut
Normal file
59
examples/SPIN/dipole_spin/in.spin.iron_dipole_cut
Normal file
@ -0,0 +1,59 @@
|
||||
# bcc iron in a 3d periodic box
|
||||
|
||||
clear
|
||||
units metal
|
||||
atom_style spin
|
||||
|
||||
dimension 3
|
||||
boundary p p p
|
||||
|
||||
# necessary for the serial algorithm (sametag)
|
||||
atom_modify map array
|
||||
|
||||
lattice bcc 2.8665
|
||||
region box block 0.0 5.0 0.0 5.0 0.0 5.0
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
# setting mass, mag. moments, and interactions for bcc iron
|
||||
|
||||
mass 1 55.845
|
||||
set group all spin 2.2 -1.0 0.0 0.0
|
||||
velocity all create 100 4928459 rot yes dist gaussian
|
||||
|
||||
pair_style hybrid/overlay eam/alloy spin/exchange 3.5 spin/dipole/cut 8.0
|
||||
pair_coeff * * eam/alloy Fe_Mishin2006.eam.alloy Fe
|
||||
pair_coeff * * spin/exchange exchange 3.4 0.02726 0.2171 1.841
|
||||
pair_coeff * * spin/dipole/cut 8.0
|
||||
|
||||
neighbor 0.1 bin
|
||||
neigh_modify every 10 check yes delay 20
|
||||
|
||||
fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
|
||||
fix_modify 1 energy yes
|
||||
fix 2 all langevin/spin 0.0 0.0 21
|
||||
|
||||
fix 3 all nve/spin lattice yes
|
||||
timestep 0.0001
|
||||
|
||||
# compute and output options
|
||||
|
||||
compute out_mag all spin
|
||||
compute out_pe all pe
|
||||
compute out_ke all ke
|
||||
compute out_temp all temp
|
||||
|
||||
variable magx equal c_out_mag[1]
|
||||
variable magy equal c_out_mag[2]
|
||||
variable magz equal c_out_mag[3]
|
||||
variable magnorm equal c_out_mag[4]
|
||||
variable emag equal c_out_mag[5]
|
||||
variable tmag equal c_out_mag[6]
|
||||
|
||||
thermo_style custom step time v_magx v_magy v_magz v_magnorm v_tmag v_emag pe etotal
|
||||
thermo 50
|
||||
|
||||
compute outsp all property/atom spx spy spz sp fmx fmy fmz
|
||||
dump 100 all custom 1 dump_iron.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]
|
||||
|
||||
run 2000
|
||||
60
examples/SPIN/dipole_spin/in.spin.iron_ewald
Normal file
60
examples/SPIN/dipole_spin/in.spin.iron_ewald
Normal file
@ -0,0 +1,60 @@
|
||||
# bcc iron in a 3d periodic box
|
||||
|
||||
clear
|
||||
units metal
|
||||
atom_style spin
|
||||
|
||||
dimension 3
|
||||
boundary p p p
|
||||
|
||||
# necessary for the serial algorithm (sametag)
|
||||
atom_modify map array
|
||||
|
||||
lattice bcc 2.8665
|
||||
region box block 0.0 5.0 0.0 5.0 0.0 5.0
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
# setting mass, mag. moments, and interactions for bcc iron
|
||||
|
||||
mass 1 55.845
|
||||
set group all spin 2.2 -1.0 0.0 0.0
|
||||
velocity all create 100 4928459 rot yes dist gaussian
|
||||
|
||||
pair_style hybrid/overlay eam/alloy spin/exchange 3.5
|
||||
pair_coeff * * eam/alloy Fe_Mishin2006.eam.alloy Fe
|
||||
pair_coeff * * spin/exchange exchange 3.4 0.02726 0.2171 1.841
|
||||
neighbor 0.1 bin
|
||||
neigh_modify every 10 check yes delay 20
|
||||
|
||||
fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
|
||||
fix_modify 1 energy yes
|
||||
fix 2 all langevin/spin 0.0 0.0 21
|
||||
|
||||
fix 3 all nve/spin lattice yes
|
||||
timestep 0.0001
|
||||
|
||||
# compute and output options
|
||||
|
||||
compute out_mag all spin
|
||||
compute out_pe all pe
|
||||
compute out_ke all ke
|
||||
compute out_temp all temp
|
||||
|
||||
variable magx equal c_out_mag[1]
|
||||
variable magy equal c_out_mag[2]
|
||||
variable magz equal c_out_mag[3]
|
||||
variable magnorm equal c_out_mag[4]
|
||||
variable emag equal c_out_mag[5]
|
||||
variable tmag equal c_out_mag[6]
|
||||
|
||||
thermo_style custom step time v_magx v_magy v_magz v_magnorm v_tmag v_emag pe etotal
|
||||
thermo 50
|
||||
|
||||
compute outsp all property/atom spx spy spz sp fmx fmy fmz
|
||||
dump 100 all custom 1 dump_iron.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]
|
||||
|
||||
run 2000
|
||||
# min_style spin
|
||||
# min_modify alpha_damp 1.0 discrete_factor 10
|
||||
# minimize 1.0e-16 1.0e-16 10000 10000
|
||||
60
examples/SPIN/dipole_spin/in.spin.iron_pppm
Normal file
60
examples/SPIN/dipole_spin/in.spin.iron_pppm
Normal file
@ -0,0 +1,60 @@
|
||||
# bcc iron in a 3d periodic box
|
||||
|
||||
clear
|
||||
units metal
|
||||
atom_style spin
|
||||
|
||||
dimension 3
|
||||
boundary p p p
|
||||
|
||||
# necessary for the serial algorithm (sametag)
|
||||
atom_modify map array
|
||||
|
||||
lattice bcc 2.8665
|
||||
region box block 0.0 5.0 0.0 5.0 0.0 5.0
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
# setting mass, mag. moments, and interactions for bcc iron
|
||||
|
||||
mass 1 55.845
|
||||
set group all spin 2.2 -1.0 0.0 0.0
|
||||
velocity all create 100 4928459 rot yes dist gaussian
|
||||
|
||||
pair_style hybrid/overlay eam/alloy spin/exchange 3.5
|
||||
pair_coeff * * eam/alloy Fe_Mishin2006.eam.alloy Fe
|
||||
pair_coeff * * spin/exchange exchange 3.4 0.02726 0.2171 1.841
|
||||
neighbor 0.1 bin
|
||||
neigh_modify every 10 check yes delay 20
|
||||
|
||||
fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
|
||||
fix_modify 1 energy yes
|
||||
fix 2 all langevin/spin 0.0 0.0 21
|
||||
|
||||
fix 3 all nve/spin lattice yes
|
||||
timestep 0.0001
|
||||
|
||||
# compute and output options
|
||||
|
||||
compute out_mag all spin
|
||||
compute out_pe all pe
|
||||
compute out_ke all ke
|
||||
compute out_temp all temp
|
||||
|
||||
variable magx equal c_out_mag[1]
|
||||
variable magy equal c_out_mag[2]
|
||||
variable magz equal c_out_mag[3]
|
||||
variable magnorm equal c_out_mag[4]
|
||||
variable emag equal c_out_mag[5]
|
||||
variable tmag equal c_out_mag[6]
|
||||
|
||||
thermo_style custom step time v_magx v_magy v_magz v_magnorm v_tmag v_emag pe etotal
|
||||
thermo 50
|
||||
|
||||
compute outsp all property/atom spx spy spz sp fmx fmy fmz
|
||||
dump 100 all custom 1 dump_iron.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]
|
||||
|
||||
run 2000
|
||||
# min_style spin
|
||||
# min_modify alpha_damp 1.0 discrete_factor 10
|
||||
# minimize 1.0e-16 1.0e-16 10000 10000
|
||||
@ -25,8 +25,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "pair_spin_dipolar_cut.h"
|
||||
#include "pair_spin_dipole_cut.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "neighbor.h"
|
||||
@ -34,7 +33,6 @@
|
||||
#include "neigh_request.h"
|
||||
#include "fix_nve_spin.h"
|
||||
#include "force.h"
|
||||
#include "kspace.h"
|
||||
#include "math_const.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
@ -45,17 +43,9 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
#define EWALD_F 1.12837917
|
||||
#define EWALD_P 0.3275911
|
||||
#define A1 0.254829592
|
||||
#define A2 -0.284496736
|
||||
#define A3 1.421413741
|
||||
#define A4 -1.453152027
|
||||
#define A5 1.061405429
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarCut::PairSpinDipolarCut(LAMMPS *lmp) : PairSpin(lmp),
|
||||
PairSpinDipoleCut::PairSpinDipoleCut(LAMMPS *lmp) : PairSpin(lmp),
|
||||
lockfixnvespin(NULL)
|
||||
{
|
||||
single_enable = 0;
|
||||
@ -77,7 +67,7 @@ lockfixnvespin(NULL)
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarCut::~PairSpinDipolarCut()
|
||||
PairSpinDipoleCut::~PairSpinDipoleCut()
|
||||
{
|
||||
if (allocated) {
|
||||
memory->destroy(setflag);
|
||||
@ -90,7 +80,7 @@ PairSpinDipolarCut::~PairSpinDipolarCut()
|
||||
global settings
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::settings(int narg, char **arg)
|
||||
void PairSpinDipoleCut::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg < 1 || narg > 2)
|
||||
error->all(FLERR,"Incorrect args in pair_style command");
|
||||
@ -122,22 +112,18 @@ void PairSpinDipolarCut::settings(int narg, char **arg)
|
||||
set coeffs for one or more type pairs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::coeff(int narg, char **arg)
|
||||
void PairSpinDipoleCut::coeff(int narg, char **arg)
|
||||
{
|
||||
if (!allocated) allocate();
|
||||
|
||||
// check if args correct
|
||||
|
||||
if (strcmp(arg[2],"long") != 0)
|
||||
error->all(FLERR,"Incorrect args in pair_style command");
|
||||
if (narg < 1 || narg > 4)
|
||||
if (narg < 1 || narg > 3)
|
||||
error->all(FLERR,"Incorrect args in pair_style command");
|
||||
|
||||
int ilo,ihi,jlo,jhi;
|
||||
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
|
||||
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
|
||||
|
||||
double spin_long_cut_one = force->numeric(FLERR,arg[3]);
|
||||
double spin_long_cut_one = force->numeric(FLERR,arg[2]);
|
||||
|
||||
int count = 0;
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
@ -155,7 +141,7 @@ void PairSpinDipolarCut::coeff(int narg, char **arg)
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::init_style()
|
||||
void PairSpinDipoleCut::init_style()
|
||||
{
|
||||
if (!atom->sp_flag)
|
||||
error->all(FLERR,"Pair spin requires atom/spin style");
|
||||
@ -191,7 +177,7 @@ void PairSpinDipolarCut::init_style()
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairSpinDipolarCut::init_one(int i, int j)
|
||||
double PairSpinDipoleCut::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
|
||||
@ -204,7 +190,7 @@ double PairSpinDipolarCut::init_one(int i, int j)
|
||||
extract the larger cutoff if "cut" or "cut_coul"
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *PairSpinDipolarCut::extract(const char *str, int &dim)
|
||||
void *PairSpinDipoleCut::extract(const char *str, int &dim)
|
||||
{
|
||||
if (strcmp(str,"cut") == 0) {
|
||||
dim = 0;
|
||||
@ -227,7 +213,7 @@ void *PairSpinDipolarCut::extract(const char *str, int &dim)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::compute(int eflag, int vflag)
|
||||
void PairSpinDipoleCut::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,ii,jj,inum,jnum,itype,jtype;
|
||||
double rinv,r2inv,r3inv,rsq;
|
||||
@ -338,7 +324,7 @@ void PairSpinDipolarCut::compute(int eflag, int vflag)
|
||||
removing erf(r)/r (for r in [0,rc]) from the kspace force
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::compute_single_pair(int ii, double fmi[3])
|
||||
void PairSpinDipoleCut::compute_single_pair(int ii, double fmi[3])
|
||||
{
|
||||
int i,j,jj,jnum,itype,jtype;
|
||||
double rsq,rinv,r2inv,r3inv;
|
||||
@ -406,7 +392,7 @@ void PairSpinDipolarCut::compute_single_pair(int ii, double fmi[3])
|
||||
compute dipolar interaction between spins i and j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::compute_dipolar(int i, int j, double eij[3],
|
||||
void PairSpinDipoleCut::compute_dipolar(int i, int j, double eij[3],
|
||||
double fmi[3], double spi[4], double spj[4], double r3inv)
|
||||
{
|
||||
double sjdotr;
|
||||
@ -426,7 +412,7 @@ void PairSpinDipolarCut::compute_dipolar(int i, int j, double eij[3],
|
||||
atom i and atom j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::compute_dipolar_mech(int i, int j, double eij[3],
|
||||
void PairSpinDipoleCut::compute_dipolar_mech(int i, int j, double eij[3],
|
||||
double fi[3], double spi[3], double spj[3], double r2inv)
|
||||
{
|
||||
double sisj,sieij,sjeij;
|
||||
@ -449,7 +435,7 @@ void PairSpinDipolarCut::compute_dipolar_mech(int i, int j, double eij[3],
|
||||
allocate all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::allocate()
|
||||
void PairSpinDipoleCut::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->ntypes;
|
||||
@ -467,7 +453,7 @@ void PairSpinDipolarCut::allocate()
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::write_restart(FILE *fp)
|
||||
void PairSpinDipoleCut::write_restart(FILE *fp)
|
||||
{
|
||||
write_restart_settings(fp);
|
||||
|
||||
@ -486,7 +472,7 @@ void PairSpinDipolarCut::write_restart(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::read_restart(FILE *fp)
|
||||
void PairSpinDipoleCut::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
|
||||
@ -512,7 +498,7 @@ void PairSpinDipolarCut::read_restart(FILE *fp)
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::write_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleCut::write_restart_settings(FILE *fp)
|
||||
{
|
||||
fwrite(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
fwrite(&mix_flag,sizeof(int),1,fp);
|
||||
@ -522,7 +508,7 @@ void PairSpinDipolarCut::write_restart_settings(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarCut::read_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleCut::read_restart_settings(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
fread(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
|
||||
@ -13,24 +13,24 @@
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(spin/dipolar/cut,PairSpinDipolarCut)
|
||||
PairStyle(spin/dipole/cut,PairSpinDipoleCut)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLAR_CUT_H
|
||||
#define LMP_PAIR_SPIN_DIPOLAR_CUT_H
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLE_CUT_H
|
||||
#define LMP_PAIR_SPIN_DIPOLE_CUT_H
|
||||
|
||||
#include "pair_spin.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairSpinDipolarCut : public PairSpin {
|
||||
class PairSpinDipoleCut : public PairSpin {
|
||||
public:
|
||||
double cut_coul;
|
||||
double **sigma;
|
||||
|
||||
PairSpinDipolarCut(class LAMMPS *);
|
||||
~PairSpinDipolarCut();
|
||||
PairSpinDipoleCut(class LAMMPS *);
|
||||
~PairSpinDipoleCut();
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
double init_one(int, int);
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "pair_spin_dipolar_long.h"
|
||||
#include "pair_spin_dipole_long.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "neighbor.h"
|
||||
@ -50,7 +50,7 @@ using namespace MathConst;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarLong::PairSpinDipolarLong(LAMMPS *lmp) : PairSpin(lmp),
|
||||
PairSpinDipoleLong::PairSpinDipoleLong(LAMMPS *lmp) : PairSpin(lmp),
|
||||
lockfixnvespin(NULL)
|
||||
{
|
||||
single_enable = 0;
|
||||
@ -74,7 +74,7 @@ lockfixnvespin(NULL)
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarLong::~PairSpinDipolarLong()
|
||||
PairSpinDipoleLong::~PairSpinDipoleLong()
|
||||
{
|
||||
if (allocated) {
|
||||
memory->destroy(setflag);
|
||||
@ -87,7 +87,7 @@ PairSpinDipolarLong::~PairSpinDipolarLong()
|
||||
global settings
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::settings(int narg, char **arg)
|
||||
void PairSpinDipoleLong::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg < 1 || narg > 2)
|
||||
error->all(FLERR,"Incorrect args in pair_style command");
|
||||
@ -116,7 +116,7 @@ void PairSpinDipolarLong::settings(int narg, char **arg)
|
||||
set coeffs for one or more type pairs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::coeff(int narg, char **arg)
|
||||
void PairSpinDipoleLong::coeff(int narg, char **arg)
|
||||
{
|
||||
if (!allocated) allocate();
|
||||
|
||||
@ -149,7 +149,7 @@ void PairSpinDipolarLong::coeff(int narg, char **arg)
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::init_style()
|
||||
void PairSpinDipoleLong::init_style()
|
||||
{
|
||||
if (!atom->sp_flag)
|
||||
error->all(FLERR,"Pair spin requires atom/spin style");
|
||||
@ -196,7 +196,7 @@ void PairSpinDipolarLong::init_style()
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairSpinDipolarLong::init_one(int i, int j)
|
||||
double PairSpinDipoleLong::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
|
||||
@ -209,7 +209,7 @@ double PairSpinDipolarLong::init_one(int i, int j)
|
||||
extract the larger cutoff if "cut" or "cut_coul"
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *PairSpinDipolarLong::extract(const char *str, int &dim)
|
||||
void *PairSpinDipoleLong::extract(const char *str, int &dim)
|
||||
{
|
||||
if (strcmp(str,"cut") == 0) {
|
||||
dim = 0;
|
||||
@ -232,7 +232,7 @@ void *PairSpinDipolarLong::extract(const char *str, int &dim)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::compute(int eflag, int vflag)
|
||||
void PairSpinDipoleLong::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,ii,jj,inum,jnum,itype,jtype;
|
||||
double r,rinv,r2inv,rsq;
|
||||
@ -366,7 +366,7 @@ void PairSpinDipolarLong::compute(int eflag, int vflag)
|
||||
update the pair interaction fmi acting on the spin ii
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::compute_single_pair(int ii, double fmi[3])
|
||||
void PairSpinDipoleLong::compute_single_pair(int ii, double fmi[3])
|
||||
{
|
||||
int i,j,jj,jnum,itype,jtype;
|
||||
double r,rinv,r2inv,rsq;
|
||||
@ -463,7 +463,7 @@ void PairSpinDipolarLong::compute_single_pair(int ii, double fmi[3])
|
||||
compute dipolar interaction between spins i and j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::compute_long(int i, int j, double eij[3],
|
||||
void PairSpinDipoleLong::compute_long(int i, int j, double eij[3],
|
||||
double bij[4], double fmi[3], double spi[4], double spj[4])
|
||||
{
|
||||
double sjeij,pre;
|
||||
@ -486,7 +486,7 @@ void PairSpinDipolarLong::compute_long(int i, int j, double eij[3],
|
||||
atom i and atom j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::compute_long_mech(int i, int j, double eij[3],
|
||||
void PairSpinDipoleLong::compute_long_mech(int i, int j, double eij[3],
|
||||
double bij[4], double fi[3], double spi[3], double spj[3])
|
||||
{
|
||||
double sisj,sieij,sjeij,b2,b3;
|
||||
@ -514,7 +514,7 @@ void PairSpinDipolarLong::compute_long_mech(int i, int j, double eij[3],
|
||||
allocate all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::allocate()
|
||||
void PairSpinDipoleLong::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->ntypes;
|
||||
@ -532,7 +532,7 @@ void PairSpinDipolarLong::allocate()
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::write_restart(FILE *fp)
|
||||
void PairSpinDipoleLong::write_restart(FILE *fp)
|
||||
{
|
||||
write_restart_settings(fp);
|
||||
|
||||
@ -551,7 +551,7 @@ void PairSpinDipolarLong::write_restart(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::read_restart(FILE *fp)
|
||||
void PairSpinDipoleLong::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
|
||||
@ -577,7 +577,7 @@ void PairSpinDipolarLong::read_restart(FILE *fp)
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::write_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleLong::write_restart_settings(FILE *fp)
|
||||
{
|
||||
fwrite(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
fwrite(&mix_flag,sizeof(int),1,fp);
|
||||
@ -587,7 +587,7 @@ void PairSpinDipolarLong::write_restart_settings(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLong::read_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleLong::read_restart_settings(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
fread(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
|
||||
@ -13,24 +13,24 @@
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(spin/dipolar/long,PairSpinDipolarLong)
|
||||
PairStyle(spin/dipole/long,PairSpinDipoleLong)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLAR_LONG_H
|
||||
#define LMP_PAIR_SPIN_DIPOLAR_LONG_H
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLE_LONG_H
|
||||
#define LMP_PAIR_SPIN_DIPOLE_LONG_H
|
||||
|
||||
#include "pair_spin.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairSpinDipolarLong : public PairSpin {
|
||||
class PairSpinDipoleLong : public PairSpin {
|
||||
public:
|
||||
double cut_coul;
|
||||
double **sigma;
|
||||
|
||||
PairSpinDipolarLong(class LAMMPS *);
|
||||
~PairSpinDipolarLong();
|
||||
PairSpinDipoleLong(class LAMMPS *);
|
||||
~PairSpinDipoleLong();
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
double init_one(int, int);
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "pair_spin_dipolar_long_qsymp.h"
|
||||
#include "pair_spin_dipole_long_qsymp.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "neighbor.h"
|
||||
@ -50,7 +50,7 @@ using namespace MathConst;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarLongQsymp::PairSpinDipolarLongQsymp(LAMMPS *lmp) : PairSpin(lmp),
|
||||
PairSpinDipoleLongQsymp::PairSpinDipoleLongQsymp(LAMMPS *lmp) : PairSpin(lmp),
|
||||
lockfixnvespin(NULL)
|
||||
{
|
||||
single_enable = 0;
|
||||
@ -75,7 +75,7 @@ lockfixnvespin(NULL)
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
PairSpinDipolarLongQsymp::~PairSpinDipolarLongQsymp()
|
||||
PairSpinDipoleLongQsymp::~PairSpinDipoleLongQsymp()
|
||||
{
|
||||
if (allocated) {
|
||||
memory->destroy(setflag);
|
||||
@ -88,7 +88,7 @@ PairSpinDipolarLongQsymp::~PairSpinDipolarLongQsymp()
|
||||
global settings
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::settings(int narg, char **arg)
|
||||
void PairSpinDipoleLongQsymp::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg < 1 || narg > 2)
|
||||
error->all(FLERR,"Incorrect args in pair_style command");
|
||||
@ -117,7 +117,7 @@ void PairSpinDipolarLongQsymp::settings(int narg, char **arg)
|
||||
set coeffs for one or more type pairs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::coeff(int narg, char **arg)
|
||||
void PairSpinDipoleLongQsymp::coeff(int narg, char **arg)
|
||||
{
|
||||
if (!allocated) allocate();
|
||||
|
||||
@ -150,7 +150,7 @@ void PairSpinDipolarLongQsymp::coeff(int narg, char **arg)
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::init_style()
|
||||
void PairSpinDipoleLongQsymp::init_style()
|
||||
{
|
||||
if (!atom->sp_flag)
|
||||
error->all(FLERR,"Pair spin requires atom/spin style");
|
||||
@ -193,7 +193,7 @@ void PairSpinDipolarLongQsymp::init_style()
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairSpinDipolarLongQsymp::init_one(int i, int j)
|
||||
double PairSpinDipoleLongQsymp::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
|
||||
@ -206,7 +206,7 @@ double PairSpinDipolarLongQsymp::init_one(int i, int j)
|
||||
extract the larger cutoff if "cut" or "cut_coul"
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *PairSpinDipolarLongQsymp::extract(const char *str, int &dim)
|
||||
void *PairSpinDipoleLongQsymp::extract(const char *str, int &dim)
|
||||
{
|
||||
if (strcmp(str,"cut") == 0) {
|
||||
dim = 0;
|
||||
@ -229,7 +229,7 @@ void *PairSpinDipolarLongQsymp::extract(const char *str, int &dim)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::compute(int eflag, int vflag)
|
||||
void PairSpinDipoleLongQsymp::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,ii,jj,inum,jnum,itype,jtype;
|
||||
double r,rinv,r2inv,rsq;
|
||||
@ -390,7 +390,7 @@ void PairSpinDipolarLongQsymp::compute(int eflag, int vflag)
|
||||
removing erf(r)/r (for r in [0,rc]) from the kspace force
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::compute_single_pair(int ii, double fmi[3])
|
||||
void PairSpinDipoleLongQsymp::compute_single_pair(int ii, double fmi[3])
|
||||
{
|
||||
int i,j,jj,jnum,itype,jtype;
|
||||
double rinv,r2inv,r3inv,rsq;
|
||||
@ -470,7 +470,7 @@ void PairSpinDipolarLongQsymp::compute_single_pair(int ii, double fmi[3])
|
||||
compute dipolar interaction between spins i and j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::compute_long(int i, int j, double rij[3],
|
||||
void PairSpinDipoleLongQsymp::compute_long(int i, int j, double rij[3],
|
||||
double bij[4], double fmi[3], double spi[4], double spj[4])
|
||||
{
|
||||
double sjdotr;
|
||||
@ -492,7 +492,7 @@ void PairSpinDipolarLongQsymp::compute_long(int i, int j, double rij[3],
|
||||
atom i and atom j
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::compute_long_mech(int i, int j, double rij[3],
|
||||
void PairSpinDipoleLongQsymp::compute_long_mech(int i, int j, double rij[3],
|
||||
double bij[4], double fi[3], double spi[3], double spj[3])
|
||||
{
|
||||
double sdots,sidotr,sjdotr,b2,b3;
|
||||
@ -522,7 +522,7 @@ void PairSpinDipolarLongQsymp::compute_long_mech(int i, int j, double rij[3],
|
||||
allocate all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::allocate()
|
||||
void PairSpinDipoleLongQsymp::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->ntypes;
|
||||
@ -540,7 +540,7 @@ void PairSpinDipolarLongQsymp::allocate()
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::write_restart(FILE *fp)
|
||||
void PairSpinDipoleLongQsymp::write_restart(FILE *fp)
|
||||
{
|
||||
write_restart_settings(fp);
|
||||
|
||||
@ -559,7 +559,7 @@ void PairSpinDipolarLongQsymp::write_restart(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::read_restart(FILE *fp)
|
||||
void PairSpinDipoleLongQsymp::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
|
||||
@ -585,7 +585,7 @@ void PairSpinDipolarLongQsymp::read_restart(FILE *fp)
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::write_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleLongQsymp::write_restart_settings(FILE *fp)
|
||||
{
|
||||
fwrite(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
fwrite(&mix_flag,sizeof(int),1,fp);
|
||||
@ -595,7 +595,7 @@ void PairSpinDipolarLongQsymp::write_restart_settings(FILE *fp)
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairSpinDipolarLongQsymp::read_restart_settings(FILE *fp)
|
||||
void PairSpinDipoleLongQsymp::read_restart_settings(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
fread(&cut_spin_long_global,sizeof(double),1,fp);
|
||||
|
||||
@ -13,24 +13,24 @@
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(spin/dipolar/long/qsymp,PairSpinDipolarLongQsymp)
|
||||
PairStyle(spin/dipole/long/qsymp,PairSpinDipoleLongQsymp)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLAR_LONG_QSYMP_H
|
||||
#define LMP_PAIR_SPIN_DIPOLAR_LONG_QSYMP_H
|
||||
#ifndef LMP_PAIR_SPIN_DIPOLE_LONG_QSYMP_H
|
||||
#define LMP_PAIR_SPIN_DIPOLE_LONG_QSYMP_H
|
||||
|
||||
#include "pair_spin.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairSpinDipolarLongQsymp : public PairSpin {
|
||||
class PairSpinDipoleLongQsymp : public PairSpin {
|
||||
public:
|
||||
double cut_coul;
|
||||
double **sigma;
|
||||
|
||||
PairSpinDipolarLongQsymp(class LAMMPS *);
|
||||
~PairSpinDipolarLongQsymp();
|
||||
PairSpinDipoleLongQsymp(class LAMMPS *);
|
||||
virtual ~PairSpinDipoleLongQsymp();
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
double init_one(int, int);
|
||||
|
||||
Reference in New Issue
Block a user