Msc. Patran pcl handbook In a Nutshell 7



Download 1.08 Mb.
Page22/25
Date05.08.2017
Size1.08 Mb.
#26706
1   ...   17   18   19   20   21   22   23   24   25

Appendix C

Noteworthy Functions

sys_move_raw(…)


sys_move_raw(source, destination)

DESCRIPTION

Move one raw PCL variable to another. This is a great function to use when transferring the contents of one array to another array. It is significantly faster than a loop.

INPUT







source

Any

Source variable to copy.

OUTPUT







destination

Any

Destination variable to receive the copy of the source variable.

EXAMPLE

INTEGER a(12), b(12), c(6, 12), d(24)

sys_move_raw(a, b)

sys_move_raw(a, c(1, 1:))

sys_move_raw(a, c(1, 1:12))

sys_move_raw(a(1:), c(1, 1:))

sys_move_raw(a, c(2, 1:12))

sys_move_raw(a, d(1:12))

sys_move_raw(a, d(13:))

mth_array_search(…)


mth_array_search(IntegerArray, Look4, Sorted)

DESCRIPTION

Search an integer array for a value.

INPUT







IntegerArray

Integer array

Integer array of values to search.

Look4

Integer

Value to look for within the IntegerArray

Sorted

Logical

TRUE if the input array is sorted. This makes the search faster.

OUTPUT









Integer

Array index indicating the position within IntegerArray where the Look4 value was found. Zero if the value was not found

EXAMPLES

INTEGER p

INTEGER a(4) = [1, 5, 2, 3]

p = mth_array_search(a, 2, FALSE)

p -> 3, i.e., a(3) = 2

p = mth_array_search(a, 12, FALSE)

p -> 0, i.e., a(i) != 12

mth_sort(…)


mth_sort(Array, RemoveDuplicates, NumLeft)

DESCRIPTION

This function will sort an array of integers into ascending order, optionally removing all duplicates.

INPUT







Array

Integer array

Integer array to be sorted. This argument is used for both input and output. The contents of the original array are destroyed and replaced by the sorted values.

RemoveDuplicates

Logical

When set to TRUE, duplicate values are removed.

OUTPUT







Array

Integer array

Input array in sorted order.

NumLeft

Integer

Number of items in the sorted array.

EXAMPLE

INTEGER a(4) = [5, 1, 9, 8]

INTEGER NumLeft

mth_sort(a, TRUE, NumLeft)

a(1:4) -> 1, 5, 8, 9

NumLeft -> 4

mth_sort_row(…)


mth_row_sort(Array, Row, Ascend)

DESCRIPTION

Sorts a two-dimensional integer or real array by one of its rows.

INPUT







Array

Integer or Real array

Matrix of values to sort. This is both the input and output array.

Row

Integer

Row Id to sort on.

Ascend

Logical

If TRUE, then sort in ascending order.

OUTPUT







Array

Integer or Real array

Matrix is sorted in place.

EXAMPLE

INTEGER a(2, 3) = [3, 1, 2, 4, 5, 6]

mth_row_sort(a, 1, TRUE)

a() -> [1, 2, 3, 5, 6, 4]

mth_sort_column(…)


mth_sort_column(Array, Column, Ascend)

DESCRIPTION

Sorts a two-dimensional integer or real array by one of its columns.

fem_geom_edge_length(…)


fem_geom_edge_length(PickList, Lengths, NumLengths)

DESCRIPTION

Determines the length of bar elements and/or element edges.

INPUT







PickList

String[]

String of bar element Ids or element edges (elm 1.1).

OUTPUT







Lengths(virtual)

Real array

Length of each entity in PickList.

NumLengths

Integer

Number of entities contained in PickList.



Integer

Zero for success



fem_geom_face_area(…)


fem_geom_face_area(PickList, Areas, NumAreas)

DESCRIPTION

Returns the face area of 2D elements or 3D element faces.

fem_geom_elem_volume(…)


fem_geom_elem_volume(PickList, Volumes, NumVolumes)

DESCRIPTION

Returns the volumes of 3D elements.

fem_geom_elem_location(…)


fem_geom_elem_location(PickList, Locations, NumLocations)

DESCRIPTION

Returns the location of the centroid of elements, element edges, etc.



Download 1.08 Mb.

Share with your friends:
1   ...   17   18   19   20   21   22   23   24   25




The database is protected by copyright ©ininet.org 2024
send message

    Main page