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 will transform shape coefficients in the supplied imat_shp using coordinate system and node information provided in the IMAT_FEM object FEM. The imat_shp can be multi-dimensional and contain shapes of various sizes. Coordinate system transformations can be local to global, global to local, or local to local. Transformations can occur between any two arbitrary coordinate systems.

CSFROM and CSTO are coordinate system labels to transform from and to, respectively. They can either be a vector of the same length as the number of nodes in the shape, or a scalar. If CSFROM is not supplied, the coordinate system(s) to transform from will be extracted from the .CSType attribute of SHAPE. If this is set to 'Other', an error will occur. If CSTO is not supplied, the coordinate system(s) to transform to will be extracted from the second column (node displacement coordinate system) of the .cs field of the node structure. If the nodes are currently in local coordinates, XFORM assumes that you want to transform back to the global. Coordinate system 0 is defined as the global Cartesian coordinate system.

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.

XFORM will return 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