Changes for coupling magnetomech:

- hybrid_overlay friend with fix_nve_spin
- modif of the allocation of pair classes in fix_nve_spin
- modif input file for hybrid/overlay eam - spin/pair
- new file for cobalt eam potentials
This commit is contained in:
julient31 2017-08-23 11:22:31 -06:00
parent 45ea7b3cc7
commit f5ff30df83
9 changed files with 6296 additions and 38 deletions

6006
Co_PurjaPun_2012.eam.alloy Normal file

File diff suppressed because it is too large Load Diff

126
examples/SPIN/in.kagome Normal file
View File

@ -0,0 +1,126 @@
###################
#######Init########
###################
clear
#setting units to metal (Ang, picosecs, eV, ...):
units metal
#setting dimension of the system (N=2 or 3):
dimension 3
#setting boundary conditions. (p for periodic, f for fixed, ...)
boundary p p p
#boundary f f f
#setting atom_style to spin:
atom_style spin
#Define sort for paramagnetic simulations (if no pair interaction)
#atom_modify sort 1000 4.0
#why?
atom_modify map array
#newton off for pair spin in SEQNEI
#newton off off
###########################
#######Create atoms########
###########################
#Lattice constant of fcc Cobalt
lattice fcc 3.54
#lattice sc 2.50
#Test Kagome
#variable a equal sqrt(3.0)/8.0
#variable b equal 3.0*sqrt(3.0)/8.0
#variable c equal sqrt(3.0)/4.0
#lattice custom 2.5 a1 1.0 0.0 0.0 &
# a2 0.0 1.0 0.0 &
# a3 0.0 0.0 1.0 &
# basis 0.0 $a 0.0 &
# basis 0.25 $a 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
#(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 5.0
#Creating a simulation box based on the specified region. Entries: number of atom types and box ref.
create_box 1 box
#Creating atoms (or molecules) on a lattice, or a single atom (or molecule), ...
#Entries: atom type,
create_atoms 1 box
#Replicating NxNxN the entire set of atoms
#replicate 1 1 1
#######################
#######Settings########
#######################
#Setting one or more properties of one or more atoms.
#Setting mass
mass 1 1.0
#set group all mass 1.0
#Setting spins orientation and moment
#set group all spin/random 11 1.72
set group all spin 1.72 1.0 0.0 0.0
#Magnetic exchange interaction coefficient for bulk fcc Cobalt
pair_style pair/spin 4.0
#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
#type i and j | interaction type | cutoff | Int (eV) | [dx,dy,dz] (for DMI and ME)
#pair_coeff * * dmi 2.6 0.001 0.0 0.0 1.0
#pair_coeff * * me 2.6 0.01 1.0 1.0 1.0
#Define a skin distance, update neigh list every
#neighbor 1.0 bin
#neigh_modify every 10 check yes delay 20
neighbor 0.0 bin
neigh_modify every 1 check no delay 0
#Magnetic field fix
#Type | Intensity (T or eV) | Direction
fix 1 all force/spin zeeman 1.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.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)
#Temp | Alpha_trans | Alpha_long | Seed
#fix 2 all langevin/spin 0.0 0.1 0.0 21
fix 2 all langevin/spin 1.0 0.1 0.0 21
#fix 2 all langevin/spin 0.0 0.0 0.0 21
#Magnetic integration fix
fix 3 all nve/spin mpi
#compute real time, total magnetization, magnetic energy, and spin temperature
#Iteration | Time | Mx | My | Mz | |M| | Em | Tm
compute mag all compute/spin
fix outmag all ave/time 1 1 10 c_mag[1] c_mag[2] c_mag[3] c_mag[4] c_mag[5] c_mag[6] c_mag[7] file mag_Co_nodamp.dat format %20.16g
#Setting the timestep for the simulation (in ps)
timestep 0.0001
##################
#######run########
##################
#Dump the positions and spin directions of magnetic particles (vmd format)
dump 1 all custom 100 dump_spin_T100.lammpstrj type x y z spx spy spz
#Running the simulations for N timesteps
run 2000
#run 1

111
in.co_magnetomech Normal file
View File

