From c847ac1fd45259e4bec3618d2ee2153a213a77fe Mon Sep 17 00:00:00 2001 From: Jacob Tavenner Date: Thu, 19 Dec 2024 13:37:30 -0700 Subject: [PATCH] Removed trailing whitespace --- doc/src/fix_neighbor_swap.rst | 12 ++++++------ src/MC/fix_neighbor_swap.cpp | 30 +++++++++++++++--------------- src/MC/fix_neighbor_swap.h | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/src/fix_neighbor_swap.rst b/doc/src/fix_neighbor_swap.rst index a3eb1c6d82..e97b8bcbf2 100644 --- a/doc/src/fix_neighbor_swap.rst +++ b/doc/src/fix_neighbor_swap.rst @@ -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 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 voro compute-ID - + where *compute-ID* is the ID of a corresponding Voronoi computation with neighbor list, i.e. .. code-block:: LAMMPS @@ -89,17 +89,17 @@ be swapped at the initial step, i.e. for using *fix neighbor/swap* with *diff 2*. -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. +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. 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 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 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 -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, the corresponding compute voronoi command can be adjusted accordingly. diff --git a/src/MC/fix_neighbor_swap.cpp b/src/MC/fix_neighbor_swap.cpp index 9bbb777d92..1bd9cbbc02 100755 --- a/src/MC/fix_neighbor_swap.cpp +++ b/src/MC/fix_neighbor_swap.cpp @@ -195,7 +195,7 @@ void FixNeighborSwap::options(int narg, char **arg) } } else if (strcmp(arg[iarg],"voro") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal fix neighbor/swap command"); - + int icompute = modify->find_compute(utils::strdup(arg[iarg+1])); if (icompute < 0) error->all(FLERR,"Could not find neighbor compute ID"); @@ -481,7 +481,7 @@ int FixNeighborSwap::attempt_swap() } energy_stored = energy_after; - // utils::logmesg(lmp,"Swap accepted\n"); + // utils::logmesg(lmp,"Swap accepted\n"); // Swap atom groups if successful swap // 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 // 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 ) { atom->type[i] = itype; @@ -613,7 +613,7 @@ double FixNeighborSwap::get_distance(double* i, double* j) // r_x = i[0] - j[0]; // r_y = i[1] - j[1]; // r_z = i[2] - j[2]; - + // // Domain::minimum_image(r_x, r_y, r_z); // double r = sqrt(pow(r_x, 2.) + // pow(r_y, 2.) + @@ -648,7 +648,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center) memory->sfree(local_swap_probability); local_swap_probability = (double *) memory->smalloc(atom_swap_nmax*sizeof(double), "MCSWAP:local_swap_probability_list"); - + memory->sfree(local_swap_type_list); local_swap_type_list = (int *) memory->smalloc(atom_swap_nmax*sizeof(int), "MCSWAP:local_swap_type_list"); @@ -656,7 +656,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center) // Compute voronoi and access neighbor list c_voro->compute_local(); - + voro_neighbor_list = c_voro->array_local; njswap_local = 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); for (int n = 0; n < c_voro->size_local_rows; n++){ - + int temp_j_id = -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 (diff_flag) { // Calculate distance from i to each j, adjust probability of selection - + // Get distance if own centr atom double r = INFINITY; if ( i_center >= 0 ){ double r = get_distance(x[temp_j], x[i_center]); } - + // Get local id of ghost center atom when ghost for (int i=nlocal; i < nlocal+nghost; i++){ if ( (id[i] == id_center) && @@ -743,7 +743,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center) if ( i_center >= 0 ){ double r = get_distance(x[temp_j], x[i_center]); } - + // Get local id of ghost center atom when ghost for (int i=nlocal; i < nlocal+nghost; i++){ if ( (id[i] == id_center) && @@ -776,7 +776,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center) if ( i_center >= 0 ){ r = get_distance(x[temp_j], x[i_center]); } - + // Get local id of ghost center atoms // if ( i_center < 0 ){ // 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); 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_probability += local_swap_probability[njswap_local]; - + local_swap_type_list[njswap_local] = type[temp_j]; local_swap_neighbor_list[njswap_local] = temp_j; njswap_local++; @@ -810,7 +810,7 @@ void FixNeighborSwap::build_i_neighbor_list(int i_center) if ( i_center >= 0 ){ double r = get_distance(x[temp_j], x[i_center]); } - + // Get local id of ghost center atom when ghost for (int i=nlocal; i < nlocal+nghost; i++){ 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.)); } else { local_swap_probability[njswap_local] = exp(-pow((r/3.), 2.)); - } + } local_probability += local_swap_probability[njswap_local]; local_swap_type_list[njswap_local] = jswaptype; diff --git a/src/MC/fix_neighbor_swap.h b/src/MC/fix_neighbor_swap.h index 1413de2ef8..e53eb9c1c3 100755 --- a/src/MC/fix_neighbor_swap.h +++ b/src/MC/fix_neighbor_swap.h @@ -63,7 +63,7 @@ class FixNeighborSwap : public Fix { double nswap_attempts; double nswap_successes; - + bool unequal_cutoffs; int atom_swap_nmax; @@ -79,7 +79,7 @@ class FixNeighborSwap : public Fix { int *local_swap_neighbor_list; int *local_swap_type_list; // Type list index of atoms stored on this proc double *local_swap_probability; - + class RanPark *random_equal; class RanPark *random_unequal;