FEA Mesh Generation Commands
The best way to generate an FEA mesh is to use Keypoint, Path, and Area commands, with an optional BMP, Region, and Hole commands to assign material properties from a digitized image of the object and from shape commands.
Scripted Input Files
In scripted input files, you build the mesh by using multiple Mesh Generation Commands. These commands are usually grouped together, but may be at various locations in the input file.
XML Input Files
In XML input files, all Mesh Generation Commands must be within a single Mesh block:
<Mesh> <<a href="#Keypoints"><code>Keypoints</code></a>> <pt x='0' y='0' id='lowerleft'/> <pt x='0' y='10' id='upperleft'/> <pt x='50' y='0' id='lowerright'/> <pt x='50' y='10' id='upperright'/> </Keypoints> <<a href="#Paths"><code>Path</code></a> id="bottom" intervals='6' ratio='1'> <keypt id='lowerleft'/> <keypt id='lowerright'/> </Path> <Path id="right" intervals='3'> <keypt id='lowerright'/> <keypt id='upperright'/> </Path> <Path id="top" intervals='6'> <keypt id='upperright'/> <keypt id='upperleft'/> </Path> <Path id="left" intervals='3'> <keypt id='upperleft'/> <keypt id='lowerleft'/> </Path> <<a href="#Areas"><code>Area</code></a> mat="1" thick="10" type="4" flip="0" angle="0"> <path id="bottom"/> <path id="right"/> <path id="top"/> <path id="left"/> </Area> </Mesh> <!-- image and shape methods to set element properties --> <BMP name="MatImage.bmp" width="50" angles="MatAngles.bmp"> <Origin x="0" y="0"/> <Intensity mat="2" imin="76" imax="255"> <Thickness units="mm">1</Thickness> </Intensity> <Intensity mat="3" imin="1" imax="75"> <Thickness units="mm">1</Thickness> </Intensity> <Intensity imin="0" imax="255" minAngle="0.000000" maxAngle="90.000000"/> </BMP> <Body mat='1' angle='0' thick='1'> <Oval units='mm' xmin='10' xmax='40' ymin='10' ymax='40'/> <Rect units='mm' xmin='10' xmax='40' ymin='10' ymax='40'/> </Body> <Hole> <Rect xmin='20' xmax='30' ymin='20' ymax='30'/> </Hole>
Keypoints
The <Keypoints> section must come first. It can define any number of key points. Each subordinate <pt> command defines a key point, provides its x and y coordinates and gives it an id. The id's can be text or numbers and must all be unique among key points.
Paths
Following the <Keypoints>, there are a series of <Path> commands that link the key points into lines or arcs and define mesh information along those paths. Subordinate to each <Path> command are a series of <keypt> commands that list the key points that define the path. Use two key points to define a line or three key points to define an arc. Currently the path can only have two or three key points. The key points are selected by their id. The attributes for a <Path> command are:
- id: An id for the path. The id's can be text or numbers and must be unique among all paths.
- intervals: Number of elements along this path when it is meshed into an area.
- ratio: Ratio of the size of the first element along the path to the last one. If ratio<0, then the absolute size of the first element on the path with be |ratio|. The default is 1.0 which gives equally sized elements.
Areas
Finally, the FEA mesh is created by a series of <Area> commands. An <Area> command links a series of paths into a region to be meshed. Subordinate to each <Area> command are a series of <path> commands that list the paths that define the area. Currently NairnFEA only supports areas with four paths, to mesh quadrilateral areas, or areas with two paths, to mesh interfaces.
For quadrilateral areas, the end of the last path must connect to the start of the first path. The direction of each path does not matter as they will be rearranged if needed to define the area; but the paths must circumnavigate the area in the counter-clockwise direction. If n1, n2, n3, and n4 are the number of nodes along each of the four paths, the meshing algorithm requires that n1+n2=n3+n4.
For interface meshing, the two paths must be different, but indentical paths. In other words, they must connect different keypoints, but the coordinates of the keypoints, the number of intervals along the path, and the path ratios must be identical. The order and orientation of the two paths in the area command does not matter. Finally, interfaces only function when they connect two areas. To insure this connection, the paths for an interface must have each been previously used in exactly one quadrilateral area.
The attributes for a <Area> command are:
- mat: Material number in the list of defined materials. Quadrilateral areas cannot use an <a href="definematl.html#interface">interface material</a> while interface areas must use an <a href="definematl.html#interface">interface material</a>. When materials and angle will be set using a
BMP
file, themat
should be set to 0 to indicate no material assigned until the <a href="#bmpcmd"><BMP>
</a> command. - matname: Alternatively, materials can be specied by name. See <a href="definematl.html#usemats">Defining Materials</a> for details on this method.
- angle: Optional material angle relevant to <a href="definematl.html">anisotropic materials</a>. It can be entered as a number or as a <a href="function.html">user-defined function</a>. A function is evaluated at the midpoint of an element. Triangular elements are created in pairs and the function is evaluated at the midpoint of each pair.
- thick: Thickness in mm for plane stress or plain strain analysis; not needed for axisymmetric analysis.
- type: The type of element to create. The options are:
1
: 3-node constant-stain triangular elements (linear)2
: 4-node isoparametric rectangular elements(linear)3
: 8-node isoparametric rectangular elements (quadratic)4
: 6-node isoparametric triangular elements (quadratic)5
: 4-node imperfect interface elements (linear)6
: 6-node imperfect interface elements (quadratic)8
: 9-node Langrangian rectangular element (quadratic) (9 point Gaussian quadrature) The first<Area>
command must define an element type. Subsequent<Area>
commands can omit the element type unless the element type is changed to have an analysis with mixed elements. When mixed elements are used, they must be compatible elements (i.e., you can mix linear elements (types 1, 2, and 5) with each other or quadratic elements (types 3, 4, 6, and 8) with each other, but cannot mix linear elements with quadratic elements). Whenever atype
attribute is used, it will apply to that area and all subsequent areas until it is changed. Finally, quadrilateral areas can only use solid elements (types 1, 2, 3, 4, and 8) and interface areas can use only interface elements (type 5 and 6).flip
: For triangular elements, the initially created quadrilaterials are split into two elements by drawing a diagonal across the quadrilaterial. Theflip
option can change which diagonal is used. It should be 0 or 1. Once it is set, it will apply to that area and all subsequent areas until it is changed.