NAME
polygon
SYNOPSIS
polygon [-A name] [-N name] first x0 y0 ray x y [-optional link arguments] bcurv type dim [-optional link arguments] x_1 y_1 x_2 y_2 ... ... x_dim y_dim carc [-optional link arguments] x_1 y_1 length sgn sing x y [-optional link arguments] end
DESCRIPTION
polygon creates irregularly shaped immersed boundaries by piecewise combinations of line segments, circular arcs, parameterically defined curves and single points. polygon subcommands, bcurv, ray, carc, and sing can be used an arbitrary number of times allowing polygon to draw arbitrary objects.polygon requires two arguments, each on a separate line, and it requires at least one optional statement. These arguments are:
These commands must have the form:
- first - specifies the first point of the polygon
- end - specifies the end of the polygon statements
polygon first x0 y0 endpolygon interpretes two optional statements.The default elastic link properties of a polygon can be changed in two ways. The spring p commands can be used to change the defaults for any polygon subcommand, see the spring synopsis for the relevant details on this method. Second, the elastic link properties for a given subsection of a polygon can be changed using the optional arguments that define that subsection.
- -A name - indicates this entity is active and provides a name
- -N name - provides a name
POLYGON SUBCOMMANDS
The polygon subcommands ``draw'' the immersed boundary, and the optional arguments of the polygon subcommands specify the elastic link properties of the immersed boundary, The subcommands of polygon and their uses are:
first and end specify the start and end of the polygon and must be included in every polygon.bcurv specifies a parametrically defined curve segment from the current point to the last point in a list of (x,y) data pairs that follows the bcurv statement.
carc specifies an arc of a circle from the current point to a specified endpoint and having a specified arclength. The optional arguments specify the elastic link properties of the carc.
ray specifies a line segment from the current point to the last point listed in the required arguments. The optional arguments specify the elastic link properties.
sing specifies a single immersed boundary point that can be tethered with an optional argument.
CLOSED AND OPEN POLYGONS:
If the distance between the first and last points of a polygon is less than half the spatial grid spacing, then the polygon is assumed to be closed, otherwise the polygon is assumed to be open.The difference between an open and closed polygon is that a closed polygon has an interior, while an open polygon does not. This difference can make a substantial difference in the outcome of all computations.
The forces that the immersed boundary generate are computed periodically for all closed polygons, i.e. there are elastic links between the first and last points of the polygon. In an open polygon, no such links are created. Additionally, when the color graphics files are generated, the interiors of objects are coded to allow for different colors than used in the exterior.
PROPERTIES OF THE PIECEWISE CURVE
The piecewise curve created by polygon is constructed sequentially. To imagine drawing a polygon, put a pen down on the paper at the starting point and leave it there. Evaluate the next statement and draw the new section of the curve that the statement defines, leaving your pen on the paper. Repeat this process until there are no more statements, and never raise your pen until you are done.In the definition of the piecewise curve created by polygon, the first point of a segment belongs to that segment, but the last point of a segment belongs to the next segment. This is important because the elastic link properties of a segment are applied at the first point and not the last point. For example a tethered line segment is tethered at the first point but not the last point. Tethering can be applied at the last point by using a singlet at the last poin and tethering that point. For example, to create a polygon that consists of a line of points from (1,1) to (1,2), tether them and include tethering at the point (1,2), the following code would be used
polygon first 1.0 1.0 ray 1.0 2.0 -t 1000.0 sing 1.0 2.0 -t 1000.0 end
DEFAULT CONNECTING ANGLES:
The default connecting angle between two segments must be calculated at the point where the two segments meet. The resting positions of the immersed boundary points involved in this calculation are the the cooresponding tether point locations. Let the resting position of the point where the segments meet be Xj and the resting position of the previous and next points be Xj-1 and Xj+1, respectively. The default connecting angle is calculated from the inner product of Xj - Xj-1 and Xj - Xj+1. To override this default, determine the desired resting angle, and use the -u optional statement.
EXAMPLES:
The balloon apparatus was created using polygon. The following code will create one large and one small balloon on the ends of the straw. The elastic link properties of the balloons are slightly different.polygon first 1.50 1.125 bcurv s 4 -n 200 0.50 2.50 -0.50 1.00 0.50 -0.50 1.50 0.875 ray 2.50 0.875 bcurv s 4 -n 200 3.00 0.25 3.50 1.00 3.00 1.75 2.50 1.125 ray 1.50 1.125 endThe bcurv statements place immersed boundary points on a curve defined by a polynomial. That polynomial is described in Appendix ???. The ray statements place immersed boundary points on a straight line segment. Notice that the last point of the control polygon is the same as the first point of the polygon, thus creating a closed curve.
NAME
polygon - bcurv
SYNOPSIS
bcurv type n [-optional link arguments] x1 y1 x2 y2 ... ... n data pairs xn yn
DESCRIPTION
bcurv specifies a parametrically defined curve segment from the current point to the last point in a list of (xn,yn) .bcurv has two sets of required arguments. On the bcurv command line, the required arguments are:
The second set of bcurv required arguments consist of a set of (x,y) data pairs (one pair per line) that define the curve. The role of these points will be discussed below.
- type - Specifies the resting position of the curve from a predetermined set. This possible types are:
- f - resting initial positions are the same
- s - resting position is a straight line between current point and (xn,yn).
- n - Number of data pairs that define the curve.
The optional arguments of bcurv specify the elastic link properties of that curve. bcurv interprets the following options.
- -a angle - resting angle at the IB points (default=0)
- -b bend - bending stiffness at the IB points (default=40000)
- -d distance - initial distance between IB points (default=0.5)
- -e end tether - tether spring stiffness at the endpoints (default=0)
- -l link - inter-IB-point spring rest length (default=0.5)
- -s stiff - inter-IB-point spring stiffness (default=40000)
- -t tether - tether spring stiffness (default=0)
The (x,y) data pairs that are specfied in bcurv are the control points of a Berstein-Bezier (BB) polygon. These points determine a parametrically-defined polynomial curve. Mathematical details about the BB curve are given in Appendix ???, but the important features of the curve as it relates to the required points are;
Figure ??? gives an example, using four data pairs, of a cubic BB curve. The figure displays how moving a specific point on the control polygon changes the curve.
- The first point of the control polygon is the current point.
- The curve interpolates the current and last points.
- The tangent to the curve at the beginning point is parallel to the vector pointing from the first control point to the second control point.
- The curve is drawn toward, but not through, the points of the BB polygon. Thus to force the curve in a specified direction, place control point farther in that direction than where the position of the curve is desired.
EXAMPLE
bcurv s 3 x1 y1 x2 y2 x3 y3
This code draws the BB curve shown in Figure ???.
NAME
polygon - carc
SYNOPSIS
carc [-optional link arguments] x y length sgn
DESCRIPTION
carc specifies a circular arc of immersed boundary points in the polygon. carc requires two separate lines, each containing two arguments. These lines and arguments are:The circular arc extends from the current point to the specified endpoint and has the specified arclength. If the arclength is less than the distance between the current point and the endpoint, then carc determines an error has occurred and terminates. Two points on a circular arc and the arclength between them does not determine a unique circle. Therefore, the direction of the center of the circle must be specified. sgn sets that directions. sgn should be set to 1 if the difference between the x component of the center of the circle from the midpoint of the current point and the endpoint is positive. sgn should be set to -1 otherwise. This uniquely determines a circle, except in one case where the center of the circle and the midpoint of the current point and the endpoint are the same. This case, IBIS will will cheat by adding a small number to the endpoint to resolve this problem.
- x y - The endpoints of the circular arc.
- length sgn - The length of the arc and the direction of the center of the circle that contains the arc. sgn must be either 1 or -1.
carc interpretes the following options.
- -a angle - resting angle at the IB points (default=determined analytically)
- -b bend - bending stiffness at the IB points (default=40000)
- -d distance - initial distance between IB points (default=0.5)
- -e end tether - tether spring stiffness at the endpoints (default=0)
- -l link - inter-IB-point spring rest length (default=0.5)
- -n number - number of IB points on the circular arc
- -s stiff - inter-IB-point spring stiffness (default=40000)
- -t tether - tether spring stiffness (default=0)
EXAMPLE
carc [-optional link arguments] x y length sgn
Starts the polygon at (1,2).
NAME
polygon - end
SYNOPSIS
end
DESCRIPTION
end is a required statement in a polygon that specifies the end of the polygon. end must appear on the last line of a set of polygon subcommands. end has no arguments.
NAME
polygon - first
SYNOPSIS
first x y
DESCRIPTION
first is a required statement in a polygon that specifies the first immersed boundary point in the polygon. first must appear on the line directly below polygon. first requires two arguments.first has no optional statements.
- x - The x coordinate of the first polygon point.
- y - The y coordinate of the first polygon point.
EXAMPLE
first 1 2
Starts the polygon at (1,2).
NAME
polygon - ray
SYNOPSIS
ray x y [-optional link arguments]
DESCRIPTION
ray specifies a straight line segment of immersed boundary points in the polygon. ray requires two arguments.ray interpretes the following options.
- x - The x endpoint of the line segment
- y - The y endpoint of the line segment
- -a angle - resting angle at the IB points (default=0)
- -b bend - bending stiffness at the IB points (default=40000)
- -d distance - initial distance between IB points (default=0.5)
- -e endtether - tether spring stiffness at the first point (default=0)
- -n number - number of IB points on the line
- -s stiff - inter-IB-point spring stiffness (default=40000)
- -t tether - tether spring stiffness (default=0)
EXAMPLE
ray 1 2 -e 10000.
Run a straight line of IB points from the current point to the point (1,2), and tethers the first point with a spring whose resting length is zero and stiffness is 10000. The point (1,2) is not contained in the segment, see the polygon section.
NAME
polygon - sing
SYNOPSIS
sing x y [-optional link arguments]
DESCRIPTION
sing specifies a single immersed boundary point in the polygon. The polygon version sing differs from singlet in that sing is embedded in a curve and may interact with its neighbors. sing requires two arguments.sing interpretes the following options.
- x - The x endpoint of the line segment
- y - The y endpoint of the line segment
- -a angle - resting angle at the IB points (default=0)
- -b bend - bending stiffness at the IB points (default=0)
- -l link - inter-IB-point spring rest length (default=0)
- -s stiff - inter-IB-point spring stiffness (default=0)
- -t tether - tether spring stiffness (default=0)
EXAMPLE
sing 1 2 -t 2000
Places a single IB point at (1,2) and tethers that point.