@ -0,0 +1,111 @@
###################
#######Init########
###################
clear
#setting units to metal (Ang, picosecs, eV, ...):
units metal
#setting dimension of the system (N=2 or 3):
dimension 3
#setting boundary conditions. (p for periodic, f for fixed, ...)
boundary p p p
#boundary f f f
#setting atom_style to spin:
atom_style spin
#Define sort for paramagnetic simulations (if no pair interaction)
#atom_modify sort 1000 4.0
#why?
atom_modify map array
#newton off for pair spin in SEQNEI
#newton off off
###########################
#######Create atoms########
###########################
#Lattice constant of fcc Cobalt
lattice fcc 3.54
#lattice sc 2.50
#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)
region box block 0.0 5.0 0.0 5.0 0.0 5.0
#Creating a simulation box based on the specified region. Entries: number of atom types and box ref.
create_box 1 box
#Creating atoms (or molecules) on a lattice, or a single atom (or molecule), ...
#Entries: atom type,
create_atoms 1 box
#######################
#######Settings########
#######################
#Setting one or more properties of one or more atoms.
#Setting mass
mass 1 1.0
#set group all mass 1.0
#Setting spins orientation and moment
#set group all spin/random 11 1.72
set group all spin 1.72 1.0 0.0 0.0
#Magneto-mechanic interactions for bulk fcc Cobalt
pair_style hybrid/overlay eam/alloy pair/spin 4.0
pair_coeff * * eam/alloy ../Co_PurjaPun_2012.eam.alloy Co
#pair_style pair/spin 4.0
#type i and j | interaction type | cutoff | J1 (eV) | J2 (adim) | J3 (Ang) (for Exchange)
pair_coeff * * pair/spin exchange 4.0 0.0446928 0.003496 1.4885
#type i and j | interaction type | cutoff | Int (eV) | [dx,dy,dz] (for DMI and ME)
#pair_coeff * * dmi 2.6 0.001 0.0 0.0 1.0
#pair_coeff * * me 2.6 0.01 1.0 1.0 1.0
#Define a skin distance, update neigh list every
#neighbor 1.0 bin
#neigh_modify every 10 check yes delay 20
neighbor 0.0 bin
neigh_modify every 1 check no delay 0
#Magnetic field fix
#Type | Intensity (T or eV) | Direction
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.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)
#Temp | Alpha_trans | Alpha_long | Seed
#fix 2 all langevin/spin 0.0 0.1 0.0 21
fix 2 all langevin/spin 1.0 0.1 0.0 21
#fix 2 all langevin/spin 0.0 0.0 0.0 21
#Magnetic integration fix
fix 3 all nve/spin mpi
#compute real time, total magnetization, magnetic energy, and spin temperature
#Iteration | Time | Mx | My | Mz | |M| | Em | Tm
compute mag all compute/spin
fix outmag all ave/time 1 1 10 c_mag[1] c_mag[2] c_mag[3] c_mag[4] c_mag[5] c_mag[6] c_mag[7] file mag_Co_nodamp.dat format %20.16g
#Setting the timestep for the simulation (in ps)
timestep 0.00001
##################
#######run########
##################
#Dump the positions and spin directions of magnetic particles (vmd format)
dump 1 all custom 100 dump_spin_MM.lammpstrj type x y z spx spy spz
#Running the simulations for N timesteps
run 10000
#run 1

View File

@ -32,21 +32,6 @@ atom_modify map array
#Lattice constant of fcc Cobalt
lattice fcc 3.54
#lattice sc 2.50
#Test Kagome
#variable a equal sqrt(3.0)/8.0
#variable b equal 3.0*sqrt(3.0)/8.0
#variable c equal sqrt(3.0)/4.0
#lattice custom 2.5 a1 1.0 0.0 0.0 &
# a2 0.0 1.0 0.0 &
# a3 0.0 0.0 1.0 &
# basis 0.0 $a 0.0 &
# basis 0.25 $a 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
#(for block, one has x0, xf, y0, yf, z0, zf, in distance units)
@ -59,10 +44,6 @@ create_box 1 box
#Entries: atom type,
create_atoms 1 box
#Replicating NxNxN the entire set of atoms
#replicate 1 1 1
#######################
#######Settings########
#######################

View File

