Commit before pull on SOLO

This commit is contained in:
julient31
2017-11-02 08:27:32 -06:00
parent f6b4587fe8
commit b219392d59
3 changed files with 51 additions and 289 deletions

View File

@ -35,7 +35,7 @@ lattice fcc 3.54
#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 2.0 0.0 2.0 0.0 2.0
region box block 0.0 8.0 0.0 8.0 0.0 8.0
#Creating a simulation box based on the specified region. Entries: number of atom types and box ref.
create_box 1 box
@ -57,27 +57,27 @@ mass 1 58.93
#set group all mass 58.93
#Setting spins orientation and moment
#set group all spin/random 31 1.72
set group all spin 1.72 0.0 0.0 1.0
set group all spin/random 31 1.72
#set group all spin 1.72 0.0 0.0 1.0
#set group single_spin spin/random 11 1.72
#velocity all create 200 4928459 rot yes dist gaussian
velocity all create 200 4928459 rot yes dist gaussian
#Magneto-mechanic interactions for bulk fcc Cobalt
pair_style pair/spin/exchange 4.0
#pair_style pair/spin/exchange 4.0
#pair_style eam/alloy
#pair_style hybrid/overlay eam/alloy pair/spin/soc 4.0
#pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0 pair/spin/soc/neel 4.0
#pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0
pair_style hybrid/overlay eam/alloy pair/spin/exchange 6.5
#pair_coeff * * eam/alloy ../Co_PurjaPun_2012.eam.alloy Co
pair_coeff * * eam/alloy ../Co_PurjaPun_2012.eam.alloy Co
#pair_coeff * * ../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 * * exchange 4.0 0.0446928 0.003496 1.4885
#pair_coeff * * exchange 4.0 -0.0446928 0.003496 1.4885
#pair_coeff * * exchange 4.0 0.0 0.003496 1.4885
#pair_coeff * * pair/spin/exchange exchange 4.0 0.0446928 0.003496 1.4885
pair_coeff * * pair/spin/exchange 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
@ -100,10 +100,10 @@ fix 1 all force/spin zeeman 0.0 0.0 0.0 1.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 300.0 0.1 0.0 21
fix 2 all langevin/spin 0.0 0.0 0.0 21
#Magnetic integration fix
fix 3 all integration/spin serial
fix 3 all integration/spin mpi
#compute real time, total magnetization, magnetic energy, and spin temperature
#Iteration | Time | Mx | My | Mz | |M| | Em | Tm
@ -129,14 +129,16 @@ variable emag equal c_out_mag[6]
variable tmag equal c_out_mag[7]
variable mag_force equal f_1
thermo 500
thermo_style custom step time v_emag c_out_pe c_out_ke c_out_temp v_mag_force v_magnorm v_tmag etotal
thermo 100
#thermo_style custom step time v_emag c_out_pe c_out_ke c_out_temp v_mag_force v_magnorm v_tmag etotal
thermo_style custom step time v_emag c_out_pe c_out_ke etotal
thermo_modify format float %20.15g
#fix out_vals all ave/time 1 1 50 step v_emag file temp_lattice_VSRSV.dat format %20.16g
#Dump the positions and spin directions of magnetic particles (vmd format)
dump 1 all custom 100 dump_VSRSV.lammpstrj type x y z spx spy spz
dump 1 all custom 5000 dump_VSRSV.lammpstrj type x y z spx spy spz
#Running the simulations for N timesteps
run 40000
run 10000
#run 1

View File

@ -109,9 +109,9 @@ void ComputeSpin::compute_vector()
tempnum += tx*tx+ty*ty+tz*tz;
tempdenom += sp[i][0]*fm[i][0]+fm[i][1]*sp[i][1]+sp[i][2]*fm[i][2];
countsp++;
}
}
else error->all(FLERR,"Compute spin/compute declared magnetic quantities (sp and mumag flags)");
}
else error->all(FLERR,"Compute spin/compute declared magnetic quantities (sp and mumag flags)");
}
MPI_Allreduce(mag,magtot,4,MPI_DOUBLE,MPI_SUM,world);

View File

