Difference between revisions of "2D MPM Shape Commands"
Line 1: | Line 1: | ||
These shape commands are used in 2D MPM simulations within | These shape commands are used in 2D MPM simulations within [[MPM Region and Hole Commands|<tt>Region</tt>and <tt>Hole</tt> commands]] to discretize an object for the calculations. Besides these shapes, you can also [[BMPRegion Command|discretize objects directly from images]]. | ||
== Rect Command == | == Rect Command == |
Revision as of 08:35, 21 November 2013
These shape commands are used in 2D MPM simulations within Regionand Hole commands to discretize an object for the calculations. Besides these shapes, you can also discretize objects directly from images.
Rect Command
A scripted Rect command defines a region to be assigned element materials or to be defined as a hole:
Rect (xmin),(xmax),(ymin),(ymax)
In XML files, the command is:
<Rect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'/>
where
- (xmin),(xmax),(ymin), and (ymax) are the x and y extents of the rectangle (or R and Z extents if axisymmetric). If xmax<xmin or ymax<ymin, they will be automatically switched to define the rectangle. The units are mm (or determined by a units attribute in XML files).
If the defined rectangle overlaps areas that already has assigned elements, or has been defined as a hole, those areas will be ignored.
Oval Command
A scripted Oval command defines a region to be assigned element materials or to be defined as a hole:
Oval (xmin),(xmax),(ymin),(ymax)
In XML files, the command is:
<Oval xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'/>
where
- (xmin),(xmax),(ymin), and (ymax) are the x and y extents of the rectangle (or R and Z extents if axisymmetric) that encloses the oval. If xmax<xmin or ymax<ymin, they will be automatically switched to define the oval. The units are mm (or determined by a units attribute in XML files).
If the defined oval overlaps areas that already has assigned elements, or has been defined as a hole, those areas will be ignored.
PolyPt Command
In scripted files, a series of PolyPt commands is used to define a polygonal region to be assigned element materials, or to be defined as a hole:
PolyPt (x1),(y1) PolyPt (x2),(y2) ... PolyPt (xn),(yn) PolyPt
In XML files, a polygon is defined with a <Polygon> block:
<Polygon> <pt x='(x1)' y='(y1)'/> <pt x='(x2)' y='(x2)'/> ... <pt x='(xn)' y='(yn)'/> </Polygon>
where
- (xi),(yi) (for i = 1 to n) are the x and y coordinates of the each point in the polygon (or R and Z if axisymmetric) with the last point (xn),(yn)) being connected to the first ((x1),(y1)). If the PolyPt arguments are omitted, the polygon is closed. The units are mm (or determined by a units attribute in XML files).
A blank PolyPt command in scripted files is only needed if you need to define more than one polygon in the same region. The blank command will finish the current one and the next one will start with the next PolyPt command. Intervening Rect and Oval commands or the end of a block will also stop the current polygon; in these cases the blank PolyPt is not needed.