Graphics functions

The group of graphics functions comprises functions for element based graphics. Mesh plots, displacements, section forces, flows, iso lines and principal stresses can be displayed. The functions are divided into two dimensional, and general graphics functions.

Two dimensional graphics functions

dispbeam2

Purpose:

Draw the displacements for a two dimensional beam element.

Syntax:
[sfac] = dispbeam2(ex, ey, edi)
[sfac] = dispbeam2(ex, ey, edi, plotpar)
dispbeam2(ex, ey, edi, plotpar, sfac)
Description:

Input variables are the coordinate matrices ex and ey, see e.g. beam2e, and the element displacements edi obtained by e.g. beam2s.

The variable plotpar sets plot parameters for linetype, linecolour and node marker:

plotpar\(= [\, linetype \;\; linecolor \;\; nodemark \,]\)

where

\(linetype\)

\(linecolor\)

\(nodemark\)

1

solid line

1

black

1

circle

2

dashed line

2

blue

2

asterisk

3

dotted line

3

magenta

0

no mark

4

red

Default is dashed black lines with circles at nodes.

The scale factor sfac is a scalar that the element displacements are multiplied with to get a suitable geometrical representation. If sfac is omitted in the input list, the scale factor is set automatically.

eldraw2

Purpose:

Draw the undeformed mesh for a two dimensional structure.

Syntax:

eldraw2(Ex, Ey)
eldraw2(Ex, Ey, plotpar)
eldraw2(Ex, Ey, plotpar, elnum)
Description:

eldraw2 displays the undeformed mesh for a two dimensional structure.

Input variables are the coordinate matrices Ex and Ey formed by the function coordxtr.

The variable plotpar sets plot parameters for linetype, linecolor and node marker:

plotpar\(= [\, \text{linetype} \;\; \text{linecolor} \;\; \text{nodemark} \,]\)

where

\(linetype\)

\(linecolor\)

\(nodemark\)

1

solid line

1

black

1

circle

2

dashed line

2

blue

2

asterisk

3

dotted line

3

magenta

0

no mark

4

red

Default is solid black lines with circles at nodes.

Element numbers can be displayed at the center of the element if a column vector elnum with the element numbers is supplied. This column vector can be derived from the element topology matrix Edof:

elnum = texttt{Edof}(:,1)

i.e. the first column of the topology matrix.

Limitations:

Supported elements are bar, beam, triangular three node, and quadrilateral four node elements.

eldisp2

Purpose:

Draw the deformed mesh for a two dimensional structure.

Syntax:

[sfac] = eldisp2(Ex, Ey, Ed)
[sfac] = eldisp2(Ex, Ey, Ed, plotpar)
eldisp2(Ex, Ey, Ed, plotpar, sfac)
Description:

eldisp2 displays the deformed mesh for a two dimensional structure.

Input variables are the coordinate matrices Ex and Ey formed by the function coordxtr, and the element displacements Ed formed by the function extract_ed.

The variable plotpar sets plot parameters for linetype, linecolor and node marker:

plotpar\(= [\, linetype \quad linecolor \quad nodemark \,]\)

where

\(linetype\)

\(linecolor\)

\(nodemark\)

1

solid line

1

black

1

circle

2

dashed line

2

blue

2

asterisk

3

dotted line

3

magenta

0

no mark

4

red

Default is dashed black lines with circles at nodes.

The scale factor sfac is a scalar that the element displacements are multiplied with to get a suitable geometrical representation. The scale factor is set automatically if it is omitted in the input list.

Limitations:

Supported elements are bar, beam, triangular three node, and quadrilateral four node elements.

elflux2

Purpose:

Draw element flow arrows for two dimensional elements.

Syntax:

[sfac] = elflux2(Ex, Ey, Es)
[sfac] = elflux2(Ex, Ey, Es, plotpar)
elflux2(Ex, Ey, Es, plotpar, sfac)
Description:

elflux2 displays element heat flux vectors (or corresponding quantities) for a number of elements of the same type. The flux vectors are displayed as arrows at the element centroids. Note that only the flux vectors are displayed. To display the element mesh, use eldraw2.

Input variables are the coordinate matrices Ex and Ey, and the element flux matrix Es defined in flw2ts or flw2qs.

The variable plotpar sets plot parameters for the flux arrows:

plotpar\(= [\, arrowtype \;\; arrowcolor \,]\)

where

\(arrowtype\)

\(arrowcolor\)

1

solid line

1

black

2

dashed line

2

blue

3

dotted line

3

magenta

4

red

Default, if plotpar is omitted, is solid black arrows.

The scale factor sfac is a scalar that the values are multiplied with to get a suitable arrow size in relation to the element size. The scale factor is set automatically if it is omitted in the input list.

Limitations:

Supported elements are triangular 3 node and quadrilateral 4 node elements.

eliso2

Purpose:

Display element iso lines for two dimensional elements.

Syntax:

eliso2(Ex, Ey, Ed, isov)
eliso2(Ex, Ey, Ed, isov, plotpar)
Description:

