XLPack 7.0
Python API Reference Manual
Loading...
Searching...
No Matches

◆ mesh23()

def mesh23 ( nx  ,
ny  ,
x  ,
y  ,
knc  ,
ks  ,
lb  ,
sclx  = 1.0,
scly  = 1.0 
)

Generates simple rectangular mesh for FEM (2D) (Triangular element)

Purpose
This routine generates the simple rectangular mesh for FEM. (2D) (triangular element)
Returns
(info, n, ne, nb)

info (int):
= 0: Normal return.
= i < 0: The (-i)-th argument is invalid or has an illegal value.

n (int):
Total number of nodes. (= (nx + 1)*(ny + 1))

ne (int):
Number of elements. (= 2*nx*ny)

nb (int):
Number of boundary sides. (= 2*(nx + ny))
Parameters
[in]nxNumber of grids in the x-direction. (nx > 0)
[in]nyNumber of grids in the y-direction. (ny > 0)
[out]xNumpy ndarray (1-dimensional, float, n)
x-coordinates of nodes.
[out]yNumpy ndarray (1-dimensional, float, n)
y-coordinates of nodes.
[out]kncNumpy ndarray (2-dimensional, int32, ldknc x ne) (ldknc = 4 (number of nodes in the element + 1) (3-node triangle))
Connection matrix: knc[k, 0] is the type of element k (= 2: 3-node triangle), knc[k, 1], ..., knc[k, 3] point to the nodes of element k.
[out]ksNumpy ndarray (2-dimensional, int32, ldks x nb) (ldks = 3 (number of nodes in the natural boundary element + 1) (2-node line element))
Connection matrix of natural boundary sides: ks[k, 0] is the type of boundary element k (= 1: 2-node line element), ks[k, 1] and ks[k, 2] point to the nodes of boundary element k.
[out]lbNumpy ndarray (1-dimensional, int32, nb)
Boundary side label.
= 1: front. (y = 0)
= 2: right. (x = 1)
= 3: back. (y = 1)
= 4: left. (x = 0)
[in]sclx(Optional)
Scale factor of x-coordinates. (default = 1)
[in]scly(Optional)
Scale factor of y-coordinates. (default = 1)