Finite element model geometry data is partially supported by IMAT. The primary purpose for FEM support with IMAT is visualization, both of the FEM geometry and of mode shapes and contour results. Current support is limited to FEM entities consisting of coordinate systems, nodes, elements, and tracelines. Nodes are used to define point locations in 3D space, and elements and tracelines are used to define connectivity between the node for visualization purposes. Coordinate systems allow for definition of nodes in a local orientation.
IMAT stores FEM geometry as individual classes (data types) for each of the FEM entity types, with an overall FEM class that contains each of the individual entity objects. All of the data found in Universal files for these data types is stored in these entities.
The primary class (imat_fem) containing the coordinate system, node, element, and traceline data has four properties (cs, node, elem, and tl). Each of these properties, in turn,contains an object that contains the data specific to that data type. For example, the .node property of the imat_fem contains an IMAT_NODE object that contains all of the nodes and their associated properties and methods. For a complete list of the various classes and descriptions of their contents, please refer to the FEM Data Format Reference.
Below is an example of the imat_fem object and its contents. These data classes operate very much like MATLAB structures.
>> fem % Each type of FEM entity is stored as an object in the imat_fem
fem =
IMAT_FEM Finite Element Model
76 coordinate systems
5379 nodes
5611 elements
0 tracelines
>> fem.cs % Extract and view the imat_cs object containing the coordinate systems
ans =
IMAT_CS - Coordinate systems
ID Name Type Color
-------- ---------------------------------------- ---- -----
4 CS4 0 8
5 CS5 0 8
6 CS6 0 8
. . .
76 CS76 0 9
>> fem.node % Extract and view the imat_node object containing the nodes
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
--------- -------- -------- -------- ------------ ------------ ------------ ---- -----
1 4 4 4 -4.5 -7.5 -14 1 11
2 4 4 4 -2.5 -7.5 -14 1 11
3 4 4 4 -4.5 -7.5 -11.5 1 11
4 4 4 4 -2.5 -7.5 -14 1 11
. . .
5379 76 76 76 0 -27 -12 1 11
>> fem.tl % Extract and view the imat_tl object containing the tracelines
IMAT_TL - Tracelines
--- Empty ---
>> fem.elem % Extract and view the imat_elem object containing the elements
IMAT_ELEM - Elements
ID Type Color # Nodes
-------- ---------- ---------- ----------
1 33 1 4
2 33 1 4
3 33 1 4
4 33 1 4
. . .
5611 902 4 33
>>
Currently, FEM data can be read through Universal files and NASTRAN OP2 and bulk data files with IMAT+FEA. Universal files provide a way to move function data from one platform to another.
The IMAT toolbox allows you to read a wide variety of Universal files. Universal files are generally ASCII text files that can be read and written by I-deas and other software packages. You can create a Universal file containing FEM geometry by accessing the File/Export menu in I-deas. Select the option "Test Universal File" (or "Simulation Universal File" from the Simulation task). You may export more than one FEM to the same Universal file. You then must choose the universal filename and select the FEMs you want to export.
To read a universal file containing FEM geometry into MATLAB, use the readunv function in the IMAT toolbox. You can provide a filename argument, or call readunv with a wildcard or no argument to interactively select the file to read. Generally, readunv supports both the old and new dataset formats for geometry.
To read FEM geometry from NASTRAN files, use the readnas function.
IMAT provides several methods to operate on the FEM data. Some of the methods are implemented on the imat_fem class as well as the individual imat_cs, imat_node, imat_elem, and imat_tl classes. To determine what methods are available for each object, use Matlab's methods function. For example, to see the available imat_fem methods, type methods(imat_fem) in the Matlab command window. Generally, methods that operate on the FEM as a whole are methods of the imat_fem class. For example, the xform method transforms node coordinates between coordinate systems. It is an imat_fem method since it uses both nodes and coordinate systems. The partition method partitions a FEM down to the entities that are associated with the supplied partitioning entity such as an imat_ctrace. It partitions each of the individual FEM entities stored in the imat_fem. The cat method concatenates two or more FEMs into a single FEM.
By contrast, some methods and properties are specific to that entity type. For example, to determine the number of nodes in your FEM, use length(fem.node).
For example, let's say that you read in a large analysis FEM from a Universal file, but the mode shapes that you want to plot only contain a subset of the geometry. You may want to partition your FEM down to the nodes corresponding to your test degrees of freedom. The following MATLAB session illustrates how to do this.
>> whos
Name Size Bytes Class
ct 975x1 39582 imat_ctrace
fem 1x1 2700458 imat_fem
>> fem % Here is the original FEM read in from a Universal file
fem =
IMAT_FEM Finite Element Model
76 coordinate systems
5379 nodes
5611 elements
0 tracelines
>> numel(unique(node(ct))) % The partitioning coordinate trace has 275 nodes
ans =
275
>> fem2=partition(fem,ct) % Partition the FEM. The elements are also partitioned to those fully defined by the remaining nodes.
Partitioning nodes
Partitioning elements
Partitioning tracelines
fem =
IMAT_FEM Finite Element Model
76 coordinate systems
275 nodes
361 elements
0 tracelines
>>
FEM objects, including the individual coordinate system, node, element, and traceline objects, are scalar objects. However, the individual objects can obviously contain many entities. For example, a single IMAT_NODE object can contain many nodes.
There are several ways of accessing the information in the FEM and FEM entity objects. The most straight-forward way to access the properties using "dot" (structure) notation. You can also access methods this way, following the Matlab convention. The following code snippet shows several examples of this.
>> fem
fem =
IMAT_FEM Finite Element Model
1 coordinate system
30 nodes
10 elements
3 3tracelines
>> fem.tl % Access the scalar traceline object, which contains 3 tracelines
ans =
IMAT_TL - Tracelines
ID Description Color # Nodes
-------- ---------------------------------------- ---------- ----------
1 8 10
2 8 31
3 8 20
>> fem.tl.color % Extract the traceline colors, which are a property of the traceline object
ans =
8
8
8
>> n=imat_node; % Create an empty node object
>> n=n.add(1); % Call the ADD method to add a node
>> n=add(n,1); % Another way to call the ADD method
>>
You can use parenthesis "()" subscripting with the individual FEM entity objects. These subscripts return the entities referenced by those indices. To extract entities by their ID, use curly brace "{}" notation instead. This is equivalent to using the KEEP method. See the following code snippet for examples of this.
>> node = fem.node;
>> setdisplay(node,3)
ans =
IMAT_NODE - Nodes
30 nodes
>> n([3 5]) % Extract the 3rd and 5th nodes -- note the parenthesis notation
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
103 0 0 0 -0.2032 0.41487 0 1 11
105 0 0 0 -0.1016 0.43603 0 1 11
>> n{[103 105]} % Extract node IDs 103 and 105 -- note the curly brace notation
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
103 0 0 0 -0.2032 0.41487 0 1 11
105 0 0 0 -0.1016 0.43603 0 1 11
>>
Curly brace "{}" notation has a special meaning with an imat_fem. If you use this notation and pass in an imat_group object, the FEM will be partitioned to the entities in the group. Groups are covered in the next section.
>> fem
fem =
IMAT_FEM Finite Element Model
1 coordinate system
30 nodes
10 elements
3 tracelines
>> group=group(1)
group =
IMAT_GROUP - Groups
GROUP(1): 1 - EVERYTHING
ID Type Name
-------- -------- ---------------
1 1 coordinate system
1 7 node
2 7 node
3 7 node
4 7 node
1 8 element
-------- -------- ---------------
1 coordinate system
4 nodes
1 element
>> fem{group}
ans =
IMAT_FEM Finite Element Model
1 coordinate system
4 nodes
1 element
0 tracelines
>>
You can add or remove FEM entities using one of three methods: add, keep, or remove. These methods exist for the IMAT_CS, IMAT_NODE, IMAT_ELEM, and IMAT_TL classes.
The following examples show how to add and remove FEM entities.
>> fem
fem =
IMAT_FEM Finite Element Model
1 coordinate system
30 nodes
10 elements
3 tracelines
>> fem.node = fem.node.add(100) % Add node 100, accepting defaults for the node properties
fem =
IMAT_FEM Finite Element Model
1 coordinate system
31 nodes
10 elements
3 tracelines
>> fem.node{100} % List node 100
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
100 0 0 0 0 0 0 1 11
>> fem.node = fem.node.remove(100) % Remove node 100
fem =
IMAT_FEM Finite Element Model
1 coordinate system
30 nodes
10 elements
3 tracelines
>>
Coordinate systems can be confusing, especially since different analysis programs use different naming conventions, and different file formats store their data in different ways. The purpose of this section is to hopefully reduce some of the confusion by defining the naming conventions that IMAT uses. It will also describe how some of the IMAT-supported file formats store their data. Finally, it will provide some simple examples of how one might want to use the coordinate transformation capabilities provided by IMAT.
Different solvers use different naming conventions for the different classes of coordinate systems. Unfortunately, the same terminology can have different meanings in different contexts. The following table outlines different coordinate system labels and shows their equivalence across different platforms.This documentation uses the IMAT naming convention when describing coordinate systems and results.
IMAT | NASTRAN | I-deas | Description |
global | basic | global or Part | The global cartesian system, or in other words the reference coordinate system. |
local | global | local | A local coordinate system that defines the coordinate directions for a specific location. This is always referenced back to the global cartesian system. A transformation matrix and offset defines the orientation of this system relative to the global. |
definition | definition | definition | A local coordinate system that specifies the coordinate system in which the node's coordinates are defined in software such as NASTRAN. When creating a node in IMAT, the coordinates of the node are entered in the storage CS not the definition CS. See more below. |
displacement | displacement | displacement | A local coordinate system that specifies the coordinate system in which displacement output is generated. |
storage | - | - | The coordinate system in which the X, Y, and Z coordinates of the node are displayed in IMAT. This is also the coordinate system in which the node coordinates are supplied when creating or adding nodes. |
This is described in the FEM Data Format Reference, but is worth highlighting here. The node.cs property is an nx3 matrix of coordinate system identifiers. The first column specifies the definition coordinate system for each node. Column 2 specifies the displacement coordinate system. Column 3 is the storage coordinate system, and is specific to IMAT. It specifies the coordinate system in which the node coordinates (found in the .coord property) are actually stored, created, and displayed. The storage coordinate system does not have to be the same as the displacement or definition system for that node, though in many cases it will be the same as the definition system.
The primary reasons the storage coordinate system exists in IMAT is to offer flexibility when transforming coordinate systems, and to preserve information. For example, let's say your nodes coordinates are stored in local coordinates and you transform them to global Cartesian. The storage coordinate system for each node will be set to 1, but the definition and displacement coordinate systems would stay what they were, thus preserving this information for future tasks such as exporting to a node format where you want the coordinates specified in the definition system. If IMAT did not have a storage coordinate system, the definition system would have to change on transform to the coordinate system(s) you are transforming to.
Different file formats assume different coordinate system storage conventions. It is very important that you know what coordinate system(s) your data is specified in when working with this data in IMAT.
Universal files for the most part store their information in the global coordinate system. This includes FEM nodes as well as shape coefficients. Thus when you import either entity from a Universal file, the coordinate system that defines this data is 1. This is why the 3rd column of the node.cs matrix (storage CS) is 1 for FEM nodes imported from a Universal file.
Shape Associated Data Files (ASH) store their shape coefficients in the local coordinate system. This is because these shape files are typically generated from a curve-fit of Frequency Response Functions. These FRF of course measure the response of a structure in the direction in which the accelerometer was installed, which is by definition a local coordinate system. In some cases tests are designed so that the accelerometers are all lined up with a previously defined global coordinate system.
NASTRAN stores shape coefficients in either local or global coordinates, depending on the file format. PCH files by default will store displacement shape coefficients in local coordinates. It is possible to write them in different systems using the appropriate PARAM. OP2 files generally store shape coefficients in the OUGV1, BOUGV1, or BOPHIG datablock name. The easy way to remember what coordinate system the shape coefficients are stored in is that if the datablock name starts with 'B' ('basic'), the shape coefficients are stored in global coordinates. Thus OUGV1 stores its coefficients in local coordinates. However, it is important to note that the default option for readnas is to transform displacement coefficients to the global (basic) coordinate system. This can be controlled either through the Options button on the OP2 directory form in readnas, or through an input argument to readnas. Please note that if the coefficients are already in global coordinates in the OP2 file (datablock begins with 'B'), they will be imported into IMAT in global coordinates regardless of the options setting.
Please see the documentation for the most up-to-date specific documentation on how to use the coordinate system transformation functions.
Because the data you import into IMAT may not be in the coordinate systems with which you wish to use the data, IMAT provides transformation methods for FEM (nodes), imat_shp, and imat_fn. These transformation methods offer great flexibility in what coordinate systems you transform from and to, but their basic use is fairly simple. In this section we will show a few examples of actions you might want to perform.
In the first example, we will import a FEM from a Universal file and shapes from an ADF, and we will transform the shape coefficients to the global cartesian coordinate system.
>> fem = readunv
Universal file written in IN units
Read 1 FEMs
fem =
IMAT_FEM Finite Element Model
8 coordinate systems
371 nodes
528 elements
4 tracelines
>> shp = readadf('shapes.ash');
ADF Name: shapes.ash
Units : <7> IN
Begin processing...
19 records processed...
End processing...
>> shpg = xform(shp,fe,0);
Shape 1: Transforming LOCAL->GLOBAL
>>
Note that IMAT treats shapes and functions defined in cylindrical and spherical coordinate systems specially. It assumes that the actual coefficients are really cartesian values in a cartesian system that aligns with the cylindrical or spherical coordinate system at that particular node location, and thus transforms the data accordingly.
To better understand how coordinate systems work in IMAT, consider the following 2-node example. First, a default imat_cs is created. This object contains the global Cartesian coordinate system. Next, a local coordinate system is created such that it is oriented the same way as the global Cartesian system but translated one unit in the X direction. Node 1 is created and stored at the global Cartesian origin since its storage CS is 1. Node 2 is created at the origin of the local coordinate system, since its storage CS is 2.
>> cs = imat_cs(); % creates imat_cs with the global Cartesian system
>> cs = cs.add(2,'Translated',1,1,[eye(3);1,0,0])
cs =
IMAT_CS - Coordinate systems
ID Name Type Color
-------- ---------------------------------------- ---- -----
0 Global cartesian 0 12
2 Translated 1 1
2 coordinate systems
>> fem = imat_fem(cs); % create an imat_fem that uses the newly created imat_cs
>> fem.node = fem.node.add(1,[2 0 0],1,[0 0 0]);
>> fem.node = fem.node.add(2,[2 0 2],1,[0 0 0]);
>> fem.node
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
1 2 0 0 0 0 0 1 1
2 2 0 2 0 0 0 1 1
2 nodes
When the nodes are created, the coordinates are entered in the storage system, NOT the definition system. For node 1 the storage system is global Cartesian (basic), and for node 2 the storage system is the local system. The node coordinates are listed in their storage coordinate systems.
Next let us transform the FEM to the global cartesian system.
>> femg = xform(fem,0); % equivalent to xform(fem); since the storage CS is local for node 2, xform assumes TO is global cartesian
Nodes: Transforming LOCAL->GLOBAL
>> femg.node
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
1 2 0 0 0 0 0 1 1
2 2 0 0 1 0 0 1 1
2 nodes
In femg the node coordinates are stored and displayed in the global Cartesian coordinate system. To transform the FEM geometry to local (definition) coordinates, simply do the following. You do not need to specify the TO coordinate system because the storage coordinate system is global Cartesian, so xform assumes that you want to transform to the definition system. Note that even though xform assumes your intentions, it is probably helpful to be explicit about which coordinate system(s) you are transforming from and to.
>> feml=xform(femg);
Nodes: Transforming GLOBAL->LOCAL
>> feml.node
ans =
IMAT_NODE - Nodes
ID Def CS Disp CS Store CS X Y Z Type Color
-------- ---------- ---------- ---------- ------------ ------------ ------------ ---- -----
1 2 0 2 -1 0 0 1 1
2 2 0 2 0 0 0 1 1
2 nodes
In this case XFORM knows that the node coordinate are stored in the global cartesian system, and it defaults to translating the coordinate to the node definition coordinate system. It is also possible to transform the node coordinates to an arbitrary coordinate system, as seen below.
>> feml=xform(fem,3);
Nodes: Transforming GLOBAL->LOCAL
>>
In this example the node coordinates are all converted to coordinate system 3, which does not have to be the definition or displacement coordinate system for these nodes. After performing this transformation, the storage coordinate system is 3.
It needs to be stressed that the FEM contains all of the coordinate system transformation information for both shapes and functions. This is why it is a required input argument to the shape and function transformation functions. If FROM and TO coordinate systems are not specified, the FEM is used to decide what these should be. In the above example we saw that XFORM transformed from the global to the definition coordinate system for nodes. For shapes and functions, the default transformation is between global and the displacement coordinate system. We can use this to our advantage to transform shape coefficients from the global to the displacement coordinate system, as seen in the example below.
>> shpl=xform(shpg,fem);
Shape 1: Transforming GLOBAL->LOCAL
>>
In the above example, XFORM uses column 3 of the FEM node.cs matrix to determine the FROM coordinate system (which in this case is 0, or global cartesian). It uses column 2, which is the displacement coordinate system, to determine the TO coordinate system.