imat_shp/xform


Purpose

Coordinate transform shape coefficients.

Syntax

shp2=xform(shp,fem)
shp2=xform(shp,fem,csto)
shp2=xform(shp,fem,csfrom,csto)
shp2=xform(shp,fem,'silent')

Description

XFORM transforms shape coefficients. It handles local->global, global->local, and local->local transformations. Transformations can occur between arbitrary coordinate systems.

SHAPE is an imat_shp to be transformed. It can be multi-dimensional and contain shapes of various sizes.

FEM is an imat_fem containing node and coordinate system data for all of the functions to be transformed.

CSFROM and CSTO are coordinate system labels to transform from and to, respectively. They can be a vector of the same length as the number of nodes, a scalar, or a string. If only one coordinate system list/scalar is supplied, it is assumed to be CSTO, and CSFROM is extracted from the .CSType attribute of SHAPE. If this property is set to 'Other', an error will occur. If CSTO is not supplied, the coordinate system(s) to transform to is the displacement coordinate system (column 2 of fem.node.cs). Coordinate system 0 is defined as the global Cartesian (basic) coordinate system.

Passing in strings for CSFROM and CSTO is a shorthand way of specifying the column of node.cs from which to extract the coordinate systems. Strings starting with 's' specify the storage coordinate system (column 3), 'd' specifies the displacement coordinate system (column 2), and 'r' specifies the reference or definition system (column 1).

Passing in the string 'silent' suppresses output to the screen.

When transforming coordinates, XFORM assumes that shape coefficients for coordinate systems defined in cylindrical and spherical coordinate systems are actually stored in Cartesian coordinates for a Cartesian system based on the node location in the cylindrical or spherical system. As a result it only applies a Cartesian transformation. The coordinate system offsets are also not applied. For cylindrical and spherical coordinate transforms, shape coefficient transformations for nodes located at a local origin may produce inaccurate results due to numerical roundoff.

For cylindrical and spherical coordinate transforms, shape coefficient transformations for nodes located at a local origin may produce inaccurate results due to numerical roundoff.

XFORM returns an imat_shp the same size as the input imat_shp containing the transformed shape coefficients.

Examples

>> fem = readunv('simple_fem.unv');

>> fem.node.id             % Node labels

ans =
      100
      200
      300
      400
      500

>> fem.node.cs             % Nodal coordinate system definitions

ans =
     2     2     0
     2     2     0
     2     2     0
     2     2     0
     2     2     0

>> fem.cs.matrix(:,:,2)    % Transformation matrix for CS 2

ans =
    0.5000   -0.4330    0.7500
         0    0.8660    0.5000
   -0.8660   -0.2500    0.4330
    1.0000    2.0000    3.0000

>> shp = readadf('simple_shapes.ash');
>> list(shp)

Shape 1 - 1.100000 Hz, 1.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
       100            1            0            0
       200            0            1            0
       300            1            0            0
       400            1            0            0
       500            1            0            1

Shape 2 - 2.200000 Hz, 1.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
       100            1            2            3
       300            4            5            6

>> shp2 = xform(shp,fem);
Shape 1:Transforming GLOBAL->LOCAL
>> list(shp2)

Shape 1 - 1.100000 Hz, 1.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
       100          0.5            0     -0.86603
       200     -0.43301      0.86603        -0.25
       300          0.5            0     -0.86603
       400          0.5            0     -0.86603
       500         1.25          0.5     -0.43301

Shape 2 - 2.200000 Hz, 1.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
       100        1.884       3.2321    -0.066987
       300       4.3349       7.3301       -2.116

See Also

imat_fn/xform, xform