diff --git a/doc/src/region.rst b/doc/src/region.rst index 073e824fe1..5de63844cb 100644 --- a/doc/src/region.rst +++ b/doc/src/region.rst @@ -11,7 +11,7 @@ Syntax region ID style args keyword arg ... * ID = user-assigned name for the region -* style = *delete* or *block* or *cone* or *cylinder* or *plane* or *prism* or *sphere* or *union* or *intersect* +* style = *delete* or *block* or *cone* or *cylinder* or *ellipsoid* or *plane* or *prism* or *sphere* or *union* or *intersect* .. parsed-literal:: @@ -64,7 +64,7 @@ Syntax *lattice* = the geometry is defined in lattice units *box* = the geometry is defined in simulation box units *move* args = v_x v_y v_z - v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time + v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time (distance units) *rotate* args = v_theta Px Py Pz Rx Ry Rz v_theta = equal-style variable for rotaton of region over time (in radians) Px,Py,Pz = origin for axis of rotation (distance units) @@ -162,9 +162,11 @@ Thus the third example above specifies a cylinder with its axis in the y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and extending in the y-direction from -5.0 to the upper box boundary. -For style *ellipsoid*, an axis-alligned ellipsoid is defined. The ellipsoid has -its center at (x,y,z) and is defined by 3 axis-aligned vectors given by -A = (a,0,0); B = (0,b,0); C = (0,0,c). +For style *ellipsoid*, an axis-aligned ellipsoid is defined. The +ellipsoid has its center at (x,y,z) and is defined by 3 axis-aligned +vectors given by A = (a,0,0); B = (0,b,0); C = (0,0,c). Note that +although the ellipsoid is specified as axis-aligned it can be rotated +via the optional *rotate* keyword. For style *plane*, a plane is defined which contain the point (px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does @@ -192,16 +194,21 @@ since if the maximum tilt factor is 5 (as in this example), then configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all geometrically equivalent. -The *radius* value for style *sphere* and *cylinder* as well as -the parameters a, b, c for style *ellipsoid* can be specified -as an equal-style :doc:`variable `. If the value is a -variable, it should be specified as v_name, where name is the variable -name. In this case, the variable will be evaluated each timestep, and -its value used to determine the radius of the region. For style *sphere* -and *ellipsoid* also the x-, y-, and z- coordinate of the center of the sphere/ellipsoid -and for style *cylinder* the two center positions c1 and c2 for the location of -the cylinder axes can be a variable with the same kind of effect and -requirements than for the radius. +For style *sphere*, a sphere is defined with its center at (x,y,z) +and with radius as its radius. + +The *radius* value for styles *sphere* and *cylinder*, and the +parameters a,b,c for style *ellipsoid*, can each be specified as an +equal-style :doc:`variable `. Likewise, for style *sphere* +and *ellipsoid* the x-, y-, and z- coordinates of the center of the +sphere/ellipsoid can be specified as an equal-style variable. And for +style *cylinder* the two center positions c1 and c2 for the location +of the cylinder axes can be specified as a equal-style variable. + +If the value is a variable, it should be specified as v_name, where +name is the variable name. In this case, the variable will be +evaluated each timestep, and its value used to determine the radius of +the region. Equal-style variables can specify formulas with various mathematical functions, and include :doc:`thermo_style ` command @@ -259,6 +266,9 @@ define the lattice spacings which are used as follows: to lo and hi. The spacings in the two radial dimensions are applied to c1 and c2. The cylinder radius is scaled by the lattice spacing in the dimension corresponding to c1. +* For style *ellipsoid*, the lattice spacing in dimensions x,y,z are + applied to the ellipsoid center x,y,z. The spacing in dimensions + x,y,z are applied to the ellipsoid radii a,b,c respectively. * For style *plane*, the lattice spacing in dimension x is applied to px and nx, similarly the spacings in dimensions y,z are applied to py/ny and pz/nz. diff --git a/region_ellipsoid.cpp b/src/region_ellipsoid.cpp similarity index 98% rename from region_ellipsoid.cpp rename to src/region_ellipsoid.cpp index f021ead348..6942d4bdfd 100644 --- a/region_ellipsoid.cpp +++ b/src/region_ellipsoid.cpp @@ -460,6 +460,7 @@ void RegEllipsoid::variable_check() } } +// ------------------------------------------------------------------ // David Eberly, Geometric Tools, Redmond WA 98052 // Copyright (c) 1998-2021 // Based on https://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf @@ -467,10 +468,11 @@ void RegEllipsoid::variable_check() // https://www.boost.org/LICENSE_1_0.txt // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // Version: 4.0.2021.08.01 +// ------------------------------------------------------------------ /* ---------------------------------------------------------------------- - * functions for the 2D case - * ------------------------------------------------------------------------- */ + functions for the 2D case +------------------------------------------------------------------------- */ double RegEllipsoid::GetRoot2D(double r0, double z0, double z1, double g) { @@ -543,8 +545,8 @@ double RegEllipsoid::DistancePointEllipse(double e0, double e1, double y0, doubl } /* ---------------------------------------------------------------------- - * functions for the 3D case - * ------------------------------------------------------------------------- */ + functions for the 3D case +------------------------------------------------------------------------- */ double RegEllipsoid::GetRoot3D(double r0, double r1, double z0, double z1, double z2, double g) { @@ -647,4 +649,3 @@ double RegEllipsoid::DistancePointEllipsoid(double e0, double e1, double e2, dou } return distance; } - diff --git a/region_ellipsoid.h b/src/region_ellipsoid.h similarity index 100% rename from region_ellipsoid.h rename to src/region_ellipsoid.h