Elements

Functions and constants relating to Elements

Functions

Details of functions

GetElemAxes(type_code[integer], item[integer], state_id (optional)[integer]) [static]

Description

Returns the local axes of the element in model space, expressed as direction cosines in a 2d array

Arguments

  • type_code (integer)

    A valid element type code (SOLID, BEAM, SHELL or TSHELL)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    2d array of reals. The cosines of the element in model space as a two-dimensional array, subscripts [row][col], with cosines organised in rows.

    Spelled out in detail for results array R this means:

    • X axis cosines: R[X][X], R[X][Y], R[X][Z]
    • Y axis cosines: R[Y][X], R[Y][Y], R[Y][Z]
    • Z axis cosines: R[Z][X], R[Z][Y], R[Z][Z]

    Return type

    Number

    Example

    // Return the direction cosines of shell 1
    var r = GetElemAxes(SHELL, 1);
    
    var yz_cosine = r[Y][Z];
    


    GetElemBetaAngle(type_code[integer], item[integer], ply_id[integer], int_pnt (optional)[integer], state_id (optional)[integer]) [static]

    Description

    Returns the beta angle (in degrees) at either the ply id or integration point number on element <item> of <type_code>

    If <ply_id> is non-zero then <int_pnt> can be omitted or set to zero.

    If <ply_id> is zero then <int_pnt> must be defined and non-zero.

    When working with <ply_id> if the ply does not exist in the element, then false is returned.

    When working with <int_pnt> a value will always be returned, but this will be zero if no beta angle is defined for the element / int_pnt combination.

    Ply data is only available if a .ztf file containing composite information has been read.

    Arguments

  • type_code (integer)

    A valid element type code (Currently only SHELL is valid)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • ply_id (integer)

    If +ve, the internal ply index. If -ve, the external ply label. Internal numbers will be many times faster to process. Set to zero if <int_pt> is to be used instead.

  • int_pnt (optional) (integer)

    Integration point in the range 1 - maxint, required if <ply_id> is zero.

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    real

    Return type

    Number

    Example

    // Return the beta angle in shell 1 for ply external label 13
    var beta = GetElemBetaAngle(SHELL, 1, -13);
    
    // Return the beta angle in shell 1 at integration point 7
    var beta = GetElemBetaAngle(SHELL, 1, 0, 7);
    


    GetElemsAtNode(node[integer], type_code[integer], state_id (optional)[integer]) [static]

    Description

    Returns an object containing the number of elements of <type> at <node>, and also an array <list[ ]> of their internal indices. If there are no elements of <type> at the node then false is returned.

    Arguments

  • node (integer)

    The node at which to return the list of elements. If +ve, the internal node number starting at 1. If -ve, the external node label. Internal numbers will be many times faster to process.

  • type_code (integer)

    A valid element type code (SOLID etc.)

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    Object with the following properties:

    Name Type Description
    list array of integers Internal element ids
    nn integer Number of elements in list

    Return type

    object

    Example

    // Get a list of shell elements at node 5
    if(a = GetElemsAtNode(5, SHELL))
    {
        var nelems = a.nn;
        var e1 = a.list[0];
        var e2 = a.list[1];
    }
    


    GetElemsInPart(part_id[integer], state_id (optional)[integer]) [static]

    Description

    Returns an object containing the number of elements in part <part_id>, the element type code, and also an array <list[ ]> of their internal indices. If there are no elements in the part then false is returned.

    Arguments

  • part_id (integer)

    The part in which to return the list of elements. If +ve, the internal part number starting at 1. If -ve, the external part label. Internal numbers will be many times faster to process.

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    Object with the following properties:

    Name Type Description
    list array of integers Internal element ids
    nn integer Number of elements in list
    type integer Element type code

    Return type

    object

    Example

    // Get a list of elements in part 5
    if(a = GetElemsInPart(5))
    {
        var nelems = a.nn;
        for(var i=0; i<nelems; i++)
        {
            Message("Element: " + GetLabel(a.type, a.list[i]))
        }
    }
    


    GetTopology(type_code[integer], item[integer], state_id (optional)[integer]) [static]

    Description

    Returns the topology list for internal <item> of type <type_code>. This should only be used for element types which have nodal topologies.

    Arguments

  • type_code (integer)

    A valid element type code (SOLID etc.)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    Object with the following properties:

    Name Type Description
    nn integer Number of nodes in topology list
    pid integer Internal part id for part-based elements, otherwise zero
    top array of integers Internal node ids

    Return type

    object

    Example

    // Get the topology of internal shell 27
    var a = GetTopology(SHELL, 27);
    
    var nnodes = a.nn;
    var n1 = a.top[0];
    var n2 = a.top[1];
    var pid = a.pid;