Merge pull request #71 from jtclemm/create-atoms-mesh

Fixing typos and cleaning up quasirandom comments
This commit is contained in:
Axel Kohlmeyer
2022-05-14 15:13:27 -04:00
committed by GitHub
2 changed files with 9 additions and 9 deletions

View File

@ -141,12 +141,12 @@ For the *mesh* style, a file with a triangle mesh in `STL format
more particles are placed into the area of each triangle. The reader
supports both ASCII and binary files conforming to the format on the
Wikipedia page. Binary STL files (e.g. as frequently offered for
3d-printing) also be first converted to ASCII for editing with the
3d-printing) can also be first converted to ASCII for editing with the
:ref:`stl_bin2txt tool <stlconvert>`. The use of the *units box* option
is required. There are two algorithms for placing atoms available:
*bisect* and *qrand*. They can be selected via the *meshmode* option;
*bisect* is the default. If the atom style allows to set a per-atom
radius this radius is set to the average distance of the triangle
*bisect* is the default. If the atom style allows one to set a per-atom
radius, this radius is set to the average distance of the triangle
vertices from its center times the value of the *radscale* keyword
(default: 1.0). If the atom style supports it, the atoms created from
the mesh are assigned a new molecule ID.
@ -157,14 +157,14 @@ larger than the *radthresh* value (default is lattice spacing in
x-direction). In case the average distance is over the threshold, the
triangle is recursively split into two halves along the the longest side
until the threshold is reached. There will be at least one sphere per
triangle. The value of *radthresh* is set as argument to *meshmode
triangle. The value of *radthresh* is set as an argument to *meshmode
bisect*.
In *qrand* mode a quasirandom sequence is used to distribute particles
on mesh triangles using an approach by :ref:`(Roberts) <Roberts2019>`.
Particles are added to the triangle until minimum number density is met
Particles are added to the triangle until the minimum number density is met
or exceeded such that every triangle will have at least one particle.
The minimum number density is set as argument to the *qrand* option.
The minimum number density is set as an argument to the *qrand* option.
.. note::

View File

@ -971,7 +971,7 @@ int CreateAtoms::add_quasirandom(const double vert[3][3], tagint molid)
MathExtra::copy3(vert[0], ref);
}
// Estimate number of particles from area, could scale by RCP
// Estimate number of particles from area
MathExtra::cross3(ab, ac, temp);
area = 0.5 * MathExtra::len3(temp);
int nparticles = ceil(mesh_density * area);
@ -979,7 +979,7 @@ int CreateAtoms::add_quasirandom(const double vert[3][3], tagint molid)
for (int i = 0; i < nparticles; i++) {
// Define point in unit square
xi = (i + 1) * INV_P_CONST;
yi = (i + 1) * INV_SQ_P_CONST; // Add seed function of vertices
yi = (i + 1) * INV_SQ_P_CONST;
xi += seed;
yi += seed;
@ -987,7 +987,7 @@ int CreateAtoms::add_quasirandom(const double vert[3][3], tagint molid)
xi = std::fmod(xi, 1.0);
yi = std::fmod(yi, 1.0);
// Map to tirangle using parallelogram method
// Map to triangle using parallelogram method
if ((xi + yi) < 1) {
MathExtra::scale3(xi, ac, point);
MathExtra::scale3(yi, ab, temp);