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
exandey, see e.g.beam2e, and the element displacementsediobtained by e.g.beam2s.The variable
plotparsets 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
sfacis a scalar that the element displacements are multiplied with to get a suitable geometrical representation. Ifsfacis 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:
eldraw2displays the undeformed mesh for a two dimensional structure.Input variables are the coordinate matrices
ExandEyformed by the functioncoordxtr.The variable
plotparsets 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
elnumwith the element numbers is supplied. This column vector can be derived from the element topology matrixEdof: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:
eldisp2displays the deformed mesh for a two dimensional structure.Input variables are the coordinate matrices
ExandEyformed by the functioncoordxtr, and the element displacementsEdformed by the functionextract_ed.The variable
plotparsets 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
sfacis 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:
elflux2displays 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, useeldraw2.Input variables are the coordinate matrices
ExandEy, and the element flux matrixEsdefined inflw2tsorflw2qs.The variable
plotparsets 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
plotparis omitted, is solid black arrows.The scale factor
sfacis 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:
eliso2displays 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, useeldraw2.Input variables are the coordinate matrices
ExandEyformed by the functioncoordxtr, and the element nodal quantities (e.g., displacement or energy potential) matrixEddefined inextract.If
isovis a scalar, it determines the number of iso lines to be displayed. Ifisovis a vector, it determines the values of the iso lines to be displayed (number of iso lines equal to the length of vectorisov):isov\(= [\, \text{iso lines} \,]\)isov\(= [\, \text{isovalue}(1) \; \ldots \; \text{isovalue}(n) \,]\)The variable
plotparsets 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:
elprinc2displays 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, useeldraw2.Input variables are the coordinate matrices
ExandEy, and the element stresses matrixEsdefined inplantsorplanqs.The variable
plotparsets 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
plotparis omitted, is solid black arrows.The scale factor
sfacis 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:
scalfact2determines a scale factorsfacfor drawing computational results, such as displacements, section forces, or flux.Input variables are the coordinate matrices
exandey, and the matrixedcontaining the quantity to be displayed. The scalarratdefines the ratio between the geometric representation of the largest quantity to be displayed and the element size. Ifratis not specified, \(0.2\) is used.- Theory:
The scale factor
sfacis computed so that the largest value inedis represented as a fractionratof 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:
scalgraph2draws a graphic scale to visualize the magnitude of displayed computational results. The input variablesfacis a scale factor determined by the functionscalfact2. The variablemagnitudeis 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
plotparsets 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
exandeyare defined inbar2eorbeam2e. The input variablees\(= \begin{bmatrix} S_1 \\ S_2 \\ \vdots \\ S_n \end{bmatrix}\)consists of a column matrix that contains section forces. The values in
esare computed in, e.g.,bar2sorbeam2s.The variable
plotparsets 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
sfacis a scalar that the section forces are multiplied with to get a suitable graphical representation. Ifsfacis 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. Ifeciis not given, uniform distance is assumed.