Implemetation of SeqNei Algo 1
Still Seq and SeqNei versions Loop on Neigh in SeqNei not working yet
This commit is contained in:
70
in.cobalt
70
in.cobalt
@ -10,8 +10,8 @@ units metal
|
|||||||
dimension 3
|
dimension 3
|
||||||
|
|
||||||
#setting boundary conditions. (p for periodic, f for fixed, ...)
|
#setting boundary conditions. (p for periodic, f for fixed, ...)
|
||||||
#boundary p p p
|
boundary p p p
|
||||||
boundary f f f
|
#boundary f f f
|
||||||
|
|
||||||
#setting atom_style, defines what can of atoms to use in simulation (atomic, molecule, angle, dipole, ...)
|
#setting atom_style, defines what can of atoms to use in simulation (atomic, molecule, angle, dipole, ...)
|
||||||
atom_style spin
|
atom_style spin
|
||||||
@ -20,30 +20,35 @@ atom_style spin
|
|||||||
|
|
||||||
atom_modify map array
|
atom_modify map array
|
||||||
|
|
||||||
|
#newton off for pair spin in SEQNEI
|
||||||
|
#newton off off
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
#######Create atoms########
|
#######Create atoms########
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
#Lattice constant of fcc Cobalt
|
#Lattice constant of fcc Cobalt
|
||||||
#lattice fcc 3.54
|
lattice fcc 3.54
|
||||||
lattice sc 2.50
|
#lattice sc 2.50
|
||||||
|
|
||||||
#Test Kagome
|
#Test Kagome
|
||||||
#variable a equal sqrt(3.0)
|
#variable a equal sqrt(3.0)/8.0
|
||||||
#variable d equal 1.0/(2.0*sqrt(3.0)+1)
|
#variable b equal 3.0*sqrt(3.0)/8.0
|
||||||
#variable p_1 equal $d*sqrt(3.0)
|
#variable c equal sqrt(3.0)/4.0
|
||||||
#variable p_2 equal $d*2.2*sqrt(3.0)
|
|
||||||
|
|
||||||
#lattice custom 1.0 a1 2.0 0.0 0.0 &
|
#lattice custom 2.5 a1 1.0 0.0 0.0 &
|
||||||
# a2 1.0 $a 0.0 &
|
# a2 0.0 1.0 0.0 &
|
||||||
# a3 0.0 0.0 1.0 &
|
# a3 0.0 0.0 1.0 &
|
||||||
# basis ${p_1} ${p_2} 0.0 &
|
# basis 0.0 $a 0.0 &
|
||||||
# basis ${p_2} ${p_2} 0.0 &
|
# basis 0.25 $a 0.0 &
|
||||||
# basis 0.5 0.0 0.0
|
# basis 0.375 0.0 0.0 &
|
||||||
|
# basis 0.25 $b 0.0 &
|
||||||
|
# basis 0.5 $b 0.0 &
|
||||||
|
# basis 0.625 $c 0.0
|
||||||
|
|
||||||
#Defining a geometric region of space. Sets ID(user's choice), style(block, sphere, ...), then, args depends on the style chosen
|
#Defining a geometric region of space. Sets ID(user's choice), style(block, sphere, ...), then, args depends on the style chosen
|
||||||
#(for block, one has x0, xf, y0, yf, z0, zf, in distance units)
|
#(for block, one has x0, xf, y0, yf, z0, zf, in distance units)
|
||||||
region box block 0.0 5.0 0.0 5.0 0.0 1.0
|
region box block 0.0 2.0 0.0 2.0 0.0 2.0
|
||||||
|
|
||||||
#Creating a simulation box based on the specified region. Entries: number of atom types and box ref.
|
#Creating a simulation box based on the specified region. Entries: number of atom types and box ref.
|
||||||
create_box 1 box
|
create_box 1 box
|
||||||
@ -65,27 +70,18 @@ create_atoms 1 box
|
|||||||
mass 1 1.0
|
mass 1 1.0
|
||||||
#set group all mass 1.0
|
#set group all mass 1.0
|
||||||
#Setting spins orientation and moment
|
#Setting spins orientation and moment
|
||||||
set group all spin/random 11 1.72
|
#set group all spin/random 11 1.72
|
||||||
#set group all spin 1.72 1.0 0.0 0.0
|
set group all spin 1.72 1.0 0.0 0.0
|
||||||
|
|
||||||
#Magnetic exchange interaction coefficient for bulk fcc Cobalt
|
#Magnetic exchange interaction coefficient for bulk fcc Cobalt
|
||||||
#pair_style pair/spin/exchange 4.0
|
|
||||||
#type i and j | J1 | J2 | J3
|
|
||||||
#pair_coeff * * 0.0446928 0.003496 1.4885
|
|
||||||
#pair_coeff * * 0.0 0.003496 1.4885
|
|
||||||
#pair_style pair/spin/dmi 4.0
|
|
||||||
# type i and j | DM (in eV) | Directions
|
|
||||||
#pair_coeff * * 0.001 0.0 0.0 1.0
|
|
||||||
#pair_style hybrid/overlay pair/spin/exchange 4.0 pair/spin/dmi 4.0
|
|
||||||
pair_style pair/spin 4.0
|
pair_style pair/spin 4.0
|
||||||
#type i and j | interaction type | cutoff | J1 | J2 | J3
|
#type i and j | interaction type | cutoff | J1 (eV) | J2 (adim) | J3 (Ang) (for Exchange)
|
||||||
pair_coeff * * exchange 4.0 0.0446928 0.003496 1.4885
|
pair_coeff * * exchange 4.0 0.0446928 0.003496 1.4885
|
||||||
pair_coeff * * dmi 2.6 0.01 1.0 0.0 0.0
|
#type i and j | interaction type | cutoff | Int (eV) | [dx,dy,dz] (for DMI and ME)
|
||||||
|
#pair_coeff * * dmi 2.6 0.01 1.0 0.0 0.0
|
||||||
#pair_coeff * * me 2.6 0.01 1.0 1.0 1.0
|
#pair_coeff * * me 2.6 0.01 1.0 1.0 1.0
|
||||||
|
|
||||||
|
#Define a skin distance, update neigh list every
|
||||||
#Fix Langevin spins (merging damping and temperature)
|
|
||||||
#Defines a cutof distance for the neighbors.
|
|
||||||
#neighbor 1.0 bin
|
#neighbor 1.0 bin
|
||||||
#neigh_modify every 10 check yes delay 20
|
#neigh_modify every 10 check yes delay 20
|
||||||
neighbor 0.0 bin
|
neighbor 0.0 bin
|
||||||
@ -93,13 +89,15 @@ neigh_modify every 1 check no delay 0
|
|||||||
|
|
||||||
#Magnetic field fix
|
#Magnetic field fix
|
||||||
#Type | Intensity (T or eV) | Direction
|
#Type | Intensity (T or eV) | Direction
|
||||||
fix 1 all force/spin zeeman 0.0 0.0 0.0 1.0
|
fix 1 all force/spin zeeman 10.0 0.0 0.0 1.0
|
||||||
#fix 1 all force/spin anisotropy 0.001 0.0 0.0 1.0
|
#fix 1 all force/spin anisotropy 0.001 0.0 0.0 1.0
|
||||||
|
#fix 1 all force/spin anisotropy -0.1 0.0 0.0 1.0
|
||||||
|
#fix 1 all force/spin anisotropy 0.1 0.0 1.0 0.0
|
||||||
|
|
||||||
#Fix Langevin spins (merging damping and temperature)
|
#Fix Langevin spins (merging damping and temperature)
|
||||||
#Temp | Alpha_trans | Alpha_long | Seed
|
#Temp | Alpha_trans | Alpha_long | Seed
|
||||||
fix 2 all langevin/spin 0.0 0.1 0.0 21
|
#fix 2 all langevin/spin 0.0 0.1 0.0 21
|
||||||
#fix 2 all langevin/spin 0.0 0.0 0.0 21
|
fix 2 all langevin/spin 0.0 0.0 0.0 21
|
||||||
|
|
||||||
#Magnetic integration fix
|
#Magnetic integration fix
|
||||||
fix 3 all nve/spin
|
fix 3 all nve/spin
|
||||||
@ -107,13 +105,13 @@ fix 3 all nve/spin
|
|||||||
#compute real time, total magnetization, magnetic energy, and spin temperature
|
#compute real time, total magnetization, magnetic energy, and spin temperature
|
||||||
#Iteration | Time | Mx | My | Mz | |M| | Em | Tm
|
#Iteration | Time | Mx | My | Mz | |M| | Em | Tm
|
||||||
compute mag all compute/spin
|
compute mag all compute/spin
|
||||||
fix outmag all ave/time 1 1 50 c_mag[1] c_mag[2] c_mag[3] c_mag[4] c_mag[5] c_mag[6] c_mag[7] file mag.dat
|
fix outmag all ave/time 1 1 50 c_mag[1] c_mag[2] c_mag[3] c_mag[4] c_mag[5] c_mag[6] c_mag[7] file mag_seqnei_test.dat
|
||||||
|
|
||||||
#Defining a computation that will be performed on a group of atoms.
|
#Defining a computation that will be performed on a group of atoms.
|
||||||
#Entries: ID(user assigned), group-ID(group of atoms to peform the sim on), style(temp, pe, ...), args
|
#Entries: ID(user assigned), group-ID(group of atoms to peform the sim on), style(temp, pe, ...), args
|
||||||
|
|
||||||
#Setting the timestep for the simulation
|
#Setting the timestep for the simulation
|
||||||
timestep 0.00005
|
timestep 0.00001
|
||||||
|
|
||||||
##################
|
##################
|
||||||
#######run########
|
#######run########
|
||||||
@ -123,6 +121,6 @@ timestep 0.00005
|
|||||||
dump 1 all custom 50 dump_spin.lammpstrj type x y z spx spy spz
|
dump 1 all custom 50 dump_spin.lammpstrj type x y z spx spy spz
|
||||||
|
|
||||||
#Running the simulations for N timesteps
|
#Running the simulations for N timesteps
|
||||||
run 60000
|
#run 200000
|
||||||
#run 10
|
run 1
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp)
|
|||||||
|
|
||||||
forceclearflag = 1;
|
forceclearflag = 1;
|
||||||
atom->mumag_flag = atom->sp_flag = 1;
|
atom->mumag_flag = atom->sp_flag = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
|
#include "memory.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace FixConst;
|
using namespace FixConst;
|
||||||
@ -60,9 +61,12 @@ FixForceSpin::FixForceSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, a
|
|||||||
Ka = 0.0;
|
Ka = 0.0;
|
||||||
Kax = Kay = Kaz = 0.0;
|
Kax = Kay = Kaz = 0.0;
|
||||||
|
|
||||||
|
zeeman_flag = aniso_flag = 0;
|
||||||
|
|
||||||
if (strcmp(arg[3],"zeeman") == 0) {
|
if (strcmp(arg[3],"zeeman") == 0) {
|
||||||
if (narg != 8) error->all(FLERR,"Illegal fix zeeman command");
|
if (narg != 8) error->all(FLERR,"Illegal fix zeeman command");
|
||||||
style = ZEEMAN;
|
style = ZEEMAN;
|
||||||
|
zeeman_flag = 1;
|
||||||
H_field = force->numeric(FLERR,arg[4]);
|
H_field = force->numeric(FLERR,arg[4]);
|
||||||
Hx = force->numeric(FLERR,arg[5]);
|
Hx = force->numeric(FLERR,arg[5]);
|
||||||
Hy = force->numeric(FLERR,arg[6]);
|
Hy = force->numeric(FLERR,arg[6]);
|
||||||
@ -71,6 +75,7 @@ FixForceSpin::FixForceSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, a
|
|||||||
} else if (strcmp(arg[3],"anisotropy") == 0) {
|
} else if (strcmp(arg[3],"anisotropy") == 0) {
|
||||||
if (narg != 8) error->all(FLERR,"Illegal fix anisotropy command");
|
if (narg != 8) error->all(FLERR,"Illegal fix anisotropy command");
|
||||||
style = ANISOTROPY;
|
style = ANISOTROPY;
|
||||||
|
aniso_flag = 1;
|
||||||
Ka = force->numeric(FLERR,arg[4]);
|
Ka = force->numeric(FLERR,arg[4]);
|
||||||
Kax = force->numeric(FLERR,arg[5]);
|
Kax = force->numeric(FLERR,arg[5]);
|
||||||
Kay = force->numeric(FLERR,arg[6]);
|
Kay = force->numeric(FLERR,arg[6]);
|
||||||
@ -88,6 +93,8 @@ FixForceSpin::FixForceSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, a
|
|||||||
|
|
||||||
FixForceSpin::~FixForceSpin()
|
FixForceSpin::~FixForceSpin()
|
||||||
{
|
{
|
||||||
|
memory->destroy(spi);
|
||||||
|
memory->destroy(fmi);
|
||||||
delete [] magstr;
|
delete [] magstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,6 +141,9 @@ void FixForceSpin::init()
|
|||||||
// set magnetic field components once and for all
|
// set magnetic field components once and for all
|
||||||
if (varflag == CONSTANT) set_magneticforce();
|
if (varflag == CONSTANT) set_magneticforce();
|
||||||
|
|
||||||
|
memory->create(spi,3,"forcespin:spi");
|
||||||
|
memory->create(fmi,3,"forcespin:fmi");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -160,7 +170,7 @@ void FixForceSpin::post_force(int vflag)
|
|||||||
set_magneticforce(); //Update value of the mag. field if time-dependent
|
set_magneticforce(); //Update value of the mag. field if time-dependent
|
||||||
}
|
}
|
||||||
|
|
||||||
double **x = atom->x;
|
// double **x = atom->x;
|
||||||
double **sp = atom->sp;
|
double **sp = atom->sp;
|
||||||
double *mumag = atom->mumag;
|
double *mumag = atom->mumag;
|
||||||
double **fm = atom->fm;
|
double **fm = atom->fm;
|
||||||
@ -170,21 +180,41 @@ void FixForceSpin::post_force(int vflag)
|
|||||||
eflag = 0;
|
eflag = 0;
|
||||||
emag = 0.0;
|
emag = 0.0;
|
||||||
|
|
||||||
if (style == ZEEMAN) {
|
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
fm[i][0] += mumag[i]*xmag;
|
fmi[0] = fmi[1] = fmi[2] = 0.0;
|
||||||
fm[i][1] += mumag[i]*ymag;
|
//if (style == ZEEMAN) {
|
||||||
fm[i][2] += mumag[i]*zmag;
|
if (zeeman_flag) {
|
||||||
|
compute_zeeman(i,fmi);
|
||||||
|
}
|
||||||
|
//if (style == ANISOTROPY) {
|
||||||
|
if (aniso_flag) {
|
||||||
|
spi[0] = sp[i][0];
|
||||||
|
spi[1] = sp[i][1];
|
||||||
|
spi[2] = sp[i][2];
|
||||||
|
compute_anisotropy(i,spi,fmi);
|
||||||
|
}
|
||||||
|
fm[i][0] += fmi[0];
|
||||||
|
fm[i][1] += fmi[1];
|
||||||
|
fm[i][2] += fmi[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (style == ANISOTROPY) {
|
|
||||||
for (int i = 0; i < nlocal; i++) {
|
|
||||||
scalar = Kax*sp[i][0] + Kay*sp[i][1] + Kaz*sp[i][2];
|
/* ---------------------------------------------------------------------- */
|
||||||
fm[i][0] += scalar*xmag;
|
void FixForceSpin::compute_zeeman(int i, double *fmi)
|
||||||
fm[i][1] += scalar*ymag;
|
{
|
||||||
fm[i][2] += scalar*zmag;
|
double *mumag = atom->mumag;
|
||||||
}
|
fmi[0] += mumag[i]*xmag;
|
||||||
|
fmi[1] += mumag[i]*ymag;
|
||||||
|
fmi[2] += mumag[i]*zmag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FixForceSpin::compute_anisotropy(int i, double * spi, double *fmi)
|
||||||
|
{
|
||||||
|
double scalar = Kax*spi[0] + Kay*spi[1] + Kaz*spi[2];
|
||||||
|
fmi[0] += scalar*xmag;
|
||||||
|
fmi[1] += scalar*ymag;
|
||||||
|
fmi[2] += scalar*zmag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -37,6 +37,10 @@ class FixForceSpin : public Fix {
|
|||||||
virtual void post_force_respa(int, int, int);
|
virtual void post_force_respa(int, int, int);
|
||||||
double compute_scalar();
|
double compute_scalar();
|
||||||
|
|
||||||
|
int zeeman_flag, aniso_flag;
|
||||||
|
void compute_zeeman(int, double *);
|
||||||
|
void compute_anisotropy(int, double *, double *);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int style;
|
int style;
|
||||||
|
|
||||||
@ -58,6 +62,8 @@ class FixForceSpin : public Fix {
|
|||||||
double Ka; //Magnetic anisotropy intensity and direction
|
double Ka; //Magnetic anisotropy intensity and direction
|
||||||
double Kax, Kay, Kaz;
|
double Kax, Kay, Kaz;
|
||||||
|
|
||||||
|
double *spi, *fmi; //Temp var. in compute
|
||||||
|
|
||||||
void set_magneticforce();
|
void set_magneticforce();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -26,8 +26,15 @@
|
|||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
|
||||||
|
//Add headers (see delete later)
|
||||||
#include "pair.h"
|
#include "pair.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "integrate.h"
|
||||||
|
#include "neighbor.h"
|
||||||
|
#include "neigh_list.h"
|
||||||
|
#include "pair_spin.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "fix_force_spin.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace FixConst;
|
using namespace FixConst;
|
||||||
@ -58,6 +65,23 @@ FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (extra == SPIN && !atom->mumag_flag)
|
if (extra == SPIN && !atom->mumag_flag)
|
||||||
error->all(FLERR,"Fix nve/spin requires spin attribute mumag");
|
error->all(FLERR,"Fix nve/spin requires spin attribute mumag");
|
||||||
|
|
||||||
|
#if defined SEQNEI
|
||||||
|
lockpairspin = NULL;
|
||||||
|
lockforcespin = NULL;
|
||||||
|
exch_flag = dmi_flag = me_flag = 0;
|
||||||
|
zeeman_flag = aniso_flag = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
FixNVESpin::~FixNVESpin(){
|
||||||
|
#if defined SEQNEI
|
||||||
|
//delete lockpairspin;
|
||||||
|
//delete lockforcespin;
|
||||||
|
memory->destroy(spi);
|
||||||
|
memory->destroy(fmi);
|
||||||
|
memory->destroy(fmj);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -68,6 +92,26 @@ void FixNVESpin::init()
|
|||||||
|
|
||||||
dts = update->dt;
|
dts = update->dt;
|
||||||
|
|
||||||
|
#if defined SEQNEI
|
||||||
|
lockpairspin = (PairSpin *) force->pair;
|
||||||
|
|
||||||
|
memory->create(spi,3,"nves:spi");
|
||||||
|
memory->create(fmi,3,"nves:fmi");
|
||||||
|
memory->create(fmj,3,"nves:fmj");
|
||||||
|
|
||||||
|
int iforce;
|
||||||
|
for (iforce = 0; iforce < modify->nfix; iforce++)
|
||||||
|
if (strstr(modify->fix[iforce]->style,"force/spin")) break;
|
||||||
|
lockforcespin = (FixForceSpin *) modify->fix[iforce];
|
||||||
|
|
||||||
|
exch_flag = lockpairspin->exch_flag;
|
||||||
|
dmi_flag = lockpairspin->dmi_flag;
|
||||||
|
me_flag = lockpairspin->me_flag;
|
||||||
|
|
||||||
|
zeeman_flag = lockforcespin->zeeman_flag;
|
||||||
|
aniso_flag = lockforcespin->aniso_flag;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*int idamp;
|
/*int idamp;
|
||||||
for (idamp = 0; idamp < modify->nfix; idamp++)
|
for (idamp = 0; idamp < modify->nfix; idamp++)
|
||||||
if (strstr(modify->fix[idamp]->style,"damping/spin")) break;
|
if (strstr(modify->fix[idamp]->style,"damping/spin")) break;
|
||||||
@ -101,9 +145,18 @@ void FixNVESpin::initial_integrate(int vflag)
|
|||||||
// Advance half spins all particles
|
// Advance half spins all particles
|
||||||
//See Omelyan et al., PRL 86, 2001 and P.W. Ma et al, PRB 83, 2011
|
//See Omelyan et al., PRL 86, 2001 and P.W. Ma et al, PRB 83, 2011
|
||||||
if (extra == SPIN) {
|
if (extra == SPIN) {
|
||||||
|
#if defined SEQNEI
|
||||||
for (int i = 0; i < nlocal; i++){
|
for (int i = 0; i < nlocal; i++){
|
||||||
|
ComputeSpinInteractionsNei(i);
|
||||||
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined SEQ
|
||||||
|
for (int i = 0; i < nlocal; i++){
|
||||||
|
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
||||||
|
ComputeSpinInteractions();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// update half v all particles
|
// update half v all particles
|
||||||
@ -125,18 +178,293 @@ void FixNVESpin::initial_integrate(int vflag)
|
|||||||
x[i][2] += 0.5 * dtv * v[i][2];
|
x[i][2] += 0.5 * dtv * v[i][2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define FORCE_PRINT
|
|
||||||
#if defined FORCE_PRINT
|
|
||||||
FILE* file_force=NULL;
|
|
||||||
file_force=fopen("spin_force_Lammps.dat","a");
|
|
||||||
fprintf(file_force,"---------------------------------- \n");
|
|
||||||
for(int i=0;i<nlocal;i++){
|
|
||||||
fprintf(file_force,"%d %lf %lf %lf \n",i,fm[i][0],fm[i][1],fm[i][2]);
|
|
||||||
}
|
}
|
||||||
if (file_force!=NULL) fclose(file_force);
|
|
||||||
|
#if defined SEQNEI
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void FixNVESpin::ComputeSpinInteractionsNei(int ii)
|
||||||
|
{
|
||||||
|
int nflag,sortflag;
|
||||||
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
|
int n_post_integrate = modify->n_post_integrate;
|
||||||
|
int n_pre_exchange = modify->n_pre_exchange;
|
||||||
|
int n_pre_neighbor = modify->n_pre_neighbor;
|
||||||
|
int n_pre_force = modify->n_pre_force;
|
||||||
|
int n_pre_reverse = modify->n_pre_reverse;
|
||||||
|
int n_post_force = modify->n_post_force;
|
||||||
|
int n_end_of_step = modify->n_end_of_step;
|
||||||
|
|
||||||
|
bigint ntimestep;
|
||||||
|
ntimestep = update->ntimestep;
|
||||||
|
|
||||||
|
//Force compute quantities
|
||||||
|
int i,j,jj,inum,jnum,itype,jtype;
|
||||||
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||||
|
double **x = atom->x;
|
||||||
|
double **sp = atom->sp;
|
||||||
|
double **fm = atom->fm;
|
||||||
|
int *type = atom->type;
|
||||||
|
int newton_pair = force->newton_pair;
|
||||||
|
|
||||||
|
inum = lockpairspin->list->inum;
|
||||||
|
ilist = lockpairspin->list->ilist;
|
||||||
|
numneigh = lockpairspin->list->numneigh;
|
||||||
|
firstneigh = lockpairspin->list->firstneigh;
|
||||||
|
|
||||||
|
double xtmp,ytmp,ztmp;
|
||||||
|
double rsq,rd,delx,dely,delz;
|
||||||
|
double cut_ex_2, cut_dmi_2, cut_me_2;
|
||||||
|
cut_ex_2 = cut_dmi_2 = cut_me_2 = 0.0;
|
||||||
|
|
||||||
|
int eflag = 1;
|
||||||
|
int vflag = 0;
|
||||||
|
int pair_compute_flag = 1;
|
||||||
|
|
||||||
|
if (atom->sortfreq > 0) sortflag = 1;
|
||||||
|
else sortflag = 0;
|
||||||
|
if (n_post_integrate) modify->post_integrate();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
|
||||||
|
// regular communication vs neighbor list rebuild
|
||||||
|
nflag = neighbor->decide();
|
||||||
|
if (nflag == 0) {
|
||||||
|
timer->stamp();
|
||||||
|
comm->forward_comm();
|
||||||
|
timer->stamp(Timer::COMM);
|
||||||
|
} else {
|
||||||
|
if (n_pre_exchange) {
|
||||||
|
timer->stamp();
|
||||||
|
modify->pre_exchange();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
//if (triclinic) domain->x2lamda(atom->nlocal);
|
||||||
|
domain->pbc();
|
||||||
|
if (domain->box_change) {
|
||||||
|
domain->reset_box();
|
||||||
|
comm->setup();
|
||||||
|
if (neighbor->style) neighbor->setup_bins();
|
||||||
|
}
|
||||||
|
timer->stamp();
|
||||||
|
comm->exchange();
|
||||||
|
if (sortflag && ntimestep >= atom->nextsort) atom->sort();
|
||||||
|
comm->borders();
|
||||||
|
//if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||||
|
timer->stamp(Timer::COMM);
|
||||||
|
if (n_pre_neighbor) {
|
||||||
|
modify->pre_neighbor();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
neighbor->build();
|
||||||
|
timer->stamp(Timer::NEIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////Force computation for spin i/////////////
|
||||||
|
i = ilist[ii];
|
||||||
|
//Clear atom i
|
||||||
|
fm[i][0] = fm[i][1] = fm[i][2] = 0.0;
|
||||||
|
|
||||||
|
timer->stamp();
|
||||||
|
|
||||||
|
xtmp = x[i][0];
|
||||||
|
ytmp = x[i][1];
|
||||||
|
ztmp = x[i][2];
|
||||||
|
fmi[0] = fmi[1] = fmi[2] = 0.0;
|
||||||
|
fmj[0] = fmj[1] = fmj[2] = 0.0;
|
||||||
|
jlist = firstneigh[i];
|
||||||
|
jnum = numneigh[i];
|
||||||
|
|
||||||
|
// printf("Test inum: %g \n",inum);
|
||||||
|
/*
|
||||||
|
//Pair interaction
|
||||||
|
for (int jj = 0; jj < inum; jj++) {
|
||||||
|
j = jlist[jj];
|
||||||
|
j &= NEIGHMASK;
|
||||||
|
|
||||||
|
delx = xtmp - x[j][0];
|
||||||
|
dely = ytmp - x[j][1];
|
||||||
|
delz = ztmp - x[j][2];
|
||||||
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
|
itype = type[ii];
|
||||||
|
jtype = type[j];
|
||||||
|
|
||||||
|
if (exch_flag) {
|
||||||
|
cut_ex_2 = (lockpairspin->cut_spin_exchange[itype][jtype])*(lockpairspin->cut_spin_exchange[itype][jtype]);
|
||||||
|
if (rsq <= cut_ex_2) {
|
||||||
|
lockpairspin->compute_exchange(i,j,rsq,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmi_flag) {
|
||||||
|
cut_dmi_2 = (lockpairspin->cut_spin_dmi[itype][jtype])*(lockpairspin->cut_spin_dmi[itype][jtype]);
|
||||||
|
if (rsq <= cut_dmi_2) {
|
||||||
|
lockpairspin->compute_dmi(i,j,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (me_flag) {
|
||||||
|
cut_me_2 = (lockpairspin->cut_spin_me[itype][jtype])*(lockpairspin->cut_spin_me[itype][jtype]);
|
||||||
|
if (rsq <= cut_me_2) {
|
||||||
|
lockpairspin->compute_me(i,j,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
//Pair interaction
|
||||||
|
int natom = nlocal + atom->nghost;
|
||||||
|
for (int k = 0; k < natom; k++) {
|
||||||
|
delx = xtmp - x[k][0];
|
||||||
|
dely = ytmp - x[k][1];
|
||||||
|
delz = ztmp - x[k][2];
|
||||||
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
|
itype = type[ii];
|
||||||
|
jtype = type[k];
|
||||||
|
|
||||||
|
if (exch_flag) {
|
||||||
|
cut_ex_2 = (lockpairspin->cut_spin_exchange[itype][jtype])*(lockpairspin->cut_spin_exchange[itype][jtype]);
|
||||||
|
if (rsq <= cut_ex_2) {
|
||||||
|
lockpairspin->compute_exchange(i,k,rsq,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmi_flag) {
|
||||||
|
cut_dmi_2 = (lockpairspin->cut_spin_dmi[itype][jtype])*(lockpairspin->cut_spin_dmi[itype][jtype]);
|
||||||
|
if (rsq <= cut_dmi_2) {
|
||||||
|
lockpairspin->compute_dmi(i,k,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (me_flag) {
|
||||||
|
cut_me_2 = (lockpairspin->cut_spin_me[itype][jtype])*(lockpairspin->cut_spin_me[itype][jtype]);
|
||||||
|
if (rsq <= cut_me_2) {
|
||||||
|
lockpairspin->compute_me(i,k,fmi,fmj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//post force
|
||||||
|
if (zeeman_flag) {
|
||||||
|
lockforcespin->compute_zeeman(i,fmi);
|
||||||
|
}
|
||||||
|
if (aniso_flag) {
|
||||||
|
spi[0] = sp[i][0];
|
||||||
|
spi[1] = sp[i][1];
|
||||||
|
spi[2] = sp[i][2];
|
||||||
|
lockforcespin->compute_anisotropy(i,spi,fmi);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Replace the force by its new value
|
||||||
|
fm[i][0] = fmi[0];
|
||||||
|
fm[i][1] = fmi[1];
|
||||||
|
fm[i][2] = fmi[2];
|
||||||
|
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void FixNVESpin::ComputeSpinInteractions()
|
||||||
|
{
|
||||||
|
int nflag,sortflag;
|
||||||
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
|
int n_post_integrate = modify->n_post_integrate;
|
||||||
|
int n_pre_exchange = modify->n_pre_exchange;
|
||||||
|
int n_pre_neighbor = modify->n_pre_neighbor;
|
||||||
|
int n_pre_force = modify->n_pre_force;
|
||||||
|
int n_pre_reverse = modify->n_pre_reverse;
|
||||||
|
int n_post_force = modify->n_post_force;
|
||||||
|
int n_end_of_step = modify->n_end_of_step;
|
||||||
|
|
||||||
|
bigint ntimestep;
|
||||||
|
ntimestep = update->ntimestep;
|
||||||
|
|
||||||
|
//int eflag = update->integrate->eflag;
|
||||||
|
//int vflag = update->integrate->vflag;
|
||||||
|
int eflag = 1;
|
||||||
|
int vflag = 0;
|
||||||
|
int pair_compute_flag = 1;
|
||||||
|
|
||||||
|
if (atom->sortfreq > 0) sortflag = 1;
|
||||||
|
else sortflag = 0;
|
||||||
|
if (n_post_integrate) modify->post_integrate();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
|
||||||
|
// regular communication vs neighbor list rebuild
|
||||||
|
nflag = neighbor->decide();
|
||||||
|
if (nflag == 0) {
|
||||||
|
timer->stamp();
|
||||||
|
comm->forward_comm();
|
||||||
|
timer->stamp(Timer::COMM);
|
||||||
|
} else {
|
||||||
|
if (n_pre_exchange) {
|
||||||
|
timer->stamp();
|
||||||
|
modify->pre_exchange();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
//if (triclinic) domain->x2lamda(atom->nlocal);
|
||||||
|
domain->pbc();
|
||||||
|
if (domain->box_change) {
|
||||||
|
domain->reset_box();
|
||||||
|
comm->setup();
|
||||||
|
if (neighbor->style) neighbor->setup_bins();
|
||||||
|
}
|
||||||
|
timer->stamp();
|
||||||
|
comm->exchange();
|
||||||
|
if (sortflag && ntimestep >= atom->nextsort) atom->sort();
|
||||||
|
comm->borders();
|
||||||
|
//if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||||
|
timer->stamp(Timer::COMM);
|
||||||
|
if (n_pre_neighbor) {
|
||||||
|
modify->pre_neighbor();
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
neighbor->build();
|
||||||
|
timer->stamp(Timer::NEIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
// force computations
|
||||||
|
// important for pair to come before bonded contributions
|
||||||
|
// since some bonded potentials tally pairwise energy/virial
|
||||||
|
// and Pair:ev_tally() needs to be called before any tallying
|
||||||
|
|
||||||
|
size_t nbytes;
|
||||||
|
nbytes = sizeof(double) * nlocal;
|
||||||
|
if (force->newton) nbytes += sizeof(double) * atom->nghost;
|
||||||
|
|
||||||
|
atom->avec->force_clear(0,nbytes);
|
||||||
|
|
||||||
|
timer->stamp();
|
||||||
|
|
||||||
|
if (n_pre_force) {
|
||||||
|
modify->pre_force(vflag);
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pair_compute_flag) {
|
||||||
|
force->pair->compute(eflag,vflag);
|
||||||
|
timer->stamp(Timer::PAIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (kspace_compute_flag) {
|
||||||
|
force->kspace->compute(eflag,vflag);
|
||||||
|
timer->stamp(Timer::KSPACE);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (n_pre_reverse) {
|
||||||
|
modify->pre_reverse(eflag,vflag);
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reverse communication of forces
|
||||||
|
|
||||||
|
if (force->newton) {
|
||||||
|
comm->reverse_comm();
|
||||||
|
timer->stamp(Timer::COMM);
|
||||||
|
}
|
||||||
|
|
||||||
|
// force modifications
|
||||||
|
|
||||||
|
if (n_post_force) modify->post_force(vflag);
|
||||||
|
timer->stamp(Timer::MODIFY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -218,8 +546,17 @@ void FixNVESpin::final_integrate()
|
|||||||
// Advance half spins all particles
|
// Advance half spins all particles
|
||||||
//See Omelyan et al., PRL 86, 2001 and P.W. Ma et al, PRB 83, 2011
|
//See Omelyan et al., PRL 86, 2001 and P.W. Ma et al, PRB 83, 2011
|
||||||
if (extra == SPIN) {
|
if (extra == SPIN) {
|
||||||
for (int i = 0; i < nlocal; i++){
|
#if defined SEQNEI
|
||||||
|
for (int i = nlocal-1; i >= 0; i--){
|
||||||
|
ComputeSpinInteractionsNei(i);
|
||||||
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if defined SEQ
|
||||||
|
for (int i = nlocal-1; i >= 0; i--){
|
||||||
|
AdvanceSingleSpin(i,0.5*dts,sp,fm);
|
||||||
|
ComputeSpinInteractions();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,24 +25,34 @@ FixStyle(nve/spin,FixNVESpin)
|
|||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class FixNVESpin : public FixNVE {
|
class FixNVESpin : public FixNVE {
|
||||||
friend class FixSpinDamping;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FixNVESpin(class LAMMPS *, int, char **);
|
FixNVESpin(class LAMMPS *, int, char **);
|
||||||
virtual ~FixNVESpin() {}
|
virtual ~FixNVESpin();
|
||||||
void init();
|
void init();
|
||||||
virtual void initial_integrate(int);
|
virtual void initial_integrate(int);
|
||||||
void AdvanceSingleSpin(int, double, double **, double **);
|
void AdvanceSingleSpin(int, double, double **, double **);
|
||||||
virtual void final_integrate();
|
virtual void final_integrate();
|
||||||
|
|
||||||
//Sorting atoms/spins routine
|
//#define SEQ
|
||||||
void SortSpins();
|
#define SEQNEI
|
||||||
|
void ComputeSpinInteractions();
|
||||||
|
void ComputeSpinInteractionsNei(int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int extra;
|
int extra;
|
||||||
double dts;
|
double dts;
|
||||||
//double alpha_t;
|
//double alpha_t;
|
||||||
|
|
||||||
|
#if defined SEQNEI
|
||||||
|
private:
|
||||||
|
int exch_flag, dmi_flag, me_flag;
|
||||||
|
int zeeman_flag, aniso_flag;
|
||||||
|
class PairSpin *lockpairspin;
|
||||||
|
double *spi, *fmi, *fmj; //Temp var. for compute
|
||||||
|
class FixForceSpin *lockforcespin;
|
||||||
|
#endif
|
||||||
|
|
||||||
//private:
|
//private:
|
||||||
//class FixSpinDamping *lockspindamping;
|
//class FixSpinDamping *lockspindamping;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -25,6 +25,9 @@
|
|||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
//Add. lib. for full neighb. list
|
||||||
|
#include "neigh_request.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace MathConst;
|
using namespace MathConst;
|
||||||
|
|
||||||
@ -35,6 +38,8 @@ PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp)
|
|||||||
single_enable = 0;
|
single_enable = 0;
|
||||||
exch_flag = 0;
|
exch_flag = 0;
|
||||||
dmi_flag = 0;
|
dmi_flag = 0;
|
||||||
|
me_flag = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -76,7 +81,7 @@ void PairSpin::compute(int eflag, int vflag)
|
|||||||
double evdwl,ecoul;
|
double evdwl,ecoul;
|
||||||
double xtmp,ytmp,ztmp;
|
double xtmp,ytmp,ztmp;
|
||||||
double fmix,fmiy,fmiz,fmjx,fmjy,fmjz;
|
double fmix,fmiy,fmiz,fmjx,fmjy,fmjz;
|
||||||
double cut_ex,cut_dmi,cut_me;
|
double cut_ex_2,cut_dmi_2,cut_me_2;
|
||||||
double rsq,rd,delx,dely,delz;
|
double rsq,rd,delx,dely,delz;
|
||||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||||
|
|
||||||
@ -120,28 +125,27 @@ void PairSpin::compute(int eflag, int vflag)
|
|||||||
dely = ytmp - x[j][1];
|
dely = ytmp - x[j][1];
|
||||||
delz = ztmp - x[j][2];
|
delz = ztmp - x[j][2];
|
||||||
rsq = delx*delx + dely*dely + delz*delz; //square or inter-atomic distance
|
rsq = delx*delx + dely*dely + delz*delz; //square or inter-atomic distance
|
||||||
rd = sqrt(rsq); //Inter-atomic distance
|
|
||||||
itype = type[i];
|
itype = type[i];
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
//Exchange interaction
|
//Exchange interaction
|
||||||
if (exch_flag) {
|
if (exch_flag) {
|
||||||
cut_ex = cut_spin_exchange[itype][jtype];
|
cut_ex_2 = cut_spin_exchange[itype][jtype]*cut_spin_exchange[itype][jtype];
|
||||||
if (rd <= cut_ex) {
|
if (rsq <= cut_ex_2) {
|
||||||
compute_exchange(i,j,rsq,fmi,fmj);
|
compute_exchange(i,j,rsq,fmi,fmj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//DM interaction
|
//DM interaction
|
||||||
if (dmi_flag){
|
if (dmi_flag){
|
||||||
cut_dmi = cut_spin_dmi[itype][jtype];
|
cut_dmi_2 = cut_spin_dmi[itype][jtype]*cut_spin_dmi[itype][jtype];
|
||||||
if (rd <= cut_dmi){
|
if (rsq <= cut_dmi_2){
|
||||||
compute_dmi(i,j,fmi,fmj);
|
compute_dmi(i,j,fmi,fmj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//ME interaction
|
//ME interaction
|
||||||
if (me_flag){
|
if (me_flag){
|
||||||
cut_me = cut_spin_me[itype][jtype];
|
cut_me_2 = cut_spin_me[itype][jtype]*cut_spin_me[itype][jtype];
|
||||||
if (rd <= cut_me){
|
if (rsq <= cut_me_2){
|
||||||
compute_me(i,j,fmi,fmj);
|
compute_me(i,j,fmi,fmj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +166,7 @@ void PairSpin::compute(int eflag, int vflag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
inline void PairSpin::compute_exchange(int i, int j, double rsq, double *fmi, double *fmj)
|
void PairSpin::compute_exchange(int i, int j, double rsq, double *fmi, double *fmj)
|
||||||
{
|
{
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int itype, jtype;
|
int itype, jtype;
|
||||||
@ -188,9 +192,8 @@ inline void PairSpin::compute_exchange(int i, int j, double rsq, double *fmi, d
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
inline void PairSpin::compute_dmi(int i, int j, double *fmi, double *fmj)
|
void PairSpin::compute_dmi(int i, int j, double *fmi, double *fmj)
|
||||||
{
|
{
|
||||||
|
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int itype, jtype;
|
int itype, jtype;
|
||||||
double **sp = atom->sp;
|
double **sp = atom->sp;
|
||||||
@ -212,7 +215,7 @@ inline void PairSpin::compute_dmi(int i, int j, double *fmi, double *fmj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
inline void PairSpin::compute_me(int i, int j, double *fmi, double *fmj)
|
void PairSpin::compute_me(int i, int j, double *fmi, double *fmj)
|
||||||
{
|
{
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int itype, jtype;
|
int itype, jtype;
|
||||||
@ -247,8 +250,6 @@ inline void PairSpin::compute_me(int i, int j, double *fmi, double *fmj)
|
|||||||
fmj[1] -= sp[i][2]*meix - sp[i][0]*meiz;
|
fmj[1] -= sp[i][2]*meix - sp[i][0]*meiz;
|
||||||
fmj[2] -= sp[i][0]*meiy - sp[i][1]*meix;
|
fmj[2] -= sp[i][0]*meiy - sp[i][1]*meix;
|
||||||
|
|
||||||
// printf("test val fmi=%g, fmj=%g \n",fmi[2],fmj[2]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -312,6 +313,7 @@ void PairSpin::settings(int narg, char **arg)
|
|||||||
if (setflag[i][j]) {
|
if (setflag[i][j]) {
|
||||||
cut_spin_exchange[i][j] = cut_spin_pair_global;
|
cut_spin_exchange[i][j] = cut_spin_pair_global;
|
||||||
cut_spin_dmi[i][j] = cut_spin_pair_global;
|
cut_spin_dmi[i][j] = cut_spin_pair_global;
|
||||||
|
cut_spin_me[i][j] = cut_spin_pair_global;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,6 +440,13 @@ void PairSpin::init_style()
|
|||||||
error->all(FLERR,"Pair spin requires atom attributes sp, mumag");
|
error->all(FLERR,"Pair spin requires atom attributes sp, mumag");
|
||||||
|
|
||||||
neighbor->request(this,instance_me);
|
neighbor->request(this,instance_me);
|
||||||
|
|
||||||
|
#define FULLNEI
|
||||||
|
#if defined FULLNEI
|
||||||
|
int irequest = neighbor->request(this,instance_me);
|
||||||
|
neighbor->requests[irequest]->half = 0;
|
||||||
|
neighbor->requests[irequest]->full = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -39,11 +39,12 @@ class PairSpin : public Pair {
|
|||||||
void write_restart_settings(FILE *);
|
void write_restart_settings(FILE *);
|
||||||
void read_restart_settings(FILE *);
|
void read_restart_settings(FILE *);
|
||||||
|
|
||||||
inline void compute_exchange(int, int, double, double *, double *);
|
void compute_exchange(int, int, double, double *, double *);
|
||||||
inline void compute_dmi(int, int, double *, double *);
|
void compute_dmi(int, int, double *, double *);
|
||||||
inline void compute_me(int, int, double *, double *);
|
void compute_me(int, int, double *, double *);
|
||||||
|
|
||||||
protected:
|
//Test for seq. integ.
|
||||||
|
//protected:
|
||||||
int exch_flag,dmi_flag,me_flag;
|
int exch_flag,dmi_flag,me_flag;
|
||||||
double cut_spin_pair_global;
|
double cut_spin_pair_global;
|
||||||
double cut_spin_dipolar_global;
|
double cut_spin_dipolar_global;
|
||||||
@ -52,6 +53,8 @@ class PairSpin : public Pair {
|
|||||||
double **cut_spin_dmi; //cutting distance dmi
|
double **cut_spin_dmi; //cutting distance dmi
|
||||||
double **cut_spin_me; //cutting distance me
|
double **cut_spin_me; //cutting distance me
|
||||||
|
|
||||||
|
//Test for seq. integ.
|
||||||
|
protected:
|
||||||
double **J_1, **J_2, **J_3; //exchange coeffs Jij
|
double **J_1, **J_2, **J_3; //exchange coeffs Jij
|
||||||
//J1 in eV, J2 adim and J3 in Ang
|
//J1 in eV, J2 adim and J3 in Ang
|
||||||
double **DM;
|
double **DM;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
eoundary p f f
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
http://lammps.sandia.gov, Sandia National Laboratories
|
http://lammps.sandia.gov, Sandia National Laboratories
|
||||||
Steve Plimpton, sjplimp@sandia.gov
|
Steve Plimpton, sjplimp@sandia.gov
|
||||||
|
|||||||
Reference in New Issue
Block a user