@ -34,6 +34,7 @@
#include "memory.h"
#include "fix_force_spin.h"
#include "fix_langevin_spin.h"
#include "pair_hybrid.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -114,7 +115,21 @@ void FixNVESpin::init()
memory->create(fmi,3,"nves:fmi");
memory->create(fmj,3,"nves:fmj");
lockpairspin = (PairSpin *) force->pair;
if (strstr(force->pair_style,"pair/spin")) {
lockpairspin = (PairSpin *) force->pair;
} else if (strstr(force->pair_style,"hybrid/overlay")) {
PairHybrid *lockhybrid = (PairHybrid *) force->pair;
int nhybrid_styles = lockhybrid->nstyles;
int ipair;
for (ipair = 0; ipair < nhybrid_styles; ipair++) {
if (strstr(lockhybrid->keywords[ipair],"pair/spin")) {
lockpairspin = (PairSpin *) lockhybrid->styles[ipair];
}
}
} else error->all(FLERR,"Illegal fix nve/spin command");
// check errors, and handle simple hybrid (not overlay)
int iforce;
for (iforce = 0; iforce < modify->nfix; iforce++)
@ -125,15 +140,29 @@ void FixNVESpin::init()
if (strstr(modify->fix[iforce]->style,"langevin/spin")) break;
locklangevinspin = (FixLangevinSpin *) modify->fix[iforce];
exch_flag = lockpairspin->exch_flag;
dmi_flag = lockpairspin->dmi_flag;
me_flag = lockpairspin->me_flag;
if (lockpairspin->exch_flag == 1) {
exch_flag = lockpairspin->exch_flag;
}
if (lockpairspin->dmi_flag == 1) {
dmi_flag = lockpairspin->dmi_flag;
}
if (lockpairspin->me_flag == 1) {
me_flag = lockpairspin->me_flag;
}
zeeman_flag = lockforcespin->zeeman_flag;
aniso_flag = lockforcespin->aniso_flag;
if (lockforcespin->zeeman_flag == 1) {
zeeman_flag = lockforcespin->zeeman_flag;
}
if (lockforcespin->aniso_flag == 1) {
aniso_flag = lockforcespin->aniso_flag;
}
tdamp_flag = locklangevinspin->tdamp_flag;
temp_flag = locklangevinspin->temp_flag;
if (locklangevinspin->tdamp_flag == 1) {
tdamp_flag = locklangevinspin->tdamp_flag;
}
if (locklangevinspin->temp_flag == 1){
temp_flag = locklangevinspin->temp_flag;
}
if (mpi_flag == 1) {
sectoring();
@ -173,7 +202,6 @@ void FixNVESpin::initial_integrate(int vflag)
int *type = atom->type;
int *mask = atom->mask;
// update half v all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
@ -193,7 +221,6 @@ void FixNVESpin::initial_integrate(int vflag)
x[i][2] += 0.5 * dtv * v[i][2];
}
}
if (extra == SPIN) {
if (mpi_flag == 1) {
@ -236,7 +263,7 @@ void FixNVESpin::initial_integrate(int vflag)
} else error->all(FLERR,"Illegal fix nve/spin command");
}
// update x for all particles
// update half x for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += 0.5 * dtv * v[i][0];
@ -279,10 +306,13 @@ void FixNVESpin::ComputeInteractionsSpin(int ii)
int *type = atom->type;
const int newton_pair = force->newton_pair;
inum = lockpairspin->list->inum;
ilist = lockpairspin->list->ilist;
numneigh = lockpairspin->list->numneigh;
firstneigh = lockpairspin->list->firstneigh;
// add test here
if (exch_flag == 1 || dmi_flag == 1 || me_flag == 1 ) {
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;
@ -350,6 +380,7 @@ void FixNVESpin::ComputeInteractionsSpin(int ii)
lockpairspin->compute_me(i,j,fmi,fmj,spi,spj);
}
}
}
// post force

View File

@ -47,6 +47,7 @@ class FixNVESpin : public FixNVE {
int zeeman_flag, aniso_flag;
int tdamp_flag, temp_flag;
class PairHybrid *lockhybrid;
class PairSpin *lockpairspin;
class FixForceSpin *lockforcespin;
class FixLangevinSpin *locklangevinspin;

View File

@ -39,7 +39,6 @@ PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp)
exch_flag = 0;
dmi_flag = 0;
me_flag = 0;
}
/* ---------------------------------------------------------------------- */
@ -364,7 +363,8 @@ void PairSpin::coeff(int narg, char **arg)
if (count == 0) error->all(FLERR,"Incorrect args in pair_style command");
} else if (strcmp(arg[2],"dmi")==0) {
if (narg != 8) error->all(FLERR,"Incorrect args in pair_style command");
dmi_flag = 1;
dmi_flag = 1;
int ilo,ihi,jlo,jhi;
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
@ -426,7 +426,8 @@ void PairSpin::coeff(int narg, char **arg)
if (count == 0) error->all(FLERR,"Incorrect args in pair_style command");
} else error->all(FLERR,"Incorrect args in pair_style command");
//Check if Jex [][] still works for Ferrimagnetic exchange
// check if Jex [][] still works for Ferrimagnetic exchange
}

View File

@ -31,6 +31,7 @@ class PairHybrid : public Pair {
friend class FixOMP;
friend class Force;
friend class Respa;
friend class FixNVESpin;
friend class Info;
public:
PairHybrid(class LAMMPS *);

View File

@ -70,7 +70,7 @@ proc enable_trace {} {
trace variable vmd_frame([molinfo top]) w vmd_draw_spin
}
set molid [mol addfile {/home/jtranch/Documents/lammps/src/dump_spin_BFO.lammpstrj} type {lammpstrj} autobonds off first 0 last -1 step 1 waitfor all]
set molid [mol addfile {/home/jtranch/Documents/lammps/src/dump_spin_MM.lammpstrj} type {lammpstrj} autobonds off first 0 last -1 step 1 waitfor all]
scale by 0.5
animate style Loop
enable_trace