Difference between revisions of "2D MPM Shape Commands"

From OSUPDOCS
Jump to navigation Jump to search
Line 60: Line 60:
where
where


* <tt>(xi),(yi)</tt> (for i = 1 to n) are the <tt>x</tt> and <tt>y</tt> coordinates of the each point in the polygon (or <tt>R</tt> and <tt>Z</tt> if axisymmetric) with the last point <tt>(xn),(yn)</tt>) being connected to the first (<tt>(x1),(y1)</tt>). If the <tt>PolyPt</tt> arguments are omitted, the polygon is closed. The units are [[ConsistentUnits Command#Legacy and Consistent Units|length units]] (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files).
* <tt>(xi),(yi)</tt> (for i = 1 to n) are the <tt>x</tt> and <tt>y</tt> coordinates of the each point in the polygon (or <tt>R</tt> and <tt>Z</tt> if axisymmetric) with the last point <tt>(xn),(yn)</tt>) being connected to the first (<tt>(x1),(y1)</tt>). If the <tt>PolyPt</tt> arguments are omitted, the polygon is closed. The units are [[ConsistentUnits Command#Legacy and Consistent Units|length units]] (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, the coordinates can alternatively be specified [[#Relative Grid Locations|relative to the mesh edges]].


A blank <tt>PolyPt</tt> 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 <tt>PolyPt</tt> command. Intervening [[#Rect Command|<tt>Rect</tt>]] and [[#Oval Command|<tt>Oval</tt>]] commands or the end of a block will also stop the current polygon; in these cases the blank <tt>PolyPt</tt> is not needed.
A blank <tt>PolyPt</tt> 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 <tt>PolyPt</tt> command. Intervening [[#Rect Command|<tt>Rect</tt>]] and [[#Oval Command|<tt>Oval</tt>]] commands or the end of a block will also stop the current polygon; in these cases the blank <tt>PolyPt</tt> is not needed.

Revision as of 21:03, 7 March 2017

These shape commands are used in 2D or axisymmetric MPM simulations within Region and Hole commands to discretize an object for the calculations.

Rect Command

A scripted Rect command defines a region to be filled with material points or to be defined as a hole:

Rect (xmin),(xmax),(ymin),(ymax),<(arcStart)>,<(arcEnd)>

In XML files, the command is:

<Rect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
   <arc start='(arcStart)' end='(arcEnd)'/>
</Rect>

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 length units (or determined by a units attribute in XML files). In XML files, the coordinates can alternatively be specified relative to the mesh edges.
  • (arcStart) and (arcEnd) are optional parameters that limit the shape to an to arc of the rectangle (ccw from start to end in degrees with 0 degrees along the x axis, 0≤(arcStart)<360, and (arcEnd)>(arcStart)).

If the defined rectangle overlaps areas that already have material points or previously was defined as a hole, those areas will be ignored.

Oval Command

A scripted Oval command defines a region to be filled with material points or to be defined as a hole:

Oval (xmin),(xmax),(ymin),(ymax),<(arcStart)>,<(arcEnd)>

In XML files, the command is:

<Oval xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
   <arc start='(arcStart)' end='(arcEnd)'/>
</Oval>

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 length units (or determined by a units attribute in XML files). In XML files, the coordinates can alternatively be specified relative to the mesh edges.
  • (arcStart) and (arcEnd) are optional parameters that limit the shape to an to arc of the oval (ccw from start to end in degrees with 0 degrees along the x axis, 0≤(arcStart)<360, and (arcEnd)>(arcStart)).

If the defined oval overlaps areas that already have material points or previously was 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 filled with material points 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 length units (or determined by a units attribute in XML files). In XML files, the coordinates can alternatively be specified relative to the mesh edges.

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.

If the defined polygon overlaps areas that already have material points or previously was defined as a hole, those areas will be ignored.

Relative Grid Locations

Rather than hard code positions for boundary conditions or shapes that define material points, any coordinate specified in XML files (e.g., an entry for (x1), (x2), (xmin), (xmax), etc.) can be the text 'min', 'max', 'min-3', 'min+1.2', 'max-3.8', 'max+2', etc., meaning the minimum, the maximum, or a specified number of cells relative to the minimum or maximum of the current mesh. For GIMP calculations 'min' and 'max' will be limits of useable mesh while 'min-1' and 'max+1' will be limits to the total mesh. For backward compatibility, min+, min-, max+, and max- refer to plus or minus one cell from the minimum or maximum of the current mesh.

Nested Commands

You can nest shapes in other shapes to create a wide variety of new shapes.

Using 2D Images

You can convert pixels in 2D images into material points using BMRegion commands.