@ -127,9 +127,9 @@ void FixIntegrationSpin::init()
//FixNVE::init();
// set timesteps
dtv = 0.5 * update->dt;
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dts = 0.5 * update->dt;
dts = 0.25 * update->dt;
memory->create(xi,3,"integrations:xi");
memory->create(sec,3,"integrations:sec");
@ -146,7 +146,7 @@ void FixIntegrationSpin::init()
if (strstr(force->pair_style,"pair/spin/exchange")) {
exch_flag = 1;
lockpairspinexchange = (PairSpinExchange *) force->pair;
} else if (strstr(force->pair_style,"pair/spin/soc")) {
} else if (strstr(force->pair_style,"pair/spin/soc/neel")) {
soc_flag = 1;
lockpairspinsocneel = (PairSpinSocNeel *) force->pair;
} else if (strstr(force->pair_style,"hybrid/overlay")) {
@ -157,7 +157,7 @@ void FixIntegrationSpin::init()
if (strstr(lockhybrid->keywords[ipair],"pair/spin/exchange")) {
exch_flag = 1;
lockpairspinexchange = (PairSpinExchange *) lockhybrid->styles[ipair];
} else if (strstr(lockhybrid->keywords[ipair],"pair/spin/soc")) {
} else if (strstr(lockhybrid->keywords[ipair],"pair/spin/soc/neel")) {
soc_flag = 1;
lockpairspinsocneel = (PairSpinSocNeel *) lockhybrid->styles[ipair];
}
@ -220,10 +220,7 @@ void FixIntegrationSpin::initial_integrate(int vflag)
int *type = atom->type;
int *mask = atom->mask;
#define VSRSV_TEST
#if defined VSRSV_TEST
// advance spin-lattice system, vsrsv
// update half v for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
@ -235,14 +232,14 @@ void FixIntegrationSpin::initial_integrate(int vflag)
}
}
// update s for all particles
// update half s for all particles
if (extra == SPIN) {
if (mpi_flag == 1) {
if (mpi_flag == 1) { // mpi seq. update
int nseci;
// mpi seq. update
for (int j = 0; j < nsectors; j++) {
for (int j = 0; j < nsectors; j++) { // advance quarter s for nlocal
comm->forward_comm();
for (int i = 0; i < nlocal; i++) {
//comm->forward_comm();
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
@ -252,9 +249,10 @@ void FixIntegrationSpin::initial_integrate(int vflag)
AdvanceSingleSpin(i,dts,sp,fm);
}
}
for (int j = nsectors-1; j >= 0; j--) {
for (int j = nsectors-1; j >= 0; j--) { // advance quarter s for nlocal
comm->forward_comm();
for (int i = nlocal-1; i >= 0; i--) {
//comm->forward_comm();
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
@ -264,20 +262,16 @@ void FixIntegrationSpin::initial_integrate(int vflag)
AdvanceSingleSpin(i,dts,sp,fm);
}
}
} else if (mpi_flag == 0) {
// serial seq. update
// advance quarter s for nlocal-1
for (int i = 0; i < nlocal-1; i++){
} else if (mpi_flag == 0) { // serial seq. update
for (int i = 0; i < nlocal-1; i++){ // advance quarter s for nlocal
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
AdvanceSingleSpin(i,dts,sp,fm);
}
// advance half s for 1
ComputeInteractionsSpin(nlocal-1);
AdvanceSingleSpin(nlocal-1,dts,sp,fm);
// advance quarter s for nlocal-1
for (int i = nlocal-2; i >= 0; i--){
AdvanceSingleSpin(nlocal-1,2.0*dts,sp,fm); // advance half s for 1
for (int i = nlocal-2; i >= 0; i--){ // advance quarter s for nlocal
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
AdvanceSingleSpin(i,dts,sp,fm);
}
} else error->all(FLERR,"Illegal fix integration/spin command");
}
@ -285,20 +279,20 @@ void FixIntegrationSpin::initial_integrate(int vflag)
// update x for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += 2.0 * dtv * v[i][0];
x[i][1] += 2.0 * dtv * v[i][1];
x[i][2] += 2.0 * dtv * v[i][2];
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
// update half s for all particles
if (extra == SPIN) {
if (mpi_flag == 1) {
if (mpi_flag == 1) { // mpi seq. update
int nseci;
// mpi seq. update
for (int j = 0; j < nsectors; j++) {
for (int j = nsectors-1; j >= 0; j--) { // advance quarter s for nlocal
comm->forward_comm();
for (int i = 0; i < nlocal; i++) {
for (int i = nlocal-1; i >= 0; i--) {
//comm->forward_comm();
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
@ -308,9 +302,10 @@ void FixIntegrationSpin::initial_integrate(int vflag)
AdvanceSingleSpin(i,dts,sp,fm);
}
}
for (int j = nsectors-1; j >= 0; j--) {
for (int j = 0; j < nsectors; j++) { // advance quarter s for nlocal
comm->forward_comm();
for (int i = nlocal-1; i >= 0; i--) {
for (int i = 0; i < nlocal-1; i++) {
//comm->forward_comm();
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
@ -320,163 +315,19 @@ void FixIntegrationSpin::initial_integrate(int vflag)
AdvanceSingleSpin(i,dts,sp,fm);
}
}
} else if (mpi_flag == 0) {
// serial seq. update
// advance quarter s for nlocal-2 particles
for (int i = nlocal-1; i >= 1; i--){
} else if (mpi_flag == 0) { // serial seq. update
for (int i = nlocal-1; i >= 1; i--){ // advance quarter s for nlocal-2 particles
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
AdvanceSingleSpin(i,dts,sp,fm);
}
// advance half s for 1
ComputeInteractionsSpin(0);
AdvanceSingleSpin(0,dts,sp,fm);
// advance quarter s for nlocal-2 particles
for (int i = 1; i < nlocal; i++){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
}
} else error->all(FLERR,"Illegal fix integration/spin command");
}
#endif
//#define VRSRV
#if defined VRSRV
// update half v for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (rmass) dtfm = dtf / rmass[i];
else dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
v[i][1] += dtfm * f[i][1];
v[i][2] += dtfm * f[i][2];
}
}
// update half x for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
// update s for all particles
if (extra == SPIN) {
if (mpi_flag == 1) {
int nseci;
// mpi seq. update
for (int j = 0; j < nsectors; j++) {
comm->forward_comm();
for (int i = 0; i < nlocal; i++) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
for (int j = nsectors-1; j >= 0; j--) {
comm->forward_comm();
for (int i = nlocal-1; i >= 0; i--) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
} else if (mpi_flag == 0) {
// serial seq. update
for (int i = 0; i < nlocal; i++){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
for (int i = nlocal-1; i >= 0; i--){
AdvanceSingleSpin(0,2.0*dts,sp,fm); // advance half s for 1
for (int i = 1; i < nlocal; i++){ // advance quarter s for nlocal-2 particles
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
} else error->all(FLERR,"Illegal fix integration/spin command");
}
// update half x for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
#endif
//#define RSVSR_TEST
#if defined RSVSR_TEST
// update half x for all particles
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
// update half s for all particles
if (extra == SPIN) {
if (mpi_flag == 1) {
int nseci;
// mpi seq. update
for (int j = 0; j < nsectors; j++) {
comm->forward_comm();
for (int i = 0; i < nlocal; i++) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
for (int j = nsectors-1; j >= 0; j--) {
comm->forward_comm();
for (int i = nlocal-1; i >= 0; i--) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
} else if (mpi_flag == 0) {
// serial seq. update
// advance quarter s for nlocal-2 particles
for (int i = 0; i < nlocal-2; i++){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
}
// advance half s for nlocal-1
ComputeInteractionsSpin(nlocal-1);
AdvanceSingleSpin(nlocal-1,dts,sp,fm);
// advance quarter s for nlocal-2 particles
for (int i = nlocal-2; i >= 0; i--){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
}
} else error->all(FLERR,"Illegal fix integration/spin command");
}
#endif
}
@ -726,9 +577,6 @@ void FixIntegrationSpin::final_integrate()
int *type = atom->type;
int *mask = atom->mask;
#define VSRSV_TEST
#if defined VSRSV_TEST
// update half v for all particles
for (int i = nlocal-1; i >= 0; i--) {
if (mask[i] & groupbit) {
@ -740,92 +588,4 @@ void FixIntegrationSpin::final_integrate()
}
}
#endif
//#define VRSRV
#if defined VRSRV
// update half v for all particles
for (int i = nlocal-1; i >= 0; i--) {
if (mask[i] & groupbit) {
if (rmass) dtfm = dtf / rmass[i];
else dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
v[i][1] += dtfm * f[i][1];
v[i][2] += dtfm * f[i][2];
}
}
#endif
//#define RSVSR_TEST
#if defined RSVSR_TEST
// update v for all particles
for (int i = nlocal-1; i >= 0; i--) {
if (mask[i] & groupbit) {
if (rmass) dtfm = dtf / rmass[i];
else dtfm = dtf / mass[type[i]];
v[i][0] += 2.0 * dtfm * f[i][0];
v[i][1] += 2.0 * dtfm * f[i][1];
v[i][2] += 2.0 * dtfm * f[i][2];
}
}
// update half s for all particles
if (extra == SPIN) {
if (mpi_flag == 1) {
int nseci;
// mpi seq. update
for (int j = 0; j < nsectors; j++) {
comm->forward_comm();
for (int i = 0; i < nlocal; i++) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
for (int j = nsectors-1; j >= 0; j--) {
comm->forward_comm();
for (int i = nlocal-1; i >= 0; i--) {
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
nseci = coords2sector(xi);
if (j != nseci) continue;
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,dts,sp,fm);
}
}
} else if (mpi_flag == 0) {
// serial seq. update
// advance quarter s for nlocal-2 particles
for (int i = nlocal-1; i >= 1; i--){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
}
// advance half s for nlocal-1
ComputeInteractionsSpin(0);
AdvanceSingleSpin(0,dts,sp,fm);
// advance quarter s for nlocal-2 particles
for (int i = 1; i < nlocal-1; i++){
ComputeInteractionsSpin(i);
AdvanceSingleSpin(i,0.5*dts,sp,fm);
}
} else error->all(FLERR,"Illegal fix integration/spin command");
}
// update half x for all particles
for (int i = nlocal-1; i >= 0; i--) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
#endif
}