Commit JT 040119

- corrected tangent vector projection
- output verbose (Gradidottan)
This commit is contained in:
julient31 2019-04-01 15:53:36 -06:00
parent 44fe8330b9
commit a0e5d14990
2 changed files with 33 additions and 44 deletions

View File

@ -15,6 +15,10 @@
Contributing authors: Julien Tranchida (SNL)
Please cite the related publication:
Bessarab, P. F., Uzdin, V. M., & Jónsson, H. (2015).
Method for finding mechanism and activation energy of magnetic transitions,
applied to skyrmion and antivortex annihilation.
Computer Physics Communications, 196, 335-347.
------------------------------------------------------------------------- */
#include <mpi.h>
@ -467,6 +471,15 @@ void FixNEB_spin::min_post_force(int /*vflag*/)
}
}
// project tangent vector on tangent space
double sdottan;
sdottan = sp[i][0]*tangent[i][0] + sp[i][1]*tangent[i][1] +
sp[i][2]*tangent[i][2];
tangent[i][0] -= sdottan*sp[i][0];
tangent[i][1] -= sdottan*sp[i][1];
tangent[i][2] -= sdottan*sp[i][2];
// calc. next geodesic length
spi[0]=sp[i][0];
@ -518,7 +531,8 @@ void FixNEB_spin::min_post_force(int /*vflag*/)
dottangrad = bufout[6];
dotgrad = bufout[7];
// project tangent vector on tangent space and normalize it
// check projection of tangent vector on tangent space
// and normalize it
double buftan[3];
double tandots;
@ -655,7 +669,7 @@ double FixNEB_spin::geodesic_distance(double spi[3], double spj[3])
if (normcross == 0.0 && dots == 0.0)
error->all(FLERR,"Incorrect calc. of geodesic_distance in Fix NEB/spin");
dist = atan2(normcross,dots);
dist = atan2(normcross,dots);
return dist;
}

View File

@ -281,10 +281,9 @@ void NEB_spin::run()
if (uscreen) {
if (verbose) {
fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... "
"RDN PEN pathangle1 angletangrad1 anglegrad1 gradV1 "
"ReplicaForce1 MaxAtomForce1 pathangle2 angletangrad2 "
"... ReplicaTorqueN MaxAtomTorqueN\n");
"GradV0 GradV1 GradVc EBF EBR RDT "
"RD1 PE1 RD2 PE2 ... RDN PEN "
"GradV0dottan ... GradVNdottan\n");
} else {
fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... "
@ -294,11 +293,10 @@ void NEB_spin::run()
if (ulogfile) {
if (verbose) {
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... "
"RDN PEN pathangle1 angletangrad1 anglegrad1 gradV1 "
"ReplicaForce1 MaxAtomForce1 pathangle2 angletangrad2 "
"... ReplicaTorqueN MaxAtomTorqueN\n");
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT "
"RD1 PE1 RD2 PE2 ... RDN PEN "
"GradV0dottan ... GradVNdottan\n");
} else {
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... "
@ -370,9 +368,7 @@ void NEB_spin::run()
fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT "
"RD1 PE1 RD2 PE2 ... RDN PEN "
"pathangle1 angletangrad1 anglegrad1 gradV1 "
"ReplicaForce1 MaxAtomForce1 pathangle2 angletangrad2 "
"... ReplicaForceN MaxAtomForceN\n");
"GradV0dottan ... GradVNdottan\n");
} else {
fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc "
@ -382,12 +378,10 @@ void NEB_spin::run()
}
if (ulogfile) {
if (verbose) {
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT "
"RD1 PE1 RD2 PE2 ... RDN PEN "
"pathangle1 angletangrad1 anglegrad1 gradV1 "
"ReplicaForce1 MaxAtomForce1 pathangle2 angletangrad2 "
"... ReplicaForceN MaxAtomForceN\n");
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc EBF EBR RDT "
"RD1 PE1 RD2 PE2 ... RDN PEN "
"GradV0dottan ... GradVNdottan\n");
} else {
fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque "
"GradV0 GradV1 GradVc "
@ -879,17 +873,8 @@ void NEB_spin::print_status()
for (int i = 0; i < nreplica; i++)
fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]);
if (verbose) {
fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg,
all[0][3],freplica[0],fmaxatomInRepl[0]);
for (int i = 1; i < nreplica-1; i++)
fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg,
180-acos(all[i][6])*todeg,all[i][3],freplica[i],
fmaxatomInRepl[i]);
fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3],
freplica[nreplica-1],fmaxatomInRepl[nreplica-1]);
for (int i = 0; i < nreplica; i++)
fprintf(uscreen,"%12.8g ",all[i][5]);
}
fprintf(uscreen,"\n");
}
@ -901,20 +886,10 @@ void NEB_spin::print_status()
gradvnorm0,gradvnorm1,gradvnormc);
fprintf(ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt);
for (int i = 0; i < nreplica; i++)
//fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]);
fprintf(ulogfile,"%12.8g %12.8g %12.8g %12.8g ",rdist[i],all[i][0],all[i][2],all[i][5]);
fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]);
if (verbose) {
fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg,
all[0][3],freplica[0],fmaxatomInRepl[0]);
for (int i = 1; i < nreplica-1; i++)
fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg,
180-acos(all[i][6])*todeg,all[i][3],freplica[i],
fmaxatomInRepl[i]);
fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g",
NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3],
freplica[nreplica-1],fmaxatomInRepl[nreplica-1]);
for (int i = 0; i < nreplica; i++)
fprintf(ulogfile,"%12.8g ",all[i][5]);
}
fprintf(ulogfile,"\n");
fflush(ulogfile);