Difference between revisions of "Create a Mesh with Images and Shapes"

From OSUPDOCS
Jump to navigation Jump to search
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
One way to create a complicated FEA mesh, especially composite materials with complex structures of subelements, is to  define them with image and shape commands.
One way to create a complicated FEA mesh, especially composite materials with complex structures of subelements, is to  define them with image and shape commands.
__TOC__
== Procedure ==


== Introduction ==
An advanced method for creating FEA meshes is to create them using image and shape commands. The procedure for using this method is:
 
An advanced method for creating FEA meshes is to create them using image and shape commands. The process to use these commands is:


<ol>
<ol>


<li>Create a standard mesh, which can be done by [[FEA Mesh Generation Commands|generating]] or [[Explicit FEA Mesh Generation|explicitly defining]] a mesh. Each area (in [[FEA Mesh Generation Commands|generated]] meshes) or element (in [[Explicit FEA Mesh Generation|explicitly defined]] meshes) can be assigned to various materials. For sections of the mesh that will be set from a image or shape commands, set the material argument in the [[Area Command]] to <tt>_NONE_</tt> or the <tt>mat</tt> attribute of <tt>XML</tt> commands to 0. The material will be determined later by subsequent image and shape commands.</li>
<li>Create a standard mesh, which can be done by [[FEA Mesh Generation Commands|generating]] or [[Explicit FEA Mesh Generation|explicitly defining]] a mesh. Each area (in [[FEA Mesh Generation Commands|generated]] meshes) or element (in [[Explicit FEA Mesh Generation|explicitly defined]] meshes) can be assigned to various materials. For sections of the mesh that will be set from image or shape commands, set the material <tt>id</tt> in the [[Area Command]] to <tt>_NONE_</tt> or the <tt>mat</tt> attribute of <tt>XML</tt> commands to 0. The material will be determined later by subsequent image and shape commands.</li>


<li>Once the initial mesh is ready, use one or more interspersed [[BMPRegion Command|BMPRegion]], [[Region Command|Region]], or [[Hole Command|Hole]] commands (in <tt>XML</tt> files, the corresponing commands are [[BMPRegion Command|<tt><BMP></tt>]], [[Region Command|<tt><Body></tt>]], or [[Hole Command|<tt><Hole></tt>]] commands). These commands will map elements covered by the image or by shapes to the material associated with the command. The grid can be regular or irregular. The material will be selected by comparing the centroid of the element to same location in an image or to see if it is contained in a shape. To resolve complicated structures, the grid has to be fine enough to resolve material boundaries.</li>
<li>Once the initial mesh is ready, use one or more interspersed [[BMPRegion Command|BMPRegion]], [[FEA Region and Hole Commands|Region, or Hole]], commands (in <tt>XML</tt> files, the corresponing commands are [[BMPRegion Command|<tt><BMP></tt>]], [[FEA Region and Hole Commands|<tt><Body></tt>, or <tt><Hole></tt>]] commands). These commands will map elements covered by the image or by shapes to the material (or hole) associated with the command. The grid can be regular or irregular. The assignment will be determined by comparing the centroid of the element to the same location in an image or to see if it is contained in a shape. To resolve complicated structures, the grid has to be fine enough to resolve material boundaries.</li>


<li>When the mesh is done, any elements initialized to <tt>_NONE_</tt> (or <tt>mat=0</tt>) but not assigned to a material by an image or shape command will automatically be removed from the mesh. This feature allows calculations on materials with voids or irregular edges without needing to use complicated [[Area Command|Area commands]] to construct the shape. If these removals cause the mesh to be partitioned into disconnected sections, however, the FEA analysis will fail. A good way to verify connectivity is to attempt to [[Resequence Command|resequence the nodes]].</li>
<li>When the mesh is done, any elements initialized to <tt>_NONE_</tt> (or <tt>mat=0</tt>) but not assigned to a material by an image or shape command will automatically be removed from the mesh. This feature allows calculations on materials with voids or irregular edges without needing to use complicated [[Area Command|Area commands]] to construct the shape. If these removals cause the mesh to be partitioned into disconnected sections, however, the FEA analysis will fail. A good way to verify connectivity is to attempt to [[Resequence Command|resequence the nodes]].</li>
Line 15: Line 15:
</ol>
</ol>


== Scripted Images and Shapes ==
== Image and Shape Commands ==
 
* <a href="bmpregion.html">BMPRegion</a> ... <a href="endregion.html">EndRegion</a>: Generate elements from an image in a BMP file.
* <a href="hole.html">Hole</a> ... <a href="endhole.html">EndHole</a>: Remove elements using a series of shape commands.
* <a href="oval.html">Oval</a>: Define oval to set element material type.
* <a href="polypt.html">PolyPt</a>: Define polygon to set element material type
* <a href="rect.html">Rect</a>: Define rectangle to set element material type.
* <a href="region.html">Region</a> ... <a href="endregion.html">EndRegion</a>: Generate elements for a series of shape commands.
 
== XML Images and Shapes ==
 
<pre>
&lt;BMP name="MatImage.bmp" width="50" angles="MatAngles.bmp"&gt;
  &lt;Origin x="0" y="0"/&gt;
  &lt;Intensity mat="2" imin="76" imax="255"&gt;
    &lt;Thickness units="mm"&gt;1&lt;/Thickness&gt;
  &lt;/Intensity&gt;
  &lt;Intensity mat="3" imin="1" imax="75"&gt;
    &lt;Thickness units="mm"&gt;1&lt;/Thickness&gt;
  &lt;/Intensity&gt;
  &lt;Intensity imin="0" imax="255" minAngle="0.000000" maxAngle="90.000000"/&gt;
&lt;/BMP&gt;
 
