2D MPM Shape Commands

From OSUPDOCS
Jump to navigation Jump to search

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.

Line Command

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

Line (x1),(x2),(y1),(y2),<(tolerance)>

In XML files, the command is:

<Line x1='(x1)' x2='(x2)' y1='(y1)' y2='(y2)' tolerance='(tol)'/>

where the line is from (x1,y1) to (x2,y2). The region will include points within (tolerance) of the line. The region will be rectangle with edges normal to the line and width of 2*(tolerance).

Note that xmin, xmax, ymin, and ymax can be used in place of x1, x2, y1, and y2.

Arc Command

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

Arc (xmin),(xmax),(ymin),(ymax),(arcStart)>,(arcEnd),<(tolerance)>

In XML files, the command is:

<Arc xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)' 
     start='(arcStart)' end='(arcEnd)' tolerance='(tolerance)'/>

where

  • (xmin),(xmax),(ymin), and (ymax) are the x and y extents of an oval (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): The arc will be path traced along border of the oval in the counterclockwise direction from angles specified in (arcStart) and (arcEnd), where 0 degrees is the positive x axis direction. These must be entered as 0≤(arcStart)<360 and (arcStart)<(arcEnd)<(arcStart)+360.
  • (tolerance): The arc region will be distance (tolerance) on either side of the arc path.

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.