eliso2 displays element iso lines for a number of elements of the same type. Note that only the iso lines are displayed. To display the element mesh, use eldraw2.

Input variables are the coordinate matrices Ex and Ey formed by the function coordxtr, and the element nodal quantities (e.g., displacement or energy potential) matrix Ed defined in extract.

If isov is a scalar, it determines the number of iso lines to be displayed. If isov is a vector, it determines the values of the iso lines to be displayed (number of iso lines equal to the length of vector isov):

isov\(= [\, \text{iso lines} \,]\)

isov\(= [\, \text{isovalue}(1) \; \ldots \; \text{isovalue}(n) \,]\)

The variable plotpar sets plot parameters for the iso lines:

plotpar\(= [\, linetype \;\; linecolor \;\; textfcn \,]\)

where

\(linetype\)

\(linecolor\)

\(textfcn\)

1

solid line

1

black

0

iso values not printed

2

dashed line

2

blue

1

iso values printed at the iso lines

3

dotted line

3

magenta

1

iso values printed where the cursor indicates

4

red

Default is solid, black lines and no iso values printed.

Limitations:

Supported elements are triangular 3 node and quadrilateral 4 node elements.

elprinc2

Purpose:

Draw element principal stresses as arrows for two dimensional elements.

Syntax:

[sfac] = elprinc2(Ex, Ey, Es)
[sfac] = elprinc2(Ex, Ey, Es, plotpar)
elprinc2(Ex, Ey, Es, plotpar, sfac)
Description:

elprinc2 displays element principal stresses for a number of elements of the same type. The principal stresses are displayed as arrows at the element centroids. Note that only the principal stresses are displayed. To display the element mesh, use eldraw2.

Input variables are the coordinate matrices Ex and Ey, and the element stresses matrix Es defined in plants or planqs.

The variable plotpar sets plot parameters for the principal stress arrows:

plotpar\(= [\, arrowtype \;\; arrowcolor \,]\)

where

\(arrowtype\)

\(arrowcolor\)

1

solid line

1

black

2

dashed line

2

blue

3

dotted line

3

magenta

4

red

Default, if plotpar is omitted, is solid black arrows.

The scale factor sfac is a scalar that values are multiplied with to get a suitable arrow size in relation to the element size. The scale factor is set automatically if it is omitted in the input list.

Limitations:

Supported elements are triangular 3 node and quadrilateral 4 node elements.

scalfact2

Purpose:

Determine scale factor for drawing computational results.

Syntax:


Description:

scalfact2 determines a scale factor sfac for drawing computational results, such as displacements, section forces, or flux.

Input variables are the coordinate matrices ex and ey, and the matrix ed containing the quantity to be displayed. The scalar rat defines the ratio between the geometric representation of the largest quantity to be displayed and the element size. If rat is not specified, \(0.2\) is used.

Theory:

The scale factor sfac is computed so that the largest value in ed is represented as a fraction rat of the element size, ensuring a visually appropriate scaling of computational results.

scalgraph2

Purpose:

Draw a graphic scale.

Syntax:

scalgraph2(sfac, magnitude)
scalgraph2(sfac, magnitude, plotpar)
Description:

scalgraph2 draws a graphic scale to visualize the magnitude of displayed computational results. The input variable sfac is a scale factor determined by the function scalfact2. The variable magnitude is defined as \([S\;\;x\;\;y]\), where \(S\) specifies the value corresponding to the length of the graphic scale, and \((x, y)\) are the coordinates of the starting point. If no coordinates are given, the starting point will be \((0, -0.5)\).

The variable plotpar sets the graphic scale color:

plotpar\(= [color]\)

where

\(color\)

1

black

2

blue

3

magenta

4

red

secforce2

Purpose:

Draw the section force diagrams of a two dimensional bar or beam element in its global position.

Syntax:

secforce2(ex, ey, es, plotpar, sfac)
secforce2(ex, ey, es, plotpar, sfac, eci)
[sfac] = secforce2(ex, ey, es)
[sfac] = secforce2(ex, ey, es, plotpar)
Description:

The input variables ex and ey are defined in bar2e or beam2e. The input variable

es\(= \begin{bmatrix} S_1 \\ S_2 \\ \vdots \\ S_n \end{bmatrix}\)

consists of a column matrix that contains section forces. The values in es are computed in, e.g., bar2s or beam2s.

The variable plotpar sets plot parameters for the diagram:

plotpar\(= [\, \text{linecolor} \;\; \text{elementcolor} \,]\)

where

linecolor

color

elementcolor

color

1

black

1

black

2

blue

2

blue

3

magenta

3

magenta

4

red

4

red

The scale factor sfac is a scalar that the section forces are multiplied with to get a suitable graphical representation. If sfac is omitted in the input list, the scale factor is set automatically.

The input variable

eci\(= \begin{bmatrix} \bar{x}_1 \\ \bar{x}_2 \\ \vdots \\ \bar{x}_n \end{bmatrix}\)

specifies the local \(\bar{x}\)-coordinates of the quantities in es. If eci is not given, uniform distance is assumed.