Personal tools
You are here: Home / cmgui / Wiki / Node, Line and Element numbering in exelem files
Navigation
Log in


Forgot your password?
 

Node, Line and Element numbering in exelem files

Introduction

Exelem files are usually generated by exporting a mesh from cm. They are a text based file format, so exelem files are human readable. Sometimes you may wish to edit your exelem file manually, or even create one from scratch (note that it is far easier to modify an existing exelem file than it is to create one manually from scratch).

If you would like to manually edit an exelem file it is useful to have an understanding of how the exelem file format. I have not found any documentation on this so here is my understanding of what is going on. I will attempt to keep this up to date as I learn more about the exelem files.

Example files

In explaining the format I will refer to this exelem file: <a href="fourelements.exelem"> fourelements.exelem </a> which uses the exnode file: <a href="fourelements.exnode"> fourelements.exnode </a>

It is not overly complicated but it does exhibit some nontrivial features. This file describes a 4 element bicubic hermite surface mesh.

Exelem structure overview

The general structure of an exelem file is to first list the 1D shapes (lines), then the 2D shapes (faces) followed by the 3D shapes (elements). In our example we are describing a 2D surface mesh so will only be dealing with 1D and 2D shapes.

Note that what is referred to as an "element" or "face" can be a little confusing. An "element" in a linear mesh is a 1D shape, whereas an element in a surface mesh is a 2D shape and an element in a volume mesh is a 3D shape. Except for the case of the 1D linear mesh, elements can be though of as being made up of "faces" which have one dimension less than the elements.

To clarify:

  • A 1D element is a 1D shape (line)
  • A 2D element is made up of 4 faces (imagine the 4 sides of a square). Each "face" is actually a 1D shape (line).
  • A 3d element is made up of 6 faces (imagine the 6 sides of a cube). Each face is a 2D shape (face). Each face is in turn made up of 4 1D shapes (lines).

If you are reading in a 3D mesh it is possible to get cmgui to generate your lines and faces automatically, so if convenient you can omit the sections which specify the 1D and 2D elements. When reading in the element file you then need to use the 'generate_faces_and_lines' flag:

gfx read node mesh.exnode
gfx read elem mesh.exelem generate_faces_and_lines

Exelem structure in detail

It may be useful to print out a copy of the fourelements.exelem file to refer to as you look at the structure in more detail. We proceed by looking at each part of the file.

Header

Excerpt:

Group name: four_elements

The first line specifies the group name. This is the name which is used to refer to the group of elements within cmgui.

1D shapes

Excerpt:

Shape.   Dimension=1
Element: 0 0       1
Element: 0 0       2
...

The next section lists all the 1D shapes. Note that it does not specify which nodes the lines connect up to. The connections are derived from the

Node ordering for the elements described later in the file. Note also that the element is identified by 3 different numbers. In general 1D shapes use the last column, 2D shapes used the middle column and 3D shapes use the first column. If only 2D surface elements are being used then the first column may be used for the 2D shapes, to indicate they are the highest level shape in the mesh.

2D shapes

Excerpt:

Shape.  Dimension=2
#Scale factor sets= 1
  c.Hermite*c.Hermite, #Scale factors=16
#Nodes=           4
#Fields=1
1) coordinates, coordinate, rectangular cartesian, #Components=3
  x.  c.Hermite*c.Hermite, no modify, standard node based.
    #Nodes= 4
    1.  #Values=4
   Value indices:     1   2   3   4
   Scale factor indices:   1   2   3   4
  2.  #Values=4
   Value indices:     1   2   3   4
   Scale factor indices:   5   6   7   8
  ...

Before listing the 2D shapes information about the nodal fields and basis functions for the shape are given. This is followed by a list of elements, where each element specifies its constituent lines (faces), node connectivity and scale factors.

Excerpt:

Element:            1 0 0
  Faces:
  0 0     3
  0 0     4
  0 0     1
  0 0     6
  Nodes:
                1            2            4           5
  Scale factors:
  0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01
  0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01
  0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01   0.1000000000000000E+01
  0.1000000000000000E+01
  ...

Line ordering for 2D shapes

The four "faces" (lines) for the 2D shape are listed down the page. The order is specified as follows: first the edge where xi1=0 then where xi1=1; then xi2=0 and finally xi2=1. Note that the xi1 and xi2 directions depend on the ordering of the nodes.

Node ordering for 2D shapes.

The four nodes for the 2D shape are listed on one line. The xi1 direction is defined by the vector with its tail at the first node and head at the second. The xi2 direction is defined by the vector with its tail at the second node and head at the third. The third and fourth node should define a vector that points in the same direction as xi1. A common error is to get the node numbers for the third and fourth nodes around the wrong way, which results in a very odd element.

Node ordering example

The images below shows the nine nodes which will be used to create our four element mesh. I have added in our desired xi1 and xi2 directions. Note that it is a good idea to keep the xi directions consistent for each element.

<img alt="Nine nodes with xi directions" src="xidirections.jpg"/> <img alt="Four elements" src="fourelements.jpg"/>

To create our first element (in the bottom left corner) with the desired xi directions we need to list the nodes in the following order: 1 2 4 5

The order for the remaining elements is as follows:

  • Element 2 uses the nodes : 2 3 5 6
  • Element 3 uses the nodes: 4 5 7 8
  • Element 4 uses the nodes: 5 6 8 9

Face ordering example

The images below shows the four elements along with the 12 numbered lines (in red) which make make up the "faces" of the elements.

<img alt="Four elements with faces" src="twelvelines.jpg"/>

The numbering of faces is arbitrary but needs to be consistent across elements, otherwise lines will not be drawn correctly. I have chosen to number my lines as shown in the picture but a different numbers could have been assigned.

To list the faces for our first element (in the bottom left corner) with the specified xi directions we need to list the faces in the following order: 3 (face at xi1=0), 4 (face at xi1=1), 1 (face at xi2=0), 6 (face at xi2=1)

The order for the remaining elements is as follows:

  • Element 2 uses the faces : 4 5 2 7
  • Element 3 uses the faces: 8 9 6 11
  • Element 4 uses the faces: 9 10 7 12