Removed trailing whitespace
This commit is contained in:
@ -70,11 +70,11 @@ as given by *diff type*. This command selects all atom types as acceptable swap
|
|||||||
centrally selected atom of type *type*. This includes the atom type specified by the diff
|
centrally selected atom of type *type*. This includes the atom type specified by the diff
|
||||||
keyword to account for self-diffusion hops of an atom type with itself.
|
keyword to account for self-diffusion hops of an atom type with itself.
|
||||||
|
|
||||||
Keyword *voro* is currently required, and is implemented as
|
Keyword *voro* is currently required, and is implemented as
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
voro compute-ID
|
voro compute-ID
|
||||||
|
|
||||||
where *compute-ID* is the ID of a corresponding Voronoi computation with neighbor list, i.e.
|
where *compute-ID* is the ID of a corresponding Voronoi computation with neighbor list, i.e.
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
@ -89,17 +89,17 @@ be swapped at the initial step, i.e.
|
|||||||
|
|
||||||
for using *fix neighbor/swap* with *diff 2*.
|
for using *fix neighbor/swap* with *diff 2*.
|
||||||
|
|
||||||
The keyword *rates* can modify the swap rate for each swapped type by values
|
The keyword *rates* can modify the swap rate for each swapped type by values
|
||||||
where the adjusted rates values are given in order of increasing atom type.
|
where the adjusted rates values are given in order of increasing atom type.
|
||||||
The number of rates provided must equal the number of atom types in the simulaton.
|
The number of rates provided must equal the number of atom types in the simulaton.
|
||||||
In the third provided example above, a simulation is conducted with three atom types
|
In the third provided example above, a simulation is conducted with three atom types
|
||||||
where the third atom type is the one sampled for attempted swaps. All three atom
|
where the third atom type is the one sampled for attempted swaps. All three atom
|
||||||
types are considered valid swaps, but atoms of type 1 will be selected three times
|
types are considered valid swaps, but atoms of type 1 will be selected three times
|
||||||
as often as atoms of type 2. Conversely, atoms of type 3 are six times more likely to
|
as often as atoms of type 2. Conversely, atoms of type 3 are six times more likely to
|
||||||
be selected than atoms of type two and twice as likely as atoms of type 1.
|
be selected than atoms of type two and twice as likely as atoms of type 1.
|
||||||
|
|
||||||
Finally, the *region* keyword is implemented as in other atomic fixes, where
|
Finally, the *region* keyword is implemented as in other atomic fixes, where
|
||||||
the *region region-ID* command indicates that atom swaps only be considered in the area
|
the *region region-ID* command indicates that atom swaps only be considered in the area
|
||||||
given by *region-ID*. If only atoms of certain groups are expected to be in this region,
|
given by *region-ID*. If only atoms of certain groups are expected to be in this region,
|
||||||
the corresponding compute voronoi command can be adjusted accordingly.
|
the corresponding compute voronoi command can be adjusted accordingly.
|
||||||
|
|
||||||
|
|||||||
@ -195,7 +195,7 @@ void FixNeighborSwap::options(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
} else if (strcmp(arg[iarg],"voro") == 0) {
|
} else if (strcmp(arg[iarg],"voro") == 0) {
|
||||||
if (iarg + 2 > narg) error->all(FLERR,"Illegal fix neighbor/swap command");
|
if (iarg + 2 > narg) error->all(FLERR,"Illegal fix neighbor/swap command");
|
||||||
|
|
||||||
int icompute = modify->find_compute(utils::strdup(arg[iarg+1]));
|
int icompute = modify->find_compute(utils::strdup(arg[iarg+1]));
|
||||||
|
|
||||||
if (icompute < 0) error->all(FLERR,"Could not find neighbor compute ID");
|
if (icompute < 0) error->all(FLERR,"Could not find neighbor compute ID");
|
||||||
@ -481,7 +481,7 @@ int FixNeighborSwap::attempt_swap()
|
|||||||
}
|
}
|
||||||
energy_stored = energy_after;
|
energy_stored = energy_after;
|
||||||
|
|
||||||
// utils::logmesg(lmp,"Swap accepted\n");
|
// utils::logmesg(lmp,"Swap accepted\n");
|
||||||
// Swap atom groups if successful swap
|
// Swap atom groups if successful swap
|
||||||
|
|
||||||
// int groupi = atom->mask[i];
|
// int groupi = atom->mask[i];
|
||||||
@ -498,7 +498,7 @@ int FixNeighborSwap::attempt_swap()
|
|||||||
// do not need to re-call comm->borders() and rebuild neighbor list
|
// do not need to re-call comm->borders() and rebuild neighbor list
|
||||||
// since will be done on next cycle or in Verlet when this fix finishes
|
// since will be done on next cycle or in Verlet when this fix finishes
|
||||||
|
|
||||||
// utils::logmesg(lmp,"Swap not accepted\n");
|
// utils::logmesg(lmp,"Swap not accepted\n");
|
||||||
|
|
||||||
if ( i >= 0 ) {
|
if ( i >= 0 ) {
|
||||||
atom->type[i] = itype;
|
atom->type[i] = itype;
|
||||||
@ -613,7 +613,7 @@ double FixNeighborSwap::get_distance(double* i, double* j)
|
|||||||
// r_x = i[0] - j[0];
|
// r_x = i[0] - j[0];
|
||||||
// r_y = i[1] - j[1];
|
// r_y = i[1] - j[1];
|
||||||
// r_z = i[2] - j[2];
|
// r_z = i[2] - j[2];
|
||||||
|
|
||||||
// // Domain::minimum_image(r_x, r_y, r_z);
|
// // Domain::minimum_image(r_x, r_y, r_z);
|
||||||
// double r = sqrt(pow(r_x, 2.) +
|
// double r = sqrt(pow(r_x, 2.) +
|
||||||
// pow(r_y, 2.) +
|
// pow(r_y, 2.) +
|
||||||
@ -648,7 +648,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
memory->sfree(local_swap_probability);
|
memory->sfree(local_swap_probability);
|
||||||
local_swap_probability = (double *) memory->smalloc(atom_swap_nmax*sizeof(double),
|
local_swap_probability = (double *) memory->smalloc(atom_swap_nmax*sizeof(double),
|
||||||
"MCSWAP:local_swap_probability_list");
|
"MCSWAP:local_swap_probability_list");
|
||||||
|
|
||||||
memory->sfree(local_swap_type_list);
|
memory->sfree(local_swap_type_list);
|
||||||
local_swap_type_list = (int *) memory->smalloc(atom_swap_nmax*sizeof(int),
|
local_swap_type_list = (int *) memory->smalloc(atom_swap_nmax*sizeof(int),
|
||||||
"MCSWAP:local_swap_type_list");
|
"MCSWAP:local_swap_type_list");
|
||||||
@ -656,7 +656,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
// Compute voronoi and access neighbor list
|
// Compute voronoi and access neighbor list
|
||||||
|
|
||||||
c_voro->compute_local();
|
c_voro->compute_local();
|
||||||
|
|
||||||
voro_neighbor_list = c_voro->array_local;
|
voro_neighbor_list = c_voro->array_local;
|
||||||
njswap_local = 0;
|
njswap_local = 0;
|
||||||
local_probability = 0.0;
|
local_probability = 0.0;
|
||||||
@ -664,7 +664,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
// utils::logmesg(lmp,"Searching for atom {}\n",id_center);
|
// utils::logmesg(lmp,"Searching for atom {}\n",id_center);
|
||||||
|
|
||||||
for (int n = 0; n < c_voro->size_local_rows; n++){
|
for (int n = 0; n < c_voro->size_local_rows; n++){
|
||||||
|
|
||||||
int temp_j_id = -1;
|
int temp_j_id = -1;
|
||||||
int temp_j = -1;
|
int temp_j = -1;
|
||||||
|
|
||||||
@ -708,13 +708,13 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
if (atom->mask[temp_j] & groupbit) {
|
if (atom->mask[temp_j] & groupbit) {
|
||||||
if (diff_flag) {
|
if (diff_flag) {
|
||||||
// Calculate distance from i to each j, adjust probability of selection
|
// Calculate distance from i to each j, adjust probability of selection
|
||||||
|
|
||||||
// Get distance if own centr atom
|
// Get distance if own centr atom
|
||||||
double r = INFINITY;
|
double r = INFINITY;
|
||||||
if ( i_center >= 0 ){
|
if ( i_center >= 0 ){
|
||||||
double r = get_distance(x[temp_j], x[i_center]);
|
double r = get_distance(x[temp_j], x[i_center]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get local id of ghost center atom when ghost
|
// Get local id of ghost center atom when ghost
|
||||||
for (int i=nlocal; i < nlocal+nghost; i++){
|
for (int i=nlocal; i < nlocal+nghost; i++){
|
||||||
if ( (id[i] == id_center) &&
|
if ( (id[i] == id_center) &&
|
||||||
@ -743,7 +743,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
if ( i_center >= 0 ){
|
if ( i_center >= 0 ){
|
||||||
double r = get_distance(x[temp_j], x[i_center]);
|
double r = get_distance(x[temp_j], x[i_center]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get local id of ghost center atom when ghost
|
// Get local id of ghost center atom when ghost
|
||||||
for (int i=nlocal; i < nlocal+nghost; i++){
|
for (int i=nlocal; i < nlocal+nghost; i++){
|
||||||
if ( (id[i] == id_center) &&
|
if ( (id[i] == id_center) &&
|
||||||
@ -776,7 +776,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
if ( i_center >= 0 ){
|
if ( i_center >= 0 ){
|
||||||
r = get_distance(x[temp_j], x[i_center]);
|
r = get_distance(x[temp_j], x[i_center]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get local id of ghost center atoms
|
// Get local id of ghost center atoms
|
||||||
// if ( i_center < 0 ){
|
// if ( i_center < 0 ){
|
||||||
// utils::logmesg(lmp,"Initial distance {}\n", r);
|
// utils::logmesg(lmp,"Initial distance {}\n", r);
|
||||||
@ -788,7 +788,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// utils::logmesg(lmp,"Final distance {}\n", r);
|
// utils::logmesg(lmp,"Final distance {}\n", r);
|
||||||
|
|
||||||
if (rates_flag) {
|
if (rates_flag) {
|
||||||
@ -797,7 +797,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
local_swap_probability[njswap_local] = exp(-pow((r/3.), 2.));
|
local_swap_probability[njswap_local] = exp(-pow((r/3.), 2.));
|
||||||
}
|
}
|
||||||
local_probability += local_swap_probability[njswap_local];
|
local_probability += local_swap_probability[njswap_local];
|
||||||
|
|
||||||
local_swap_type_list[njswap_local] = type[temp_j];
|
local_swap_type_list[njswap_local] = type[temp_j];
|
||||||
local_swap_neighbor_list[njswap_local] = temp_j;
|
local_swap_neighbor_list[njswap_local] = temp_j;
|
||||||
njswap_local++;
|
njswap_local++;
|
||||||
@ -810,7 +810,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
if ( i_center >= 0 ){
|
if ( i_center >= 0 ){
|
||||||
double r = get_distance(x[temp_j], x[i_center]);
|
double r = get_distance(x[temp_j], x[i_center]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get local id of ghost center atom when ghost
|
// Get local id of ghost center atom when ghost
|
||||||
for (int i=nlocal; i < nlocal+nghost; i++){
|
for (int i=nlocal; i < nlocal+nghost; i++){
|
||||||
if ( (id[i] == id_center) &&
|
if ( (id[i] == id_center) &&
|
||||||
@ -823,7 +823,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center)
|
|||||||
local_swap_probability[njswap_local] = rate_list[type[temp_j] - 1]*exp(-pow((r/3.), 2.));
|
local_swap_probability[njswap_local] = rate_list[type[temp_j] - 1]*exp(-pow((r/3.), 2.));
|
||||||
} else {
|
} else {
|
||||||
local_swap_probability[njswap_local] = exp(-pow((r/3.), 2.));
|
local_swap_probability[njswap_local] = exp(-pow((r/3.), 2.));
|
||||||
}
|
}
|
||||||
local_probability += local_swap_probability[njswap_local];
|
local_probability += local_swap_probability[njswap_local];
|
||||||
|
|
||||||
local_swap_type_list[njswap_local] = jswaptype;
|
local_swap_type_list[njswap_local] = jswaptype;
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class FixNeighborSwap : public Fix {
|
|||||||
|
|
||||||
double nswap_attempts;
|
double nswap_attempts;
|
||||||
double nswap_successes;
|
double nswap_successes;
|
||||||
|
|
||||||
bool unequal_cutoffs;
|
bool unequal_cutoffs;
|
||||||
|
|
||||||
int atom_swap_nmax;
|
int atom_swap_nmax;
|
||||||
@ -79,7 +79,7 @@ class FixNeighborSwap : public Fix {
|
|||||||
int *local_swap_neighbor_list;
|
int *local_swap_neighbor_list;
|
||||||
int *local_swap_type_list; // Type list index of atoms stored on this proc
|
int *local_swap_type_list; // Type list index of atoms stored on this proc
|
||||||
double *local_swap_probability;
|
double *local_swap_probability;
|
||||||
|
|
||||||
|
|
||||||
class RanPark *random_equal;
|
class RanPark *random_equal;
|
||||||
class RanPark *random_unequal;
|
class RanPark *random_unequal;
|
||||||
|
|||||||
Reference in New Issue
Block a user