&lt;Body mat='1' angle='0' thick='1'&gt;
  &lt;Oval units='mm' xmin='10' xmax='40' ymin='10' ymax='40'/&gt;
  &lt;Rect units='mm' xmin='10' xmax='40' ymin='10' ymax='40'/&gt;   
&lt;/Body&gt;
 
&lt;Hole&gt;
  &lt;Rect xmin='20' xmax='30' ymin='20' ymax='30'/&gt;   
&lt;/Hole&gt;
</pre>
 
==== BMP, Region, and Hole Commands ====
 
A powerful way to mesh complicated structures or composite materials with complicated morphologies is to do most of the work in <tt>&lt;BMP&gt;</tt> commands or using shapes in <tt>&lt;Body&gt;</tt> or <tt>&lt;Hole&gt;</tt> commands. The process is:
 
# Create a standard mesh as described above. For sections of the mesh that will be set from a <tt>BMP</tt> file or from shapes, set the material attribute to 0.
# One the <tt>&lt;Mesh&gt;</tt> section is done, use one or more interspersed <tt>&lt;BMP&gt;</tt>, <tt>&lt;Body&gt;</tt>, or <tt>&lt;Hole&gt;</tt> commands. They will map elements they cover currently with material 0 to the the material defined by the image or the region settings. The grid can be regular or irregular. The material will be selected from the image information at the centroid of the element; for shapes it will be set if the centroid of the element is in the shape. To resolve complicated structures, the grid has to be fine enough to resolve object details.
# When the mesh is done, any elements initialized to material 0 but not assigned to a material by <tt>&lt;BMP&gt;</tt>, <tt>&lt;Body&gt;</tt>, or <tt>&lt;Hole&gt;</tt> commands will automatically be removed from the mesh. This feature allows calculations on materials with voids or irregular edges without needing to use <tt>&lt;Area&gt;</tt></a> commands to construct all details of the shape. If these removals cause the mesh to be partitioned into disconnected sections, however, the FEA analysis will fail. A good way to verify connectivity is to attempt to [[resequence the nodes]]
 
The image and shape commands are:
 
<dl>
 
<dt><a name="body"></a><code>&lt;BMP&gt;</code></dt>
<dd>The details on the <code>&lt;BMP&gt;</code> command and the meaning of its attributes and subordinate commands are given <a href="definempm.html#BMPShape">here</a> (in the MPM documentation).</dd>


<dt><a name="body"></a><code>&lt;Body&gt;</code></dt>
To define the mesh using a series of geometric shapes or images, the the commands are
<dd>Defines a block of material. All material points in the block will be assigned the same material
number (<code>mat</code>, see <a href="definematl.html">Defining Materials</a>;
numbers can be replaced by names using a <code>matname</code> attribute
as explained <a href="definematl.html#usemats">here</a>), material angle
(<code>angle</code> in degrees which is used for some <a href="definematl.html">anisotropic
materials</a>; t can be entered as a number or as a <a href="function.html">user-defined function</a>), and thickness (<code>thick</code> in mm)
A single <code>&lt;Body&gt;</code> for 2D FEA can contain any number of the <a href="definempm.html#2DShapes">2D shape commands</a>. The shapes can overlap; if they do the element material will be for the first shape command that intersects that elements centroid.
If not specified angle will be zero and the thickness will be 1 mm.</dd>


<dt><code>&lt;Hole&gt;</code></dt>
* [[FEA Region and Hole Commands|Region Command]]: Generate elements using a series of shape commands.
<dd>Defines empty space within a body. A single <code>&lt;Hole&gt;</code> group for 2D FEA can contain any number of the <a href="definempm.html#2DShapes">2D shape commands</a>. Any subsequent <code>&lt;BMP&gt;</code> or <code>&lt;Body&gt;</code> structures that overlap the hole will not assign those elements.</dd>
* [[FEA Region and Hole Commands|Hole Command]]: Remove elements using a series of shape commands.
* [[BMPRegion Command|BMPRegion Command]]: Generate elements using a 2D image or CAD drawing of an object.


</dl>
By [[Nested Shapes|nesting shapes]], you can create many more types of shapes.

Latest revision as of 20:31, 5 December 2016

One way to create a complicated FEA mesh, especially composite materials with complex structures of subelements, is to define them with image and shape commands.

Procedure

An advanced method for creating FEA meshes is to create them using image and shape commands. The procedure for using this method is:

  1. Create a standard mesh, which can be done by generating or explicitly defining a mesh. Each area (in generated meshes) or element (in explicitly defined meshes) can be assigned to various materials. For sections of the mesh that will be set from image or shape commands, set the material id in the Area Command to _NONE_ or the mat attribute of XML commands to 0. The material will be determined later by subsequent image and shape commands.
  2. Once the initial mesh is ready, use one or more interspersed BMPRegion, Region, or Hole, commands (in XML files, the corresponing commands are <BMP>, <Body>, or <Hole> commands). These commands will map elements covered by the image or by shapes to the material (or hole) associated with the command. The grid can be regular or irregular. The assignment will be determined by comparing the centroid of the element to the same location in an image or to see if it is contained in a shape. To resolve complicated structures, the grid has to be fine enough to resolve material boundaries.
  3. When the mesh is done, any elements initialized to _NONE_ (or mat=0) but not assigned to a material by an image or shape command will automatically be removed from the mesh. This feature allows calculations on materials with voids or irregular edges without needing to use complicated Area commands to construct the shape. If these removals cause the mesh to be partitioned into disconnected sections, however, the FEA analysis will fail. A good way to verify connectivity is to attempt to resequence the nodes.

Image and Shape Commands

To define the mesh using a series of geometric shapes or images, the the commands are

By nesting shapes, you can create many more types of shapes.